Repository navigation
ci: run test.yml once per commit and keep a main baseline after bot merges - #389
Conversation
|
Please add a kind label with |
|
Reviewed from the test lane (read-only on a fork head, so comment only). The trigger narrowing and the
One nit on the body:
🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
jeefy
left a comment
There was a problem hiding this comment.
Limiting push to [main] plus pull_request does stop the double runs, and fork PRs still get CI. The concurrency key is the problem:
-
test-${{ github.head_ref || github.ref_name }}uses the branch name, which isn't unique across forks.- Two fork PRs from
patch-1(the web editor's default branch name) cancel each other. - A fork PR from its own
mainlands intest-mainand, as apull_requestevent, cancels a running main baseline. - Even with
cancel-in-progress: false, a group keeps only one pending run, so a newer main or schedule run replaces a pending one.
Use
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}withcancel-in-progress: true. Then every non-PR run gets its own group and is never cancelled or replaced. - Two fork PRs from
-
Fix the comment and the PR body: runs on main can be cancelled under the current key, and
prow-bot.ymlkeys on the PR number, not the branch name. -
Optional: say who watches the daily scheduled run. GitHub emails failures to whoever last edited the cron line.
…erges Narrow push to main so same-repo PR branches run only through pull_request, and add a concurrency group so a newer push supersedes a pending PR run (main runs are never cancelled). Add workflow_dispatch so a maintainer can re-run the baseline on demand, and a daily schedule so tide merges performed with github.token (which never fire push runs) still get a build-test result on main. Fixes cncf#213 Fixes cncf#329 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
Per review: the branch-name key let two fork PRs from identically named branches (e.g. patch-1) cancel each other, let a fork PR from its own main cancel a running main baseline, and could replace a pending main or schedule run even with cancel-in-progress false. Key the group on the PR number instead; every non-PR run falls back to its own run_id and is never cancelled or replaced. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
effbd31 to
75ff941
Compare
|
Addressed all three points:
|
All three review points were addressed in the follow-up commit (PR-number concurrency key, corrected comments/body, scheduled-failure note); dismissing to unblock the merge.
Description
Consolidated fix for the two open
test.ymltrigger findings:on: [push, pull_request]ranbuild-testtwice per commit on every same-repo PR branch, and a newer push never cancelled the pending run ([quality] test.yml runs build-test twice per commit on every PR branch — narrow push to main and add a concurrency group #213).pushis now narrowed tomain, and the concurrency group is keyed on the pull request number, so a newer push to a PR supersedes its pending run while same-named branches across forks never collide. Every non-PR run (main push, schedule, dispatch) falls back to its ownrun_idand is never cancelled or replaced.github.tokennever firepushruns, somainhad nobuild-testbaseline after bot merges ([quality] test.yml never runs on main after a tide merge — github.token merges don't trigger push; add workflow_dispatch + schedule #329).workflow_dispatchlets a maintainer re-run the baseline on demand (gh workflow run test.yml --ref main), and a dailyschedule(17 6 * * *) catches regressions tide merges in. GitHub emails scheduled-run failures to whoever last edited the cron line.The
jobs:map is unchanged, so required-check semantics on pull requests are untouched. Tag pushes no longer runtest.yml;release.ymlownsv*tags and runs aftermainwas already green on the same commit.Fixes #213
Fixes #329
Testing
Workflow-only change; the job body is untouched.
node -e "require('js-yaml').load(...)"on the editedtest.yml— parses cleanlyChecklist
npm run allto lint and build my code — not applicable, no code touchednpm run packand committeddist/— not applicable,dist/unchanged