Skip to content

fix: dedupe migrated root commands#1315

Merged
burmudar merged 3 commits intomainfrom
wb/dedupe-migrated-commands
May 6, 2026
Merged

fix: dedupe migrated root commands#1315
burmudar merged 3 commits intomainfrom
wb/dedupe-migrated-commands

Conversation

@burmudar
Copy link
Copy Markdown
Contributor

@burmudar burmudar commented May 6, 2026

This changes migratedRootCommand to collect commands by their canonical cli.Command.Name before sorting them for the root command. Alias dispatch entries remain supported in migratedCommands, while the generated root command only includes each command once.

Test Plan

  • go test ./cmd/src

@burmudar burmudar self-assigned this May 6, 2026
@burmudar burmudar requested a review from a team May 6, 2026 08:42
@burmudar burmudar changed the title chore/cli: dedupe migrated root commands fix: dedupe migrated root commands May 6, 2026
commands = append(commands, migratedCommands[name])
uniqueCommands := make(map[string]*cli.Command, len(migratedCommands))
for _, cmd := range migratedCommands {
uniqueCommands[cmd.Name] = cmd
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.

do we have commands with duplicated names? IE do we need to add a unique step?

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.

yeah in the subsequent migration of codeowners and orgs we register the command twice in the set to support their current aliases.

@burmudar burmudar enabled auto-merge (squash) May 6, 2026 08:57
@burmudar burmudar merged commit 618d038 into main May 6, 2026
9 checks passed
@burmudar burmudar deleted the wb/dedupe-migrated-commands branch May 6, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants