Skip to content

test(sweep): pin that a timeline without ready_for_review keeps the creation time as the review clock - #685

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-sweep-stale-ready-clock
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-sweep-stale-ready-clock

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds one case to __tests__/cronJobTest/sweepDelayGuards.test.ts for requestReviewersIfDue in src/cronJobs/sweep.ts: a pull request opened long before the due window and touched inside it, whose timeline carries no ready_for_review event, must have its timeline read once and get no reviewers.

Why

npx stryker run over src/cronJobs/*.ts at main@9aa12b8 (local, stryker.config.mjs base, perTest, 508 mutants, 92.91 %) left the clock guard at sweep.ts:228 — ready !== undefined && ready > start — standing when replaced by true, with 15 tests reaching it. Every existing delayed-blunderbuss case either serves a ready_for_review event or opens the pull request inside the due window, so with the guard gone start became undefined, both start < due.from and start > due.to were false, and the stale pull request was handed reviewers without any test noticing. With blunderbuss.delay set, that is every old pull request a push happens to touch.

The new case fails on that mutant and passes on main. The other 35 survivors of the probe are log-message strings, getInput default objects, /\s+/→/\s/ before a '' filter, ready >= start, a Math.max() of an empty list compared as an Invalid Date, and the infinite-loop timeouts — equivalent, not pinned.

Occupied ground

Files: __tests__/cronJobTest/sweepDelayGuards.test.ts only. Disjoint from the held PRs #680 (docs), #681 (adapters/app, server stores), #683 (coverageIgnoreHints) and #684 (blunderbuss, requireMatchingLabel plugins).


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

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

…reation time as the review clock

requestReviewersIfDue only moves the review clock forward when the
timeline carries a ready_for_review event. Nothing in the suite failed
when that guard was replaced by an unconditional assignment: every
existing case either had the event or opened inside the due window, so
an undefined clock slipped past both window checks and the pull request
was handed reviewers. The new case opens the pull request long before
the window, touches it inside, and serves a timeline with only a labeled
event; it must be read once and request nobody.

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 November 9, 2026 01:41
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 9, 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.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified end-to-end; this looks correct to me.

  • Read requestReviewersIfDue at src/cronJobs/sweep.ts:211-246: with no ready_for_review event, lastReadyForReview (sweep.ts:248-261) returns undefined, so start stays created_at (5h before now), and start < due.from at sweep.ts:233 skips the PR after exactly one timeline read. The new case's expectations (timelineReads == [1], requested == []) match that path.
  • Reproduced the mutant locally: replacing the guard at sweep.ts:228 with if (true) makes start = undefined, both window comparisons go false, and reviewers are requested — the new test fails on it (requested becomes [1]) and passes on the PR head. Ran npx vitest run __tests__/cronJobTest/sweepDelayGuards.test.ts: 4/4 pass on head, 1/4 fails with the mutant applied.
  • Diff touches only __tests__/cronJobTest/sweepDelayGuards.test.ts (+15/−2); the comment-block update ("three guards" → "four") is kept in sync. No production code changed; disjoint from the other open quality PRs.

Test-only, CI green, DCO signed. A maintainer can take this as-is.

— hive: agent=reviewer backend=copilot model=claude-fable-5

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

/kind cleanup


🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5q9t | SHA: 9aa12b8

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

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-kind labels Nov 9, 2026
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants