`fastly service version validate` requires `--service-id` flag with no env var fallback
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start at the implementation of fastly service version validate and compare how it resolves --service-id with other service commands that accept FASTLY_SERVICE_ID. Reproduce the command using only the environment variable, then add or update coverage for that invocation. Done means validation succeeds without explicitly passing --service-id when the environment variable is set.
Written by the indexing model from the issue text.
Description
Version
Fastly CLI version v15.4.0 (c142c746)
Built with go version go1.26.4 darwin/arm64 (2026-07-30)
What happened
When running fastly service version validate, the command errors and requires the --service-id flag to be set. The FASTLY_SERVICE_ID environment variable is present and is successfully used with other commands in the same session.
Steps:
- Exported the Fastly API credentials as environment variables for the shell session:
export FASTLY_SERVICE_ID="" # Provided ID
export FASTLY_API_TOKEN="" # Provided token
- Verified API credentials were valid and returning information:
fastly whoami
- Drafted some service changes, all reporting successful
# Clone a new service version for adding a dynamic ACL
fastly service acl create --version="active" --name="restricted_ips" --autoclone
# Add a `recv` type VCL snippet that will use the ACL entries to enforce some client IP restrictions
fastly service vcl snippet create --version="latest" --name="custom_restricted-ips_recv" --type="recv" --content="./restricted-ips.vcl" --priority=5
- Tried to validate the draft version before publishing
fastly service version validate --version="latest"
- Received error:
ERROR: error parsing arguments: required flag --service-id not provided.
- Retried by explicitly passing the
--service-idflag equal to the environment variable, which was successful
fastly service version validate --version="latest" --service-id="${FASTLY_SERVICE_ID}"
# SUCCESS: Service ... version 18 is valid: Warning: Unused table `enabled_products`
- Dominant language
- Go
- Stars
- 164
- Forks
- 80
- Avg merge
- 14h 22m
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fastly/cli
-
bug feature request
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
feature request
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 62/100
-
feature request
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
feature request
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·