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

Don't duplicate CI checks on PRs #1075

Merged
merged 1 commit into from
Apr 25, 2024
Merged

Conversation

jeffwidman
Copy link
Member

By default the pull_request trigger will run on every push to the PR branch.

So we are wasting CI minutes and electricity by running our CI checks twice on every push to a PR branch.

Instead, this makes checks run 1x per PR, and then also run on every merge to master, to ensure that master stays green. This latter check is normally useless, but occasionally if there's drift of some kind between when CI runs on a PR and when it's merged, then this can help identify the issue.

A more common pattern is simply to only run on PR's, but given we haven't previously been enforcing "only merge via PR" (#1073) I thought might be best to keep checking master as well until that's changed.

The one thing we stop doing with this change is checking on push to branches that aren't PR branches... ie, if a maintainer is working on testing something. But they may not even care about running CI on this branch, and if they do, it's easy to run the tests locally, or open a draft PR...So I don't see the point of preserving that behavior.

@cclauss
Copy link
Contributor

cclauss commented Apr 24, 2024

Thanks for the explanation -- this is quite useful.

It is too bad that the GitHub Action Python docs seem to favor on: [push] which seems suboptimal.

@jeffwidman
Copy link
Member Author

jeffwidman commented Apr 24, 2024

@cclauss good catch! Did you know you can submit a PR to improve the docs? 😊

Every docs page has a "Help us make these docs great!" link at the bottom to open a PR against that exact page.

@cclauss
Copy link
Contributor

cclauss commented Apr 24, 2024

Yes... https://github.com/github/docs/pulls?q=is%3Apr+author%3Acclauss

Will do.

By default the `pull_request` trigger will run on every push to the PR
branch.

So we are wasting CI minutes and electricity by running our CI checks
twice on every push to a PR branch.

Instead, this makes checks run 1x per PR, and then also run on every
merge to `master`, to ensure that `master` stays green. This latter
check is normally useless, but occasionally if there's drift of some
kind between when CI runs on a PR and when it's merged, then this can
help identify the issue.

A more common pattern is simply to only run on PR's, but given we
haven't previously been enforcing "only merge via PR"
(#1073) I thought might
be best to keep checking `master` as well until that's changed.

The one thing we stop doing with this change is checking on push to
branches that aren't PR branches... ie, if a maintainer is working on
testing something. But they may not even care about running CI on this
branch, and if they do, it's easy to run the tests locally, or open a
draft PR...So I don't see the point of preserving that behavior.
@rbarrois rbarrois force-pushed the dont-duplicate-CI-checks-on-PRs branch from e14d00a to 7ed1e54 Compare April 25, 2024 08:58
@rbarrois rbarrois merged commit 7ed1e54 into master Apr 25, 2024
17 checks passed
@rbarrois rbarrois deleted the dont-duplicate-CI-checks-on-PRs branch April 25, 2024 09:28
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.

3 participants