Repository navigation
test(tide): pin the merge_queue:off no-GraphQL rule, the draft-without-field refusal, and the fork-403 path boundaries - #518
Open
hivecommons-hive[bot] wants to merge 1 commit into
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>
2 tasks
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 was referenced Oct 19, 2026
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 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