Skip to content

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

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-prefixed-remove-arms
Open

hivecommons-hive[bot] wants to merge 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.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

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

@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

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. needs-kind

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

0 participants