Skip to content

バージョンバンプでWearOSアプリのversionCodeも本体アプリ+1に追従させ衝突を解消 - #6616

Merged
TinyKitten merged 1 commit into
devfrom
fix/bump-version-wearable
Aug 9, 2026
Merged

TinyKitten merged 1 commit into
devfrom
fix/bump-version-wearable

Conversation

@TinyKitten

Copy link
Copy Markdown
Member

概要

scripts/bump-version.js が android/wearable/build.gradle.kts を更新対象に含んでいなかったため、バージョンバンプで :app の versionCode だけが進み、:wearable との大小関係が壊れる問題を修正します。

canary リリースの bump (#6615) で :app が 100000579 → 100000580 に上がった結果、:wearable の 100000580 と完全に同値になっていました。同一 applicationId のマルチバンドル配信では versionCode が全体でユニークである必要があるため、この状態では Play が一方のアップロードを拒否します。

変更の種類

  • バグ修正
  • 新機能
  • リファクタリング
  • ドキュメント
  • CI/CD
  • その他

変更内容

  • scripts/bump-version.js が :wearable の versionCode を常に「:app の versionCode + 1」に更新するよう拡張(versionName も同期)
  • Kotlin DSL 用の置換関数 replaceKtsFlavorNumericSetting / replaceKtsFlavorStringSetting を追加
  • 現在発生している衝突を解消(:wearable を 100000580 → 100000581)
  • 手動 bump を前提としていた :wearable 側のコメントを、スクリプトが自動追従する旨に更新

なぜ再発したか

#6613 で wear = app + 1 の採番規約を復元しましたが、bump-version.js の更新対象は以下 3 ファイルのみで :wearable を含んでいませんでした。

  • app.config.ts
  • ios/TrainLCD.xcodeproj/project.pbxproj
  • android/app/build.gradle

そのため bump が 1 回走るだけで +1 の差が食い潰され、規約が構造的に維持できない状態でした。今回スクリプト側で機械的に追従させることで、canary / release どちらの bump でも規約が保たれます。

:wearable は Kotlin DSL のため Groovy 側 (versionCode 1) と構文が異なり (create("prod") { versionCode = 1 })、既存の置換関数が使えないので専用実装を追加しています。versionName\b の \b は versionNameSuffix への誤マッチを防ぐためのものです。

回帰リスクと対策

  • スクリプトの実挙動を確認済み: node scripts/bump-version.js 10.12.1 を実行し、:app 100000580 → 100000581、:wearable 100000581 → 100000582(= app + 1)、versionName 両者 10.12.1 に更新されることを確認(検証後に bump 分は revert し、本 PR には含めていません)。
  • 現在値が同値・逆転していても矯正される: nextWearableVersionCode は :app の次値から算出するため、:wearable の現在値に依存しません。
  • Wear モジュールが見つからない場合は例外で停止: 黙って skip すると今回と同じ事故が起きるため、意図的に loud failure にしています。
  • scripts/ は npm run lint のスコープ外(biome check ./src)。参考として npx biome check scripts/bump-version.js を実行したところ 6 件の指摘が出ますが、修正前の HEAD 版とルール・件数が完全に一致(行番号のみシフト)しており、本 PR による新規指摘は 0 件です。既存指摘(require('fs') の node: プロトコル、未使用の toNumberOrZero 等)は本 PR のスコープ外としました。

テスト

npm run lint / npm test / npm run typecheck に加え、以下を確認しました。

確認項目 結果
node scripts/bump-version.js 10.12.1 :app 581 / :wearable 582 / versionName 10.12.1 に更新
./gradlew :wearable:bundleProdRelease BUILD SUCCESSFUL
生成 AAB のマニフェスト versionCode=100000581 / versionName=10.12.0
  • npm run lint が通ること
  • npm test が通ること
  • npm run typecheck が通ること

関連Issue

スクリーンショット(任意)

@TinyKitten TinyKitten self-assigned this Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 23 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5a7ebb3e-10c8-4cea-af7f-8672c46c15df

📥 Commits

Reviewing files that changed from the base of the PR and between dcfb265 and 70dfe84.

📒 Files selected for processing (2)
  • android/wearable/build.gradle.kts
  • scripts/bump-version.js

Comment @coderabbitai help to get the list of available commands.

@TinyKitten
TinyKitten merged commit 34a1b0c into dev Aug 9, 2026
4 checks passed
@TinyKitten
TinyKitten deleted the fix/bump-version-wearable branch August 9, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant