Skip to content

Upgrade to go-fastly version 11.#1514

Merged
kpfleming merged 1 commit intofastly:mainfrom
kpfleming:go-fastly-11
Aug 11, 2025
Merged

Upgrade to go-fastly version 11.#1514
kpfleming merged 1 commit intofastly:mainfrom
kpfleming:go-fastly-11

Conversation

@kpfleming
Copy link
Contributor

@kpfleming kpfleming commented Aug 8, 2025

go-fastly version 11 requires a context.Context object to be passed as the first argument in all of the API functions it exports. This commit modifies all of the code in the CLI to pass context.TODO() in that case, since the CLI does not use context objects for any other purpose.

The CLI also has an internal 'interface' which maps to the complete set of API functions in the 'fastly' namespace exported by go-fastly, and hundreds of 'mock' functions used in the CLI test suite. Those have also been updated, and along the way many inconsistencies in those function signatures were corrected.

go-fastly version 11 removed a deprecated set of product enablement API functions, so the fastly products command has been updated to use the new API functions. The tests for the fastly products command no longer mock the API calls as they no longer exist, and the new fastly product command which will appear in the next release will provide full test coverage of the CLI's use of the new product enablement API functions.

There are no functional changes in this commit, and the entire test suite still passes.

At least 80% of the changes in this commit were produced using comby.

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 added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

go-fastly version 11 requires a context.Context object to be passed as
the first argument in all of the API functions it exports. This commit
modifies all of the code in the CLI to pass context.TODO() in that
case, since the CLI does not use context objects for any other
purpose.

The CLI also has an internal 'interface' which maps to the complete
set of API functions in the 'fastly' namespace exported by go-fastly,
and hundreds of 'mock' functions used in the CLI test suite. Those
have also been updated, and along the way many inconsistencies in
those function signatures were corrected.

go-fastly version 11 removed a deprecated set of product enablement
API functions, so the 'fastly products' command has been updated to
use the new API functions. The tests for the `fastly products` command
no longer mock the API calls as they no longer exist, and the new
'fastly product' command which will appear in the next release will
provide full test coverage of the CLI's use of the new product
enablement API functions.

There are no functional changes in this commit, and the entire test
suite still passes.

At least 80% of the changes in this commit were produced using
[comby](https://comby.dev/).
@kpfleming kpfleming added the dependencies Pull requests that update a dependency file label Aug 8, 2025
@kpfleming kpfleming marked this pull request as ready for review August 8, 2025 15:08
@kpfleming kpfleming requested a review from a team as a code owner August 8, 2025 15:08
@kpfleming kpfleming merged commit 3b5dd3b into fastly:main Aug 11, 2025
8 checks passed
@kpfleming kpfleming deleted the go-fastly-11 branch August 11, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants