Skip to content

Commit cad485b

Browse files
committed
Adds number of days from code freeze to release for milestone creation
1 parent ff64ff9 commit cad485b

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ def self.run(params)
1212
last_stone = Fastlane::Helper::GithubHelper.get_last_milestone(repository)
1313
UI.message("Last detected milestone: #{last_stone[:title]} due on #{last_stone[:due_on]}.")
1414
milestone_duedate = last_stone[:due_on]
15-
newmilestone_duration = params[:milestone_duration]
16-
newmilestone_duedate = (milestone_duedate.to_datetime.next_day(newmilestone_duration).to_time).utc
15+
milestone_duration = params[:milestone_duration]
16+
newmilestone_duedate = (milestone_duedate.to_datetime.next_day(milestone_duration).to_time).utc
1717
newmilestone_number = Fastlane::Helper::Ios::VersionHelper.calc_next_release_version(last_stone[:title])
18+
number_of_days_from_code_freeze_to_release = params[:number_of_days_from_code_freeze_to_release]
1819
UI.message("Next milestone: #{newmilestone_number} due on #{newmilestone_duedate}.")
19-
Fastlane::Helper::GithubHelper.create_milestone(repository, newmilestone_number, newmilestone_duedate, newmilestone_duration, params[:need_appstore_submission])
20+
Fastlane::Helper::GithubHelper.create_milestone(repository, newmilestone_number, newmilestone_duedate, milestone_duration, number_of_days_from_code_freeze_to_release, params[:need_appstore_submission])
2021
end
2122

2223
def self.description
@@ -55,6 +56,12 @@ def self.available_options
5556
optional: true,
5657
is_string: false,
5758
default_value: 14),
59+
FastlaneCore::ConfigItem.new(key: :number_of_days_from_code_freeze_to_release,
60+
env_name: 'GHHELPER_NUMBER_OF_DAYS_FROM_CODE_FREEZE_TO_RELEASE',
61+
description: 'Number of days from code freeze to release',
62+
optional: true,
63+
is_string: false,
64+
default_value: 14),
5865
]
5966
end
6067

lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ def self.get_last_milestone(repository)
8080
last_stone
8181
end
8282

83-
def self.create_milestone(repository, newmilestone_number, newmilestone_duedate, newmilestone_duration, need_submission)
83+
def self.create_milestone(repository, newmilestone_number, newmilestone_duedate, newmilestone_duration, number_of_days_from_code_freeze_to_release, need_submission)
8484
# If there is a review process, we want to submit the binary 3 days before its release
8585
#
8686
# Using 3 days is mostly for historical reasons where we release the apps on Monday and submit them on Friday.
87-
days_until_submission = need_submission ? (newmilestone_duration - 3) : newmilestone_duration
87+
days_until_submission = need_submission ? (number_of_days_from_code_freeze_to_release - 3) : newmilestone_duration
8888
submission_date = newmilestone_duedate.to_datetime.next_day(days_until_submission)
89-
release_date = newmilestone_duedate.to_datetime.next_day(newmilestone_duration)
89+
release_date = newmilestone_duedate.to_datetime.next_day(number_of_days_from_code_freeze_to_release)
9090
comment = "Code freeze: #{newmilestone_duedate.to_datetime.strftime('%B %d, %Y')} App Store submission: #{submission_date.strftime('%B %d, %Y')} Release: #{release_date.strftime('%B %d, %Y')}"
9191

9292
options = {}

0 commit comments

Comments
 (0)