feat(release): release.py + version lockstep SSOT (P1) - #40
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR establishes a single source of truth for versioning by introducing ChangesRelease Infrastructure and Orchestration
Managed Channel Update Support
Workflow Infrastructure and Dependency Validation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes The PR introduces substantial new orchestration logic (345 lines in Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
tests/ui_and_conv/test_shell_update.py (1)
1223-1238: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick winAdd a regression test for managed
do_update(check_only=True)cache persistence.These tests cover detection and prompt rendering, but not the managed
/updatecheck-only path that must persistLATEST_VERSION_FILEfor follow-up flows.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/ui_and_conv/test_shell_update.py` around lines 1223 - 1238, Add a regression test that verifies do_update(check_only=True) persists the managed-channel latest-version cache: in the existing test module set PYTHINKER_MANAGED via monkeypatch and sys.executable to simulate managed mode, call update.do_update(check_only=True) (or the async equivalent), then assert that the file referenced by update.LATEST_VERSION_FILE exists and contains the fetched latest version (or at least a non-empty value) so follow-up flows can read it; reference the functions/values _detect_upgrade_command, do_update, and LATEST_VERSION_FILE to find the right code paths to exercise and validate.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci-pythinker-cli.yml:
- Around line 253-257: The release-validate job calls "uv run python
scripts/check_pythinker_dependency_versions.py" but never installs the uv CLI;
add a step in the release-validate job immediately before the "uv run"
invocation that installs the pinned uv toolchain (e.g. run "python -m pip
install 'uv==0.8.5'" or equivalent using the repository's preferred installer)
so the workflow does not rely on runner state and consistently uses uv 0.8.5.
In `@scripts/release.py`:
- Around line 179-183: The code currently validates main refs but later creates
the release branch from the current HEAD, which can include unrelated commits;
change the branch creation to start from origin/main instead of HEAD by using
the remote ref you already capture (remote = _git_capture(["git", "rev-parse",
"origin/main"])) as the base when making the release branch (e.g., create
release/{target} from the commit hash stored in remote via git checkout -b or
git branch <name> <remote>), and keep the existing checks (local, remote,
read_project_version, assert_monotonic) intact.
- Around line 327-329: The except block in main() only handles ReleaseError so
subprocess.CalledProcessError from _git_capture()/_run() escapes; update the
exception handling to also catch subprocess.CalledProcessError (and/or Exception
if you prefer broader safety) and handle it the same way as ReleaseError:
capture the exception (e.g., exc), print a deterministic error message to
sys.stderr including relevant exception details, and return 1 so subprocess
failures produce controlled release-tool output; reference main(),
_git_capture(), _run(), ReleaseError, and subprocess.CalledProcessError when
locating the code to modify.
In `@src/pythinker_code/ui/shell/update.py`:
- Around line 1228-1235: The managed-channel branch in the upgrade flow (the
block checking upgrade_command[:1] == [MANAGED_CHANNEL_MARKER]) returns
UpdateResult.UPDATE_AVAILABLE before persisting latest_version to the cache,
which later causes run_update_prompt() to read stale data; modify that branch in
update.py so that before calling _print() and returning
UpdateResult.UPDATE_AVAILABLE you save/persist latest_version to the same
cache/store the normal update flow uses (the same mechanism other branches use
to write latest_version), ensuring functions like run_update_prompt() will see
the updated version even for managed-channel updates.
---
Outside diff comments:
In `@tests/ui_and_conv/test_shell_update.py`:
- Around line 1223-1238: Add a regression test that verifies
do_update(check_only=True) persists the managed-channel latest-version cache: in
the existing test module set PYTHINKER_MANAGED via monkeypatch and
sys.executable to simulate managed mode, call update.do_update(check_only=True)
(or the async equivalent), then assert that the file referenced by
update.LATEST_VERSION_FILE exists and contains the fetched latest version (or at
least a non-empty value) so follow-up flows can read it; reference the
functions/values _detect_upgrade_command, do_update, and LATEST_VERSION_FILE to
find the right code paths to exercise and validate.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 62f821eb-2d21-4805-b9bc-7f40b8c12c7e
📒 Files selected for processing (12)
.agents/skills/release/SKILL.md.github/workflows/ci-pythinker-cli.yml.github/workflows/release-pythinker-cli.ymlAGENTS.mddocs/en/release-notes/breaking-changes.mdscripts/check_pythinker_dependency_versions.pyscripts/release.pysrc/pythinker_code/ui/shell/update.pytests/test_release_py.pytests/test_release_update_pipeline.pytests/test_version_lockstep.pytests/ui_and_conv/test_shell_update.py
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/en/release-notes/changelog.md`:
- Line 20: The line added to docs/en/release-notes/changelog.md is a manual edit
and must be removed so the file remains auto-synced from the root CHANGELOG.md;
delete the manually inserted sentence about "Release preparation now uses a
version single source of truth" from docs/en/release-notes/changelog.md and rely
on the sync script (the changelog sync that copies root CHANGELOG.md into
docs/en/release-notes/changelog.md) to propagate any official changelog entries
instead of editing this file directly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a25b78d4-ad6b-4ac7-a1fe-10e4c82d1ebf
📒 Files selected for processing (2)
CHANGELOG.mddocs/en/release-notes/changelog.md
Related Issue
docs/superpowers/plans/2026-05-31-release-orchestration-p1-release-tool.md.Description
scripts/release.py, a four-phase release-prep tool that validates release preconditions, rewrites version-derived files frompyproject.toml, runs local gates, and opens arelease/X.Y.ZPR.tests/test_version_lockstep.pyso version-bearing strings and workspace pins stay aligned on every PR, including the frozenpythinker-review==0.1.0pin.pythinker-reviewwith pinneduv 0.8.5setup whereuv runis used.PYTHINKER_MANAGEDupdater handling with channel-native guidance, cache persistence for managed check-only update checks, and Homebrew regression coverage.Checklist
CHANGELOG.mdentry; left generated docs changelog manual sync alone.Summary by CodeRabbit
Release Notes