Repository navigation
test(tide): pin the merge_queue:off no-GraphQL rule, the draft-without-field refusal, and the fork-403 path boundaries - #518
Conversation
…t-field refusal, and the fork-403 workflow-file boundaries tide.ts sits at 100 % lines and branches, so a 50-mutant single-site probe is what shows which decisions the suite actually pins. Eight mutants passed the full `vitest related src/plugins/tide.ts` set; six are real and each gets one case here, named for the behaviour it pins: - tideMergeQueue.test.ts: the two `merge_queue: off` tests assumed an unhandled /graphql request would fail them, but queueState swallows a failed read with one warning and falls back to a direct merge, so always-querying survived. They now serve /graphql with the call counter and assert zero calls (and no warning). A pull without a `draft` field whose mergeable_state is `draft` is refused rather than enqueued: the only path to queueRefusedStates' `draft` entry, since blockedReason catches `draft: true` first. - tide.test.ts: a draft with an `unknown` state is refused on the first read with no retry sleep (blockedReason's draft check, not the later state check). In the fork-403 diagnosis, exactly five workflow files are listed in full with no "and 0 more", and a nested `docs/.github/workflows/...` path is not a workflow file (startsWith, not includes). getPull reads a head whose repository is gone (`head.repo: null`) as not a fork. The two remaining survivors (`state === 'open'` vs `!== 'closed'` in getPull and tideOnComment) only differ for a state GitHub never emits and are left alone. Closes #517 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 |
|
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 cases separately observe no GraphQL when the queue is off, draft refusal without retries, top-level-only workflow diagnosis, the exact five-file boundary, and deleted-head-repository handling.
Verified successful build-test, e2e-coverage and DCO results on head a3e6037. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.
Test Improvement
Pins six behaviours of
src/plugins/tide.tsthat a 50-mutant single-site probe showed no test asserts (each mutant passed the fullnpx vitest related src/plugins/tide.ts --runset, 60 files / 1166 tests, on a clean main@88241f4). Test-only;src/anddist/are untouched.__tests__/plugins/tideMergeQueue.test.tsmerge_queue: offtests assumed an unhandled/graphqlrequest would fail them. It does not:queueStateswallows the failed read with onecore.warningand falls back to a direct merge, so "always callqueueState" survived. They now serve/graphqlwith the call counter and assertcallsis empty (and, in the 405 case, that no warning fired).queueRefusedStates''draft'entry, sinceblockedReasoncatchesdraft: truefirst andgetPulldefaults a missing field tofalse.__tests__/plugins/tide.test.tssleep; pinsblockedReason's draft check as distinct from the latermergeable_statecheck.fileList's> 5), and only paths under the top-level.github/workflows/count —docs/.github/workflows/…andtemplates/.github/workflows/…(which this repository ships) are not workflow files (startsWith, notincludes).getPull: a head whose repository is gone (head.repo: null) is not a fork.After this change all six mutants are killed (re-run of the same probe against the direct tide test files). The two remaining survivors —
state === 'open'→!== 'closed'ingetPullandtideOnComment— only differ for a state GitHub never emits and are deliberately not tested.Verification:
npx vitest run __tests__/plugins/tide.test.ts __tests__/plugins/tideMergeQueue.test.ts— 141 passed;npx eslinton both files clean.Occupied ground:
__tests__/plugins/tide.test.ts(getPull,tryMergePullRequeststate cases, fork-403 describe) and__tests__/plugins/tideMergeQueue.test.ts(draft andmerge_queue: offcases). Disjoint from #510, #511, #512, #514, #516.Related Issue
Closes #517
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88