Repository navigation
test(bundle): drive parseOwners's content-shape arms (owners.ts:39/41/83) through dist/index.js - #406
Conversation
…/83) through dist/index.js Adds __tests__/bundle/ownersParseArms.test.ts: /approve on a pull request whose base has a root OWNERS file that is whitespace-only, a yaml list or a yaml scalar (an OWNERS file that names nobody, so the commenter is refused and told so), and one whose approvers/reviewers/labels value is not a list of strings (the run fails naming the file and the role, with no authorization probe and no write). A 0-byte OWNERS file is deliberately left out: decode() rejects a blob whose content is '' before parseOwners sees it (#404). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> 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 |
|
Please add a kind label with |
|
Supersession sweep found that this PR's claimed issue is already closed by another merged PR.
this PR also claims another issue that is still open. A human should decide whether to close this PR. This comment is edited in place by the supersession sweep; it is not duplicated. |
Test Improvement
Adds
__tests__/bundle/ownersParseArms.test.ts(new file only; nothing else touched): seven/approveruns byaliceon a pull request through the committeddist/index.jsagainstfakeGithub, each with a single rootOWNERSfile on the base branch whose content shape reaches an arm ofparseOwners(src/utils/owners.ts:38-90) that no bundle test drives today:owners.ts:39,:40-43→ an OWNERS file that names nobody): exit 1,::error::lines are exactly the refusalCannot approve the pull request: Error: alice is not an approver for any changed fileand the dispatcher'sTypeError: error handling issue comment: Error: alice is not an approver …; the refusal is posted as a comment; noPOST …/issues/1/labels, nomembers//collaborators/probeapprovers: alice,approvers: [alice, 42],reviewers: { bob: true },labels: [{ name: … }](owners.ts:83-86): exit 1, one::error::containingerror loading OWNERS files at basesha: Error: OWNERS at OWNERS: <role> must be a list of GitHub usernames/… of label names; no comment, no label write, no membership probeA 0-byte OWNERS file is deliberately left out and the test comment names #404:
decode(owners.ts:163) rejects a blob whosecontentis""beforeparseOwnerssees it, so pinning that shape here would pin the failure as expected behaviour.Evidence (
main@ 20d49e7, Node v26.10.0, vitest 5.0.3,npm run test:coverage:e2e):src/utils/owners.tse2e branches 124 → 131 of 134 (92.5 → 97.8 %); suite-wide branches 89.66 → 89.97 % (2013 → 2020 of 2245), lines 94.67 → 94.71 %. Bundle suite 46 files / 364 tests green against the committeddist/index.js;npx eslinton the file andnpx tsc --noEmitclean.Files/functions claimed:
__tests__/bundle/ownersParseArms.test.tsonly;parseOwners/stringListcontent-shape arms. Disjoint from every open hold-gated PR — verified by merging all 13 held heads (#298 … #403) ontomainand re-measuring: these arms were still at 0 hits. #383 (ownersTreeLoadArms.test.ts) coversloadOwnersTree's L164/L197/L229 failure arms, which this file does not touch; #401/#403 coverauth.ts/pullRequestOwners.ts.Related Issue
Closes #405
Refs #404 (needs-human: the 0-byte OWNERS shape is a production fix in
owners.ts:163/auth.ts:493, so it stays out of this test until a maintainer lands it)Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88