Skip to content

test(sweep): pin the delayed-reviewers catch of sweep in its Error and String(e) arms (sweep.ts:85) - #565

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-sweep-delay-failures
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-sweep-delay-failures

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/cronJobTest/sweepDelayFailures.test.ts (new file; no existing test is edited) for the catch of the delayed-reviewers loop in sweep (src/cronJobs/sweep.ts, line 85 at main@e3119ad): result.failures.push({ number, message: \blunderbuss: ${e instanceof Error ? e.message : String(e)}` })`.

Two due delayed-only pull requests (created_at/updated_at 70 min ago, blunderbuss.delay: 1h) on a base branch with an OWNERS file, where one of them fails:

case fault asserts
records a failed review read as that pull request's failure and still serves the other GET /pulls/1/reviews → 500 { message: 'reviews unavailable' } sweep rejects with sweep: 1 pull request(s) failed: #1 (blunderbuss: reviews unavailable); POST /pulls/2/requested_reviewers was still made and nothing was posted for #1
stringifies a non-Error rejection while requesting reviewers requestOwnersReviewers rejects once with the string 'secondary rate limit' (vi.mock('../../src/plugins/blunderbuss', { spy: true }), the technique of __tests__/utils/configSweep.test.ts) the failure reads blunderbuss: secondary rate limit; the other pull request was still requested; requestOwnersReviewers was called twice

The first case also pins that the loop continues past a failing pull request instead of aborting (forEachLimited + per-item try/catch).

Files/functions claimed: __tests__/cronJobTest/sweepDelayFailures.test.ts only; source under test is the delayed-only forEachLimited body of sweep. Disjoint from #553 (auth.ts), #555/#559 (__tests__/bundle/blunderbussDelay.test.ts), #556 (e2e floor), #557 (tide.test.ts), #558 (__tests__/cronJobTest/sweep.test.ts, which states line 85 is out of its scope), #561 (line 80, new sweepDelayWithoutOwners files), #562 (line 208, new sweepDelayBareListing files), #563 (config.ts), #564 (owners.ts).

Coverage evidence

Related Issue

Refs #560 — lands the folded sweep.ts:85 variant the hive attached to that tracker (comment <!-- hive-finding-folded --> of 2026-10-22); the tracker's original sweep.ts:80 finding is delivered by #561 and the folded :208 variant by #562, so #560 stays open until those merge.

Tests

  • npx vitest run __tests__/cronJobTest/sweepDelayFailures.test.ts — 2 passed, no ::warning:: output
  • npx eslint __tests__/cronJobTest/sweepDelayFailures.test.ts — clean
  • npm run test:coverage — 2332 passed, 75 skipped; thresholds met

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

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

…d String(e) arms (sweep.ts:85)

Adds __tests__/cronJobTest/sweepDelayFailures.test.ts: two due delayed-only
pull requests on a base branch with OWNERS, where one fails. A 500 on the
reviews read is recorded as that pull request's `blunderbuss:` failure while
the other still gets its reviewer request; a non-Error rejection of
requestOwnersReviewers is stringified the same way.

Before: coverage/lcov.info BRDA:85,5,0,0 / BRDA:85,5,1,0 (neither arm hit by
the unit suite). After: both 1; sweep.ts branches 92.3 -> 94.87 %.

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

Copy link
Copy Markdown
Contributor Author

/kind cleanup


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

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

@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 Oct 23, 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