Skip to content

Add some docs for getting the status of a merge_request rebase #1776

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
merged 2 commits into from
Dec 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/api-objects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ API examples
gl_objects/labels
gl_objects/notifications
gl_objects/merge_trains
gl_objects/mrs
gl_objects/mr_approvals
gl_objects/merge_requests
gl_objects/merge_request_approvals.rst
gl_objects/milestones
gl_objects/namespaces
gl_objects/notes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ Attempt to rebase an MR::

mr.rebase()

Get status of a rebase for an MR::

mr = project.mergerequests.get(mr_id, include_rebase_in_progress=True)
print(mr.rebase_in_progress, mr.merge_error)

For more info see:
https://docs.gitlab.com/ee/api/merge_requests.html#rebase-a-merge-request

Attempt to merge changes between source and target branch::

response = mr.merge_ref()
Expand Down
5 changes: 5 additions & 0 deletions gitlab/v4/objects/merge_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ class ProjectMergeRequestManager(CRUDMixin, RESTManager):
_path = "/projects/{project_id}/merge_requests"
_obj_cls = ProjectMergeRequest
_from_parent_attrs = {"project_id": "id"}
_optional_get_attrs = (
"render_html",
"include_diverged_commits_count",
"include_rebase_in_progress",
)
_create_attrs = RequiredOptional(
required=("source_branch", "target_branch", "title"),
optional=(
Expand Down