Skip to content

Commit 1f9b972

Browse files
authored
Merge pull request #443 from iangmaia/cleanup/remove-skip-glotpress-issue-372
Remove `skip_glotpress` and related cleanup
2 parents 24b44ab + 7449556 commit 1f9b972

File tree

3 files changed

+50
-22
lines changed

3 files changed

+50
-22
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
### Breaking Changes
88

9-
_None_
9+
- Remove the `skip_glotpress` parameter from the `ios_bump_version_release` action [#443]
1010

1111
### New Features
1212

lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb

+3-21
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ def self.run(params)
2121
Fastlane::Helper::GitHelper.create_branch(@new_release_branch, from: default_branch)
2222
UI.message 'Done!'
2323

24-
UI.message 'Updating glotPressKeys...' unless params[:skip_glotpress]
25-
update_glotpress_key unless params[:skip_glotpress]
26-
UI.message 'Done' unless params[:skip_glotpress]
27-
2824
UI.message 'Updating Fastlane deliver file...' unless params[:skip_deliver]
2925
Fastlane::Helper::Ios::VersionHelper.update_fastlane_deliver(@new_short_version) unless params[:skip_deliver]
3026
UI.message 'Done!' unless params[:skip_deliver]
@@ -35,7 +31,7 @@ def self.run(params)
3531

3632
Fastlane::Helper::Ios::GitHelper.commit_version_bump(
3733
include_deliverfile: !params[:skip_deliver],
38-
include_metadata: !params[:skip_glotpress]
34+
include_metadata: false
3935
)
4036

4137
UI.message 'Done.'
@@ -55,16 +51,11 @@ def self.details
5551

5652
def self.available_options
5753
[
58-
FastlaneCore::ConfigItem.new(key: :skip_glotpress,
59-
env_name: 'FL_IOS_CODEFREEZE_BUMP_SKIPGLOTPRESS',
60-
description: 'Skips GlotPress key update',
61-
is_string: false, # true: verifies the input is a string, false: every kind of value
62-
default_value: false), # the default value if the user didn't provide one
6354
FastlaneCore::ConfigItem.new(key: :skip_deliver,
6455
env_name: 'FL_IOS_CODEFREEZE_BUMP_SKIPDELIVER',
6556
description: 'Skips Deliver key update',
66-
is_string: false, # true: verifies the input is a string, false: every kind of value
67-
default_value: false), # the default value if the user didn't provide one
57+
type: Boolean,
58+
default_value: false),
6859
FastlaneCore::ConfigItem.new(key: :default_branch,
6960
env_name: 'FL_RELEASE_TOOLKIT_DEFAULT_BRANCH',
7061
description: 'Default branch of the repository',
@@ -105,15 +96,6 @@ def self.show_config
10596
UI.message("New short version: #{@new_short_version}")
10697
UI.message("Release branch: #{@new_release_branch}")
10798
end
108-
109-
def self.update_glotpress_key
110-
dm_file = ENV['DOWNLOAD_METADATA']
111-
if File.exist?(dm_file)
112-
sh("sed -i '' \"s/let glotPressWhatsNewKey.*/let glotPressWhatsNewKey = \\\"v#{@new_short_version}-whats-new\\\"/\" #{dm_file}")
113-
else
114-
UI.user_error!("Can't find #{dm_file}.")
115-
end
116-
end
11799
end
118100
end
119101
end

spec/ios_bump_version_release_spec.rb

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
require 'spec_helper'
2+
3+
describe Fastlane::Actions::IosBumpVersionReleaseAction do
4+
let(:default_branch) { 'my_new_branch' }
5+
let(:versions) { ['6.30'] }
6+
let(:next_version) { '6.31.0.0' }
7+
let(:next_version_short) { '6.31' }
8+
9+
describe 'creates the release branch, bumps the app version and commits the changes' do
10+
before do
11+
other_action_mock = double()
12+
allow(Fastlane::Action).to receive(:other_action).and_return(other_action_mock)
13+
allow(other_action_mock).to receive(:ensure_git_branch).with(branch: default_branch)
14+
15+
allow(Fastlane::Helper::GitHelper).to receive(:checkout_and_pull).with(default_branch)
16+
allow(Fastlane::Helper::GitHelper).to receive(:create_branch).with("release/#{next_version_short}", from: default_branch)
17+
18+
allow(Fastlane::Helper::Ios::VersionHelper).to receive(:get_version_strings).and_return(versions)
19+
allow(Fastlane::Helper::Ios::VersionHelper).to receive(:update_xc_configs).with(next_version, next_version_short, nil)
20+
end
21+
22+
it 'does the fastlane deliver update' do
23+
skip_deliver = false
24+
25+
expect(Fastlane::Helper::Ios::VersionHelper).to receive(:update_fastlane_deliver).with(next_version_short)
26+
expect(Fastlane::Helper::Ios::GitHelper).to receive(:commit_version_bump).with(include_deliverfile: !skip_deliver, include_metadata: false)
27+
28+
run_described_fastlane_action(
29+
skip_deliver: skip_deliver,
30+
default_branch: default_branch
31+
)
32+
end
33+
34+
it 'skips the fastlane deliver update properly' do
35+
skip_deliver = true
36+
37+
expect(Fastlane::Helper::Ios::VersionHelper).not_to receive(:update_fastlane_deliver)
38+
expect(Fastlane::Helper::Ios::GitHelper).to receive(:commit_version_bump).with(include_deliverfile: !skip_deliver, include_metadata: false)
39+
40+
run_described_fastlane_action(
41+
skip_deliver: skip_deliver,
42+
default_branch: default_branch
43+
)
44+
end
45+
end
46+
end

0 commit comments

Comments
 (0)