Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add support for issue.related_merge_requests#803

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
max-wittig merged 1 commit intomasterfromfeat/related_mr
Jul 1, 2019
Merged
Show file tree
Hide file tree
Changes fromall 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: 4 additions & 0 deletionsdocs/gl_objects/issues.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -180,6 +180,10 @@ Get the list of merge requests that will close an issue when merged::

mrs = issue.closed_by()

Get the merge requests related to an issue::

mrs = issue.related_merge_requests()

Get the list of participants::

users = issue.participants()
Expand Down
18 changes: 18 additions & 0 deletionsgitlab/v4/objects.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2186,6 +2186,24 @@ def move(self, to_project_id, **kwargs):
server_data = self.manager.gitlab.http_post(path, post_data=data, **kwargs)
self._update_attrs(server_data)

@cli.register_custom_action("ProjectIssue")
@exc.on_http_error(exc.GitlabGetError)
def related_merge_requests(self, **kwargs):
"""List merge requests related to the issue.

Args:
**kwargs: Extra options to send to the server (e.g. sudo)

Raises:
GitlabAuthenticationError: If authentication is not correct
GitlabGetErrot: If the merge requests could not be retrieved

Returns:
list: The list of merge requests.
"""
path = "%s/%s/related_merge_requests" % (self.manager.path, self.get_id())
return self.manager.gitlab.http_get(path, **kwargs)

@cli.register_custom_action("ProjectIssue")
@exc.on_http_error(exc.GitlabGetError)
def closed_by(self, **kwargs):
Expand Down
2 changes: 2 additions & 0 deletionstools/python_test_v4.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -566,6 +566,8 @@

assert issue1.user_agent_detail()["user_agent"]
assert issue1.participants()
assert type(issue1.closed_by()) == list
assert type(issue1.related_merge_requests()) == list

# issues labels and events
label2 = admin_project.labels.create({"name": "label2", "color": "#aabbcc"})
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp