Skip to content

Commit 42cee9e

Browse files
committed
Update code freeze version mismatch validation to fail build instead of just showing a warning
1 parent 3692a44 commit 42cee9e

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

fastlane/Fastfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,17 @@ platform :android do
125125
computed_version = release_version_next
126126
new_version = version || computed_version
127127

128-
# Warn if provided version differs from computed version
128+
# Fail if provided version differs from computed version
129129
if version && version != computed_version
130-
warning_message = <<~WARNING
131-
⚠️ Version mismatch: The explicitly-provided version was '#{version}' while new computed version would have been '#{computed_version}'.
132-
If this is unexpected, you might want to investigate the discrepency.
133-
Continuing with the explicitly-provided verison '#{version}'.
134-
WARNING
135-
UI.important(warning_message)
136-
buildkite_annotate(style: 'warning', context: 'start-code-freeze-version-mismatch', message: warning_message) if is_ci
130+
error_message = <<~ERROR
131+
❌ Version mismatch detected!
132+
133+
The explicitly-provided version from the release tool is '#{version}' but the computed version from the codebase is '#{computed_version}'.
134+
135+
This mismatch must be resolved before proceeding with the code freeze. Please investigate and ensure the versions are aligned.
136+
ERROR
137+
buildkite_annotate(style: 'error', context: 'start-code-freeze-version-mismatch', message: error_message) if is_ci
138+
UI.user_error!(error_message)
137139
end
138140

139141
message = <<-MESSAGE

0 commit comments

Comments
 (0)