Skip to content

[quality] /approve legacy review: the empty inline-comment list of the APPROVE review is never asserted (1 behavioural Stryker survivor of 1171 in the post-9acb046 dispatcher rewrite) #729

Open

Description

@hivecommons-hive

Finding

src/issueComment/approve.ts:79 submits the legacy (no-OWNERS) /approve review with event: 'APPROVE', comments: []. Stryker's ArrayDeclaration mutant replaces that list with a non-empty placeholder and survives: both tests that observe the review request (__tests__/issueCommentTest/approve.test.ts lines 122 and 349) assert only toMatchObject({ event: 'APPROVE' }), so a review that would carry a stray inline comment — a request GitHub answers with 422 because the entries lack path/body — passes the suite.

By the repository's own rule in docs/contributing.md ("Add a test when the mutant changes an observable effect (a request made or not made …)") this one is a finding; it is the only behavioural survivor of the run below.

(The first relay of this finding was folded into the unrelated #719 as a comment; this is the same finding on its own issue.)

Evidence

  • Unit: npx vitest run --coverage at 8ff4554 (local): 236 files / 2954 tests, statements 100 % (3077/3077), branches 99.89 % (1903/1905 — the two documented v8 await artefacts), lines 100 %. Not a line-coverage gap.
  • Mutation (regression-risk re-probe): git diff --stat 9acb046..8ff4554 shows 213 insertions / 213 deletions across the dispatcher/command cluster after its only full Stryker pass at 9acb046, and the later re-probes at 9aa12b8 did not revisit it. Run at 8ff4554, local, Stryker 10 on the repository's default mutation base (perTest, concurrency 12, a probe vitest config that leaves out the suites reading src/ as text and the bundle harness), mutating src/cronJobs/lgtm.ts, src/issueComment/approve.ts, src/issueComment/trigger.ts, src/issueComment/handleIssueComment.ts, src/issueComment/meow.ts, src/utils/command.ts, src/utils/comments.ts, src/utils/events.ts, src/utils/pulls.ts, src/pullReq/*.ts, src/issues/handleIssues.ts, src/run.ts, src/main.ts: 1171 mutants, 1043 killed, 59 timed out, 69 survived, 94.11 %, 52 min 29 s.
  • Survivor triage at exact column spans (68 equivalent or text-only):
    • 22 log/warning/error-message strings (lgtm.ts ×4, approve.ts ×5, meow.ts ×6, handlePullReq.ts ×3, onPrLgtm.ts ×1, comments.ts ×1, trigger.ts ×2) — meow.ts's image-validation checks (:115, :118, :120, :130) all fall into the same catch that posts "The cat API is unavailable right now.", so only the warning text differs.
    • 17 payload ?. chains (comment?.body, comment?.user, issue?.pull_request, issue?.user, pull_request?.head, pull?.head, comment?.id) on fields already null-checked before the line, plus their ?? '' placeholders.
    • trigger.ts:37/41 run.status === 'completed' && → true: an in-progress run has conclusion: null, so the conclusion test already rejects it. :238 current === undefined ||: a named run never equals undefined. :252 count++ → count--: the count is only compared with 0, and every path that yields 0 yields it either way. :217 'reviewers' → '': the pull-request owner check treats any non-'approvers' role as reviewers-or-approvers, and the type forbids the value.
    • handlePullReq.ts:34 /\\s+/ → /\\s/ (empty entries are filtered), :38 runConfig.length === 0 early return (Promise.all([]) is a no-op), { required: false } → {} (the default).
    • command.ts:116/123 inIndentedCode writes: the flag is only read together with afterBlockBoundary, which is true on every path where it matters.
    • comments.ts:77 /\\[bot\\]$/ → unanchored: a login cannot contain [bot] elsewhere.
    • onPrLgtm.ts:23 [] initialiser: overwritten or thrown over before it is read.
    • main.ts:5 setPlatform(actionsPlatform()): main.ts has no unit test by design (bundle harness runs it; see [quality] src/main.ts entry point has no unit test (0% statements) #211).
  • Gate check: src/issueComment/approve.ts is in neither the local nor the scheduled mutation set, so the nightly mutation job cannot catch a regression here; mutation gate scope is already tracked on [quality] docs/contributing.md phantom-branch section still lists close.ts:37 and reopen.ts:34 (and 1815/1819), which #642 removed #679, so this issue asks only for the test.

Recommendation

In __tests__/issueCommentTest/approve.test.ts, extend the two toMatchObject({ event: 'APPROVE' }) assertions on the POST /pulls/1/reviews body to { event: 'APPROVE', comments: [] }, so a review that would carry inline comments fails the suite.

  • both legacy-path APPROVE review assertions pin comments: []

Priority

  • Impact: low (a regression here would surface as a 422 in production, not as a wrong merge decision)
  • Effort: low

Filed by quality agent (hold-gated mode)


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 8ff4554

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancekind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.stage/040-covered-by-prAn open PR covers this issuetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions