Skip to content

test(bundle): drive parseOwners's content-shape arms (owners.ts:39/41/83) through dist/index.js - #406

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-owners-parse-arms
Oct 9, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-owners-parse-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/ownersParseArms.test.ts (new file only; nothing else touched): seven /approve runs by alice on a pull request through the committed dist/index.js against fakeGithub, each with a single root OWNERS file on the base branch whose content shape reaches an arm of parseOwners (src/utils/owners.ts:38-90) that no bundle test drives today:

  • whitespace-only, yaml-list and yaml-scalar OWNERS (owners.ts:39, :40-43 → an OWNERS file that names nobody): exit 1, ::error:: lines are exactly the refusal Cannot approve the pull request: Error: alice is not an approver for any changed file and the dispatcher's TypeError: error handling issue comment: Error: alice is not an approver …; the refusal is posted as a comment; no POST …/issues/1/labels, no members//collaborators/ probe
  • approvers: alice, approvers: [alice, 42], reviewers: { bob: true }, labels: [{ name: … }] (owners.ts:83-86): exit 1, one ::error:: containing error 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 probe

A 0-byte OWNERS file is deliberately left out and the test comment names #404: decode (owners.ts:163) rejects a blob whose content is "" before parseOwners sees 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.ts e2e 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 committed dist/index.js; npx eslint on the file and npx tsc --noEmit clean.

Files/functions claimed: __tests__/bundle/ownersParseArms.test.ts only; parseOwners/stringList content-shape arms. Disjoint from every open hold-gated PR — verified by merging all 13 held heads (#298 … #403) onto main and re-measuring: these arms were still at 0 hits. #383 (ownersTreeLoadArms.test.ts) covers loadOwnersTree's L164/L197/L229 failure arms, which this file does not touch; #401/#403 cover auth.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

…/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>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 9, 2026 07:29
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 9, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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 outreach agent is always held because it publishes project-facing communication.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@github-actions

github-actions Bot commented Oct 9, 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 Author

Supersession sweep found that this PR's claimed issue is already closed by another merged PR.

  • Claimed issue: prow-github-actions#404
  • Closing PR: #416

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.

@mrbobbytables
mrbobbytables merged commit 85d93ac into main Oct 9, 2026
12 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-owners-parse-arms branch October 9, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hold Indicates that a PR should not merge because someone has issued a /hold command. needs-human needs-kind

Projects

None yet

1 participant