Skip to content

Avoid duplicate PR push runs and fix main branch concurrency group. - #2929

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_1014903546
Nov 8, 2026
Merged

copybara-service[bot] merged 1 commit into
mainfrom
test_1014903546

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Avoid duplicate PR push runs and fix main branch concurrency group.

The GitHub Actions workflow in .github/workflows/pytest.yml triggers on both pull_request (targeting main) and unfiltered push events. Because Copybara presubmit exports push in-repo test_<CL> branches and open a pull request against main, every presubmit snapshot triggers two 12-shard test runs simultaneously (push on refs/heads/test_<CL> and pull_request on refs/pull/<PR>/merge), and every CL submission triggers three 12-shard runs. In addition, concurrency.group checks refs/heads/master instead of refs/heads/main, and cancel-in-progress only matches refs/pull/, leaving superseded push runs on test_<CL> branches running to completion.

Scope the push trigger to main so in-repo test_<CL> branches run once via the pull_request trigger (which still attaches all 12 shard check runs to the PR head commit SHA for Copybara presubmit checks). Update concurrency.group to check refs/heads/main and set cancel-in-progress to github.event_name == 'pull_request'. Over a 72-hour window, overlapping and duplicate branch/PR runs accounted for 301.3 of 674.9 runner-hours (18,078 runner-minutes, or 44.6% of the repository's Actions usage, equivalent to roughly 180,000 runner-minutes per month).

@google-cla

google-cla Bot commented Nov 5, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

The GitHub Actions workflow in .github/workflows/pytest.yml triggers on both `pull_request` (targeting `main`) and unfiltered `push` events. Because Copybara presubmit exports push in-repo `test_<CL>` branches and open a pull request against `main`, every presubmit snapshot triggers two 12-shard test runs simultaneously (`push` on `refs/heads/test_<CL>` and `pull_request` on `refs/pull/<PR>/merge`), and every CL submission triggers three 12-shard runs. In addition, `concurrency.group` checks `refs/heads/master` instead of `refs/heads/main`, and `cancel-in-progress` only matches `refs/pull/`, leaving superseded `push` runs on `test_<CL>` branches running to completion.

Scope the `push` trigger to `main` so in-repo `test_<CL>` branches run once via the `pull_request` trigger (which still attaches all 12 shard check runs to the PR head commit SHA for Copybara presubmit checks). Update `concurrency.group` to check `refs/heads/main` and set `cancel-in-progress` to `github.event_name == 'pull_request'`. Over a 72-hour window, overlapping and duplicate branch/PR runs accounted for 301.3 of 674.9 runner-hours (18,078 runner-minutes, or 44.6% of the repository's Actions usage, equivalent to roughly 180,000 runner-minutes per month).

PiperOrigin-RevId: 1016812766
@copybara-service copybara-service Bot closed this Nov 8, 2026
@copybara-service
copybara-service Bot merged commit b53645a into main Nov 8, 2026
1 check failed
@copybara-service
copybara-service Bot deleted the test_1014903546 branch November 8, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants