Skip to content

fix: show apps hint command in stripe --help#1601

Open
yahanxing-stripe wants to merge 2 commits into
masterfrom
fix-apps-hint-visibility
Open

fix: show apps hint command in stripe --help#1601
yahanxing-stripe wants to merge 2 commits into
masterfrom
fix-apps-hint-visibility

Conversation

@yahanxing-stripe
Copy link
Copy Markdown
Contributor

@yahanxing-stripe yahanxing-stripe commented May 21, 2026

Summary

This PR fixes the issue that stripe apps was not appearing under "Other commands" in stripe --help.

Root cause:

When the CLI starts up, resources_gen.go auto-generates an apps resource command and sets rootCmd.Annotations["apps"] = "namespace".
RemoveAppsCmd then deletes the cobra command to cede the namespace to the apps plugin, but never cleaned up the annotation.

The help template's "Other commands" section filters out any command with an entry in rootCmd.Annotations:

  {{if (not (or (index $.Annotations $cmd.Name) $cmd.Hidden))}}

So the hint command added by AddHintCommands was registered and runnable (stripe apps worked) but invisible in --help due to the stale annotation.

This is safe — the annotation's only consumers (the help template and showInResources) both operate on the apps command, which is already removed.

Test:

Running stripe --help
Before:
Screenshot 2026-05-26 at 1 23 35 PM

After:
Screenshot 2026-05-26 at 1 24 14 PM

@yahanxing-stripe yahanxing-stripe marked this pull request as ready for review May 26, 2026 20:52
@yahanxing-stripe yahanxing-stripe requested a review from a team as a code owner May 26, 2026 20: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.

3 participants