Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 33.9k
Introduce a gate/check GHA job#97533
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
webknjaz commented Sep 24, 2022 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" | ||
| check: # This job does nothing and is only used for the branch protection | ||
| if: always() |
webknjazSep 24, 2022 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mandatory because otherwise it'll get a skipped status in some cases and the branch protection sees that as skipped == success which is undesired.
| - name: Decide whether the needed jobs succeeded or failed | ||
| uses: re-actors/alls-green@198badcb65a1a44528f27d5da555c4be9f12eac6 | ||
| with: | ||
| allowed-skips: >- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setting tells the action that if the listed jobs (comma-separated) got skipped, that's okay. But the jobs are allowed to be skipped based on the same condition they've got set. If the first job requests test runs, this list will compute as empty and none of the jobs will be allowed to be skipped (meaning that skips would turn into failures).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I understand this right?
If
check-docsstarts, it must pass; if they skip, that's fine.If
check_generated_filesor any of the other jobs in its group start, they must all pass; if they all skip, that's fine.If
test_hypothesisstarts, it must pass; if they skip, that's fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hugovk almost: this is paired with the setting above ☝️ — essentially, if something is allowed to be skipped, and it is skipped, the action will treat it as non-failure.
But if something is allowed to be skipped and is not skipped, whether its failure is to be treated as such is controlled by the allowed-failures input.
Also, not they are not grouped inside the action, the templating here just produces a comma-separated list of things and the action doesn't know it was in some group externally. So yes, such a relation kinda exists, but I would say that it's indirect.
And since there's no “groups”, if any of the jobs that are allowed to be skipped run, each individual job is evaluated separately from the “group”, based on the fact of failures being allowed or not.
N.B. Whether a job is allowed to fail is also contributed by the continue-on-error setting, which is mostly useful for controlling individual matrix jobs. If a job was allowed to fail prior to this one, the action will not “see” if it was red and treat it as green.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- If
test_hypothesisstarts, it must pass; if they skip, that's fine.
With the context I added earlier, seeing that test_hypothesis is listed in allowed-failures unconditionally, it will never cause failures. This reflects the current branch protection configuration as seen in the Checks widget in PRs.
1e1bf94 to 75801c3Compare75801c3 to e441450Comparehugovk commented Nov 11, 2022
Thanks for the PR! Some points to consider:
|
webknjaz commented Dec 2, 2022
@hugovk these are good points and I haven't considered some of them.
|
46d97b5 to b436563CompareUh oh!
There was an error while loading. Please reload this page.
ambv commented Mar 28, 2023
I don't know if this is worth it for CPython as a number of jobs we require are outside of GitHub Actions (CLA, Issue Number, and News). So this check will increase complexity but won't actually solve the problem of bringing all required checks in one place. |
CAM-Gerlach commented Mar 28, 2023
@hugovk , as you've worked a lot of CI stuff lately across the various Python-org repos, do you have further feedback on this?
Just to note, that would be a pretty huge change in terms of workflow for this repo, since |
zware commented Mar 28, 2023
Agreed with @ambv: this looks like significant added complexity for not much actual gain in this project. It looks like a nice idea for some other setups, but doesn't feel like a great fit for us here. It's also possible I'm just missing the point, though :) |
brettcannon commented Mar 28, 2023
FYI the SC has explicitly stated individuals cannot act as owners on any one piece of code (i.e. we all own the code), so requiring |
ambv commented Mar 28, 2023
Alright, so I'm closing this based on the latest feedback. Thanks for putting this together, @webknjaz, and sorry it wasn't a good match for us at this time! |
ambv commented Apr 26, 2023
Given that our requirements changed, with Auto-merge enabled, and more checks existing now, I would like to reconsider this PR for inclusion. @webknjaz, would you be so kind as to adapt this to the current state of |
2e9f6a1 to 0abb403Comparewebknjaz commented Apr 26, 2023
@ambv so I just realized that the docs are its own workflow. The only way this is gonna work is wiring that in as a reusable workflow. |
0abb403 to 9ac328eCompareUh oh!
There was an error while loading. Please reload this page.
webknjaz commented Apr 26, 2023
A quick summary of our in-person interaction. Łukasz and I agreed to implement the following:
@ambv do we need to do the same to the |
46004d0 to 71f3a64Comparewebknjaz commented May 29, 2023
136fda2 to 79f84d7Comparewebknjaz commented Jun 26, 2023
79f84d7 to d363de3CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This adds a GHA job that reliably determines if all the required dependencies have succeeded or not. It also allows to reduce the list of required branch protection CI statuses to just one — `check`. This reduces the maintenance burden by a lot and have been battle-tested across a small bunch of projects in its action form and in-house implementations of other people. This action is now in use in aiohttp (and other aio-libs projects), CherryPy, conda, coveragepy, Open edX, Towncrier some of the Ansible repositories, pip-tools, all of the jaraco's projects (like `setuptools`, `importlib_metadata`), some of hynek's projects (like `attrs`, `structlog`), some PyCQA, PyCA, PyPA and pytest projects, a few AWS Labs projects. Admittedly, I maintain a few of these but it seems to address some of the pain folks have: jaraco/skeleton#55 (comment). I figured, this might be useful for CPython too, which is why I'm submitting this patch. The story behind this is explained in more detail at https://github.com/marketplace/actions/alls-green#why. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
bfa9d60 to 0fa6164Compare
hugovk left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Let's give @ambv some time to check before merging.
webknjaz commented Jun 30, 2023
@hugovk IIRC Łukasz and I talked about merging this PR but not changing the branch protection settings for a while so the check name would start being reported in the Checks widget on old PR updates, otherwise they'll get blocked until updated. |
hugovk commented Jul 6, 2023
Thanks again! |
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> (cherry picked from commit e7cd557) Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> (cherry picked from commit e7cd557) Co-authored-by: Sviatoslav Sydorenko <wk@sydorenko.org.ua>
bedevere-bot commented Jul 23, 2023
GH-107114 is a backport of this pull request to the 3.12 branch. |
bedevere-bot commented Jul 23, 2023
GH-107115 is a backport of this pull request to the 3.11 branch. |
This fixes an incorrect conflict resolution problem that happened in 0cdc3a5 while backporting PR python#97533 as PR python#107115 (merged prematurely). This problem caused GitHub Actions CI/CD to crash while attempting to load the workflow file definition, preventing the jobs that are defined in `.github/workflows/build.yml` from actually starting.
This fixes an incorrect conflict resolution problem that happened in 0cdc3a5 while backporting PR #97533 as PR #107115 (merged prematurely). This problem caused GitHub Actions CI/CD to crash while attempting to load the workflow file definition, preventing the jobs that are defined in `.github/workflows/build.yml` from actually starting.
webknjaz commented Jul 23, 2023
UPD: this has been backported to 3.12 and 3.11 and the branch protection changed accordingly. |
This adds a GHA job that reliably determines if all the required dependencies have succeeded or not.
It also allows to reduce the list of required branch protection CI statuses to just one —
check. This reduces the maintenance burden by a lot and have been battle-tested across a small bunch of projects in its action form and in-house implementations of other people.This action is now in use in aiohttp (and other aio-libs projects), CherryPy, some of the Ansible repositories, pip-tools, all of the jaraco's projects (like
setuptools,importlib_metadata), some of the hynek's projects (likeattrs,structlog), some PyCQA, PyCA, PyPA and pytest projects, a few AWS Labs projects. Admittedly, I maintain a few of these but it seems to address some of the pain folks have: jaraco/skeleton#55 (comment).I saw a few attempts to reduce the maintenance burden for GHA and figured
this might be useful for CPython too, which is why I'm submitting this patch.
Looking forward to hearing what you think!
The story behind this is explained in more detail at https://github.com/marketplace/actions/alls-green#why.