Skip to content

ci: run test.yml once per commit and keep a main baseline after bot merges - #389

Merged
mrbobbytables merged 2 commits into
cncf:mainfrom
mrbobbytables:ci-test-triggers
Oct 9, 2026
Merged

mrbobbytables merged 2 commits into
cncf:mainfrom
mrbobbytables:ci-test-triggers

Conversation

@mrbobbytables

@mrbobbytables mrbobbytables commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Description

Consolidated fix for the two open test.yml trigger findings:

The jobs: map is unchanged, so required-check semantics on pull requests are untouched. Tag pushes no longer run test.yml; release.yml owns v* tags and runs after main was 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 edited test.yml — parses cleanly

Checklist

  • I ran npm run all to lint and build my code — not applicable, no code touched
  • I ran npm run pack and committed dist/ — not applicable, dist/ unchanged
  • Commits are signed off (DCO)
  • Note any new dependencies these changes bring in — none
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation — none needed
  • My changes generates no new warnings (please describe new warnings if unavoidable)

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind failing-test or /kind cleanup.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Reviewed from the test lane (read-only on a fork head, so comment only). The trigger narrowing and the concurrency block look right:

  • group: test-${{ github.head_ref || github.ref_name }} with cancel-in-progress: ${{ github.event_name == 'pull_request' }} cancels only superseded PR runs; push to main, the schedule and workflow_dispatch all land in test-main and queue rather than cancel, so no merge loses its result.
  • No path filter is added, so build-test still runs (and can still be required) on every pull request.
  • A repack push triggered by ci: repack dist/ on dependabot branches without exposing a write token #390 lands in the same group as the PR's own run and supersedes it, which is the desired order.

One nit on the body: prow-bot.yml keys its group on event_name/action/comment or PR id with cancel-in-progress: false (.github/workflows/prow-bot.yml:34-36), so it is not quite "the same pattern" — the head_ref || ref_name form here is the standard GitHub-documented one and is the right choice for a build-test lane, it just isn't a precedent from this repo.

git merge-tree --write-tree pr-389 pr-390 exits 0 — this and #390 merge cleanly in either order.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: unknown

— hive: agent=quality backend=copilot model=claude-fable-5.1

jeefy
jeefy previously requested changes Oct 9, 2026

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Limiting push to [main] plus pull_request does stop the double runs, and fork PRs still get CI. The concurrency key is the problem:

  1. 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 main lands in test-main and, as a pull_request event, 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 }} with cancel-in-progress: true. Then every non-PR run gets its own group and is never cancelled or replaced.

  2. Fix the comment and the PR body: runs on main can be cancelled under the current key, and prow-bot.yml keys on the PR number, not the branch name.

  3. Optional: say who watches the daily scheduled run. GitHub emails failures to whoever last edited the cron line.

mrbobbytables and others added 2 commits October 9, 2026 08:32
…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>
@mrbobbytables

Copy link
Copy Markdown
Member Author

Addressed all three points:

  1. Concurrency group is now ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} with cancel-in-progress: true — fork PRs from same-named branches get distinct groups, and every non-PR run (main push, schedule, dispatch) keys on its own run_id, so it is never cancelled or replaced.
  2. Fixed the workflow comment and the PR body — removed the incorrect claims about main-run cancellation and the prow-bot.yml pattern.
  3. Added a comment on the schedule trigger noting GitHub emails scheduled-run failures to whoever last edited the cron line.

@mrbobbytables
mrbobbytables dismissed jeefy’s stale review October 9, 2026 13:47

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.

@mrbobbytables
mrbobbytables merged commit 0328961 into cncf:main Oct 9, 2026
8 checks passed
@mrbobbytables
mrbobbytables deleted the ci-test-triggers branch October 9, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants