Skip to content

test(tide): pin the lgtm gate re-check after an unknown-mergeability retry (evaluateMerge, tide.ts:198-206) - #557

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-tide-gate-change-mid-retry
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-tide-gate-change-mid-retry

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Test Improvement

Adds two tryMergePullRequest cases to __tests__/plugins/tide.test.ts for the mid-retry gate change that #554 ("Judge tests by behavior") asks for: mergeability is unknown on the first read and the lgtm label is gone on the re-read.

  • stops retrying an unknown state once the lgtm label disappears on the re-read — asserts exactly 2 pull reads, one sleep(1000), skipping pr #1: missing lgtm, no merge, and no "still unknown after 3 retries" log.
  • does not merge when the re-read turns clean but has lost the lgtm label — asserts the merge is not called and the skip reason is missing lgtm.

Why these two, and not more coverage

Neither adds line/branch coverage; both are justified by mutants, as #554 requires:

  • Removing the blockedReason(pr, tide) ?? re-check after fetchMergeability in evaluateMerge (src/plugins/tide.ts:203) survived all 982 existing unit tests and, after npm run build && npm run pack, all 528 bundle tests. With that mutant a pull request whose lgtm is removed while GitHub computes mergeability would merge. The second case fails on it.
  • Removing || !retryIf(pr) in fetchMergeability was already caught by the direct fetchMergeability unit case (tide.test.ts:134-140), but not through the caller; the first case pins it at the tryMergePullRequest level with read and sleep counts.

Files/functions claimed: __tests__/plugins/tide.test.ts (tryMergePullRequest describe block) only. Disjoint from #555 (fakeGithub/ownersGroups/blunderbussDelay), #553 (auth arms), #556 (coverage config).

Related Issue

Fixes #554 — this ships the "focused integration scenario where mergeability is initially unknown and LGTM disappears on the next read" checkbox under P2: Judge tests by behavior. The tracker stays open: its other sections (CI enforcement, release delivery, harness/mutation runner, remaining cross-request contracts) are not touched here and the issue states a single test PR must not close it.

Verification

  • npx vitest run __tests__/plugins/tide.test.ts — 107 passed
  • npx eslint __tests__/plugins/tide.test.ts — clean

Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-fable-5.1 requested_by=@mrbobbytables

tryMergePullRequest re-reads a pull request whose mergeability is still
unknown. Two cases were missing at the caller level: the lgtm label
disappearing on the re-read must end the wait at that read (no 2 s and 4 s
retries), and a re-read that turns clean while losing lgtm must not merge.

Dropping the blockedReason(pr, tide) re-check after fetchMergeability in
evaluateMerge survived every existing unit test (982) and the rebuilt
bundle suite (528); the second case fails on that mutant.

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 21, 2026 19:09
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 21, 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

Development

Successfully merging this pull request may close these issues.

Follow-up: strengthen test contracts, CI enforcement, release delivery, and quality triage

0 participants