Repository navigation
test(labeling): pin removeLabels continuing past an already-gone label and stopping at a real failure - #543
Conversation
…l and stopping at a real failure removeLabels is the shared removal path for /remove, /remove-<prefix>, /hold cancel, /lgtm cancel, exclusive-prefix replacement, approve's label sync and require-matching-label's cleanup. Every existing 404 case removes a single label, so a loop that stopped at the first already-gone label passed the whole suite. Call removeLabels directly with three labels, answer one DELETE with 404, and assert all three are requested in order; answer one with 500 and assert the loop stops there with the label named. 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 |
|
Please add a kind label with |
mrbobbytables
left a comment
There was a problem hiding this comment.
Copilot review performed under the maintainer's explicit authorization to update, review, release reviewed holds, and merge eligible PRs in this cleanup.
The removal-loop assertions distinguish continuing after a 404 from stopping at a real failure, including exact request order and omission of later writes after failure.
Verified successful build-test, e2e-coverage and DCO results on head 47b7f92. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.
Test Improvement
Pins the one non-equivalent survivor a single-operator mutation probe (16 mutants,
npx vitest related src/utils/labeling.ts --run, 67 files / 1369 tests) left insrc/utils/labeling.ts, which is 100 % line- and branch-covered by bothnpm run test:coverageandnpm run test:coverage:e2eonmain@ 88241f4. Tests only; nosrc/,dist/or docs change.Files / functions claimed:
__tests__/utils/labeling.test.ts(newremoveLabelsdescribe). Disjoint from every open held PR: #512 owns__tests__/label/remove.test.ts, #514command.test.ts/labelMatch.test.ts, #542duration.test.ts/labelCatalog.test.ts; none toucheslabeling.test.tsorsrc/utils/labeling.ts.labeling.ts:180-181—removeLabelsreturns after thealready absentdebug instead of continuing the loopremoveLabels› keeps removing the later labels after an earlier one is already gone:['gone', 'kind/bug', 'still-there']withgone→ 404 resolves and all threeDELETEs are issued in orderremoveLabels› stops at the first failure that is not a 404 and names the label:['first', 'broken', 'never']withbroken→ 500 rejectscould not remove label brokenandneveris not requestedremoveLabelsis the shared removal path for/remove,/remove-<prefix>,/hold cancel,/lgtm cancel, exclusive-prefix replacement (prefixed.ts:107), approve's label sync and require-matching-label's cleanup; every existing 404 case removes a single label, so a loop that silently stopped at the first gone label passed the whole suite.Equivalent survivors left alone:
e.name || ''→?? ''ingetCurrentLabels, and dropping the'status' in errorTypeScript narrowing inisNotFound.Verification (this branch, local)
npx vitest run __tests__/utils/labeling.test.ts: 17/17 pass onmain; with the mutant applied the new test fails (expected ['gone'] to deeply equal ['gone', 'kind/bug', 'still-there'])npx eslint __tests__/utils/labeling.test.ts: cleannpm run test:coverageonmain@ 88241f4: 163 files / 2206 tests, 100 / 99.75 / 100 / 100 (the four branches reported are the negative-count v8 artifacts docs(contributing): record the four negative-count BRDA branches as a v8 await artifact, not a gap #511 documents)npm run test:coverage:e2eonmain@ 88241f4: 99.96 / 98.79 / 100 / 99.95;labeling.tshas no zero-hit branch (the two reports are produced by different transforms and are not merged, asvitest.e2e-coverage.config.mjsdocuments)Related Issue
Refs #523 — the hive folded this finding (
removeLabelscontinues past a 404) onto that tracker; this PR is the finding and its complete fix. The tracker stays open for its other folded findings (trigger.ts, approveReview.ts, therun.ts:40/config.ts:657src/annotation), which are other PRs' or a human's.Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88