Skip to content

test(bundle): drive loadOwnersTree's failure arms (owners.ts L164/L197/L229) through dist/index.js - #383

Merged
mrbobbytables merged 4 commits into
mainfrom
quality/test-owners-tree-load-arms
Oct 9, 2026
Merged

mrbobbytables merged 4 commits into
mainfrom
quality/test-owners-tree-load-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/ownersTreeLoadArms.test.ts (new file only; nothing else touched): three /approve runs by an approver on a pull request through the committed dist/index.js against fakeGithub, reaching the failure arms of the complete-tree OWNERS loader loadOwnersTree in src/utils/owners.ts that no bundle test drives today:

  • GET …/git/trees/basesha?recursive=true → 500: exit 1, ::error:: includes error loading OWNERS files at basesha (L197); no git/blobs read, no write
  • GET …/git/blobs/<sha of OWNERS> → 500: exit 1, same message (L229); no write
  • GET …/git/blobs/<sha of OWNERS> → 200 { sha, size } without content: exit 1, invalid OWNERS file returned from GitHub API for OWNERS (L164); no write

Each case checks the recorded call order with the existing expectCommandThenConfig helper: the OWNERS reads, then the post-command sweep's config reads, then tide's own pulls/1 read, base-branch probe and merge-queue dequeue — and asserts no POST …/issues/…, no PUT, and no contents/OWNERS probe.

Evidence (main @ aa6a0f8, Node v26.10.0, npm run test:coverage:e2e): src/utils/owners.ts e2e 66.96 → 69.64 % lines (75 → 78 of 112), branches 68.65 → 70.14 %; L164/L197/L229 go from 0 hits to reached. Bundle suite 23 files / 218 tests green; npx eslint and npx tsc --noEmit clean.

Files/functions claimed: __tests__/bundle/ownersTreeLoadArms.test.ts only; loadOwnersTree/decode failure arms. Disjoint from the open hold-gated PRs: #320 (ownersProbeArms.test.ts, truncated-tree probeOwners/probeBranchOwners, L261), #331 (rootOwnersFallback.test.ts, issue-side auth.ts:494), #328 (pullRequestOwners), #365 (parseOwners filters), #283 (ownersAuth.test.ts) — verified by merging all 31 held heads onto main and re-measuring: the three lines were still at 0 hits.

Related Issue

Closes #382


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

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

…rough dist/index.js

Three /approve runs on a pull request reach loadOwnersTree's failure arms in src/utils/owners.ts: the recursive tree listing of the base tip answering 500 (L197), an OWNERS blob answering 500 (L229), and a blob answering 200 without content to decode (L164). Each fails the run naming the base tip before anything is written.

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 8, 2026 08:18
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 8, 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.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

/kind cleanup


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: aa6a0f8

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

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-kind labels Oct 8, 2026

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ownersTreeLoadArms.test.ts:59–66: drop the "blob fails other than 404" case. It reaches only owners.ts:229, which :68 also reaches.
  • :14: the comment points to ownersProbeArms.test.ts, which exists only in unmerged #320. Name #320 or drop the reference.

…already reaches

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in 0811304: dropped the "blob fails other than 404" case (owners.ts:229 is reached by the no-content case). The header comment keeps the ownersProbeArms.test.ts reference since #320 has merged and the file is on main; it now names #320.


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 0811304

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

mrbobbytables and others added 2 commits October 9, 2026 10:55
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
@mrbobbytables
mrbobbytables merged commit 821f194 into main Oct 9, 2026
5 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-owners-tree-load-arms branch October 9, 2026 17:59
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] loadOwnersTree's failure arms (owners.ts L164/L197/L229) are unit-only — no bundle test drives a failing tree listing or blob read

2 participants