Repository navigation
test(bundle): drive owners.ts' truncated-tree probes and the base-branch OWNERS probe's arms through dist/index.js - #320
Conversation
…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>
|
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 |
jeefy
left a comment
There was a problem hiding this comment.
All seven cases add coverage, but the file declares its own copies of shared helpers.
ownersProbeArms.test.ts:68–70declares its owncalls(). Take it fromhelpersFor(() => gh).:73–80:afterConfigre-implementsexpectCommandThenConfig, and its localstartshadows the importedstart. UseexpectCommandThenConfig([...ownersReads, ...ownersTail], tail)at :102 and :138.
Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed: 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
|
Addressed in d92399e: 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/ownersProbeArms.test.ts(new file only; nothing else touched), driving/approveby an approver on a pull request through the committeddist/index.jsagainstfakeGithubto reach the arms ofsrc/utils/owners.tsthat a complete tree listing never does:probeOwners— the base tip's tree is truncatedOWNERS200,sdk/OWNERS404: 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 nogit/blobsread happens/approvefails witherror loading OWNERS files at basesha, no label or comment writeprobeBranchOwners— the tide gate's probe of the base branchlgtmalone and the pull request merges (PUT …/pulls/1/merge), nocontents/OWNERSreadOWNERS200: the gate wantsapprovedtoo →skipping pr #1: missing approvedOWNERS404:lgtmalone, mergeserror probing for a root OWNERS file at mastererror listing the tree of master, no root probeEvidence (
main@ 3fc21f2, Node v26.10.0, vitest 5.0.3,npm run test:coverage:e2e):src/utils/owners.tse2e 66.96 → 86.61 % lines (75 → 97 of 112), 68.66 → 85.07 % branches;probeOwners0 → hit, everyprobeBranchOwnersarm except the no-base.refrepoHasOwners/defaultBranchpath (a defensive arm GitHub payloads never take) now reached. Bundle suite 6 files / 149 tests green;npx eslintandnpx tsc --noEmitclean.Disjoint from the open hold-gated PRs: #283 (
ownersAuth.test.ts,auth.tsOWNERS 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 acontents/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