Skip to content

Commit

Permalink
Recognize gitlab notes properly
Browse files Browse the repository at this point in the history
With markdown output format properly recognize notes.
Address:
https://github.com/psss/did/pull/315/files/41e93a1a4bda20c0d077258680be63363e4dcb5c#r1319684728

Signed-off-by: Sandro Bonazzola <[email protected]>
  • Loading branch information
sandrobonazzola committed Sep 8, 2023
1 parent 86489d3 commit 9d4d830
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions did/plugins/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,16 @@ def iid(self):
def __str__(self):
""" String representation """
if self.parent.options.format == "markdown":
endpoint = "merge_requests"
if self.data['target_type'] == 'Issue' or (
self.data['target_type'] == 'Note'
and self.data['note']['noteable_type'] == 'Issue'
):
endpoint = "issues"
return "[{1}#{3}]({0}/{1}/-/{2}/{3}) - {4}".format(
self.gitlabapi.url,
self.project['path_with_namespace'],
("issues"
if self.data['target_type'] == 'Issue'
else "merge_requests"),
endpoint,
str(self.id), self.title)
else:
return "{0}#{1} - {2}".format(
Expand Down

0 comments on commit 9d4d830

Please sign in to comment.