[quality] test.yml runs build-test twice per commit on every PR branch — narrow push to main and add a concurrency group
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- github-actions
- Ambito
- ci-cd
Direzione di ricerca
Leggi .github/workflows/test.yml, in particolare i suoi trigger e la jobs map invariata, quindi confronta le impostazioni proposte con prow-bot.yml:34-36. Applica le modifiche ai trigger e alla concorrenza e verifica che il commit successivo di una PR dello stesso repository produca un’esecuzione di build-test, che le esecuzioni delle PR superate vengano annullate e che le esecuzioni di main non vengano annullate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Finding
.github/workflows/test.yml:2 is on: [push, pull_request] and the workflow has no concurrency block. Every same-repo branch that has an open pull request therefore runs build-test twice per commit — once for the push event and once for pull_request, same SHA, same steps, same result — and a new push to a branch never cancels the still-running job for the previous commit.
Evidence, main @ 187c5e3:
- #188 head
8656298: run 36255852284 (push, started 16:33:01) and run 36255855092 (pull_request, started 16:33:04) — identical SHA, both fail on the same step. - Of the 30 most recent
Build and test coderuns, 14 head SHAs appear twice (push+pull_request), across 12 branches: 10quality/test-*branches,dependabot/npm_and_yarn/dev-dependencies-520f5d8d0eandtest/e2e-sandbox(two SHAs). Reproduce:gh run list --workflow test.yml --limit 30 --json headSha,event | jq 'group_by(.headSha)|map(select(length>1))|length'. prow-bot.yml:34-36already declares aconcurrencygroup for the bot;test.ymlis the onlypull_requestworkflow in the repository without one.
Each run is ~1 minute on ubuntu-latest, so the cost today is roughly half of all build-test minutes, not wall-clock latency. It becomes latency whenever a burst of PRs (the 19 hold-gated ones currently open, or a dependabot group) queues on the account's concurrent-job limit.
Recommendation
Fire once per commit and let a newer push to a pull request supersede the pending run. Exact replacement — replace lines 1-5 of .github/workflows/test.yml (name: through contents: read) with:
name: Build and test code
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
# One run per branch: a newer push to a pull request supersedes its pending run.
# Runs on main are never cancelled, so every merge keeps its own result.
concurrency:
group: test-${{ github.head_ref || github.ref_name }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
The jobs: map is unchanged.
Notes for the maintainer applying this:
push: branches: [main]removes the duplicate outright: a same-repo PR branch runs only throughpull_request;mainstill runs on every merge. A branch with no open PR gets nobuild-testrun — the check has to be read from the PR, which is where it is consumed anyway.github.head_ref || github.ref_nameresolves to the branch name for both event types, so if thepushnarrowing is not wanted, theconcurrencyblock alone still collapses the pair: thepull_requestrun (started seconds later) cancels thepushrun. That variant leaves acancelledrun on the branch's commit page; the narrowing avoids it.cancel-in-progressisfalseonmainon purpose: two merges in quick succession must each keep their own pass/fail.- Tag pushes currently also run
test.yml;release.ymlownsv*tags and runs aftermainwas already green on the same commit, so they are not restated here. Addtags: ['v*']underpush:if that run is wanted back. - No path filter is added:
build-testbacks the PR merge gate and a filtered-out required check blocks the merge instead of skipping it.
Why no PR: the whole change is inside .github/workflows/. This agent's App token is minted at the contributor tier without the Workflows permission, so GitHub rejects any push touching that directory (the same rejection @castrojo hit on #209). It needs a human or an ISSUES_PRS_MERGE-tier agent to land. No part of the fix lies outside .github/workflows/.
Completion criteria
-
test.ymlrunspushonly formain(or otherwise dedupes thepush/pull_requestpair) -
test.ymlhas aconcurrencygroup that cancels supersededpull_requestruns and never cancelsmain - The next same-repo PR commit produces exactly one
build-testrun
Priority
- Impact: low — ~2×
build-testminutes and slower burst throughput; no correctness effect - Effort: low
Filed by quality agent (hold-gated mode)
🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 187c5e3
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
- Lingua principale
- TypeScript
- Stelle
- 132
- Fork
- 24
- Merge medio
- 1g 17h
- PR unite (30g)
- 220
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cncf/prow-github-actions
-
[quality] sweep.ts delayed-reviewers OWNERS guard (line 80 false arm) is covered by neither the unit nor the bundle suiteForse già presa @hivecommons-hive l’ha presa 1 giorno fa. Apertaagent/quality needs-kind stage/040-covered-by-pr testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 25/100
cncf/prow-github-actions#560 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
Follow-up: strengthen test contracts, CI enforcement, release delivery, and quality triageForse già presa @hivecommons-hive l’ha presa 1 giorno fa. Apertakind/cleanup quality stage/040-covered-by-pr tests
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
cncf/prow-github-actions#554 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[quality] Re-evaluate the e2e branch coverage floor after pending coverage work landsForse già presa @hivecommons-hive l’ha presa 1 giorno fa. Apertahive/claimed-by-quality kind/cleanup stage/040-covered-by-pr
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
cncf/prow-github-actions#551 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
🐝 Hive Advisory ReportApertakind/cleanup
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
cncf/prow-github-actions#170 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di cncf/prow-github-actions
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
cloudscape-design/components#5184 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
JarX-Concepts/react-native-platform-components#130 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(api): optimize-for-web /preview outer catches miss asDecoderOutOfMemory on V8 OOM and SIGKILLApertaarea: backend bug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
snapotter-hq/SnapOtter#3773 ·
I maintainer di solito rispondono entro 1 giorno
-
ai-driven-qa ux-audit
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
linagora/twake-contacts-frontend#386 ·
I maintainer di solito rispondono entro 1 giorno
-
git: README should state plainly that without --repository every reachable repository is in scopeApertadocumentation server-git v2
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
modelcontextprotocol/servers#5225 ·
I maintainer di solito rispondono entro 1 giorno