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

feat: adding fail on error flag #13

Merged
merged 1 commit into from
Apr 18, 2023
Merged

feat: adding fail on error flag #13

merged 1 commit into from
Apr 18, 2023

Conversation

alex-ilgayev
Copy link
Contributor

@alex-ilgayev alex-ilgayev commented Apr 13, 2023

Even though the code is short, I spent some time thinking about how would be best to implement it.
In short, we have the pre script of Cimon and the post script.

The pre script can fail when we don't manage to reach the container's healthy state. If that happens, the CI will fail. For any other error the pre script will continue, and it will fail on the post script`.

In addition, the post script just outputs any log, including stderr the container had, so any possible error in the container (including the ones we had in pre script) would surface in post and fail the CI.

Having said that, I chosed to implement the fail-on-error flag in the following way:

  • For pre script, if the container didn't reach healthy status, nothing will happen (not even a warning/error message)
  • For post script, if any error happens, it will still return 0 (success), but will create a new job summary with the error message.

I also wanted to reduce the amount of annotation messages and make them more concrete, that's why pre script shows nothing, and for post script, if stderr exists, it will print him, or else just generic container failed... message.

You can see example for such run here: https://github.com/CycodeLabs/cimon-action/actions/runs/4712209939

@alex-ilgayev alex-ilgayev force-pushed the feat/fail_on_error branch 5 times, most recently from bc004c4 to ac1ea9f Compare April 16, 2023 07:54
@alex-ilgayev alex-ilgayev marked this pull request as ready for review April 16, 2023 08:08
Copy link
Contributor

@danielpacak danielpacak left a comment

Choose a reason for hiding this comment

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

LGTM!

@alex-ilgayev alex-ilgayev merged commit 848eb5d into main Apr 18, 2023
2 checks passed
@alex-ilgayev alex-ilgayev deleted the feat/fail_on_error branch April 18, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants