Skip to content

compute: Add help text for default value of --version when it is optional - #1928

Open
harmony7 wants to merge 1 commit into
mainfrom
kats/version-flag-help
Open

harmony7 wants to merge 1 commit into
mainfrom
kats/version-flag-help

Conversation

@harmony7

@harmony7 harmony7 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Change summary

This PR updates the help text for --version when it's optional, to describe what the default value is.

Before this PR, the help text looks like this:

% fastly compute deploy help

USAGE
  fastly compute deploy [<flags>]

Deploy a package to a Fastly Compute service

OPTIONAL FLAGS
  -s, --service-id=SERVICE-ID  Service ID (falls back to FASTLY_SERVICE_ID,
                               then fastly.toml)
      --service-name=SERVICE-NAME  
                               The name of the service
      --version=VERSION        'latest', 'active', 'staged', or the number of a
                               specific Fastly service version
...

For commands like compute deploy and compute publish, --version is optional, but it's
unclear from the help text what happens when you don't pass it.

After this PR, the help text for version looks like this:

      --version=VERSION        'latest', 'active', 'staged', or the number of
                               a specific Fastly service version (default:
                               the active version, or the latest version if none
                               is active)

I felt it would be helpful to document this default behavior because I found myself reading source to find out what happens when --version is not passed in (for example how fastly/compute-actions behaves under default conditions)

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  • Does your submission pass tests?

Changes to Core Features:

  • Have you written new tests for your core changes, as applicable?
    (There are no new tests for this because there are no tests that check flag descriptions.)
  • Have you successfully run tests with your changes locally?

User Impact

Should be no impact unless someone relies on the output of help text

Are there any considerations that need to be addressed for release?

None

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@harmony7
harmony7 requested a review from a team as a code owner October 5, 2026 05:23
@harmony7
harmony7 requested a review from kpfleming October 5, 2026 05:23
@kpfleming

Copy link
Copy Markdown
Member

The proper fix would be to make the --version flag in these commands required (as it is in all other commands) and require the user to specify active or latest, but that would be a breaking change...

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