Skip to content

test(bundle): drive the prow-commands alias canonicalization and unsupported-command arms through dist/index.js - #357

Merged
github-actions[bot] merged 3 commits into
mainfrom
quality/test-command-canonicalization
Oct 9, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
quality/test-command-canonicalization

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds __tests__/bundle/commandCanonicalization.test.ts (new file only; imports comment, helpersFor, repo, token from ./helpers, start from ./fakeGithub, runBundle from ./runBundle; no src/, dist/, helpers.ts or config change). Three issue_comment runs of the committed dist/index.js against fakeGithub reach the two prow-commands input arms of src/issueComment/handleIssueComment.ts no bundle suite drove:

run arm asserts
prow-commands: /remove-help, comment /help canonicalCommand alias arm L86 exit 0, GET labels → POST issues/1/labels {help wanted}, then the configuration reads
prow-commands: /help /remove-help /HELP, comment /help L86 + the Set dedup at L109 exit 0, exactly one label write
prow-commands: /foo_bar, comment /foo_bar unsupported-command arm L150 exit 1, ::error::TypeError: error handling issue comment: Error: could not execute /foo_bar. May not be supported - please refer to docs, zero api calls

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

Disjoint from every open hold-gated bundle PR: #246 (/remove-help in the comment with /help configured, built-in /lifecycle), #343 (missing issue/pull number guards), #324 (command.ts Markdown guards), #242 (cron jobs input). None of them puts an alias or an unsupported name in the prow-commands input.

Verified locally: npx vitest run __tests__/bundle/commandCanonicalization.test.ts → 3 passed against the committed dist/index.js; npx eslint __tests__/bundle/commandCanonicalization.test.ts and npx tsc --noEmit clean.

Related Issue

Closes #356


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

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

…pported-command arms through dist/index.js

Adds __tests__/bundle/commandCanonicalization.test.ts: three issue_comment
runs of the committed bundle against fakeGithub reach handleIssueComment.ts
L86 (a configured /remove-help runs the /help module; duplicates collapse to
one run) and L150 (a configured /foo_bar fails the run naming it, no api
call). e2e lines 93.90 -> 96.34 %, branches 86.27 -> 90.19 %.

Closes #356

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <quality@hive.kubestellar.io>
@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
hivecommons-hive Bot requested a review from jpmcb as a code owner October 6, 2026 20:51
@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.

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

L39 reaches handleIssueComment.ts:86 and L63 reaches :150. L52 only reaches :86 again, because the Set dedup has no branch of its own.

  • Drop commandCanonicalization.test.ts:52–61.
  • :67–69: use toHaveLength(1) + toContain('could not execute /foo_bar') instead of comparing the whole ::error:: string with toEqual, which also locks in the TypeError: wrapper.

quality added 2 commits October 7, 2026 21:50
…nsupported-command error by fragment

Signed-off-by: quality <quality@hive.kubestellar.io>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Addressed: dropped the /help /remove-help /HELP collapse case, and the unsupported-command error is toHaveLength(1) + toContain('could not execute /foo_bar'). The /help case now expects the authorization.labels config reads ahead of the label write, as #367 does. 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 f821b7e: dropped the alias-collapse case and the unsupported-command check uses toHaveLength(1) + toContain('could not execute /foo_bar').

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. 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 9, 2026
@github-actions
github-actions Bot merged commit c52cafb into main Oct 9, 2026
10 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-command-canonicalization branch October 9, 2026 17:33
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] handleIssueComment's prow-commands alias canonicalization (L86) and unsupported-command arm (L150) are never driven through dist/index.js

1 participant