canonical-ubuntu-qa team mailing list archive
-
canonical-ubuntu-qa team
-
Mailing list archive
-
Message #03214
[Merge] ~andersson123/autopkgtest-cloud:generate-charm-inventory into autopkgtest-cloud:master
Tim Andersson has proposed merging ~andersson123/autopkgtest-cloud:generate-charm-inventory into autopkgtest-cloud:master.
Requested reviews:
Canonical's Ubuntu QA (canonical-ubuntu-qa)
For more details, see:
https://code.launchpad.net/~andersson123/autopkgtest-cloud/+git/autopkgtest-cloud/+merge/461714
--
Your team Canonical's Ubuntu QA is requested to review the proposed merge of ~andersson123/autopkgtest-cloud:generate-charm-inventory into autopkgtest-cloud:master.
diff --git a/dev-tools/generate-charm-inventory b/dev-tools/generate-charm-inventory
new file mode 100755
index 0000000..8a99090
--- /dev/null
+++ b/dev-tools/generate-charm-inventory
@@ -0,0 +1,52 @@
+#!/usr/bin/python3
+"""
+use like this:
+./dev-tools/generate-charm-inventory $commit_id $branch
+"""
+import argparse
+
+from git import Repo
+
+repo = Repo(".")
+
+ap = argparse.ArgumentParser()
+ap.add_argument("up_to")
+ap.add_argument("branch")
+args = ap.parse_args()
+branch = args.branch
+
+commit_url = "https://git.launchpad.net/autopkgtest-cloud/commit/?id="
+up_to = args.up_to
+
+commits = {
+ "web": [],
+ "cloud": [],
+ "misc": [],
+}
+
+for commit in repo.iter_commits(branch, max_count=1000):
+ if str(commit) == up_to:
+ break
+ if "Merge branch" in commit.message:
+ continue
+ if "web: " in commit.message:
+ commits["web"].append(
+ "- [%s](%s%s)"
+ % (commit.message.splitlines()[0], commit_url, commit)
+ )
+ elif "cloud: " in commit.message:
+ commits["cloud"].append(
+ "- [%s](%s%s)"
+ % (commit.message.splitlines()[0], commit_url, commit)
+ )
+ else:
+ commits["misc"].append(
+ "- [%s](%s%s)"
+ % (commit.message.splitlines()[0], commit_url, commit)
+ )
+
+inventory = ""
+for key, item in commits.items():
+ inventory += "**%s**\n%s\n" % (key, "\n".join(item))
+
+print(inventory)