-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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(ci): kill duplicate CI jobs on PRs #26945
Conversation
Taking over #25243, where @sebastianliebscher did great work and submitted this idea. I'm re-opening under a new PR to accelerate things a bit. I've been triggering lots and lots of CI jobs while working on docker and feeling guilty about my carbon footprint. Here I grepped for workflows that have pull_request events and copy pasted the exact same snippet everywhere except for one place and that's the comment-triggered ephemeral builds, where I reference the issue number instead of the PR number. This should allow for someone to oops and retrigger the ephemeral build, and the lastest one should always land first, fixing potential race conditions
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #26945 +/- ##
==========================================
+ Coverage 66.91% 67.18% +0.27%
==========================================
Files 1900 1900
Lines 74320 74347 +27
Branches 8264 8264
==========================================
+ Hits 49732 49952 +220
+ Misses 22539 22346 -193
Partials 2049 2049
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -4,6 +4,11 @@ on: | |||
issue_comment: | |||
types: [created] | |||
|
|||
# cancel previous workflow jobs for PRs | |||
concurrency: | |||
group: ${{ github.workflow }}-${{ github.event.issue.number || github.run_id }} |
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 the only edit that's different from the other ones, pointing to github.event.issue.number
instead of github.event.pull_request.number
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.
So excited about this... thanks @sebastianliebscher for kicking this off. This project will have a much smaller carbon footprint, and hopefully we'll see a lot less competition for resources among Apache projects :)
Actually... if this does solve our problem with double-runs (like pushing those package lock files) then we can solve another DevEx problem in a similar way... we can run |
There's an incentive for us to go and do a similar PR in Apache projects that are using a significant amount of resources :) |
Taking over #25243, where @sebastianliebscher did great work and submitted this idea. I'm re-opening under a new PR to accelerate things a bit. I've been triggering lots and lots of CI jobs while working on docker and feeling guilty about my carbon footprint.
Here I grepped for workflows that have pull_request events and copy pasted the exact same snippet everywhere except for one place and that's the comment-triggered ephemeral builds, where I reference the issue number instead of the PR number. This should allow for someone to oops and retrigger the ephemeral build, and the lastest one should always land first, fixing potential race conditions