Skip to content

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
mainfrom
quality/test-tide-mutation-survivors
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-tide-mutation-survivors

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Pins six behaviours of src/plugins/tide.ts that a 50-mutant single-site probe showed no test asserts (each mutant passed the full npx vitest related src/plugins/tide.ts --run set, 60 files / 1166 tests, on a clean main@88241f4). Test-only; src/ and dist/ are untouched.

__tests__/plugins/tideMergeQueue.test.ts

  • Both merge_queue: off tests assumed an unhandled /graphql request would fail them. It does not: queueState swallows the failed read with one core.warning and falls back to a direct merge, so "always call queueState" survived. They now serve /graphql with the call counter and assert calls is empty (and, in the 405 case, that no warning fired).
  • New: a pr without a draft field whose mergeable_state is draft is refused, not enqueued — the only path to queueRefusedStates' 'draft' entry, since blockedReason catches draft: true first and getPull defaults a missing field to false.

__tests__/plugins/tide.test.ts

  • New: does not wait for an unknown state on a draft pr — one GET, no sleep; pins blockedReason's draft check as distinct from the later mergeable_state check.
  • New in the fork-403 describe: exactly five workflow files are all listed, with no "and 0 more" (fileList's > 5), and only paths under the top-level .github/workflows/ count — docs/.github/workflows/… and templates/.github/workflows/… (which this repository ships) are not workflow files (startsWith, not includes).
  • New in 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' in getPull and tideOnComment — 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 eslint on both files clean.

Occupied ground: __tests__/plugins/tide.test.ts (getPull, tryMergePullRequest state cases, fork-403 describe) and __tests__/plugins/tideMergeQueue.test.ts (draft and merge_queue: off cases). 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

…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>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 19, 2026 06:42
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 19, 2026
@hivecommons-hive

Copy link
Copy Markdown
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 outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@github-actions

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind feature, /kind failing-test or /kind cleanup.

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

Labels

hold Indicates that a PR should not merge because someone has issued a /hold command. needs-kind

Projects

None yet

0 participants