Repository navigation
test(bundle): drive /label-sync's missing-number guard and already-in-sync report through dist/index.js (src/issueComment/labelSync.ts:20-21,32,35) - #621
Conversation
…-sync report through dist/index.js Every bundle /label-sync scenario starts from a repository missing labels, so the comment always carries a Created: line, and /label-sync was the one slash command absent from the missing-number guard matrix. The new scenario seeds the fake repository from what a first sync creates, so the test holds no copy of the built-in label catalog that could drift from the bundle's, then asserts the zero-count report and that nothing is written to the labels API. Closes #620 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
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. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
There was a problem hiding this comment.
Read the diff against the tree at 36aecfa. This looks correct to me — test-only, and every claim in the body checks out against the source:
- The new matrix row drives the guard at
src/issueComment/labelSync.ts:20-22(issueNumber === undefined→ throw naming the guard), and it was indeed the only slash command missing from themissingNumberGuards.test.tsmatrix (17 rows before, 18 after). - The in-sync scenario exercises the false arms at
src/issueComment/labelSync.ts:32and:35: withcreated/updatedempty, the comment is exactlylabel-sync: created 0, updated 0, unchanged N.with noCreated:/Updated:lines — matching the assertion on the singlePOST /issues/1/commentsbody. - The asserted stdout line matches
src/cronJobs/labelSync.ts:87verbatim (created 0 [], updated 0 [], unchanged N, failed 0). - The seed-then-replay design is sound against the drift logic:
drift()(src/cronJobs/labelSync.ts:124-135) skips color when the desired label has none and compares description againstcurrent.description ?? '', so echoing the seed run's ownPOST /labelsbodies back (withcolor ?? 'ededed',description ?? null) necessarily yields zero writes — and the test asserts noPOST/PATCH/DELETEreached the API. No copy of the built-in catalog is held, as the body claims. e2e-coverage,build-testand DCO are green at this head.
No findings from any perspective. Scope matches #620 exactly (two test files, nothing under src/). The hold label is this lane's procedural gate — nothing in the change itself needs a decision.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
|
/kind cleanup |
Test Improvement
Two test files under
__tests__/bundle/; nothing undersrc/,dist/, docs or config.__tests__/bundle/missingNumberGuards.test.ts— one matrix row:/label-syncon a comment without an issue number fails naming the guard (src/issueComment/labelSync.ts:20-21). It was the only slash command missing from the 17-row matrix.__tests__/bundle/labelSyncCommandInSync.test.ts— a collaborator's/label-syncagainst a repository the job already brought into line: the comment is exactlylabel-sync: created 0, updated 0, unchanged N.with neitherCreated:norUpdated:line (labelSync.ts:32,35false arms), stdout reportscreated 0 [], updated 0 [], unchanged N, failed 0, and nothing is written to the labels API. The repository is seeded from thePOST /labelsbodies of a first sync run through the same bundle, so the test holds no copy of the built-in label catalog that could drift from the bundle's.Why. Every bundle
/label-syncscenario so far starts from a repository missing labels, so the comment always carries aCreated:line; the report a maintainer sees when the job has nothing to do was never produced end to end. Unit coverage of the file is 100 %, the bundle run hadDA:21,0and zero-countBRDArecords for lines 20, 32 and 35 (CI artifactcoverage-e2e-96433268…, run 40928440920).Files / cluster claimed —
src/issueComment/labelSync.ts's end-to-end coverage only;__tests__/bundle/missingNumberGuards.test.tsand the new file. Disjoint from thecronJobs/labelSync.tssync-algorithm scenarios (labelSyncCatalog,labelSyncFailureArms,labelSyncNullDescription,labelSyncUnprefixedAllowlist) and from everything else in flight.Testing
At 36aecfa (rebased onto main@4f97e30, after #611 and #619):
npx vitest run __tests__/bundle/labelSyncCommandInSync.test.ts __tests__/bundle/missingNumberGuards.test.ts— 2 files, 20 passednpm run test:coverage:e2e(at 9643326, before the rebase) — 92 files, 550 passed; branches 1702/1714 → 1705/1714, lines 2489/2494 → 2490/2494;src/issueComment/labelSync.tsleaves the uncovered table, exit 0npx eslinton both files andnpm run typecheck— cleandist/rebuilt viatsc && ncc build --no-cache:issueNumber === undefinedmade unreachable → the matrix row fails (not a collaboratordebug line, exit 0 instead of the guard);result.created.length > 0→>= 0→ the in-sync test fails on the comment body (Created:line appears)Related Issue
Closes #620 — both boxes of the finding are in this PR.
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88