Skip to content

Conversation

@EZoni
Copy link
Member

@EZoni EZoni commented May 13, 2025

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 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.

@EZoni EZoni requested a review from WeiqunZhang May 13, 2025 01:11
@EZoni EZoni added the component: tests Tests and CI label May 13, 2025
@EZoni EZoni force-pushed the ci_docs_skip_checks_amrex branch from 5cd181c to 811e958 Compare May 13, 2025 01:14
Comment on lines 21 to 27
filters: |
docs:
- 'Docs/**'
- '**.rst'
others:
- '!Docs/**'
- '!**.rst'
Copy link
Member Author

@EZoni EZoni May 13, 2025

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...

Copy link
Member

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.

Copy link
Member

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

Copy link
Member

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 }}

@EZoni EZoni force-pushed the ci_docs_skip_checks_amrex branch from 811e958 to 204dea7 Compare May 13, 2025 01:23
@EZoni EZoni force-pushed the ci_docs_skip_checks_amrex branch from 2491730 to 82d1168 Compare May 13, 2025 04:02
@WeiqunZhang
Copy link
Member

AMReX-Codes/amrex#4474

I tested that amrex PR on my own fork. It works as expected.

@EZoni
Copy link
Member Author

EZoni commented May 20, 2025

Thanks, @WeiqunZhang! I updated the PR, feel free to approve if everything looks good to you.

@EZoni EZoni enabled auto-merge (squash) May 20, 2025 21:24
@EZoni EZoni merged commit 1980e99 into BLAST-WarpX:development May 20, 2025
52 checks passed
@EZoni EZoni deleted the ci_docs_skip_checks_amrex branch May 20, 2025 23:00
ax3l pushed a commit that referenced this pull request Jun 20, 2025
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...
atmyers pushed a commit to atmyers/WarpX that referenced this pull request Jul 3, 2025
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.
atmyers pushed a commit to atmyers/WarpX that referenced this pull request Jul 3, 2025
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...
rho-novatron pushed a commit to novatron-fusion/WarpX that referenced this pull request Oct 7, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: tests Tests and CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants