-
Notifications
You must be signed in to change notification settings - Fork 195
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: avoid duplicate runs for secondary branches on main repo #5308
Conversation
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.
Thanks! The nightly
branch actually has its own CI scripts (and tries to install WarpX using various methods we document on various platforms)
This branch is a git "orphan" branch that has its own scripts in it.
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.
Thank you! ✨
Ah, I see. Does it have to be handled in a branch separate from |
The fix introduced in #5308 was not correct for Azure pipelines. In GitHub Actions we trigger a run on the `push` event only for the `development` branch. The Azure equivalent of that is triggering a run on the `trigger` event only for the `development` branch. However, since the `trigger` event was completely absent from the Azure pipeline file (that is, the default setup was being used), I had erroneously added the filter branch to the `pr` event instead, unlike what I did for GitHub actions where the `push` was exposed in the YAML files. This was originally aimed at avoiding duplicate runs for "individual CI" when `pre-commit` opens a pull request by pushing to a secondary branch `pre-commit-ci-update-config` in the main repo (instead of a fork). The new setup is tested in #5393, where I copied these changes and where one can see that a commit pushed to that PR does not trigger an "individual CI" Azure pipeline anymore, but only a "PR automated" one. Hopefully this is correct for the merge commits that get pushed to `development` once a PR is closed, but we'll be able to test this only after merging a PR.
…pX#5394) The fix introduced in ECP-WarpX#5308 was not correct for Azure pipelines. In GitHub Actions we trigger a run on the `push` event only for the `development` branch. The Azure equivalent of that is triggering a run on the `trigger` event only for the `development` branch. However, since the `trigger` event was completely absent from the Azure pipeline file (that is, the default setup was being used), I had erroneously added the filter branch to the `pr` event instead, unlike what I did for GitHub actions where the `push` was exposed in the YAML files. This was originally aimed at avoiding duplicate runs for "individual CI" when `pre-commit` opens a pull request by pushing to a secondary branch `pre-commit-ci-update-config` in the main repo (instead of a fork). The new setup is tested in ECP-WarpX#5393, where I copied these changes and where one can see that a commit pushed to that PR does not trigger an "individual CI" Azure pipeline anymore, but only a "PR automated" one. Hopefully this is correct for the merge commits that get pushed to `development` once a PR is closed, but we'll be able to test this only after merging a PR.
When
pre-commit
gets auto-updated, we typically see a PR from the branchpre-commit-ci-update-config
.This branch is created directly in the main fork (unlike the individual branches that WarpX contributors create from their own forks) and all CI checks run twice:
pre-commit
automatically opens (these CI checks are labeled "PR automated")pre-commit-ci-update-config
(these CI checks are labeled "individual CI")Here's an example:
On top of this, once the PR is merged, CI runs a third time, because the merge is counted as activity on the branch
development
(again "individual CI").We should be able to safely skip "individual CI" for the activity on the branch
pre-commit-ci-update-config
. This PR should do the trick, although it's good to double check the syntax for GitHub Actions and Azure pipelines.My understanding is that the cleanup-cache and post-PR workflows don't need to be updated, also to be double checked.