Skip to content

test(bundle): drive the configured hold and sweep sections through dist/index.js - #293

Merged
github-actions[bot] merged 3 commits into
mainfrom
quality/test-bundle-hold-sweep-settings
Oct 9, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
quality/test-bundle-hold-sweep-settings

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Files: __tests__/bundle/holdSweepSettings.test.ts only (new; no src/, no helpers.ts, no existing suite touched). Disjoint from the open bundle PRs: #289 (tide.missing_labels/labelMatch), #291 (blunderbuss), #283 (OWNERS authorization), #286 (approve.github_review), #246 (labels/fixed.ts), #244 (/meow).

Routes a .github/prow.yaml and runs the committed dist/index.js against it — the first bundle tests to parse the hold and sweep sections, and the first to drive a malformed-config refusal end-to-end:

hold.label

  • /hold posts { labels: ['needs-hold'] } instead of do-not-merge/hold
  • /hold cancel deletes the configured label (case-insensitively) and the legacy hold, and leaves do-not-merge/hold in place
  • refusals: hold: [], label: "", label: 7 — each fails before any label read or write

sweep.lookback

  • 30m: the logged since lies between started − 30m and finished − 30m (the child's clock ticks somewhere inside the run); the empty window makes only the page read (sweep.ts:64)
  • 48h is capped at 24h
  • refusals: sweep: 5, lookback: 30 (not a string), lookback: soon (reaches duration.ts:26), lookback: 0m

Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.3):

  • npx vitest run __tests__/bundle/holdSweepSettings.test.ts → 11 passed, 3/3 runs, 0 unhandled errors
  • npm run test:coverage:e2e: 2460 → 2500 of 3182 statements (77.31 % → 78.57 %); newly reached config.ts 353, 365, 519–527, 592–612, duration.ts 26 (now 100 %), sweep.ts 64, handleIssueComment.ts 188
  • npx eslint __tests__/bundle/holdSweepSettings.test.ts and npx tsc --noEmit clean

Related Issue

Closes #292


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

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

…st/index.js

__tests__/bundle/holdSweepSettings.test.ts routes a .github/prow.yaml and runs
the committed bundle against it:

- hold.label: /hold applies the configured label; /hold cancel removes it and
  the legacy hold label and leaves do-not-merge/hold alone
- hold refusals: not a mapping, empty and non-string label
- sweep.lookback: the window the sweep job lists for, its 24h cap, and the
  empty-window return
- sweep refusals: not a mapping, non-string, unparsable and zero lookback

normalizeHold, normalizeSweep and duration.ts had no bundle hits before this;
npm run test:coverage:e2e goes from 2460 to 2500 of 3182 statements.

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 4, 2026 04:17
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 4, 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

The red build-test on run(s) 37176595985 (79b5afd) is the shared meow.test.ts → api.thecatapi.com passthrough failure tracked as incident #294 (root cause #284, fix held in #287) — all 81 files / 1648 tests passed and this PR does not touch that file. Deferring this PR until #287 lands; no further re-runs or pushes for this failure.


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

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

This was referenced Oct 4, 2026

@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.

Three of the eleven cases reach exactly what another case reaches.

  • Drop holdSweepSettings.test.ts:117–121. The 24h cap is a plain Math.min with no branch (config.ts:622), so it reaches the same lines as :108.
  • Drop either :60–73 or :75–89. Both only reach the code that accepts hold.label, and /hold and /unhold themselves are covered at bundle.test.ts:902/:921.
  • Drop one of the it.each rows at :93 and :94 (label: "" and label: 7). Both hit the throw at config.ts:524.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed all three: dropped the 24h-cap case, the /hold cancel case (kept the /hold one), and the label: 7 row (kept label: ""). 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 f2b7b1c: dropped the 24h-cap case, the /hold cancel configured-label case, and the label: 7 row (the label: "" row stays).

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.

Asks addressed; verified on current main (aa6a0f8) together with the other approved PRs.

@jeefy

jeefy commented Oct 9, 2026

Copy link
Copy Markdown
Member

/kind cleanup
/lgtm
/approve
/hold cancel

@github-actions github-actions Bot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 9, 2026
@github-actions github-actions Bot added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-kind labels Oct 9, 2026
@github-actions
github-actions Bot merged commit 0ff06b9 into main Oct 9, 2026
10 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-bundle-hold-sweep-settings branch October 9, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] the hold and sweep sections of prow.yaml are never parsed through dist/index.js

1 participant