Rework the new version notice - #70
Merged
Merged
Conversation
Adopt the block shape that gh and depot use: a coloured headline with the version transition, the upgrade command for the detected install method, and the release page URL, with a blank line above and below. The release URL now prints for every install method, so the "Visit .../latest to upgrade." fallback is gone. --no-color and the NO_COLOR environment variable turn the colour off; this is the first code that reads the --no-color flag.
Point the version check at dnsimple/cli. The homebrew-tap release mirror that DefaultReleaseURL named is removed on main, so both the latest version lookup and the release page URL in the notice pointed at a repository that no longer holds the artifacts.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The new release notice now prints a coloured headline with the version transition, the upgrade command for the detected install method, and the release page URL, with a blank line above and below. The URL prints for every install method, which replaces the
Visit .../latest to upgrade.line that only appeared when the install method was unknown.--no-colorand theNO_COLORenvironment variable turn the colour off. This is the first code that reads the--no-colorflag; theNoColorfield onoutput.Printerstays unused.DefaultReleaseURLnow namesdnsimple/cli. #69 removed thednsimple/homebrew-taprelease mirror that the constant pointed at, so both the latest version lookup and the release page URL named a repository that no longer holds the artifacts.🔍 QA
Scenario: the notice appears
go build -ldflags "-X main.version=0.1.0" -o /tmp/dnsimple ./cmd/dnsimple.state.jsonin the config directory, then run/tmp/dnsimple accounts listin a terminal.dnsimple/cliand opens the release page for the new version.Scenario: the upgrade command matches the installation
~/.dnsimple/bin, and from~/go/bin.To upgrade, run:line.Scenario: the notice is suppressed
--no-color, and again withNO_COLOR=1. Confirm the block appears with no colour.DNSIMPLE_NO_UPDATE_CHECK=1. Confirm no block appears.📋 Deployment Pre/Post tasks
N/A
N/A