Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orca fails to bind artifact from json file #6454

Closed
morbid98 opened this issue Jun 10, 2021 · 3 comments · May be fixed by spinnaker/orca#4137
Closed

Orca fails to bind artifact from json file #6454

morbid98 opened this issue Jun 10, 2021 · 3 comments · May be fixed by spinnaker/orca#4137

Comments

@morbid98
Copy link

morbid98 commented Jun 10, 2021

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

@spinnakerbot
Copy link

This issue hasn't been updated in 45 days, so we are tagging it as 'stale'. If you want to remove this label, comment:

@spinnakerbot remove-label stale

@spinnakerbot
Copy link

This issue is tagged as 'stale' and hasn't been updated in 45 days, so we are tagging it as 'to-be-closed'. It will be closed in 45 days unless updates are made. If you want to remove this label, comment:

@spinnakerbot remove-label to-be-closed

@spinnakerbot
Copy link

This issue is tagged as 'to-be-closed' and hasn't been updated in 45 days, so we are closing it. You can always reopen this issue if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants