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

🧪 Make post-gate job chain run on gate success #602

Merged

Conversation

webknjaz
Copy link
Member

@webknjaz webknjaz commented Jun 7, 2024

Previously, jobs following the check job didn't have if conditionals
or the existing expressions didn't use the status check functions. Those
jobs are responsible for the finishing steps of the release automation.
They used to work when the entire parent job tree was successful. The
release automation is triggered by the workflow_dispatch event, which
has a boolean flag/checkbox for disregarding the testing stage status.
Using it makes the check gate pass even when some test matrix jobs
fail. It was not obvious that jobs the depend on check don't run if
any of the parent chain jobs fail. Not by default, so they were being
skipped for no obvious reason.

This patch updates said if conditionals to force GitHub Actions CI/CD
to only take into account the check job result and not its
dependencies by prepending the trick of
always() && needs.check.result == 'success' && in front of each if
conditional in publishing jobs.

Refs:

Co-Authored-By: Pavel Březina [email protected]

ISSUE TYPE
  • Bugfix Pull Request
  • Maintenance Pull Request
  • Testing Pull Request
ADDITIONAL INFORMATION

N/A

webknjaz and others added 3 commits June 7, 2024 06:27
Previously, jobs following the `check` job didn't have `if` conditionals
or the existing expressions didn't use the status check functions. Those
jobs are responsible for the finishing steps of the release automation.
They used to work when the entire parent job tree was successful. The
release automation is triggered by the `workflow_dispatch` event, which
has a boolean flag/checkbox for disregarding the testing stage status.
Using it makes the `check` gate pass even when some test matrix jobs
fail. It was not obvious that jobs the depend on `check` don't run if
any of the parent chain jobs fail. Not by default, so they were being
skipped for no obvious reason.

This patch updates said `if` conditionals to force GitHub Actions CI/CD
to only take into account the `check` job result and not its
dependencies by prepending the trick of
`always() && needs.check.result == 'success' &&` in front of each `if`
conditional in publishing jobs.

Refs:
* actions/runner#2205 (comment)
* https://github.com/orgs/community/discussions/45058#discussioncomment-7465690
* https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions

Co-Authored-By: Pavel Březina <[email protected]>
This patch refactors the conditionals with hardcoded job IDs into
universal name-agnostic checks.

Refs:
* https://github.com/orgs/community/discussions/45058#discussioncomment-8470000
@webknjaz webknjaz self-assigned this Jun 7, 2024
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jun 7, 2024
@webknjaz webknjaz marked this pull request as ready for review June 7, 2024 05:07
@webknjaz webknjaz merged commit b8aca41 into ansible:devel Jun 7, 2024
8 of 14 checks passed
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/ansible-pylibssh-602
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@webknjaz
Copy link
Member Author

webknjaz commented Jun 7, 2024

I reverted 30a9da5 because https://github.com/ansible/pylibssh/actions/runs/9414210260 revealed that the workflow seems to go into the canceled state after ignored failures anyway so it's not possible to rely on this check. always() will work better, as originally suggested.

@webknjaz
Copy link
Member Author

webknjaz commented Jun 7, 2024

I also reverted f5597a0 for the same reason — I probably missed something in the generalization example, so I will have to get back to trying it out later.

@webknjaz
Copy link
Member Author

webknjaz commented Jun 7, 2024

The workflow is now functional in YOLO mode: https://github.com/ansible/pylibssh/actions/runs/9419572873. Finally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant