Skip to content

Conversation

@iangmaia
Copy link
Contributor

@iangmaia iangmaia commented Oct 30, 2025

See AINFRA-1478

Description

This PR enhances the version handling added in the previous iteration to assume the version received by the code freeze lane as the source of truth, ignoring potential mismatches between the ReleasesV2 version and the project's computed version.

Testing

You can make sure the calculated release branch, current version and the next version are correctly shown in the "Continue" prompt, rememberomg to answer N when asked to continue to cancel the code freeze.

To avoid unexpected results, comment out the lines doing ensure_git_status_clean and Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH) at the beginning of the lane.

You can run the code_freeze lane, with and without the version parameters:

  • Run bundle exec fastlane code_freeze
  • Run bundle exec fastlane code_freeze version:30.6

This will be fully tested in the next release cycle during code freeze.

@iangmaia iangmaia self-assigned this Oct 31, 2025
@iangmaia iangmaia added this to the 26.4 milestone Oct 31, 2025
@iangmaia iangmaia force-pushed the iangmaia/fail-when-code-freeze-version-mismatch branch from 92ad71d to 4ee319c Compare October 31, 2025 22:23
@iangmaia iangmaia marked this pull request as ready for review October 31, 2025 22:26
@iangmaia iangmaia force-pushed the iangmaia/fail-when-code-freeze-version-mismatch branch from 4ee319c to f6b5eb1 Compare November 7, 2025 15:18
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 26.4. This milestone is due in less than 4 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@iangmaia iangmaia changed the title [Tooling] Fail on Version Mismatch Between ReleasesV2 and Project [Tooling] Use ReleasesV2 version as the source of truth during Code Freeze Nov 7, 2025
@iangmaia iangmaia force-pushed the iangmaia/fail-when-code-freeze-version-mismatch branch from 760d9e8 to 077ed62 Compare November 7, 2025 21:42
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 7, 2025

@twstokes
Copy link
Contributor

I applied the following patch:

diff --git a/fastlane/lanes/release.rb b/fastlane/lanes/release.rb
index 9d234d8032c..98b8d7f3c03 100644
--- a/fastlane/lanes/release.rb
+++ b/fastlane/lanes/release.rb
@@ -8,9 +8,9 @@ platform :android do
   # @param [Boolean] skip_confirm Whether to skip the confirmation prompt
   #
   lane :code_freeze do |version: nil, skip_confirm: false|
-    ensure_git_status_clean
+    #ensure_git_status_clean
 
-    Fastlane::Helper::GitHelper.checkout_and_pull(DEFAULT_BRANCH)
+    #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 || next_release_version

and ran bundle exec fastlane code_freeze and got:

      Code Freeze:
      • New release branch from trunk: release/26.4

      • Current release version and build code: 26.3 (1477).
      • New release version and build code: 26.4-rc-1 (1478).

Running bundle exec fastlane code_freeze version:30.6 gave me:

      Code Freeze:
      • New release branch from trunk: release/30.6

      • Current release version and build code: 26.3 (1477).
      • New release version and build code: 30.6-rc-1 (1478).

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.

4 participants