Skip to content

Conversation

@EZoni
Copy link
Member

@EZoni EZoni commented Oct 10, 2024

Could we do this to make sure that we run the GitHub Actions and Azure jobs (build, test) only if at least one file outside the Docs directory is modified, i.e., skip those jobs if only files in the Docs directory are modified?

I think it would be safe to do so (and a bit of a waste of resources to not do so...), but I leave it open for discussion.

If merged, we could test this rebasing #5386 and seeing if the correct CI jobs are skipped.

Note that this PR leaves the other CI jobs untouched, e.g., source, docs, CodeQL, etc.

Copy link
Member

@WeiqunZhang WeiqunZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

Copy link
Member

@lucafedeli88 lucafedeli88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent idea! I fully agree

Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!! 🤩

@ax3l ax3l merged commit baf32f3 into BLAST-WarpX:development Oct 11, 2024
@ax3l ax3l self-assigned this Oct 11, 2024
@EZoni EZoni deleted the ci_ignore_docs branch October 12, 2024 00:55
@EZoni
Copy link
Member Author

EZoni commented Oct 14, 2024

Note that this is handled by GitHub Actions in a way that is not optimal.

From their docs (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):

Warning: If a workflow is skipped due to path filtering, branch filtering or a commit message, then checks associated with that workflow will remain in a "Pending" state. A pull request that requires those checks to be successful will be blocked from merging.

The GitHub Actions workflows that we skip will appear as "pending". This should be fine for now, as maintainers should be able to force-merge the PR anyways. Hopefully GitHub will fix this in the future, marking the workflows that are skipped as "skipped" rather than "pending". I can think of other work-arounds in the meantime.

@EZoni
Copy link
Member Author

EZoni commented Oct 22, 2024

@lucafedeli88 @WeiqunZhang

I think what I reported in the comment above, #5387 (comment), might be more pressing than we think.

If you look at a docs PR, e.g., #5403, I personally do not have a way to merge it now, because GitHub (unlike Azure) is flagging the skipped workflows as "pending" and, since they are required, at least I cannot merge. I think other maintainers can probably merge, I definitely remember people merging PRs with failing or pending CI, but I cannot.

@WeiqunZhang
Copy link
Member

@EZoni Instead of path-ignore, we could try this https://github.com/dorny/paths-filter?tab=readme-ov-file

dpgrote pushed a commit to dpgrote/WarpX that referenced this pull request Oct 23, 2024
Could we do this to make sure that we run the GitHub Actions and Azure
jobs (build, test) only if _at least one file outside the_ `Docs`
_directory_ is modified, i.e., skip those jobs if only files in the
`Docs` directory are modified?

I think it would be safe to do so (and a bit of a waste of resources to
not do so...), but I leave it open for discussion.

If merged, we could test this rebasing BLAST-WarpX#5386 and seeing if the correct
CI jobs are skipped.

Note that this PR leaves the other CI jobs untouched, e.g., `source`,
`docs`, `CodeQL`, etc.
ax3l pushed a commit that referenced this pull request Jan 8, 2025
Following up on #5387, I think we should also ignore all `.rst` files in
the repository when we decide whether or not to run the CI workflows.

GitHub Actions syntax taken from the examples
[here](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#patterns-to-match-file-paths)
(see `'**.js'` example). Azure syntax to be tested.

If we merge this before #5522, we can test it (i.e., test that CI is
skipped) in #5522 after rebasing there.
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.

4 participants