Repository navigation
iOS: tellable incrementing version (1.0.x + dev tag/SHA) instead of frozen 1.0 - #5592
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds an "About" section to Settings showing the app version, introduces AppVersionInfo to read/format bundle build metadata with tests, wires xcconfig/Info.plist and scripts to supply git/tag build values, and adds localized strings. ChangesAbout Section with Version Display
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 18 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (18 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR makes iOS builds identifiable by replacing the frozen
Confidence Score: 5/5Safe to merge — build metadata wiring with no auth, data, or networking changes. All changes are confined to version display: xcconfig defaults, Info.plist key additions, a read-only SwiftUI row, a new pure value type with 10 passing tests, and a release-only shell helper. The only pre-existing concern (unescaped dots in the sed pattern of bump-ios-version.sh) was already flagged in a prior review thread and poses negligible practical risk at the current single-MARKETING_VERSION-line xcconfig. No production logic paths are affected. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Build type] -->|reload.sh| B[DEBUG dev build]
A -->|upload-testflight.sh| C[Release / TestFlight build]
B --> D["GIT_SHA = short HEAD + '+' if dirty\nCMUX_DEV_TAG = --tag argument"]
D --> E["Info.plist: CMUXGitSHA / CMUXDevTag\n(build settings injected by xcodebuild)"]
C --> F["Shared.xcconfig defaults\nCMUX_GIT_SHA = (empty)\nCMUX_DEV_TAG = (empty)"]
F --> E
E --> G["AppVersionInfo.init(infoDictionary:isDevBuild:)"]
G -->|"#if DEBUG → isDevBuild = true"| H["displayString: '1.0.0 (1) · grid · a1b2c3d'"]
G -->|"#else → isDevBuild = false"| I["displayString: '1.0.0 (20260607031606)'"]
H --> J[MobileSettingsView\nAbout → Version row]
I --> J
K[bump-ios-version.sh] -->|"patch / minor / major / X.Y.Z"| L["Shared.xcconfig\nMARKETING_VERSION = X.Y.Z"]
L --> G
Reviews (2): Last reviewed commit: "iOS: tellable incrementing version (1.0...." | Re-trigger Greptile |
|
|
||
| echo "New: MARKETING_VERSION=$NEW_MARKETING" | ||
|
|
||
| sed -i '' "s/^MARKETING_VERSION = $CURRENT_MARKETING\$/MARKETING_VERSION = $NEW_MARKETING/" "$XCCONFIG" |
There was a problem hiding this comment.
The dots in
$CURRENT_MARKETING are unescaped, so they act as regex wildcards in the sed pattern. For 1.0.0 the pattern becomes 1.0.0, which matches 1X0X0 or any other two-dot sequence at that position. In practice there is only one MARKETING_VERSION line in the xcconfig, but if the file ever gains a commented example or a comment referencing the current version the substitution could silently match the wrong line. The post-check only verifies the grep result matches $NEW_MARKETING, so a wrong-line replacement would be silently missed. Escaping the dots makes the pattern precise.
| sed -i '' "s/^MARKETING_VERSION = $CURRENT_MARKETING\$/MARKETING_VERSION = $NEW_MARKETING/" "$XCCONFIG" | |
| ESCAPED_CURRENT="${CURRENT_MARKETING//./\\.}" | |
| sed -i '' "s/^MARKETING_VERSION = $ESCAPED_CURRENT\$/MARKETING_VERSION = $NEW_MARKETING/" "$XCCONFIG" |
…ag/SHA) into dog bundle # Conflicts: # ios/cmux/Resources/Localizable.xcstrings
…rozen 1.0 The iOS app's MARKETING_VERSION was hardcoded to 1.0 in ios/Config/Shared.xcconfig and never bumped, so every build (TestFlight and dev dogfood) showed "1.0". CFBundleVersion is a date/build id, so neither users nor the dev could tell which version/build a phone was running. Changes: - Bump MARKETING_VERSION 1.0 -> 1.0.0 (CFBundleShortVersionString). This is the authoritative source for both Debug and Release (verified via -showBuildSettings; the pbxproj does not override it). TestFlight already inherits it (upload-testflight.sh never passes MARKETING_VERSION), so this alone makes release builds tellable. - Add ios/scripts/bump-ios-version.sh to bump the patch on release. The bump stays manual (mirrors the macOS bump-version.sh model) so there is no CI commit-back loop on every merge; CFBundleVersion remains the per-upload monotonic UTC timestamp. - Thread the dev --tag and short git SHA into new CMUXDevTag / CMUXGitSHA Info.plist keys (empty by default, overridden by ios/scripts/reload.sh), so a DEBUG build is tellable. The SHA gets a trailing "+" when the working tree is dirty (tracked or untracked changes). - AppVersionInfo (CmuxMobileSupport): pure, testable value type that assembles the display string. Release shows "1.0.0 (<build>)"; dev appends "· <tag> · <sha>", e.g. "1.0.0 (123) · grid · a1b2c3d". 10 unit tests. - Show it in MobileSettingsView under a new "About" > "Version" row (selectable). en + ja localization added. Verified: simulator build via reload.sh; built Info.plist shows CFBundleShortVersionString=1.0.0, CMUXDevTag=iosver, CMUXGitSHA=7135f32c5f+. All 25 CmuxMobileSupport tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
955430b to
5fc8f13
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5fc8f1346f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| GIT_SHA="$(git -C "$IOS_DIR" rev-parse --short HEAD 2>/dev/null || true)" | ||
| if [[ -n "$GIT_SHA" && -n "$(git -C "$IOS_DIR" status --porcelain 2>/dev/null)" ]]; then | ||
| GIT_SHA="$GIT_SHA+" |
There was a problem hiding this comment.
Stamp a per-reload build identifier
When reload.sh is run repeatedly from the same commit/tag after changing uncommitted iOS sources, this still stamps the same value such as abc123+ every time, and the script does not override CURRENT_PROJECT_VERSION so the Settings row remains 1.0.0 (1) · <tag> · abc123+. That makes distinct dogfood builds indistinguishable in exactly the workflow this About row is meant to support; include a per-reload timestamp/build number or tree-derived identifier instead of only HEAD plus a dirty marker.
Useful? React with 👍 / 👎.
Problem
The iOS app's
MARKETING_VERSIONwas hardcoded to1.0inios/Config/Shared.xcconfigand never bumped, so every iOS build (TestFlight releases AND dev dogfood builds) showed1.0.CFBundleVersionis a date/build id, so neither real users nor the dev could easily tell which version/build a phone was running. The version wasn't displayed in the app at all (only sent as an analytics super-property).What changed
MARKETING_VERSION1.0→1.0.0(CFBundleShortVersionString). This is the authoritative source for both Debug and Release, verified withxcodebuild -showBuildSettings(the pbxproj does not override it;Debug.xcconfigandRelease.xcconfigboth#include Shared.xcconfig). TestFlight already inherits it becauseios/scripts/upload-testflight.shnever passesMARKETING_VERSION, so this alone makes release builds report a meaningful version.ios/scripts/bump-ios-version.sh(patchdefault, alsominor/major/X.Y.Z) bumps the version on release, mirroring the macOSbump-version.shmodel. Kept manual on purpose: a per-merge auto-bump would force CI to commit back to the repo.CFBundleVersionstays the per-upload monotonic UTC timestamp thatupload-testflight.shalready stamps, so App Store's strictly-increasing-build-number requirement is unaffected.CMUXDevTag/CMUXGitSHA(sourced fromCMUX_DEV_TAG/CMUX_GIT_SHAbuild settings).ios/scripts/reload.shoverrides them with the--tagand the short git SHA (trailing+when the working tree is dirty, including untracked files). Empty on release, so release shows a clean1.0.0.AppVersionInfo(inCmuxMobileSupport) is a pure, testable value type that assembles the display string from the bundle's info dictionary plus an injectedisDevBuild. Shown inMobileSettingsViewunder a new About → Version row (selectable text). 10 unit tests cover release vs dev, dirty marker, missing keys, and unexpanded-macro fallback.What the version shows now
1.0.0 (20260607031606)— clean semver + the monotonic build number. Bump the patch withios/scripts/bump-ios-version.shper release.1.0.0 (1) · grid · a1b2c3d— semver + build number +--tag+ short git SHA, so two dev builds are never indistinguishable.The patch increments only when you run
ios/scripts/bump-ios-version.shon release (manual, no CI churn). The build number keeps auto-incrementing per TestFlight upload.Tradeoff
The
MARKETING_VERSIONbump is manual, not fully automated. A fully-automated per-merge bump would require CI to commit the version back to the repo on every iOS-affecting merge (churn + race-prone with the existing TestFlight workflow). The documentedbump-ios-version.shpath is the deliberate, low-risk choice; the build number (CFBundleVersion) is already auto-monotonic per upload, so uploads never collide regardless.Verification
Build-metadata change — verified by inspecting the built Info.plist, no full iOS dogfood required. Simulator build via
ios/scripts/reload.sh --tag iosversucceeded; builtcmux.app/Info.plistshowsCFBundleShortVersionString=1.0.0,CMUXDevTag=iosver,CMUXGitSHA=7135f32c5f+. All 25CmuxMobileSupporttests pass. Autoreview clean (patch is correct), cmux-policy clean.Localization:
mobile.settings.aboutandmobile.settings.versionadded toios/cmux/Resources/Localizable.xcstringswith en + ja. The version value string is not localizable text.🤖 Generated with Claude Code
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Note
Low Risk
Build metadata and settings UI only; release builds explicitly hide dev tag/SHA via
#if DEBUG, with tests covering edge cases.Overview
Replaces the frozen iOS
MARKETING_VERSION(1.0→1.0.0) with a semver users and testers can report, and surfaces that identity in the app.In-app: New About → Version row in
MobileSettingsViewshows a selectable string fromAppVersionInfo, which readsCFBundleShortVersionString,CFBundleVersion, and optional dev keys from the bundle.Release:
ios/scripts/bump-ios-version.shmanually bumps semver inShared.xcconfigon release (patch/minor/major or explicitX.Y.Z). TestFlight’s per-uploadCFBundleVersionbehavior is unchanged.Dev dogfood:
Info.plistaddsCMUXDevTag/CMUXGitSHA(fromCMUX_DEV_TAG/CMUX_GIT_SHA, empty by default).reload.shpasses the--tagand short git SHA (with+when the tree is dirty, including untracked files). DEBUG builds append· tag · shato the About string; release builds stay clean even if those keys are set.Unit tests cover formatting, release vs dev gating, placeholders, and missing keys. Localized About / Version labels (en + ja).
Reviewed by Cursor Bugbot for commit 5fc8f13. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Make the iOS app version tellable. Release/TestFlight builds now show semver + build number, and dev builds add a tag and short git SHA. The version also appears in-app.
New Features
MARKETING_VERSIONfrom 1.0 → 1.0.0 (CFBundleShortVersionString) for Debug and Release.ios/scripts/bump-ios-version.shto manually bump semver on release;CFBundleVersionstays the auto UTC timestamp.CMUXDevTagandCMUXGitSHAviaios/scripts/reload.sh(adds “+” when dirty); release/TestFlight render a clean string and ignore dev metadata.MobileSettingsViewusingAppVersionInfofromCmuxMobileSupport(selectable text). Tests cover release/dev formatting.Migration
ios/scripts/bump-ios-version.sh(defaults to patch).ios/scripts/reload.sh --tag <name>to stamp the tag and SHA.Written for commit 5fc8f13. Summary will update on new commits.
Summary by CodeRabbit
New Features
Tests
Chores