Repository navigation
fix(self-upgrade): don't offer a .dev0/.post0 build's base tag as the rollback version - #5358
Merged
Merged
Conversation
… rollback version packaging's Version.dev/.post are ints, so X.Y.Z.dev0 and X.Y.Z.post0 passed the stable-release check and the rollback hint pointed at vX.Y.Z. Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported, and the change includes targeted regression coverage for the corrected rollback behavior.
No open issues 🎉
What changed in this PR
This pull request fixes rollback guidance for self-upgrades originating from .dev0 and .post0 versions by ensuring only exact stable releases produce a rollback tag.
Changes:
- Changed stable-version detection to distinguish
Nonefrom falsy development and post-release values. - Added regression tests for
.dev0and.post0rollback behavior. - Preserved existing rollback handling for stable and other prerelease versions.
| File | Description |
|---|---|
| tests/specify_cli/test_version_execution.py | Adds regression tests verifying that failed upgrades from .dev0 and .post0 versions do not suggest the failed release as a rollback target. |
| src/specify_cli/_version.py | Corrects stable release-tag detection by comparing version components against None rather than relying on truthiness. |
Review effort: Lite (auto)
Collaborator
|
Thank you! |
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.
Description
_stable_release_tag_for_version()is documented to returnvX.Y.Z"only for exact stable release versions", but it testedparsed.postandparsed.devfor truthiness. Both are ints, soX.Y.Z.dev0andX.Y.Z.post0(dev == 0,post == 0) were accepted as the stable tagvX.Y.Z.Main always carries
X.Y.Z.dev0, and docs/install/pipx.md documents installing from main. So after a failedspecify self upgradefrom1.3.4.dev0tov1.3.4, the rollback hint tells the user to "pin back to the previous version" with...spec-kit.git@v1.3.4, which is the release that just failed. The fix compares againstNone, so these versions fall back to the existing "Previous version was not an exact stable release tag" message, as rc and dev1 already do.Testing
Added
test_dev0_failure_does_not_suggest_unreleased_tag_as_rollbackandtest_post0_failure_degrades_rollback_hint_to_releases_pagenext to the existing pre-release rollback test. Both fail on main and pass with this change..\.venv\Scripts\specify.exe --help.\.venv\Scripts\python.exe -m pytest tests/specify_cli/test_version_execution.py tests/specify_cli/test_version_verification.py -q: 56 passed, 3 skipped, 1 failed. The failure istest_non_windows_uv_tool_dry_run_still_previews_installer, which fails identically on unmodified main on Windows (POSIX-only scenario).AI Disclosure
AI disclosure: Claude Code (model: Claude Opus 5.5), autonomous agent mode. The agent found the bug by reading the code, wrote the reproduction, the fix and both regression tests, and ran the tests. I reviewed the finding and approved submitting it.
🤖 Generated with Claude Code