CircleCI-Public / jira-connect-orb

Display the status of CircleCI workflows and deployments in Jira!
https://circleci.com/orbs/registry/orb/circleci/jira
MIT License
25 stars 27 forks source link

"jq: command not found" for failed jobs #46

Closed jackbutler closed 4 years ago

jackbutler commented 4 years ago

Orb version

1.1.7

What happened

When a job fails, the "Update status in Atlassian Jira" step also fails: image

The output inside the failing step ends with this:

environment: line 27: jq: command not found

Exited with code exit status 127
CircleCI received exit code 127

Jira is not updated with the failed build status.

It works as expected when the previous steps in the job all pass, this appears to only be an issue when running jira/notify after failed steps.

Expected behavior

Jira is updated with the failing build status

jackbutler commented 4 years ago

I can see in successful cases there is an install jq step, that isn't there in failure cases:

Success image

Failure image

jnpwebdeveloper commented 4 years ago

Getting the same here. Using circleci/jira@1.1.7 orb.

gmemstr commented 4 years ago

@jackbutler @jnpwebdeveloper Would you mind providing a link to one of the builds in question, or providing the output of the install jq step?

jackbutler commented 4 years ago

Sorry I can't provide a link to the build itself, and I would provide the output but the "install jq" step doesn't seem to appear at all for the failed job - this is the full set of steps that I'm seeing:

image

For context it's using jira/notify passed as a post-step to the cypress/run command from the cypress orb

jnpwebdeveloper commented 4 years ago

Yea I get the same as above - also after a failed cypress test.

Below is what I get at the end of the update status job - also using the - jira/notify.

Here is my full workflow for the end to end test we're running. I added jq myself later but it didn't resolve the problem.

version: 2.1
orbs:
  node: circleci/node@2.0.2
  cypress: cypress-io/cypress@1.24.0
  browser-tools: circleci/browser-tools@1.0.1
  jira: circleci/jira@1.1.7
  jq: circleci/jq@2.1.0

... jobs etc...
workflows:
  end-to-end-test:
    jobs:
      - cypress/run:
          name: Full end to end regression test
          executor: cypress/browsers-chrome77
          browser: chrome
          start: npm start
          wait-on: "http://localhost:8080"
          store_artifacts: true
          no-workspace: true
          post-steps:
            - jira/notify

image

gmemstr commented 4 years ago

Interesting - thanks for the info, digging into this further!

gmemstr commented 4 years ago

Initial findings suggest this isn't an issue with the orb itself, but rather how the configuration parsing is handled within the platform itself. Escalating this internally to try and get to the bottom of this :)

gmemstr commented 4 years ago

Final update - looks like it is in the orb! The jq/install command will only execute if previous jobs succeeded, but the jira/notify command is set to run when: always. Should have a fix available soon :)

gmemstr commented 4 years ago

This has been fixed as of version 1.2.2.