-
Notifications
You must be signed in to change notification settings - Fork 130
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
Run CI only when useful #1372
Run CI only when useful #1372
Conversation
Concurrent runs often happen due to iterative pushes to a PR. In those cases, only the most recent commit is useful for CI to run. Given current concurrency limitations, I've been in situations where the most recent commit to a PR was waiting for CI runs on older commits to finish before it could even start, due to the FIFO nature of GitHub Actions workflow run scheduling. In those situations, I've manually canceled the older CI runs to allow the most recent CI to run. This change automates that process. Concurrent CI runs on the default branch are useful, so those are still allowed.
Unrelated to those changes here: Would be great to have a per workflow opt out option in case we know a certain workflow doesn't work with certain CI steps, like rsv with conda. |
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.
I might be wrong about these files changing test outcome, but could you have a look?
9c85aab
to
ea5104f
Compare
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.
Re #1372 (comment):
Unrelated to those changes here: Would be great to have a per workflow opt out option in case we know a certain workflow doesn't work with certain CI steps, like rsv with conda.
Isn't that what we're doing with 724e207, or do you mean something else?
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.
It disables both docker and conda if I'm not mistaken. But not a big deal, we have lots of redundancy so disabling both is fine.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1372 +/- ##
==========================================
- Coverage 66.14% 66.13% -0.01%
==========================================
Files 68 68
Lines 7221 7222 +1
Branches 1777 1777
==========================================
Hits 4776 4776
- Misses 2176 2177 +1
Partials 269 269 ☔ View full report in Codecov by Sentry. |
# Prevent concurrent runs on the same branch, except for the default branch. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref_type == 'branch' && github.ref_name == github.event.repository.default_branch && github.run_id }} | ||
cancel-in-progress: true |
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.
I have a counter-argument to ea5104f, describing a situation where concurrency is beneficial:
Sometimes, it's useful to show a difference in CI results between two commits. I have found myself pushing one commit immediately followed by another and relying on CI to run without interruption on both. With the proposed change, the same effect can only be accomplished in two ways:
- Wait for the first commit's CI run to finish before pushing the next.
- Temporarily remove this concurrency group in the PR.
I would rather cancel unwanted concurrent runs manually than use either of those approaches. Since ea5104f is the only commit left in this PR, I'm just going to close it.
Description of proposed changes
See commit messages.
Related issue(s)
Checklist
If making user-facing changes, add a message in CHANGES.md summarizing the changes in this PRno functional changes