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
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>
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 Hive will keep the |
Contributor
|
Please add a kind label with |
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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