Suppress Nightly Version Upgrade Notifications#730
Conversation
In **cmd/av/main.go**, update the `checkCliVersion()` function so that both the running version and the fetched latest version have their pre-release suffixes stripped via `strings.TrimSuffix(v, semver.Prerelease(v))` before the `semver.Compare` call. This ensures that a user on `v0.1.30-rc1-nightly` is not prompted to upgrade to `v0.1.30`, but is still prompted when `v0.1.31` is released. - Import `strings` if not already imported in **cmd/av/main.go** - Compute `currentBase := strings.TrimSuffix(config.Version, semver.Prerelease(config.Version))` - Compute `latestBase := strings.TrimSuffix(latest, semver.Prerelease(latest))` - Replace `semver.Compare(config.Version, latest) < 0` with `semver.Compare(currentBase, latestBase) < 0`
Current Aviator status
This PR was merged using Aviator.
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
There was a problem hiding this comment.
Code Review
This pull request updates the pre-commit configuration to use absolute paths for the Go binary and modifies the CLI version check logic to compare base versions by stripping pre-release tags. Feedback suggests reverting the hardcoded Go paths to maintain portability across different developer environments. Additionally, the version comparison logic should be improved to handle build metadata correctly, as the current use of strings.TrimSuffix may fail in certain scenarios.
| language: system | ||
| entry: | | ||
| sh -c 'go run golang.org/x/tools/cmd/goimports@latest -w .' | ||
| sh -c '/usr/local/go/bin/go run golang.org/x/tools/cmd/goimports@latest -w .' |
There was a problem hiding this comment.
Hardcoding the path to the Go binary (/usr/local/go/bin/go) reduces portability. This hook will fail for developers who have Go installed in different locations (e.g., via Homebrew on macOS or standard package managers on Linux). It is better to rely on the system PATH.
sh -c 'go run golang.org/x/tools/cmd/goimports@latest -w .'| language: system | ||
| entry: | | ||
| sh -c 'go run mvdan.cc/gofumpt@latest -l -w .' | ||
| sh -c '/usr/local/go/bin/go run mvdan.cc/gofumpt@latest -l -w .' |
- Replace hardcoded `/usr/local/go/bin/go` with `go` in PATH - Update goimports and gofumpt hook entries to use `sh -c 'go run ...'` - Remove trailing YAML block scalar `|` from hook entries
Aviator CI Failure Auto-ReworkCI check pre-commit Attempt: 1/2 Summary of CI failures found and fixed: Root cause: The pre-commit workflow ( Fix: Updated
Also removed the trailing YAML |
✅ FlexReview StatusCommon Owner:
Review SLO: |
This PR was created automatically by Aviator Runbooks.
Runbook URL: https://app.aviator.co/r/373
Executed by: @tulioz
💡 Revise with Runbooks
Use
/aviator reviseto address the feedback provided on this PR:As a PR comment:
/aviator revise- Process all unresolved review comments on the PR/aviator revise [instructions]- Process any unresolved comments and handle additional instructions.As a review comment:
/aviator revise [instructions]to an existing review comment to address that specific thread/aviator revise [instructions]as a review comment to have Runbooks revise that code section based on given instructions.Read the complete guide with examples
This PR is being generated automatically. Additional commits will be added as steps complete.
Steps
Included in this PR
View all Runbook steps (1 of 1 complete)