-
Notifications
You must be signed in to change notification settings - Fork 230
CI: Fix Skipped Required Workflows #5889
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
CI: Fix Skipped Required Workflows #5889
Conversation
5cd181c to
811e958
Compare
| filters: | | ||
| docs: | ||
| - 'Docs/**' | ||
| - '**.rst' | ||
| others: | ||
| - '!Docs/**' | ||
| - '!**.rst' |
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.
The **.rst filter is not present in the AMReX implementation, hopefully this is the right syntax to handle multiple filters. Not entirely intuitive why one needs to specify also the others filters...
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 think the filter rules are combined by or by default. So has_non_docs_changes means no changes in either Docs/ or *.rst. The logic for has_non_docs_changes seems incorrect. Suppose I only change GOVERANCE.rst. Because there are no changes to Docs/, has_non_docs_changes will be set to 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 think we should do this.
diff --git a/.github/workflows/check_changes.yml b/.github/workflows/check_changes.yml
index f526f162d..af2c2e62b 100644
--- a/.github/workflows/check_changes.yml
+++ b/.github/workflows/check_changes.yml
@@ -20,13 +20,10 @@ jobs:
id: changes
with:
filters: |
- docs:
- - 'Docs/**'
- - '**.rst'
- others:
+ non_docs:
- '!Docs/**'
- '!**.rst'
+ predicate-quantifier: 'every'
- id: set-output
run: |
- echo "has_docs_changes=${{ steps.changes.outputs.docs }}" >> $GITHUB_OUTPUT
- echo "has_non_docs_changes=${{ steps.changes.outputs.others }}" >> $GITHUB_OUTPUT
+ echo "has_non_docs_changes=${{ steps.changes.outputs.non_docs }}" >> $GITHUB_OUTPUT
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.
We should also remove this because we don't need it.
has_docs_changes:
value: ${{ jobs.check.outputs.has_docs_changes }}
811e958 to
204dea7
Compare
2491730 to
82d1168
Compare
82d1168 to
3766c47
Compare
|
I tested that amrex PR on my own fork. It works as expected. |
|
Thanks, @WeiqunZhang! I updated the PR, feel free to approve if everything looks good to you. |
Follow up on #5889 and fix the issue that appeared in #5883, related to the fact that we add the `clang-tidy` checks automatically from a matrix, rather than manually as separate jobs in the workflow file. Note that I had managed to fix a similar issue in the alternative in-house implementation I had proposed in #5469. To-do: - [x] Fix main issue by applying the `if` condition at the `step` level (rather than the `job` level) - [x] Remove `cron` schedule for CodeQL workflows (on Sundays at 3:27 AM...?) - [x] Revert change in .github/workflows/check_changes.yml (implemented only to test the PR) Future PRs: - Skip also CodeQL workflows (C++ and Python files analysis) - not working yet...
This implement AMReX's solution to handle skipped but required CI workflows properly, as in AMReX-Codes/amrex#4197. This is necessary due to the limitation described in https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks. PR BLAST-WarpX#5469 implements an alternative solution based on a in-house script, but I figured it may be easier to implement the same solution as in AMReX for maintenance purposes. The new preliminary jobs are named `Analyze / Check changes`. For example, they show up as `CUDA / Analyze / Check changes`, `macOS / Analyze / Check changes`, etc. This will allow all TC members to merge PRs where required workflows are skipped (e.g., PRs that change only documentation files), instead of relying on the WarpX admin team only.
Follow up on BLAST-WarpX#5889 and fix the issue that appeared in BLAST-WarpX#5883, related to the fact that we add the `clang-tidy` checks automatically from a matrix, rather than manually as separate jobs in the workflow file. Note that I had managed to fix a similar issue in the alternative in-house implementation I had proposed in BLAST-WarpX#5469. To-do: - [x] Fix main issue by applying the `if` condition at the `step` level (rather than the `job` level) - [x] Remove `cron` schedule for CodeQL workflows (on Sundays at 3:27 AM...?) - [x] Revert change in .github/workflows/check_changes.yml (implemented only to test the PR) Future PRs: - Skip also CodeQL workflows (C++ and Python files analysis) - not working yet...
This implement AMReX's solution to handle skipped but required CI workflows properly, as in AMReX-Codes/amrex#4197. This is necessary due to the limitation described in https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks. PR BLAST-WarpX#5469 implements an alternative solution based on a in-house script, but I figured it may be easier to implement the same solution as in AMReX for maintenance purposes. The new preliminary jobs are named `Analyze / Check changes`. For example, they show up as `CUDA / Analyze / Check changes`, `macOS / Analyze / Check changes`, etc. This will allow all TC members to merge PRs where required workflows are skipped (e.g., PRs that change only documentation files), instead of relying on the WarpX admin team only.
This implement AMReX's solution to handle skipped but required CI workflows properly, as in AMReX-Codes/amrex#4197.
This is necessary due to the limitation described in https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks.
PR #5469 implements an alternative solution based on a in-house script, but I figured it may be easier to implement the same solution as in AMReX for maintenance purposes.
The new preliminary jobs are named
Analyze / Check changes. For example, they show up asCUDA / Analyze / Check changes,macOS / Analyze / Check changes, etc.This will allow all TC members to merge PRs where required workflows are skipped (e.g., PRs that change only documentation files), instead of relying on the WarpX admin team only.