-
Notifications
You must be signed in to change notification settings - Fork 9
Add named params and yard docs to create_milestone
method at GithubHelper
#426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AliSoftware
merged 11 commits into
wordpress-mobile:trunk
from
raafaelima:add/named-params-create-milestone
Nov 17, 2022
Merged
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
66ccfcf
GithubHelperSpec: Add Yard Docs and Named Parameters to create_milest…
raafaelima b658f87
CreateNewMilestoneAction: Adds named parameters to create_milestone G…
raafaelima 10528de
GithubHelper#create_milestone: Rephrase yard docs
raafaelima 255d108
GithubHelper#create_milestone: Rename parameters to be more descriptive
raafaelima 99a95ac
CreateNewMilestoneAction: Rephrase comment about release times to be …
raafaelima 39b23c8
GithubHelper#create_milestone: Add unit tests and validation to date …
raafaelima 0750081
Merge branch 'trunk' into add/named-params-create-milestone
raafaelima b218ccc
GithubHelper: Fix Timezone changes unit tests
raafaelima de90d4d
GithubHelper: Adds more unit tests to validate the Timezone changes
raafaelima d87c03c
GithubHelper: Fix Rubocop Issues
raafaelima 7f99d51
GithubHelperSpec: Adds comments to DST cases to be more clear and new…
raafaelima File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter names seems a bit of a mouthful to me, given we already know from the context (of them being parameters of
create_milestone
) that those are about new milestones.For example, what about naming the parameters just
title
,due_date
,duration
, anddays_until_release
?Though a probably even nicer solution, especially because
duration
andneed_submission
are only used once and are kind of exclusive (i.e. either we passneed_submission: false
and thenduration
doesn't matter, or we passneed_submission: true
and that's only whenduration
is used…), we should probably combine the goal of the two parameters into a single one there, which would bedays_until_submission
, and let the caller pass to this value.Given that, I suggest the following new API for this helper method:
Then:
create_new_milestone_action
would just do the computation on its end, i.e. passparams[:need_appstore_submission] ? number_of_days_from_code_freeze_to_release - 3 : milestone_duration
for the newdays_until_submission
parameter of thisGithubHelper#create_milestone
, carrying over the "Using 3 days mostly for historical reasons" logic from lines 88-89 for nowcreate_new_milestone
action itself one day, we would then be able to update itsConfigItem
(in a breaking-change way) to have the callers also directly provide thedays_until_submission
anddays_until_release
values in theirFastfile
's call sites instead ofduration
and/orneed_submission
But for now, that change would make for a nicer and easier to read and understand API for the internal
GithubHelper#create_milestone
, all while preparing for the future of the planned refactor of the corresponding action and public API.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure, those parameters that are in place are big!
I'll address those changes, thanks for the input 😄