Skip to content

test(bundle): drive canonicalCommand's dynamic remove-form arm (handleIssueComment.ts:91) through dist/index.js - #470

Merged
mrbobbytables merged 1 commit into
mainfrom
quality/test-dynamic-remove-canonicalization
Oct 15, 2026
Merged

mrbobbytables merged 1 commit into
mainfrom
quality/test-dynamic-remove-canonicalization

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Test Improvement

Adds a third case to __tests__/bundle/commandCanonicalization.test.ts driving canonicalCommand's dynamic arm in handleIssueComment.ts:91 through the compiled dist/index.js: a /remove-<key> listed in prow-commands whose base is no built-in command names the <key> label section, so it enables the whole /<key> family (docs/commands.md: "Listing an alias in prow-commands enables the whole command family").

  • prow-commands: /remove-triage with labels: { triage: { values: [accepted] } } in prow.yaml; /triage accepted → one POST /issues/1/labels with triage/accepted

Previously only the /remove-help alias-table path was exercised through the bundle. The removal form's missing-section error is covered by prefixedRemoveArms.test.ts.

Test-only change; no src/ or dist/ edits.

Related Issue

Refs #466

@hivecommons-hive
hivecommons-hive Bot requested a review from jpmcb as a code owner October 13, 2026 15:14
@hivecommons-hive hivecommons-hive Bot added the hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 13, 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

Copy link
Copy Markdown
Contributor

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

@mrbobbytables

Copy link
Copy Markdown
Member

Review: looks good; one minor nit.

  • The fourth test asserts the full error string, including the Error: prefix and the yaml malformed wording, which breaks if the message is reworded. Consider matching only expected 'nosuch' top level key.

jeefy
jeefy previously requested changes Oct 14, 2026

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

All four cases reach only the two arms at handleIssueComment.ts:91.

  • Keep dynamicRemoveCanonicalization.test.ts:43–56; drop :58–69, :71–82 and :84–94, and the issueRead/labelDelete consts at :17–18 they use. :71 is the "duplicates collapse" case #357 already dropped, and the missing-section error at :84 is covered by prefixedRemoveArms.test.ts:34.
  • Minor: at :45, use repoLabels('triage/accepted') from ./helpers. The kept case would also fit as a third case in commandCanonicalization.test.ts, which has the same scaffold.

…ugh dist/index.js

Adds a third case to __tests__/bundle/commandCanonicalization.test.ts
listing a dynamic label section's remove form (/remove-triage) in
prow-commands, so handleIssueComment.ts:91's base-canonicalization arm is
reached end-to-end. Previously only the /remove-help alias-table path was
exercised through the bundle.

Refs #466

Co-authored-by: quality <quality@hive.kubestellar.io>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Bob Killen <bkillen@linuxfoundation.org>
@mrbobbytables
mrbobbytables force-pushed the quality/test-dynamic-remove-canonicalization branch from eb3625e to 0e1ce94 Compare October 14, 2026 00:57
@mrbobbytables

Copy link
Copy Markdown
Member

Addressed review: kept only the /remove-triage → /triage accepted case, now a third case in commandCanonicalization.test.ts (same scaffold, uses repoLabels('triage/accepted')); dropped the removal-form, duplicates-collapse and missing-section cases and the new file. Rebased on main.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

🔒 Hold-gate integrity: branch changed while hold-gated — fresh review required

This PR's branch moved while it sat hold-gated: the head recorded when the hold was applied was eb3625e92400, but the branch now sits at 0e1ce944cbed. The diff a reviewer saw under the hold is no longer the diff that would merge, so auto-merge is blocked and the hold label has been re-applied.

Commits not present in the hold-time snapshot (1):

  • 0e1ce944cbed by mrbobbytables — test(bundle): drive canonicalCommand's dynamic /remove- arm through dist/index.js

Authors not in the hold-time author set: mrbobbytables

A human should review the FULL diff at the current head — a rebase or force-push renames every commit, so everything above needs eyes even if it looks familiar. Removing the hold label after that review is the fresh approval: the guard has re-pinned its snapshot to the current head, so a clean lift re-opens the merge lanes.

@mrbobbytables
mrbobbytables dismissed jeefy’s stale review October 15, 2026 14:48

Dismissing stale review: the PR was revised after this review (commit post-dates it) and now implements the requested restructuring (single case, folded into the existing test file, fixture adjusted). Stack of #467–#482 verified locally: 78 bundle files / 481 tests pass, eslint clean.

@mrbobbytables
mrbobbytables merged commit 77096f3 into main Oct 15, 2026
13 checks passed
@mrbobbytables
mrbobbytables deleted the quality/test-dynamic-remove-canonicalization branch October 15, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants