11 from util
import def_arguments, Spinner, gitlab
12 from release_notes
import (
21 p = argparse.ArgumentParser()
24 p.add_argument(
"--dry-run",
"-s", action=
"store_true")
25 p.add_argument(
"--verbose",
"-v", action=
"store_true")
33 project = gl.projects.get(
"acts/acts-core")
35 with
Spinner(text=
"Loading tags"):
36 tags = project.tags.list(all=
True)
38 with
Spinner(text=
"Loading milestones"):
39 milestones = project.milestones.list(all=
True)
46 if not version
in ms_map:
47 print(f
"No milestone found for tag f{tag.name} => skipping")
48 milestone = ms_map[version]
49 print(tag.name, milestone.title)
54 print(
"Issues:",
", ".join([str(i.iid)
for i
in issues]))
56 for g, issues
in issues_grouped.items():
57 print(g,
", ".join([str(i.iid)
for i
in issues]))
59 print(
"MRs:",
", ".join([str(mr.iid)
for mr
in mrs]))
60 for g, mrs
in mrs_grouped.items():
61 print(g,
", ".join([str(mr.iid)
for mr
in mrs]))
63 with
Spinner(text=
"Assembling release notes"):
68 with
Spinner(text=f
"Saving release notes on {tag.name}"):
69 tag.set_release_description(md)
72 with
Spinner(f
"Getting release for tag {tag.name}"):
73 rel = project.releases.get(tag.name)
75 with
Spinner(f
"Setting milestones on release {tag.name} to [{milestone.title}]"):
76 gl.http_put(f
"/projects/{project.id}/releases/{tag.name}", post_data={
"milestones": [milestone.title]})
84 if "__main__" == __name__: