Repository navigation
test(bundle): drive the repoHasOwners/defaultBranch fallback of approve and the tide gate through dist/index.js - #369
hivecommons-hive[bot] wants to merge 3 commits into
Conversation
…ve and the tide gate through dist/index.js Adds __tests__/bundle/defaultBranchFallback.test.ts, running the committed bundle against the fake GitHub for the arm approve.ts:504 and tide.ts:543 take when no base branch is in scope: a pull_request payload without base.ref, and a pulls.get read without base.ref. Each reaches owners.ts repoHasOwners -> defaultBranch three ways: the payload's repository.default_branch, the repos.get fallback, and that read's 500. owners.ts e2e lines 75 -> 82 of 112; both call-site fallback arms 0 -> hit. 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 |
|
Please add a kind label with |
jeefy
left a comment
There was a problem hiding this comment.
I measured each case's new end-to-end coverage. The approve cases at L43/55/67 cover the three default-branch paths, and L100 covers the tide.ts:543 fallback. The two tide cases after those reach nothing new.
- Drop
defaultBranchFallback.test.ts:113–125and:127–140. owners.ts:354–358 is already reached by L55/L67, and tide.ts:543 by L100.
…by the approve cases Signed-off-by: quality <quality@hive.kubestellar.io>
|
Addressed: dropped the two tide cases after L100; the approve cases and the tide.ts:543 case remain. Merged 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 |
Test Improvement
Adds
__tests__/bundle/defaultBranchFallback.test.ts(one new file; no change tohelpers.ts,fakeGithub.ts,runBundle.ts, source ordist/). It drives the committeddist/index.jsagainst the fake GitHub through the arm both OWNERS consumers take when no base branch is in scope, which falls tosrc/utils/owners.tsrepoHasOwners→defaultBranch:approve.ts:504—pull_requestsynchronizewhose payload carries nopull_request.base.refrepository.default_branchpresent: approve probesGET …/git/trees/master?recursive=truewith norepos.getread;approve: the base branch has no OWNERS files, exit 0repository.default_branchremoved too:GET /repos/Codertocat/Hello-World→{ default_branch: 'trunk' }, thenGET …/git/trees/trunk?recursive=true::error::carriescould not read the default branch, no branch tree is probed (owners-label'strees/baseshalisting is the only tree read)tide.ts:543—pull_requestlabeled lgtmby a human,GET …/pulls/1returning nobase.ref[bind, pulls/1, trees/master, commit status, graphql, merge],merged pr #1[bind, pulls/1, GET /repos/…, trees/trunk, commit status, graphql, merge], mergesrepos.get500: exit 1,could not read the default branch, no tree probe and noPUTEvidence (
main@ 3fc21f2, Node v26.10.0, vitest 5.0.3,vitest run --coverage --coverage.reporter=lcovonly --config vitest.e2e-coverage.config.mjs __tests__/bundle):src/utils/owners.tse2e lines 75 → 82 of 112 (DA:283,0 … DA:358,0→DA:283,6 DA:349,6 DA:350,6 DA:351,2 DA:354,4 DA:355,4 DA:358,2)approve.tsBRDA:504fallback arm 0 → 3;tide.tsBRDA:543base === undefinedarms 0 → 3npx eslintandnpx tsc --noEmitclean__tests__/utils/owners.test.ts); the two reports are stated separately per [quality] the bundle e2e suite's coverage of src/ is never captured — runBundle.ts drops NODE_V8_COVERAGE and dist/ has no source map #235Cluster claimed:
owners.tsrepoHasOwners/defaultBranchviaapprove.ts:504andtide.ts:543. Disjoint from the held OWNERS PRs: #320 (probeOwners/probeBranchOwnerstruncated-tree arms — its body leaves this path out by name), #328/#331 (pullRequestOwners, issue-side fallback), #365 (parseOwnersfilters), #283 (root-OWNERS authorization), #333/#363 (approve evaluation arms,syncApprovalReview), #322/#347 (tide merge-queue and verdict arms).Related Issue
Closes #368
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88