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.

@Pybsama

Pybsama commented Aug 29, 2026

Copy link
Copy Markdown
Author

Revalidated this change against current main (04ae88bca60e0ec72b8dacad1978d24a0428e25b). The issue remains open, the parser-level Required: true is still present upstream, and I found no competing implementation.

  • Reapplying the regression tests while restoring Required: true reproduces exactly three failures: environment fallback, manifest fallback, and the all-sources-missing domain error. Removing that single constraint returns the focused suite to green.
  • All 12 validate scenarios passed under the race detector for 100 consecutive runs.
  • The repository's complete make all gate passed after installing its pinned golangci-lint v2.4.0 prerequisite: 20 linters reported 0 issues, Semgrep 1.172.0 ran 1,073 rules over 1,403 tracked targets with 0 blocking findings, the full race-enabled repository suite passed, and the CGO-disabled build/install completed.
  • Linux amd64 and Windows amd64 cross-builds also succeeded, and git diff --check is clean.

The source and test hunks apply cleanly. GitHub's current conflict is isolated to CHANGELOG.md, whose Unreleased/release sections moved after this PR's original base. I prepared and validated the resolved three-file tree locally. The published head remains unchanged and this PR remains Draft because publishing a branch rebased over the intervening workflow-file updates requires broader workflow authorization than the current credential has; I have not requested or expanded that scope.

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