| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -180,6 +180,10 @@ Get the list of merge requests that will close an issue when merged:: | |||
| 180 | 180 | ||
| 181 | 181 | mrs = issue.closed_by() | |
| 182 | 182 | ||
| 183 | + Get the merge requests related to an issue:: | ||
| 184 | + | ||
| 185 | + mrs = issue.related_merge_requests() | ||
| 186 | + | ||
| 183 | 187 | Get the list of participants:: | |
| 184 | 188 | ||
| 185 | 189 | users = issue.participants() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2186,6 +2186,24 @@ def move(self, to_project_id, **kwargs): | |||
| 2186 | 2186 | server_data = self.manager.gitlab.http_post(path, post_data=data, **kwargs) | |
| 2187 | 2187 | self._update_attrs(server_data) | |
| 2188 | 2188 | ||
| 2189 | + @cli.register_custom_action("ProjectIssue") | ||
| 2190 | + @exc.on_http_error(exc.GitlabGetError) | ||
| 2191 | + def related_merge_requests(self, **kwargs): | ||
| 2192 | + """List merge requests related to the issue. | ||
| 2193 | + | ||
| 2194 | + Args: | ||
| 2195 | + **kwargs: Extra options to send to the server (e.g. sudo) | ||
| 2196 | + | ||
| 2197 | + Raises: | ||
| 2198 | + GitlabAuthenticationError: If authentication is not correct | ||
| 2199 | + GitlabGetErrot: If the merge requests could not be retrieved | ||
| 2200 | + | ||
| 2201 | + Returns: | ||
| 2202 | + list: The list of merge requests. | ||
| 2203 | + """ | ||
| 2204 | + path = "%s/%s/related_merge_requests" % (self.manager.path, self.get_id()) | ||
| 2205 | + return self.manager.gitlab.http_get(path, **kwargs) | ||
| 2206 | + | ||
| 2189 | 2207 | @cli.register_custom_action("ProjectIssue") | |
| 2190 | 2208 | @exc.on_http_error(exc.GitlabGetError) | |
| 2191 | 2209 | def closed_by(self, **kwargs): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -566,6 +566,8 @@ | |||
| 566 | 566 | ||
| 567 | 567 | assert issue1.user_agent_detail()["user_agent"] | |
| 568 | 568 | assert issue1.participants() | |
| 569 | + assert type(issue1.closed_by()) == list | ||
| 570 | + assert type(issue1.related_merge_requests()) == list | ||
| 569 | 571 | ||
| 570 | 572 | # issues labels and events | |
| 571 | 573 | label2 = admin_project.labels.create({"name": "label2", "color": "#aabbcc"}) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments