From a5f17c2e62a20992ac5f1d7edca291722aea7a72 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Fri, 7 Aug 2026 13:29:37 +1000 Subject: [PATCH 1/2] Pre-allocate trunk's VERSION_SHORT after release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 1 of Jeremy Massel's Faster Releases RFC added per-commit trunk TestFlight builds (#25674), but explicitly deferred the version pre-allocation piece ("VERSION_SHORT left as-is... deferred to go-live"). Without it, trunk keeps the just-shipped VERSION_SHORT until the next code freeze, and any trunk TestFlight upload in that window is rejected by `altool` once Apple closes that version's pre-release train — as happened on trunk starting build #33637. `create_backmerge_pr` gains a `pre_allocate_trunk_version` option, wired up only from `finalize_release` (never `finalize_hotfix_release`, since a hotfix doesn't own trunk's currently-open line). It uses the `create_release_backmerge_pull_request` action's existing `intermediate_branch_created_callback` hook to bump trunk's `VERSION_SHORT` to the next release version as part of the backmerge, instead of letting the merge carry back the release branch's now-closed version. `code_freeze` now reads that pre-allocated value directly (`release_version_current`) instead of deriving `+1` from it (`release_version_next`) — otherwise the next freeze would derive one version too many and silently skip a release number. RFC: https://wpmobilep2.wordpress.com/2026/05/13/rfc-faster-releases-for-wordpress-and-jetpack/ --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Sonnet 5 --- fastlane/lanes/release.rb | 40 ++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/fastlane/lanes/release.rb b/fastlane/lanes/release.rb index da84756ae3c5..dcf95499a629 100644 --- a/fastlane/lanes/release.rb +++ b/fastlane/lanes/release.rb @@ -19,15 +19,15 @@ # Check out the up-to-date default branch, the designated starting point for the code freeze Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH) - # If a new version is passed, use it as source of truth from now on - new_version = version || release_version_next + # If a new version is passed, use it as source of truth from now on. Otherwise, trunk's + # VERSION_SHORT is already pre-allocated to the version being frozen (see + # `bump_trunk_version_after_backmerge`), so read it as-is rather than deriving `+1` from it. + new_version = version || release_version_current release_branch_name = compute_release_branch_name(options: { version: new_version, skip_confirm: skip_confirm }, version: new_version) new_build_code = build_code_code_freeze(version_short: new_version) ensure_branch_does_not_exist!(release_branch_name) - # The `release_version_next` is used as the `new internal release version` value because the external and internal - # release versions are always the same. message = <<~MESSAGE Code Freeze: @@ -410,7 +410,7 @@ trigger_release_build - pr_url = create_backmerge_pr + pr_url = create_backmerge_pr(pre_allocate_trunk_version: true) message = <<~MESSAGE Release successfully finalized. Next, review and merge the [integration PR](#{pr_url}). MESSAGE @@ -586,13 +586,20 @@ def commit_version_and_build_files ) end -def create_backmerge_pr(source_branch: release_branch_name, target_branch: nil) +# @param [Boolean] pre_allocate_trunk_version When true (only for a regular release, never a +# hotfix), pre-allocates `trunk`'s `VERSION_SHORT` to the next release version as part of the +# backmerge, so trunk never carries a version whose train Apple has closed for new submissions. +# See `bump_trunk_version_after_backmerge`. +def create_backmerge_pr(source_branch: release_branch_name, target_branch: nil, pre_allocate_trunk_version: false) + callback = pre_allocate_trunk_version ? method(:bump_trunk_version_after_backmerge).to_proc : nil + pr_url = create_release_backmerge_pull_request( repository: GITHUB_REPO, source_branch: source_branch, target_branches: Array(target_branch), labels: ['Releases'], - milestone_title: release_version_next + milestone_title: release_version_next, + intermediate_branch_created_callback: callback ) rescue StandardError => e error_message = <<-MESSAGE @@ -611,6 +618,25 @@ def create_backmerge_pr(source_branch: release_branch_name, target_branch: nil) pr_url end +# Pre-allocates trunk's `VERSION_SHORT` to the next release version, as the last step of the +# release backmerge (see `create_backmerge_pr`). No-ops for any target branch other than trunk — +# a backmerge can also target a newer, already-versioned release branch. +# +# Runs on the backmerge's intermediate branch, checked out from the release branch being +# finalized — so `release_version_next` here computes the version after it. +def bump_trunk_version_after_backmerge(base_branch, _intermediate_branch) + return unless base_branch == DEFAULT_BRANCH + + next_trunk_version = release_version_next + UI.message("Pre-allocating trunk's VERSION_SHORT to #{next_trunk_version}...") + + PUBLIC_VERSION_FILE.write( + version_short: next_trunk_version, + version_long: build_code_code_freeze(version_short: next_trunk_version) + ) + commit_version_and_build_files +end + def ensure_git_branch_is_release_branch! # Verify that the current branch is a release branch. Notice that `ensure_git_branch` expects a RegEx parameter ensure_git_branch(branch: '^release/') From 3fa24af77a091418c48b00fa8e509d5f3db7c595 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Fri, 7 Aug 2026 13:29:42 +1000 Subject: [PATCH 2/2] Bump trunk to 27.2, unblocking TestFlight uploads 27.1 shipped and Apple closed its pre-release train, so every trunk TestFlight upload since has failed with "Invalid Pre-Release Train" (`altool`). This one-time bump seeds the pre-allocation invariant just added in the previous commit for a version that shipped before it existed. Only safe together with that commit: without the `code_freeze` change there, the next freeze would derive `27.3` from this value and skip `27.2` as an actual release. --- Generated with the help of Claude Code, https://claude.ai/code Co-Authored-By: Claude Sonnet 5 --- config/Version.public.xcconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/Version.public.xcconfig b/config/Version.public.xcconfig index 01cc16b178d3..9ff37d323585 100644 --- a/config/Version.public.xcconfig +++ b/config/Version.public.xcconfig @@ -1,2 +1,2 @@ -VERSION_LONG = 27.1.0.4 -VERSION_SHORT = 27.1 +VERSION_LONG = 27.2.0.0 +VERSION_SHORT = 27.2