Skip to content

Commit 290cf90

Browse files
agustifmattisssa
authored andcommitted
feat(scripts/gitlab): Add url, description, author to merge request
1 parent a263024 commit 290cf90

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

commands/developer-utils/gitlab/gitlab-mergerequests.template.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,22 @@
3434
# Main program
3535

3636
from gitlabhelper import GitLab
37+
import textwrap
38+
3739
gitlab = GitLab()
3840
data = gitlab.get_call("merge_requests?state=opened&scope=assigned_to_me")
39-
print(f"GitLab Merge requests assigned to you on {gitlab.instance}:\n")
41+
print(f"GitLab Merge requests assigned to you on {gitlab.instance}/:\n")
42+
4043
for e in data:
4144
title = e.get("title")
45+
state = e.get("state")
46+
web_url = e.get("web_url")
47+
author = e.get("author")
48+
name = author.get("name")
49+
username = author.get("username")
4250
reference = e.get("references", {}).get("full")
43-
print(f"* {title} at {reference}")
51+
description = textwrap.shorten(e.get("description"), width=420, placeholder="...")
52+
print(f"[{state}] * {title} at {reference}\n")
53+
print(f"{description}\n")
54+
print(f"{web_url}\n")
55+
print(f"By {name} @{username}\n")

0 commit comments

Comments
 (0)