Skip to content

Commit

Permalink
Use formatted string to print link to PR in markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Konovalov committed Mar 19, 2021
1 parent 2b0e207 commit 2b0fd8e
Showing 1 changed file with 15 additions and 25 deletions.
40 changes: 15 additions & 25 deletions dev/releases/generate_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ def changes_overview(prs,startdate):
["topic: packages", "Packages"]
]

# removelist = []
# for k in prs:
# if "backport-to-4.11-DONE" in prs[k]["labels"]:
# removelist.append(k)
# for item in removelist:
# del prs[item]
# del jsondict[item]


# TODO: why does this need a special treatment?
# Adding it to the prioritylist could ensure that it goes first
f.write("## Release Notes \n\n")
Expand All @@ -100,7 +109,6 @@ def changes_overview(prs,startdate):
for k in prs:
# The format of an entry of list is: ["title of PR", "Link" (Alternative the PR number can be used), [ list of labels ] ]
if "release notes: highlight" in prs[k]["labels"]:
# TODO: writing up these details should be a function
title = prs[k]["title"]
f.write(f"- [#{k}](https://github.com/gap-system/gap/pull/{k}) {title}\n")
removelist.append(k)
Expand All @@ -122,14 +130,8 @@ def changes_overview(prs,startdate):
removelist = []
for k in prs:
if "release notes: to be added" in prs[k]["labels"]:
f2.write("- [#")
issuenumber = str(k)
f2.write(issuenumber)
f2.write("](")
f2.write("https://github.com/gap-system/gap/pull/" + str(k))
f2.write(") ")
f2.write(prs[k]["title"])
f2.write("\n")
title = prs[k]["title"]
f2.write(f"- [#{k}](https://github.com/gap-system/gap/pull/{k}) {title}\n")
removelist.append(k)
for item in removelist:
del prs[item]
Expand All @@ -141,14 +143,8 @@ def changes_overview(prs,startdate):
for k in prs:
#if not "release notes: use title" in item[2]:
if not "release notes: added" in prs[k]["labels"]:
f2.write("- [#")
issuenumber = str(k)
f2.write(issuenumber)
f2.write("](")
f2.write("https://github.com/gap-system/gap/pull/" + str(k))
f2.write(") ")
f2.write(prs[k]["title"])
f2.write("\n")
title = prs[k]["title"]
f2.write(f"- [#{k}](https://github.com/gap-system/gap/pull/{k}) {title}\n")
removelist.append(k)
for item in removelist:
del prs[item]
Expand All @@ -160,14 +156,8 @@ def changes_overview(prs,startdate):
removelist = []
for k in prs:
if priorityobject[0] in prs[k]["labels"]:
f.write("- [#")
issuenumber = str(k)
f.write(issuenumber)
f.write("](")
f.write("https://github.com/gap-system/gap/pull/" + str(k))
f.write(") ")
f.write(prs[k]["title"])
f.write("\n")
title = prs[k]["title"]
f.write(f"- [#{k}](https://github.com/gap-system/gap/pull/{k}) {title}\n")
removelist.append(k)
for item in removelist:
del prs[item]
Expand Down

0 comments on commit 2b0fd8e

Please sign in to comment.