Skip to content

fix(service-version): honor service ID fallbacks - #1867

Draft
Pybsama wants to merge 1 commit into
fastly:mainfrom
Pybsama:codex/honor-validate-service-id-fallback
Draft

fix(service-version): honor service ID fallbacks#1867
Pybsama wants to merge 1 commit into
fastly:mainfrom
Pybsama:codex/honor-validate-service-id-fallback

Conversation

@Pybsama

@Pybsama Pybsama commented Jul 31, 2026

Copy link
Copy Markdown

Change summary

Fixes #1866.

fastly service version validate currently marks --service-id as a parser-level required flag, so argument parsing rejects calls that rely on FASTLY_SERVICE_ID or the service_id in fastly.toml. The command's execution path already uses ServiceDetails, which implements the CLI's existing --service-id > environment > manifest precedence.

This removes only the premature required constraint, keeps --version required, and adds regression coverage for environment, manifest, explicit-flag precedence, latest, and the all-sources-missing error path. It also adds the corresponding Unreleased changelog entry.

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?

Changes to Core Features:

  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

Local validation: make all, including race-enabled repository tests, golangci-lint, Semgrep, build, and install.

User Impact

Users can validate a service version without repeating --service-id when the service is already configured through FASTLY_SERVICE_ID or fastly.toml. If no service ID source exists, the command now reaches the existing actionable no service ID found error. Explicit flags continue to take precedence.

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

No breaking changes. The behavior aligns service version validate with the CLI's existing service-ID resolution path and is covered by an Unreleased bug-fix changelog entry.

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.

fastly service version validate requires --service-id flag with no env var fallback

1 participant