Skip to content

test(bundle): drive owners.ts' truncated-tree probes and the base-branch OWNERS probe's arms through dist/index.js - #320

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-bundle-owners-probe-arms
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-bundle-owners-probe-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/ownersProbeArms.test.ts (new file only; nothing else touched), driving /approve by an approver on a pull request through the committed dist/index.js against fakeGithub to reach the arms of src/utils/owners.ts that a complete tree listing never does:

probeOwners — the base tip's tree is truncated

  • root OWNERS 200, sdk/OWNERS 404: bob approves from the root file; the probes run root-first, one at a time (GET …/contents/OWNERS?ref=basesha, GET …/contents/sdk%2FOWNERS?ref=basesha), and no git/blobs read happens
  • a probe answering 500: /approve fails with error loading OWNERS files at basesha, no label or comment write

probeBranchOwners — the tide gate's probe of the base branch

  • a complete tree without an OWNERS blob: the gate wants lgtm alone and the pull request merges (PUT …/pulls/1/merge), no contents/OWNERS read
  • a truncated tree without an OWNERS blob + root OWNERS 200: the gate wants approved too → skipping pr #1: missing approved
  • a truncated tree without an OWNERS blob + root OWNERS 404: lgtm alone, merges
  • a truncated tree + root probe 500: the merge fails with error probing for a root OWNERS file at master
  • a tree listing answering 500: the merge fails with error listing the tree of master, no root probe

Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3, npm run test:coverage:e2e): src/utils/owners.ts e2e 66.96 → 86.61 % lines (75 → 97 of 112), 68.66 → 85.07 % branches; probeOwners 0 → hit, every probeBranchOwners arm except the no-base.ref repoHasOwners/defaultBranch path (a defensive arm GitHub payloads never take) now reached. Bundle suite 6 files / 149 tests green; npx eslint and npx tsc --noEmit clean.

Disjoint from the open hold-gated PRs: #283 (ownersAuth.test.ts, auth.ts OWNERS arms on complete trees), #286 (approveReview.test.ts), #289 (mergeGateLabels.test.ts), #291, #293, #296, #298 (ownersLabelArms.test.ts), #300, #302, #304, #306, #308, #310, #312, #314, #316, #318, #242, #244, #246 (helpers.ts, labelCommands.test.ts, bundle.test.ts), #230, #287 — none drives a truncated tree or a contents/OWNERS?ref= probe.

Related Issue

Closes #319


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

…ex.js

Adds __tests__/bundle/ownersProbeArms.test.ts, driving /approve on a pull
request through the committed bundle against the fake GitHub to reach the
arms of src/utils/owners.ts that a complete tree listing never does:

- probeOwners: a truncated base-tip tree makes loadOwnersTree read each
  candidate OWNERS path directly (root 200 + sdk/OWNERS 404 approves with
  no blob read; a 500 probe fails /approve naming the base tip)
- probeBranchOwners, the tide gate's base-branch probe: a complete tree
  without an OWNERS blob (gate wants lgtm alone, the pull request merges),
  a truncated tree with and without a root OWNERS file, a 500 root probe
  and a 500 tree listing

owners.ts e2e coverage (npm run test:coverage:e2e, main@3fc21f2):
66.96% -> 86.61% lines, 68.66% -> 85.07% branches.

Closes #319

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 5, 2026 05:21
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 5, 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 5, 2026

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind failing-test or /kind cleanup.

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-kind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] owners.ts truncated-tree probes (probeOwners, probeBranchOwners arms) are never driven through dist/index.js

0 participants