Skip to content

test(bundle): drive require-matching-label's no-rule, already-correct, grace-period and comment-failure arms through dist/index.js - #316

Merged
github-actions[bot] merged 1 commit into
mainfrom
quality/test-bundle-require-matching-label-arms
Oct 7, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
quality/test-bundle-require-matching-label-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/requireMatchingLabelArms.test.ts (new file only; imports comment, configReads, helpersFor, repo, token from ./helpers, start from ./fakeGithub, runBundle from ./runBundle). Eight runs of the committed dist/index.js against fakeGithub reach the arms of src/plugins/requireMatchingLabel.ts that bundle.test.ts's issues require-matching-label block does not:

case arm asserted
labeled area/sdk, rule ^kind/ applicableRules → none (L62 false, L149–150) config reads only
opened on an issue, rule prs: true rule-kind filter (L57, L149–150) config reads only
labeled kind/bug, no needs-kind evaluate → none (L83, L208) GET issues/1 only, no writes
opened, grace_period_duration: 500ms sleep before the labels read (L155–156) ≥450 ms elapsed, then issue read → labels read → POST labels {needs-kind}
opened, bot marker comment already present postMissingComment early return (L220–221) label added, comments listed, no POST comments
opened, GET issues/1/comments → 500 could not list comments → per-rule aggregation → throw (L245, L167, L172) exit 1, ::error::error handling issues event: require-matching-label needs-kind: could not list comments: HttpError: Server Error
labeled kind/bug + needs-kind, DELETE issues/comments/11 → 500 could not delete comment 11 → aggregation → throw (L233, L167, L172) exit 1, matching ::error::, needs-kind already removed
issue_comment /check-required-labels, issue.state: closed checkRequiredLabels early return (L115–116) zero requests

Measured with npm run test:coverage:e2e on main @ 3fc21f2: src/plugins/requireMatchingLabel.ts e2e lines 81.6 % (71/87) → 98.85 % (86/87), branches 77.04 % → 96.72 %; repository e2e total 77.9 % → 78.53 %. The one remaining line, 184 (subject() throwing on a payload with neither issue nor pull_request), is unreachable through run.ts's issues/issue_comment dispatch and stays unit-only.

Verification: npx vitest run __tests__/bundle/requireMatchingLabelArms.test.ts → 8 pass against the committed dist/index.js; npx eslint __tests__/bundle/requireMatchingLabelArms.test.ts clean; npx tsc --noEmit clean.

Disjoint from every open hold-gated PR: none of #230–#314 touches requireMatchingLabel/require_matching_label (checked each diff); the nearest, #289, is tide's missing_labels gate and labelMatch wildcards in mergeGateLabels.test.ts.

Related Issue

Closes #315


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

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

…, grace-period and comment-failure arms through dist/index.js

Adds __tests__/bundle/requireMatchingLabelArms.test.ts: eight issues /
issue_comment runs of the committed bundle against fakeGithub that reach the
arms of src/plugins/requireMatchingLabel.ts no bundle test drove: a rule for
the other object kind, a labeled label no rule concerns, the already-correct
verdict, grace_period_duration, an already-posted missing_comment,
/check-required-labels on a closed issue, and the listComments and
deleteComment failures that fail the run.

e2e lines on src/plugins/requireMatchingLabel.ts: 81.6% -> 98.85%.

Closes #315

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 5, 2026 01:09
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 5, 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 is red here for the shared baseline flake tracked in #294, not for this diff: both runs on 4d52012 (37250277147, 37250241099) pass all 81 test files / 1647 tests and exit 1 on the single unhandled ERR_TLS_CERT_ALTNAME_INVALID error originating in __tests__/issueCommentTest/meow.test.ts, which this PR does not touch (it adds only __tests__/bundle/requireMatchingLabelArms.test.ts).

Deferring until #287 (the fix) merges; no retries or pushes for this failure.


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

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

@jeefy

jeefy commented Oct 7, 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. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 7, 2026
@jeefy

jeefy commented Oct 7, 2026

Copy link
Copy Markdown
Member

/lgtm

@github-actions
github-actions Bot merged commit 4983c88 into main Oct 7, 2026
10 of 12 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-bundle-require-matching-label-arms 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] require_matching_label's no-rule, already-correct, grace-period and comment-failure arms are never driven through dist/index.js

1 participant