Skip to content

test(bundle): drive the prefixed label commands' and /remove's failure arms through dist/index.js - #341

Merged
github-actions[bot] merged 1 commit into
mainfrom
quality/test-prefixed-remove-arms
Oct 7, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
quality/test-prefixed-remove-arms

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/prefixedRemoveArms.test.ts (new file only; imports comment, configReads, helpersFor, repo, token from ./helpers, start from ./fakeGithub, runBundle from ./runBundle; no src/, dist/, helpers.ts or config change). Six issue_comment runs of the committed dist/index.js against fakeGithub reach the arms of src/labels/prefixed.ts and src/labels/remove.ts no bundle suite drove:

run arm asserts
/kind cleanup, configuration has no kind section prefixed.ts allowlistFor L199 → L208 exit 1, could not get labels from yaml: Error: kind: yaml malformed, expected 'kind' top level key, only the configuration reads
/kind not-allowed prefixed.ts requestedLabels L228 exit 1, kind: command args missing from body, no labels read or written
/remove-kind cleanup, issue carries only area/bug prefixed.ts removePrefixedLabels L135-136 exit 0, GET /issues/1, no DELETE
/remove-kind cleanup, GET /issues/1 → 500 prefixed.ts currentIssueLabels L258 (via labeling.ts L174) exit 1, could not get labels from issue: Error: could not get issue, no DELETE
/remove foo by a collaborator, GET /issues/1 → 500 remove.ts L54 exit 1, same error; collaborator read, issue read, then the post-command configuration sweep
/remove foo by a collaborator, issue carries only bar remove.ts L63 exit 1, remove: command args missing from body, no DELETE

Evidence (main @ 3fc21f2, Node v26.10.0, vitest 5.0.1, @vitest/coverage-v8 5.0.1, npm run test:coverage:e2e):

  • src/labels/prefixed.ts e2e lines 90.79 % (69/76) → 98.68 % (75/76); the remaining L146 (requireIssueNumber) needs a payload without an issue number, which an issue_comment event never lacks.
  • src/labels/remove.ts e2e lines 83.33 % (20/24) → 91.67 % (22/24); remaining L25 (same missing-issue-number arm) and L37 are unreachable — checkCollaborator catches every error and returns false (src/utils/auth.ts:88-102), so its catch in remove.ts never fires.
  • Bundle suites overall: 77.90 % → 78.28 % lines (1855 → 1864 / 2381), 70.82 % → 71.01 % branches.
  • Unit: both files already 100/100/100/100; unit and e2e figures are reported separately ([quality] the bundle e2e suite's coverage of src/ is never captured — runBundle.ts drops NODE_V8_COVERAGE and dist/ has no source map #235).

Disjoint from the open hold-gated bundle PRs: #246 (/remove-help, built-in /lifecycle, no-configuration failure), #300 (removeFixedLabels, src/labels/fixed.ts), #337 (labelIssue L88), #324 (command.ts Markdown guards), #339 (parseProwConfig schema rejections). None drives the prefixed-command or /remove arms above.

Verified locally: npx vitest run __tests__/bundle/prefixedRemoveArms.test.ts → 6 passed; npx eslint __tests__/bundle/prefixedRemoveArms.test.ts clean.

Related Issue

Closes #340


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

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

…e arms through dist/index.js

Adds __tests__/bundle/prefixedRemoveArms.test.ts, running the committed bundle
against the fake GitHub for the arms of src/labels/prefixed.ts and
src/labels/remove.ts that no bundle suite reached: the missing-section and
missing-args refusals of /kind, the no-op and failed-labels-read arms of
/remove-kind, and the failed-labels-read and missing-args arms of /remove.

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 04:10
@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 9952fba is red for the shared cause tracked in #294, not this diff: all 81 files / 1645 tests pass and the job exits 1 on the single unhandled ERR_TLS_CERT_ALTNAME_INVALID originating in __tests__/issueCommentTest/meow.test.ts (run 37412467970). The twin push run on the same SHA (37412424161) is green. Deferring until #294 closes.


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

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

@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. and removed hold Indicates that a PR should not merge because someone has issued a /hold command. labels Oct 7, 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 7, 2026
@jeefy jeefy closed this Oct 7, 2026
@jeefy jeefy reopened this Oct 7, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Triage: build-test on 9952fba previously passed (run 37412424161); the current run (37686042257) is still in progress. The Codertocat is not included in the approvers role / not a org member lines are expected stderr from other bundle suites' failure arms, not assertion failures. Locally npx vitest run __tests__/bundle/prefixedRemoveArms.test.ts → 6 passed. No code change needed; leaving for the automerge sweep.

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


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

@jeefy

jeefy commented Oct 7, 2026

Copy link
Copy Markdown
Member

/lgtm

@github-actions
github-actions Bot merged commit 9db051d into main Oct 7, 2026
13 of 16 checks passed
jeefy added a commit that referenced this pull request Oct 8, 2026
…issing" (#376)

`/kind foo` where `foo` is not an allowed value, and the same for every
prefixed or dynamic label command and its `/remove-<key>` form, failed
with `kind: command args missing from body` although an argument was
given: requestedLabels threw that message whenever no allowed value was
left after filtering.

The message now says what happened, e.g.
`kind: no allowed value in "foo"; allowed: bug, feature` (`allowed: none`
for an empty section). A command with no argument at all keeps
`<key>: command args missing from body`.

Tests: the eleven unit cases under __tests__/label/ and the bundle case
in prefixedRemoveArms.test.ts (#341) that passed a disallowed value
asserted the old text; they now assert the new one. New cases: several
disallowed values, an empty section, and /lifecycle, /remove-lifecycle
and (bundle) /kind with no value keeping the missing-args message.
docs/labeling.md describes both messages.

Signed-off-by: Jeffrey Sica <me@jeefy.dev>
@mrbobbytables
mrbobbytables deleted the quality/test-prefixed-remove-arms branch October 9, 2026 17:35
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] prefixed label commands' and /remove's failure arms are never driven through dist/index.js

1 participant