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

ci: fix go workflow succeeding even if a step fails #5

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

joshuasing
Copy link
Contributor

Summary
Remove use of continue-on-error flag in Go workflow due to it causing the workflow to suceed even if a step failed.

Changes

  • Replace continue-on-error with if: (success() || failure()) && steps.deps.outcome == 'success' to mimic behaviour without causing the job to succeed with steps failing.

The continue-on-error flag appears to be buggy and not well
documented, however it was causing the workflow to be marked as
succeded even if a step failed.
@joshuasing joshuasing added type: bug This is a bug area: ci This is a change to CI files. Excluded from changelog labels Feb 26, 2024
@joshuasing joshuasing added the size: XS This change is very small (+/- <10) label Feb 26, 2024
@ClaytonNorthey92
Copy link
Contributor

ClaytonNorthey92 commented Feb 26, 2024

hey @joshuasing I am a little confused here; I think I understand the issue we're trying to solve, however why not just leave it with the default? why do we need this if check? wouldn't the pipeline fail if make deps failed anyway? as long as we didn't "continue on error"

@joshuasing
Copy link
Contributor Author

hey @joshuasing I am a little confused here; I think I understand the issue we're trying to solve, however why not just leave it with the default? why do we need this if check? wouldn't the pipeline fail if make deps failed anyway? as long as we didn't "continue on error"

@ClaytonNorthey92 I had added 'continue-on-error' so that we can collect error logs from each step instead of it exiting immediately when one step failed, aiming to allow us to collect extra information that could be useful for debugging.

I was unsure of whether continue-on-error would cause this bug at the time, as different parts of GitHub's documentation said completely different things.

@ClaytonNorthey92
Copy link
Contributor

hey @joshuasing I am a little confused here; I think I understand the issue we're trying to solve, however why not just leave it with the default? why do we need this if check? wouldn't the pipeline fail if make deps failed anyway? as long as we didn't "continue on error"

@ClaytonNorthey92 I had added 'continue-on-error' so that we can collect error logs from each step instead of it exiting immediately when one step failed, aiming to allow us to collect extra information that could be useful for debugging.

I was unsure of whether continue-on-error would cause this bug at the time, as different parts of GitHub's documentation said completely different things.

@joshuasing OK that makes sense. Can we test this before merging? Perhaps push up a broken commit and make sure the pipeline fails correctly with this change? If so, then I approve ✅️

@ClaytonNorthey92
Copy link
Contributor

Hey @joshuasing I saw the breaking test 👍 let's drop that commit and merge

@joshuasing joshuasing force-pushed the joshua/fix-ci-false-pass branch from 1c621a7 to 37a3bd1 Compare February 27, 2024 10:57
Copy link
Contributor

@ClaytonNorthey92 ClaytonNorthey92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's drop the force-break test and merge!

@joshuasing joshuasing merged commit b3993a0 into main Feb 27, 2024
2 checks passed
@joshuasing joshuasing deleted the joshua/fix-ci-false-pass branch February 27, 2024 13:07
web3cryptoguy pushed a commit to web3cryptoguy/heminetwork that referenced this pull request Nov 1, 2024
The continue-on-error flag appears to be buggy and not well
documented, however it was causing the workflow to be marked as
succeded even if a step failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ci This is a change to CI files. Excluded from changelog size: XS This change is very small (+/- <10) type: bug This is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants