Skip to content

Commit 6bcba6f

Browse files
authored
CDTOOL-1235: Provide links to major version release notes in 'new version available' output. (#1623)
### Change summary When the CLI informs the user that a newer version is available for installation, it will now detect whether that new version is at least one major version higher than the installed version. If it is, it will provide the user links to the changelog (release notes) for each of the major versions between the current version and the latest version. There is no change in the output if the current version and latest version have the same major version number. --- Sample output (one major version behind): ```text kpfleming@kpf25:~/src/fastly/cli$ ./fastly version Fastly CLI version v12.1.0 (unknown) Built with go version go1.25.5 linux/amd64 (2026-01-16) A new version of the Fastly CLI is available. Current version: 12.1.0 Latest version: 13.3.0 Note: Please review the release notes for the major version(s) listed below before upgrading. Version 13.0.0: https://github.com/fastly/cli/releases/tag/v13.0.0 Run `fastly update` to get the latest version. ``` --- Sample output (multiple major versions behind): ```text kpfleming@kpf25:~/src/fastly/cli$ ./fastly version Fastly CLI version v10.1.0 (unknown) Built with go version go1.25.5 linux/amd64 (2026-01-16) A new version of the Fastly CLI is available. Current version: 10.1.0 Latest version: 13.3.0 Note: Please review the release notes for the major versions listed below before upgrading. Version 11.0.0: https://github.com/fastly/cli/releases/tag/v11.0.0 Version 12.0.0: https://github.com/fastly/cli/releases/tag/v12.0.0 Version 13.0.0: https://github.com/fastly/cli/releases/tag/v13.0.0 Run `fastly update` to get the latest version. ``` All Submissions: * [X] Have you followed the guidelines in our Contributing document? * [X] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/fastly/cli/pulls) for the same update/change? <!-- You can erase any parts of this template not applicable to your Pull Request. --> ### 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?
1 parent fda0c07 commit 6bcba6f

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- feat(service/vcl): moved the `vcl` command under the `service` command, with an unlisted and deprecated alias of `vcl` ([#1616](https://github.com/fastly/cli/pull/1616))
1717
- feat(service/healthcheck): moved the `healthcheck` command under the `service` command, with an unlisted and deprecated alias of `healthcheck` ([#1619](https://github.com/fastly/cli/pull/1619))
1818
- feat(service/backend): moved the `backend` command under the `service` command, with an unlisted and deprecated alias of `backend` ([#1621](https://github.com/fastly/cli/pull/1621))
19+
- feat(version): If the latest version is at least one major version higher than the current version, provide links to the release notes for the major version(s) so the user can review them before upgrading. ([#1623](https://github.com/fastly/cli/pull/1623))
1920

2021
### Bug fixes:
2122

pkg/commands/update/check.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ func CheckAsync(
6666
fmt.Fprintf(w, "A new version of the Fastly CLI is available.\n")
6767
fmt.Fprintf(w, "Current version: %s\n", result.current)
6868
fmt.Fprintf(w, "Latest version: %s\n", result.latest)
69+
if result.latest.Major != result.current.Major {
70+
fmt.Fprintf(w, "\nNote: Please review the release notes for the major version(s) listed below before upgrading.\n")
71+
for ver := result.current.Major + 1; ver <= result.latest.Major; ver++ {
72+
fmt.Fprintf(w, "Version %d.0.0: https://github.com/fastly/cli/releases/tag/v%d.0.0\n", ver, ver)
73+
}
74+
}
6975
fmt.Fprintf(w, "Run `fastly update` to get the latest version.\n")
7076
fmt.Fprintf(w, "\n")
7177
}

0 commit comments

Comments
 (0)