Skip to content

🐛 fix(cli): reject unknown flags on the ui subcommand - #318

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-317
Oct 22, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-317

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #317

Summary

The ui subcommand silently accepted any --flag without validation. Only --port was read; everything else was dropped on the floor. A typo'd port flag (e.g., --prot=3700) would start the server on the default port with no error.

Changes

  • New helper in flags.ts: Added assertOnlyFlags(flags, allowed, command) that validates flag keys against an allowlist and throws a UsageError with clear messaging.
  • Updated ui handler: The ui command now calls assertOnlyFlags(flags, ['port'], 'ui') before dispatching to startUI.
  • Tests added:
    • Unit tests in flags.test.ts for the new assertOnlyFlags helper
    • CLI test in cli.test.ts looping over unknown flags (--prot, --json, --cross, --status, --no-interactive) to verify they are rejected with the expected error message
  • Changelog: Added changelog.d/fixed-ui-unknown-flags.md
  • dist/ rebuilt: TypeScript compiled and committed as required by CI

Error Message

Unknown flag --prot: ui only accepts --port=<value>

Follows the house style established in #314 for unknown-flag rejection.

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

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 22, 2026
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 22, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: bed67f3

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

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Oct 22, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Overlap note: #319 (by @mendezr) also fixes #317 and touches the same files (src/cli.ts, src/cli.test.ts, dist/cli*.js*). Whichever lands first will leave the other conflicting; the second one should be rebased or closed as superseded rather than both merging.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

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

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no findings from this perspective.

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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Hive filed review findings that do not block this PR as backlog items:

Cap: 10 backlog item(s) per PR per day.

@hivecommons-hive
hivecommons-hive Bot merged commit f3e4829 into main Oct 22, 2026
14 of 15 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-317 branch October 22, 2026 11:53
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
Evidence bundle `#318bed67f3` sha256:9b531f9f110652cfd39fe5057d3aa4707220f00c65bf07f191e6a0ffe74b1cfa — download from the dashboard or `hivectl review evidence #318`.

@github-actions

Copy link
Copy Markdown

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed the stage/050-review-pending Review swarm requested; awaiting a verdict for the current head label Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] cli: ui silently accepts unknown flags (--prot=3700 starts on the default port)

0 participants