Skip to content

Orca fails to bind artifact from json file #6454

@darrowmire

Description

@darrowmire

Issue Summary:

Orca fails to bind artifact from custom github webhook, which pulls json from github

Cloud Provider(s):

Kubernetes

Environment:

Spinnaker 1.23.0 deployed with helm chart

Feature Area:

Orca

Description:

When Invoking custom webhook which pulls json from github, artifact defined in json

  "artifacts": [
    {
     "name": "service.tgz",
    "reference": "s3://my-bucket/service-1.2.3.tgz",
    "type": "s3/object"
    }
  ]
}

Should be properly parsed and binded. However, Spinnaker throws the following error:

Webhook failed: Expected artifacts in webhook response couldn't be parsed: com.jayway.jsonpath.PathNotFoundException: Expected to find an object with property ['artifacts'] in path $ but found 'java.lang.String'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.

Steps to Reproduce:

  1. Setup orca with the following webhook
          preconfigured:
          - label: Github - Find Artifact From File
            type: embedArtifacts
            enabled: true
            description: Embed Artifact into pipeline from a JSON file in Github
            method: GET
            url: https://raw.githubusercontent.com/SOME_REPO/${parameterValues["repo"]}/${parameterValues["branch"]}/${parameterValues["filePath"]}
            customHeaders:
              Authorization:
              - Basic REPLACE_ME
            parameters:
            - label: Git Branch
              name: branch
              description: The branch to pull the file from on github
              defaultValue: ''
              type: string
            - label: File Path
              name: filePath
              description: The path to the file in github
              defaultValue: ''
              type: string
            - label: Git Repo
              name: repo
              description: The Git repository containing the file to read
              defaultValue: ''
              type: string
  1. In your repo create a file for File Path parameter and populate it as mentioned in Description
  2. Set up pipeline with proper Webhook parameters. In produces artifacts section use name mentioned in description in artifact definition
  3. Run pipeline
  4. Observe the error

Additional Details

This issue appears starting from release 1.23.0, previous versions work with no issues.
This file is parsed with no issues if trying to copy code locally or with other tools. Seems like spinnaker is changing the response somehow

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions