Fix update detection for pseudo-version builds - #375
Merged
Conversation
The CLI treated any different GitHub release tag as an available update, even when the current build was actually newer than the latest tagged release. This caused outputs like: - current: 0.4.1-0.20260313174735-243815fa23b2 - update available: 0.4.0 Use semantic version comparison for doctor, upgrade, and background update notices so updates are only shown when the latest release is actually newer than the current build. Tests: - go test ./internal/commands/...
There was a problem hiding this comment.
Pull request overview
This PR fixes false-positive update notifications when the CLI is built from a newer pseudo-version than the latest tagged release by switching update detection to semantic version comparison (including pseudo-versions/prereleases) across doctor, upgrade, and background update notices.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Add a shared semantic version comparison helper (
isUpdateAvailable) usinggolang.org/x/mod/semver. - Apply semantic “latest > current” checks consistently in
upgrade,doctor, and update notices. - Add targeted tests to ensure older “latest” releases are suppressed when the current build is a newer pseudo-version.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/commands/version_compare.go | Introduces semantic version normalization and comparison helper for update detection. |
| internal/commands/version_compare_test.go | Adds unit tests for update-availability logic, including pseudo-version cases. |
| internal/commands/upgrade.go | Uses semantic update detection to avoid reporting updates when “latest” is older. |
| internal/commands/upgrade_test.go | Adds coverage ensuring upgrade output is suppressed when latest is older than a pseudo-version build. |
| internal/commands/update_notice.go | Uses semantic comparison so background notices don’t show when latest is older. |
| internal/commands/update_notice_test.go | Adds coverage for suppressing notices when latest is older than current pseudo-version build. |
| internal/commands/doctor.go | Uses semantic update detection in the version check to avoid false “update available” warnings. |
| internal/commands/doctor_test.go | Adds coverage ensuring doctor doesn’t warn when latest is older than current pseudo-version build. |
| go.mod | Adds golang.org/x/mod dependency for semver comparison. |
| go.sum | Records checksums for the new golang.org/x/mod dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jeremy
added a commit
that referenced
this pull request
Jul 25, 2026
Add TestTodosShowJSONSurfacesSDKFields, a regression guard for #449: the fields that report (due_on, starts_on, comments_count, boosts_count, completion_subscribers, description_attachments) must all surface in the --json output of `todos show`. The implementation already landed on main via the SDK model — SDK #375 added completion_subscribers/comments_count, SDK #400 added description_attachments, absorbed by CLI #552/#554's SDK bumps; due_on, starts_on and boosts_count already existed with omitempty. `todos show` emits the SDK Todo object directly, so the fields surface today. This is coverage, not a fix (hence Refs, not Fixes). The test serves a fully-populated todo and asserts both the presence and the values of all six fields, keeping the omitempty date/count fields exercised with nonzero values so a future SDK bump can't silently drop them.
jeremy
added a commit
that referenced
this pull request
Jul 25, 2026
Add TestTodosShowJSONSurfacesSDKFields, a regression guard for #449: the fields that report (due_on, starts_on, comments_count, boosts_count, completion_subscribers, description_attachments) must all surface in the --json output of `todos show`. The implementation already landed on main via the SDK model — SDK #375 added completion_subscribers/comments_count, SDK #400 added description_attachments, absorbed by CLI #552/#554's SDK bumps; due_on, starts_on and boosts_count already existed with omitempty. `todos show` emits the SDK Todo object directly, so the fields surface today. This is coverage, not a fix (hence Refs, not Fixes). The test serves a fully-populated todo and asserts both the presence and the values of all six fields, keeping the omitempty date/count fields exercised with nonzero values so a future SDK bump can't silently drop them.
jeremy
added a commit
that referenced
this pull request
Jul 25, 2026
…564) Add TestTodosShowJSONSurfacesSDKFields, a regression guard for #449: the fields that report (due_on, starts_on, comments_count, boosts_count, completion_subscribers, description_attachments) must all surface in the --json output of `todos show`. The implementation already landed on main via the SDK model — SDK #375 added completion_subscribers/comments_count, SDK #400 added description_attachments, absorbed by CLI #552/#554's SDK bumps; due_on, starts_on and boosts_count already existed with omitempty. `todos show` emits the SDK Todo object directly, so the fields surface today. This is coverage, not a fix (hence Refs, not Fixes). The test serves a fully-populated todo and asserts both the presence and the values of all six fields, keeping the omitempty date/count fields exercised with nonzero values so a future SDK bump can't silently drop them.
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.
Summary
Ref: https://3.basecamp.com/2914079/buckets/46292715/card_tables/cards/9714497196
Testing
Summary by cubic
Use semantic version comparison so updates are only shown when the latest release is actually newer. Fixes false “update available” notices for pseudo-version builds in doctor, upgrade, and background checks.
Bug Fixes
golang.org/x/mod/semvervia a new helper, preventing pseudo-version builds from being flagged as outdated.UpdateCheck.Notice()paths.Dependencies
golang.org/x/mod v0.34.0for semver comparisons.Written for commit 17abd55. Summary will update on new commits.