Skip to content

test(bundle): drive the sweep cron's empty-window, failed-listing and blunderbuss-freshness arms through dist/index.js - #345

Merged
mrbobbytables merged 5 commits into
mainfrom
quality/test-sweep-arms
Oct 9, 2026
Merged

mrbobbytables merged 5 commits into
mainfrom
quality/test-sweep-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/sweepArms.test.ts, which runs the schedule event with jobs: sweep through dist/index.js against the fake GitHub for the arms of src/cronJobs/sweep.ts no bundle test reached:

  • sweep with no open pull request updated within the window → sweep: 0 candidates updated since …, config reads + one listing page, nothing else
  • recentlyUpdatedPulls when pulls.list answers 500 → run fails with sweep: could not list the open pull requests: HttpError: boom
  • requestReviewersIfFresh on a repository with OWNERS files: opened before the window; draft / reviewers already requested; already reviewed (the per_page=1 read happens, no request follows); and the pass-through case where reviewers are requested

Files/functions claimed: __tests__/bundle/sweepArms.test.ts (new) only; src/cronJobs/sweep.ts lines 64, 150–160, 175. Line 75 (enqueued) is deliberately left to #322's merge-queue cluster. Disjoint from #293 (sweep.lookback settings) and #291 (blunderbuss via pull_request).

Evidence (main @ 3fc21f2): npm run test:coverage:e2e → sweep.ts 67/76 → 75/76 statements. npx eslint clean; npx vitest run __tests__/bundle/sweepArms.test.ts → 7 passed.

Related Issue

Closes #344


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

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

… blunderbuss-freshness arms through dist/index.js

__tests__/bundle/sweepArms.test.ts runs the schedule sweep job against the
fake GitHub for the arms of src/cronJobs/sweep.ts that no bundle test
reached: the zero-candidate return, the pulls.list failure, and
requestReviewersIfFresh's three early returns (opened before the window,
draft or already requested, already reviewed), plus the pass-through case.

npm run test:coverage:e2e on main @ 3fc21f2: sweep.ts 67/76 -> 75/76
statements; only the enqueued arm (line 75) remains.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 6, 2026 08:23
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 6, 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. Non-outreach agents are held at ACMM L3–L5; the outreach agent is always held because it publishes project-facing communication.

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

build-test on this PR (37435768843, 37435730525, head 4ce67a0) is red for the shared cause tracked in #294, not for anything in this diff: all 81 files / 1646 tests pass and the job exits 1 on the single vitest unhandled ERR_TLS_CERT_ALTNAME_INVALID originating in __tests__/issueCommentTest/meow.test.ts, which this PR does not touch (it only adds __tests__/bundle/sweepArms.test.ts). Deferring until #294 closes (durable fix: #287); no re-runs or pushes for this failure.


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

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

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Six of the seven cases add coverage.

  • Drop sweepArms.test.ts:157–169. Requesting reviewers when every check passes is already covered at bundle.test.ts:2001.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed: dropped the fresh-unreviewed-PR case whose reviewer request bundle.test.ts already covers. Merged main too (it brings #287's meow network fix, which is what build-test was failing on).


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

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in 00d2ad2: dropped the all-guards-pass reviewer-request case.

CI is green on the new head.


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

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

@jeefy jeefy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The all-guards-pass case is dropped. One it.each row still adds nothing. I missed this in the first review.

  • sweepArms.test.ts:130: drop the already has requested reviewers row. The a draft row at :129 already reaches sweep.ts:153's if and its return (154–155), and bundle.test.ts:2000 already evaluates both sides of that || on main. This is the same as the http:/credentials rows on #372.

…ready covers

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed in 1bec826: dropped the already has requested reviewers row; the draft case stands alone as a plain it (sweep.ts:153–155 reached, both sides of the || evaluated by bundle.test.ts:2000).


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

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

@mrbobbytables

Copy link
Copy Markdown
Member

/kind cleanup

@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 9, 2026
@mrbobbytables
mrbobbytables merged commit a4f81c6 into main Oct 9, 2026
5 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-sweep-arms branch October 9, 2026 17:59
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 cron's empty-window, failed-listing and blunderbuss-freshness arms have no end-to-end coverage

2 participants