Repository navigation
test(labeling): pin removeLabels continuing past an already-gone label and stopping at a real failure - #543
Open
hivecommons-hive[bot] wants to merge 1 commit into
Open
hivecommons-hive[bot] wants to merge 1 commit into
hivecommons-hive[bot] wants to merge 1 commit into
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>
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. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
Contributor
|
Please add a kind label with |
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
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