Skip to content

test(sweep): pin the delayed-reviewers OWNERS guard on a base branch without OWNERS files (sweep.ts:80) - #561

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

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

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Description

Pins the false arm of the branchHasOwners guard that precedes requestReviewersIfDue in the delayed-reviewers loop of src/cronJobs/sweep.ts (line 80): a pull request that is due for delayed blunderbuss but whose base branch carries no OWNERS files must be left alone — no timeline read, no review read, no requested_reviewers write.

Files/functions claimed (both new, so #558 __tests__/cronJobTest/sweep.test.ts, #559 / #555 __tests__/bundle/blunderbussDelay.test.ts, #553 auth.ts, #556 e2e floor and #557 tide.test.ts are untouched):

file case asserts
__tests__/cronJobTest/sweepDelayWithoutOwners.test.ts blunderbuss.delay: 1h, empty master tree, one PR created/updated 70 min ago sweep resolves { candidates: [], merged: [], enqueued: [], failures: [] }; git/trees/master read; timeline, reviews and requested_reviewers handlers never called
__tests__/bundle/blunderbussDelayWithoutOwners.test.ts the same scenario through dist/index.js on the schedule event exit 0, no ::error::, sweep: 0 candidates updated since, sweep: 1 more checked for delayed reviewers, exactly one git/trees/master?recursive=true read, zero timeline/review reads, zero non-GET requests, and the only non-config requests are the pull list and the tree read

Source under test is unchanged.

Fixes #560

Mutation check

if (await branchHasOwners(...)) → if (await branchHasOwners(...) || true) in src/cronJobs/sweep.ts:

  • unit case fails: sweep: 1 pull request(s) failed: #1 (blunderbuss: [MSW] Cannot bypass a request …) — the mutant reaches an endpoint the test deliberately does not serve
  • bundle case (after npm run pack:coverage, run with PROW_BUNDLE_PATH=.coverage-bundle/index.js) fails: ::error::… sweep: 1 pull request(s) failed: #1 (blunderbuss: could not read the timeline: HttpError: Not Found (fake))

Before this PR the same mutant is accepted by all 46 cases of sweep.test.ts and by the whole bundle suite.

Coverage evidence

Testing

  • npx vitest run __tests__/cronJobTest/sweepDelayWithoutOwners.test.ts — 1 passed
  • npx vitest run __tests__/bundle/blunderbussDelayWithoutOwners.test.ts — 1 passed (against committed dist/index.js)
  • npm run pack:coverage && PROW_BUNDLE_PATH=.coverage-bundle/index.js npx vitest run __tests__/bundle/blunderbussDelayWithoutOwners.test.ts — 1 passed
  • npx eslint on both files — clean

Checklist

  • Commits are signed off (DCO)
  • No new dependencies
  • No dist/ change (tests only)
  • Self-reviewed

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

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

…without OWNERS files

Both suites left the false arm of the branchHasOwners guard ahead of
requestReviewersIfDue in src/cronJobs/sweep.ts with zero hits: every
delayed-blunderbuss case served an OWNERS file on master. Add one unit case
and one dist/index.js scenario, each in its own file, that configure
blunderbuss.delay, serve an empty master tree and a due pull request, and
assert the tree is probed once while the timeline, reviews and
requested_reviewers endpoints are never touched. Both fail when the guard is
replaced by `|| true`.

Fixes #560

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 01:32
@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: unknown

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

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.

[quality] sweep.ts delayed-reviewers OWNERS guard (line 80 false arm) is covered by neither the unit nor the bundle suite

0 participants