Repository navigation
test(bundle): drive root-OWNERS authorization on an issue and the OWNERS-based /lgtm refusal through dist/index.js - #283
Conversation
…ERS-based /lgtm refusal through dist/index.js 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 |
|
/kind cleanup — 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.
All three cases add coverage, but the pull-request case is flaky: it failed 5 of 12 local runs.
ownersAuth.test.ts:86–90expects the two OWNERS reads in a fixed order, but the code fetches them concurrently. Put both reads in the any-order argument ([...ownersReads, blobOWNERS, blobSdkOWNERS]) and leave only[commentPost]in the ordered list.- Minor:
:68and:81check the full comment text, including thebecause Error: …wording that lgtm.ts:127 happens to produce. Check only the reason.
… the refusal reason only Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed both: the two OWNERS blob reads are now in the any-order argument ( 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
Addressed in ec40611: the two OWNERS blob reads are now in the any-order argument ( CI is green on the new head. 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
/kind cleanup |
Test Improvement
Adds
__tests__/bundle/ownersAuth.test.ts(new file only; importscomment,helpersFor,ownersProbe,ownersReads,queueRead,repo,tokenfrom./helpers) with three/lgtmcases driven through the committeddist/index.jsagainstfakeGithub— the OWNERS arms ofsrc/utils/auth.tsthat no bundle test reached:OWNERSlists the commenter as reviewer →GET …/contents/OWNERS(200, base64) →GET …/labels→POST …/issues/1/labels {labels:['lgtm']}; no/orgs/…/membersor/collaboratorsread; then the post-command config reads (assertRootOwner+retrieveOwnersFile, L271–290 / L338–364).OWNERSdoes not list the commenter → exit 1, one refusal commentCannot apply the lgtm label because Error: Codertocat is not included in the reviewers role in the OWNERS file, no label write, no membership fallback.OWNERS+sdk/OWNERScoversdk/file.go, commenter in neither → exit 1,… stranger is not a reviewer or approver for any changed file, nocontents/OWNERSread, no membership read; then the config reads and tide's gate (L321–322).Every bundle
/lgtmso far was either by a listed reviewer on an OWNERS repository or went through the membership fallback withcontents/OWNERSanswering 404; no bundle test sent/lgtmto a plain issue at all.Measured with
npm run test:coverage:e2eonmain@ ec76a3b:src/utils/auth.tse2e lines 63.1 % → 79.61 % (branches 53.12 % → 70.31 %). The remaining unreached lines in the file arethrow/catcharms the unit suite (__tests__/utils/auth.test.ts) already pins; they are not repeated here.Verification:
npx eslint __tests__/bundle/ownersAuth.test.tsclean,npx tsc --noEmitclean,npx vitest run __tests__/bundle/ownersAuth.test.ts→ 3 pass.Disjoint from the open hold-gated PRs: #230 (
vitest.config.mjs), #242 (cronJobsInput.test.ts), #244 (meow.test.ts), #246 (labelCommands.test.ts,helpers.ts).Related Issue
Closes #282
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88