← Back to Pull requests

Guided release: prepare the version bump and CHANGELOG cut itself #114

Closed
unknown closed this pull request without merging on Nov 15, 2026 04:27 UTC
View on GitHub
unknown unknown commented on Nov 15, 2026 03:41 UTC
Author

Summary

The guided release scripts now do docs/RELEASE.md Step 1.1 (bump pubspec.yaml and cut the CHANGELOG) when you give them a new version. Before, they listed what to do by hand and waited.

./scripts/release-android.sh --new-tag 0.2.0

The scripts also offer this when you answer "release a new version" at the prompt, and whenever origin/main is not ready to tag.

Changes

  • scripts/release-lib.sh

  • - --new-tag [X.Y.Z] (also --new-tag=X.Y.Z; a leading v is accepted). --from-tag together with a version is refused.
    - When origin/main is ready, the script now offers three choices: release it as is, release a new version, or stop. Before, the only options were yes or abort.
    - prepare_release_commit: makes a scratch worktree of origin/main on a new release/vX.Y.Z branch. It sets pubspec.yaml's version, keeping +N and the rest of the line. It moves the entries under ## Unreleased / ## [Unreleased] into a new ## [X.Y.Z] - <today> section, drops a "Nothing yet" placeholder and leaves the Unreleased heading empty. It then shows the diff, offers $EDITOR for the notes, and commits. Your own checkout is never touched. If you decline, the worktree and branch it made are removed.
    - open_release_pr: asks first, then pushes the branch and opens a PR into main with gh pr create. Merging stays with the human. The run then waits, re-checks origin/main, and carries on tagging the new version.
    - The prep refuses:
    - a version that is not above every v* tag, or is already tagged. The highest tag is picked with version_gt, not git's v:refname sort, which ranks -rc1 above the release;
    - a CHANGELOG that already has an [X.Y.Z] section, or has no Unreleased heading;
    - an empty Unreleased section. In that case it offers to write the entries first, in $EDITOR or by hand.
    - If the release branch is already on the remote (a PR not yet merged), the run says so and waits instead of making a second one.
    - New pure helpers: version_valid, version_gt, version_bump, pubspec_set_version, changelog_cut.
    - Fixes:
    - case "$(choose …)" hid a die inside the substitution, so end of input fell through as if answered. The choice is now captured into a variable first, in both places.
    - ask_required and ask_version now stop at end of input. Before, under a caller's || exit 1, they looped forever.
  • scripts/release-lib-selftest.sh:

  • - covers the helpers: version ordering, both heading styles, placeholders, link refs, no extra blank line at EOF, and each refusal code;
    - covers end of input at the prompts, and an rc tag next to its release;
    - runs an end-to-end prep and PR against the throwaway origin with a stubbed gh: branch pushed, only the two files changed, worktree removed, checkout untouched;
    - checks that a declined prep leaves nothing behind.
  • docs/RELEASE.md, the usage lines in both entry scripts, and the CHANGELOG are updated.
  • Testing

  • ./scripts/release-lib-selftest.sh and ./scripts/ci-shellcheck.sh pass.

  • Interactive smoke test of resolve_new_tag against a throwaway origin. Input: choose "new version", 0.1.0, prepare, commit, push. Output: a release/v0.1.0 commit that changes only pubspec.yaml (0.0.0+1 → 0.1.0+1) and CHANGELOG.md.

  • The CI mirror passes (./scripts/test.sh): all checks passed, 4521 Flutter tests, and every Rust suite. That run was on the first commit. The second commit touches only release-lib.sh and its selftest, and both pass again.

  • Local-network discovery suites: not applicable, the Wi-Fi path is untouched.

  • Tested on Android / iOS: not applicable, script-only change.
  • Related Issues

    Follows the guided release scripts PR (liberatedbread/liberatedbread-mobile#111) and liberatedbread/liberatedbread-mobile#112.

    ---
    _Generated by Claude Code_

    <!-- codesmith:footer -->
    ---
    <a href="` https://backend.blacksmith.sh/track/enable-autofix?expires=1797306094&installation_model_id=429530&pr_number=114&ref=codesmith_pr_footer&repository=liberatedbread%2Fliberatedbread-mobile&return_to=https%3A%2F%2Fgithub.com%2Fliberatedbread%2Fliberatedbread-mobile%2Fpull%2F114&signature=8fc626372d64db2cb974ab48ee788c953628e8a85094ae88b83e36142d74222f"&gt;&lt;picture&gt;&lt;source media="(prefers-color-scheme: dark)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark.svg"&gt;&lt;source media="(prefers-color-scheme: light)" srcset="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-light.svg"&gt;&lt;img alt="Autofix with [code]smith" src="https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png" width="190" height="28"&gt; `</picture></a>
    <sup><a href="https://app.blacksmith.sh/liberatedbread/codesmith/liberatedbread-mobile/pr/114?autoLogin=true&ref=codesmith_pr_footer">Open in [code]smith</a> · Need help on this PR? Tag <code>@codesmith-bot</code> with what you need.</sup>

    <!-- codesmith:autofix:disabled -->
    <!-- /codesmith:footer -->

    Diff: 640 lines (+480 / -160) across 8 files Reviewer: holdenk Review duration: 46m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 640 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.387
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #114"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 51.9% (MEDIUM) · Higher = larger blast radius
    51.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.5% · Safe to merge
    22.5%