Repository navigation
test(bundle): drive owners-label's early-return and failure arms through dist/index.js - #298
Conversation
…ugh dist/index.js Adds __tests__/bundle/ownersLabelArms.test.ts: five pull_request synchronize runs against the fake GitHub covering the arms of src/plugins/ownersLabel.ts the bundle suite never reached - already carrying every declared label, labels the repository lacks, a known/unknown mix, a failing repository label list and a payload without a pull request. npm run test:coverage:e2e: ownersLabel.ts 80 -> 100 % lines, 73.33 -> 100 % branches. Signed-off-by: quality <quality@hive.kubestellar.io>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
|
🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
jeefy
left a comment
There was a problem hiding this comment.
- Drop
ownersLabelArms.test.ts:87–102. Its only new lines (ownersLabel.ts:77–78) are already reached by:72, and the label write is covered at bundle.test.ts:1030.
Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed: dropped the known/unknown declared-labels mix case. Merged 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
Addressed in 60eb572: dropped the known/unknown declared-labels mix case. CI is green on the new head. 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
jeefy
left a comment
There was a problem hiding this comment.
Your earlier asks are done, and all four cases add coverage. One thing left: repoLabels() was added to ./helpers in #246, after the first review.
ownersLabelArms.test.ts:46–48: delete the localrouteRepoLabels. ImportrepoLabelsfrom./helpersand callgh.route('GET', \${repo}/labels`, repoLabels('area/sdk', 'area/docs'))at :57 andrepoLabels('kind/bug')` at :74.
…Labels helper Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed in 9650d0e: deleted the local 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
/kind cleanup |
Test Improvement
Files:
__tests__/bundle/ownersLabelArms.test.tsonly (new; nosrc/,dist/,helpers.tsor config change). Cluster: the non-write arms ofsrc/plugins/ownersLabel.tsdriven throughdist/index.jsonpull_request synchronize(require-matching-label, blunderbuss and tide skip that action, so each call list is the OWNERS reads, the plugin's own reads and approve's probe). Disjoint from every open hold-gated bundle PR (#242 cron jobs input, #244 /meow, #246 fixed/prefixed labels +helpers.ts, #283 OWNERS authorization, #286 approve.github_review, #289 tide merge gate, #291 blunderbuss, #293 hold/sweep, #296 close/milestone).Five cases, one per unreached arm:
Area/SDKvsarea/sdk) → noGET /labels, no write (ownersLabel.ts:61-62)owners-label: skipping label … (run label-sync)info lines, no write (77-78, 81)area/docsposted, in the OWNERS spelling, while the repository's spelling (Area/Docs) decides it is knownGET /labels→ 500 →::error::error handling pull_request event: could not list the repository labels: …boom…, exit 1, and approve's default-branch probe still runs after it (70;runEventHandlerscollects the rejection)pull_request→github context payload missing pull request: …, exit 1, zero API calls (30)Evidence (
main@ 3fc21f2, Node v26.10.0, vitest 5.0.3):npm run test:coverage:e2e:ownersLabel.ts80 → 100 % lines, 73.33 → 100 % branches; bundle suite 6 files / 147 tests green (was 5 / 142).npx vitest run --coverage(unit): unchanged, 81 files / 1644 tests,ownersLabel.tsalready 100 %.npx eslint __tests__/bundle/ownersLabelArms.test.tsandnpx tsc --noEmitclean.Once #246 lands its
repoLabels()helper, the localrouteRepoLabelshere can import it; kept local for now sohelpers.tsstays untouched.Related Issue
Closes #297
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88