Repository navigation
fix(flags): describe the accepted values of --addon and --database - #1265
Merged
Merged
Conversation
The help of the `--addon` flag only mentions an ID, while the flag also accepts an addon type: `utils.GetAddonUUIDFromType` returns the value as-is when it starts with `ad-`, and otherwise resolves it from the addon provider name (`postgresql`, `redis`, ...), with a few aliases. Passing a type for an app that has no such addon gives: `Unable to get the addon UUID based on its type: ... no 'X' addon exists`. The help of the `--database` flag (preview feature) mentions an ID as well, while the code handles a database name: `ExtractDatabaseNameFromCommandLineOrEnv` returns the value of the flag, this value is passed to `AddonsList`, and the errors of `currentDatabaseNameAndUUID` mention "the given name".
`--addon my-addon` cannot work: the flag accepts an addon ID or an addon type, not the name of the addon. Use `postgresql`, PITR being a PostgreSQL feature.
EtienneM
self-requested a review
October 9, 2026 09:20
--addon and --database
EtienneM
approved these changes
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The help of the
--addonflag only documents an ID, but the flag accepts an addon type as well. Verified with the installed CLI (1.49.0):But in practice:
With a value starting with
ad-,addonUUIDFromFlagsuses it as-is, otherwiseutils.GetAddonUUIDFromTyperesolves it from the addon provider name (postgresql,redis, ... and a few aliases), and fails withno 'X' addon existswhen nothing matches. So a type is accepted (a custom addon name is not), which the help does not say.While I was in the same file:
--database(preview feature) has the same kind of mismatch, its help says "ID of the current database" while the code handles a name (ExtractDatabaseNameFromCommandLineOrEnv,AddonsList(dbName), and the errors ofcurrentDatabaseNameAndUUIDmention "the given name"). Happy to drop this one if you prefer to keep the PR focused.Changes
fix(flags): describe the accepted values of --addon and --databasefix(pitr): use a valid --addon value in the examples—--addon my-addoncannot work, the flag does not accept the name of an addon.Notes
gofmt -lreports nothing on the modified files.--addonexamples of the repository use several placeholders (addon_uuid,addon-uuid,ad-9be0fc04-...): I left them untouched, but I can normalize them in a follow-up if you want.