-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor update_pull_requests_milestone
to update_assigned_milestone
#547
Conversation
This is not limited to PRs but should also cover issues
cc @mokagio FYI as I think you're the only one, besides Tumblr mobile repos, to have started using this action. |
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/update_assigned_milestone_action.rb
Outdated
Show resolved
Hide resolved
lib/fastlane/plugin/wpmreleasetoolkit/actions/common/update_assigned_milestone_action.rb
Outdated
Show resolved
Hide resolved
@@ -3,68 +3,68 @@ | |||
|
|||
module Fastlane | |||
module Actions | |||
class UpdatePullRequestsMilestoneAction < Action | |||
class UpdateAssignedMilestoneAction < Action |
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.
Again naming 😅
In one hand it is easy to first think "assigned to what?", but at the same time, I think you can only assign a milestone to PRs and issues? In any case, I wonder if being more explicit (e.g. UpdatePullRequestsAndIssuesAssignedMilestoneAction
) wouldn't make it clearer.
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.
I think you can only assign a milestone to PRs and issues?
Indeed.
I wonder if being more explicit (e.g. UpdatePullRequestsAndIssuesAssignedMilestoneAction) wouldn't make it clearer
Yeah, but tbh the pull_requests
in the original name already felt like a mouthful, so update_pull_requests_and_issues_milestone
felt a bit too long as well…
But open to continue brainstorming on ideas if you have other suggestions 👍
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.
And thinking a bit more, perhaps Assigned
is redundant 🤔
What about:
MilestoneUpdaterAction
/MilestoneUpdateAction
/UpdateMilestoneAction
UpdatePullRequestsAndIssuesMilestoneAction
UpdateMilestoneForPullRequestsAndIssuesAction
MilestoneIssueUpdateAction
(considering PRs are also issues, though that might be less obvious at first glance)
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.
[Approved the PR; feel free to merge it if you don't feel any of these or another variation improves the current name; I don't feel very strongly about it, but thought we could perhaps find a more fitting one]
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.
- I thought about
upldate_milestone
/milestone_update
but the problem with that naming is that it suggests that the action updates the milestone… as in the milestone's own title or due date, etc. - The 2nd and 3rd suggestion have the same problem as mentioned in above comment: they're a bit of a mouthful 😓
- I also thought about using just "issue" in the wording, considering that in the GitHub API parlance, pull requests are also issues (and the search API includes both issues and PRs when using
type:issue
)… But I felt like this was not obvious enough, especially as in common parlance when we talk about "GitHub Issues" we don't usually mean to include PRs. And as a result, I feel like including "issue" in the action name… might actually have the opposite effect of adding confusion, letting users of the action believe that it would only act on issues but not on PRs…
Boy, naming is hard 😅
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.
Found myself here from a "call for input" on Slack, but I only looked at this specific discussion. Hope my thoughts will prove useful!
I think the original name UpdateAssignedMilestoneAction
is good and descriptive.
I agree with @AliSoftware that calling it UpdateMilestoneAction
would be interpreted as updating the milestone itself, which means calling this API endpoint that GitHub also titles as Update a milestone
.
The current action instead calls the updating issue GitHub endpoint, but it only handles the milestone
. Since it's handling a single endpoint and there is really nothing else you can assign a milestone to, I think adding the Assigned
is all we need.
Alternative could be UpdateIssueMilestoneAction
or UpdateMilestoneForIssueAction
, but I don't like these as much.
I also don't think the phrase pull request
is necessary to include in the name. In GitHub, pull request
is a type of issue, it's not a separate thing. When we do use pull request
, I think we should do it because it only handles the pull request
type, the same way this specific action only handles the milestone
of the issue.
Co-authored-by: Ian Guedes Maia <[email protected]>
What & Why
This updates the
update_pull_requests_milestone
action so it also includes issues when fetching the list of things to update the milestone of, not just PRs.Since the action's name and parameters are too related with the "PR" wording, and we already have a breaking change in the
CHANGELOG
pending to be released (making the next version a major bump anyway), I've decided to use the occasion to rename the action and its parameters to make them more agnostic to the "PR" wording and be more generic:update_pull_requests_milestone
toupdate_assigned_milestone
pr_numbers
parameter tonumbers
pr_comment
parameter tocomment
Checklist before requesting a review
bundle exec rubocop
to test for code style violations and recommendationsspecs/*_spec.rb
) if applicablebundle exec rspec
to run the whole test suite and ensure all your tests passCHANGELOG.md
file to describe your changes under the appropriate existing###
subsection of the existing## Trunk
section.MIGRATION.md
file to describe how the changes will affect the migration from the previous major version and what the clients will need to change and consider.