Skip to content

test(require-matching-label): pin the withGracePeriod default, the graceMs > 0 guard, isBot's || and the no-rule debug text - #520

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-require-matching-label-survivors
Oct 21, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-require-matching-label-survivors

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Files: __tests__/plugins/requireMatchingLabel.test.ts only. No src/, dist/, docs/ or config change — disjoint from #510 (src/utils/auth.ts, dist/index.js), #511 (docs/contributing.md), #512 (__tests__/label/remove.test.ts, eslint.config.mjs), #514 (__tests__/utils/{command,labelMatch}.test.ts), #516 (__tests__/cronJobTest/sweep.test.ts) and #518 (__tests__/plugins/tide*.test.ts).

A single-operator mutation probe over src/plugins/requireMatchingLabel.ts on main @ 88241f4 (57 mutants; details on #519) left four alive against npx vitest related src/plugins/requireMatchingLabel.ts --run (40 files / 752 tests). This adds one case per survivor:

  • enforceRequiredLabels without options (new describe): the sweep's call shape — a 5s rule, no withGracePeriod → sleep not called, needs-kind added. Pins the = false default at :139.
  • opened under a grace-less rule: sleep not called at all (not sleep(0)), needs-kind added. Pins graceMs > 0 at :154.
  • another app's bot marker comment (type: 'Bot', login other-app[bot]) next to a human copy of the marker: exactly comment 13 is deleted. Pins isBot's || at :252.
  • the existing unrelated-label case now asserts the debug line … no rule applies to issue #1 for label priority/high. Pins :149.

Verification (this branch, local)

  • npx vitest run __tests__/plugins/requireMatchingLabel.test.ts: 53 passed
  • same file with each mutant applied in turn (:139, :154, :252, :149): 1 failed | 52 passed each time (mutants reverted, not committed)
  • npx eslint __tests__/plugins/requireMatchingLabel.test.ts: clean

Related Issue

Closes #519


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

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

…aceMs > 0 guard, isBot's || and the no-rule debug text

A single-operator mutation probe over src/plugins/requireMatchingLabel.ts
left four mutants alive against the full vitest related set:

- :139 withGracePeriod default false -> true: the sweep's option-less
  call would start sleeping the grace period on every swept PR
- :154 graceMs > 0 -> >= 0: a grace-less rule would call sleep(0)
- :252 isBot || -> &&: another app's Bot marker comment would stop
  being deleted
- :149 the 'for label X' debug suffix inverted

Each new case fails exactly one of the four mutants. No src/ change.

Closes #519

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

@github-actions

Copy link
Copy Markdown
Contributor

Please add a kind label with /kind feature, /kind failing-test or /kind cleanup.

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

Copilot review performed under the maintainer's explicit authorization to update, review, release reviewed holds, and merge eligible PRs in this cleanup.

The cases observe default/zero grace periods without sleep, app-bot cleanup without deleting the human marker copy, and the no-applicable-rule diagnostic.

Verified successful build-test, e2e-coverage and DCO results on head fce1df6. Any folded issue findings remain assigned to the canonical destinations in the updated scope tables.

@mrbobbytables mrbobbytables 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. needs-kind labels Oct 21, 2026
@mrbobbytables
mrbobbytables merged commit d280769 into main Oct 21, 2026
18 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-require-matching-label-survivors branch October 26, 2026 20:19
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.

Projects

None yet

1 participant