Skip to content

Commit ab3d6db

Browse files
authored
Merge pull request #288 from wordpress-mobile/fix/hotfix-actions
Fix hotfix actions
2 parents 4045134 + 483679e commit ab3d6db

File tree

3 files changed

+18
-20
lines changed

3 files changed

+18
-20
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ _None_
1414

1515
### Bug Fixes
1616

17-
Fixes a bug that was breaking the `promo_screenshots` helper [#276]
17+
* Fixes a bug that was breaking the `promo_screenshots` helper [#276]
18+
* Fix crashes in actions dealing with hotfixes. [#288]
1819

1920
### Internal Changes
2021

21-
Update the `BigDecimal` and `ActiveSupport` gems to clean up our `Gemfile` and improve future compatibility.
22+
* Update the `BigDecimal` and `ActiveSupport` gems to clean up our `Gemfile` and improve future compatibility.
2223

2324
## 1.3.1
2425

lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ def self.run(params)
1010
app = params[:app]
1111

1212
current_version = Fastlane::Helper::Android::VersionHelper.get_release_version(product_name: app)
13-
current_version_alpha = Fastlane::Helper::Android::VersionHelper.get_alpha_version(app)
14-
new_version = Fastlane::Helper::Android::VersionHelper.calc_next_hotfix_version(params[:version_name], params[:version_code])
15-
new_short_version = new_version_name
16-
new_release_branch = "release/#{new_short_version}"
13+
new_version = Fastlane::Helper::Android::VersionHelper.calc_next_hotfix_version(params[:version_name], params[:version_code]) # NOTE: this just puts the name/code values in a tuple, unchanged (no actual calc/bumping)
14+
new_release_branch = "release/#{params[:version_name]}"
1715

18-
UI.message("Current version[#{app}]: #{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{current_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]})")
19-
UI.message("New hotfix version[#{app}]: #{new_version[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]}(#{new_version[Fastlane::Helper::Android::VersionHelper::VERSION_CODE]})")
16+
name_key = Fastlane::Helper::Android::VersionHelper::VERSION_NAME
17+
code_key = Fastlane::Helper::Android::VersionHelper::VERSION_CODE
18+
UI.message("Current version [#{app}]: #{current_version[name_key]} (#{current_version[code_key]})")
19+
UI.message("New hotfix version[#{app}]: #{new_version[name_key]} (#{new_version[code_key]})")
2020
UI.message("Release branch: #{new_release_branch}")
2121

2222
UI.message 'Updating app version...'
23-
Fastlane::Helper::Android::VersionHelper.update_versions(app, new_version, current_version_alpha)
23+
Fastlane::Helper::Android::VersionHelper.update_versions(app, new_version, nil)
2424
UI.message 'Done!'
2525

2626
Fastlane::Helper::Android::GitHelper.commit_version_bump()
@@ -41,25 +41,22 @@ def self.details
4141
end
4242

4343
def self.available_options
44-
# Define all options your action supports.
45-
46-
# Below a few examples
4744
[
4845
FastlaneCore::ConfigItem.new(key: :version_name,
4946
env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_VERSION',
50-
description: 'The version of the hotfix',
47+
description: 'The version name for the hotfix',
5148
is_string: true),
5249
FastlaneCore::ConfigItem.new(key: :version_code,
5350
env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_CODE',
54-
description: 'The version of the hotfix'),
51+
description: 'The version code for the hotfix'),
5552
FastlaneCore::ConfigItem.new(key: :previous_version_name,
5653
env_name: 'FL_ANDROID_BUMP_VERSION_HOTFIX_PREVIOUS_VERSION',
5754
description: 'The version to branch from',
58-
is_string: true), # the default value if the user didn't provide one
55+
is_string: true),
5956
FastlaneCore::ConfigItem.new(key: :app,
6057
env_name: 'PROJECT_NAME',
6158
description: 'The name of the app to get the release version for',
62-
is_string: true), # true: verifies the input is a string, false: every kind of value
59+
is_string: true),
6360
]
6461
end
6562

lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotifx_prechecks.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def self.run(params)
1414

1515
# Confirm
1616
message = "Requested Hotfix version: #{new_ver}\n"
17-
message << "Branching from: #{prev_ver}\n"
17+
message << "Branching from tag: #{prev_ver}\n"
1818

1919
if params[:skip_confirm]
2020
UI.message(message)
@@ -50,13 +50,13 @@ def self.available_options
5050
[
5151
FastlaneCore::ConfigItem.new(key: :version_name,
5252
env_name: 'FL_ANDROID_HOTFIX_PRECHECKS_VERSION',
53-
description: 'The version to work on', # a short description of this parameter
53+
description: 'The hotfix version number to create',
5454
is_string: true),
5555
FastlaneCore::ConfigItem.new(key: :skip_confirm,
5656
env_name: 'FL_ANDROID_HOTFIX_PRECHECKS_SKIPCONFIRM',
5757
description: 'Skips confirmation',
58-
is_string: false, # true: verifies the input is a string, false: every kind of value
59-
default_value: false), # the default value if the user didn't provide one
58+
is_string: false, # Boolean
59+
default_value: false),
6060
]
6161
end
6262

0 commit comments

Comments
 (0)