-
-
Notifications
You must be signed in to change notification settings - Fork 400
Merge request Approvals API #393
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
Conversation
| # @param [Integer] project(required) The ID of a project. | ||
| # @param [Integer] merge_request(required) The IID of a merge_request. | ||
| # @return [Gitlab::ObjectifiedHash] MR approval configuration information about the merge request | ||
| def merge_request_mr_approvals_configuration(project, merge_request) |
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.
Do we need the prefix to be merge_request_mr? I think merge_request would be sufficient.
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 thought crossed my mind. But since we are maintaining two levels of MR approvals, one at the project level as well as one at the Merge Request Level, this seemed more intuitive to differentiate between the two.
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.
So should I edit it or its OK ?
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'm not a maintainer ;) I just came about your MR and am using your code myself. Seems this project is not so actively maintained.
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.
okay @asedge , any chance this gets merged ?
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.
merge_request_approvals would be more consistent with other method naming.
asedge
left a comment
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 provided some feedback on how I think the method names could be changed so they more closely match what we've done elsewhere.
| # | ||
| # @param [Integer] project The ID of a project. | ||
| # @return [Gitlab::ObjectifiedHash] MR approval configuration information about the project | ||
| def project_mr_approvals_configuration(project) |
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.
project_merge_request_approvals would more closely follow the method naming pattern we have elsewhere.
| # @option options [Boolean] :reset_approvals_on_push(optional) Reset approvals on a new push | ||
| # @option options [Boolean] :disable_overriding_approvers_per_merge_request(optional) Allow/Disallow overriding approvers per MR | ||
| # @return [Gitlab::ObjectifiedHash] MR approval configuration information about the project | ||
| def change_project_mr_approvals_configuration(project, options = {}) |
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.
edit_project_merge_request_approvals - we use methods starting with edit when resources are changed, I think we should stay consistent.
| # @option options [Array] :approver_ids(optional) An array of User IDs that can approve MRs | ||
| # @option options [Array] :approver_group_ids(optional) An array of Group IDs whose members can approve MRs | ||
| # @return [Gitlab::ObjectifiedHash] MR approval configuration information about the project | ||
| def change_project_approvers(project, options = {}) |
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.
edit_project_approvers
| # @param [Integer] merge_request(required) The IID of a merge_request. | ||
| # @option options [Integer] :approvals_required(required) Approvals required before MR can be merged | ||
| # @return [Gitlab::ObjectifiedHash] Updated MR approval configuration information about the merge request | ||
| def change_merge_request_mr_approvals_configuration(project, merge_request, options = {}) |
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.
edit_merge_request_approvals
| # @option options [Array] :approver_ids(optional) An array of User IDs that can approve MRs | ||
| # @option options [Array] :approver_group_ids(optional) An array of Group IDs whose members can approve MRs | ||
| # @return [Gitlab::ObjectifiedHash] MR approval configuration information about the project | ||
| def change_merge_request_approvers(project, merge_request, options = {}) |
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.
edit_merge_request_approvers
| # | ||
| # @param [Integer] project(required) The ID of a project. | ||
| # @param [Integer] merge_request(required) The IID of a merge request. | ||
| # @option options [String] :sha(required) The HEAD of the MR |
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.
API docs say this isn't required: https://docs.gitlab.com/ee/api/merge_request_approvals.html#approve-merge-request
| # @param [Integer] project(required) The ID of a project. | ||
| # @param [Integer] merge_request(required) The IID of a merge_request. | ||
| # @return [Gitlab::ObjectifiedHash] MR approval configuration information about the merge request | ||
| def merge_request_mr_approvals_configuration(project, merge_request) |
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.
merge_request_approvals would be more consistent with other method naming.
|
@asedge Would it be possible to release a new gem version with that change? |
Closes #392