Skip to content

fix: Correctly resolve staged version parameter - #1870

Open
acme wants to merge 1 commit into
mainfrom
acme/resolve-staged-versions
Open

fix: Correctly resolve staged version parameter#1870
acme wants to merge 1 commit into
mainfrom
acme/resolve-staged-versions

Conversation

@acme

@acme acme commented Aug 5, 2026

Copy link
Copy Markdown
Member

Change summary

  • Use ListVersions to find staged version instead of unsupported filter
  • Add test for when latest ≠ staged version

This ensures that --version staged returns the actual staged version.

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?
  • Have you successfully run tests with your changes locally?

User Impact

This ensures that --version staged returns the actual staged version.

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

This changes behaviour, but makes it correct.

- Use ListVersions to find staged version instead of unsupported filter
- Add test for when latest ≠ staged version

This ensures that `--version staged` returns the actual staged version.
@acme
acme requested a review from a team as a code owner August 5, 2026 10:45
@acme
acme requested a review from philippschulte August 5, 2026 10:45
Comment thread pkg/argparser/flags.go
case "staged":
serviceDetails, err := client.GetServiceDetails(context.TODO(), &fastly.GetServiceDetailsInput{
// Find staged version by listing all versions and searching for staging=true.
vs, err := client.ListVersions(context.TODO(), &fastly.ListVersionsInput{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We intentionally changed from listing all versions to using filters because the 'list all versions' API endpoint is problematic for a number of reasons. In previous testing the 'staged' filter worked properly, so if it is not working now we need to work with the API team to correct that, not revert the code in the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants