]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
script/ptl-tool: add comment to PRs under QA 56936/head
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 17 Apr 2024 02:02:35 +0000 (22:02 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 17 Apr 2024 02:09:18 +0000 (22:09 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/script/ptl-tool.py

index 505082305ff89b3ec1a1cf8cf0a7c9e8f4a7353b..1d3778f9ad4c3644874466a271a4fc14254bc8dd 100755 (executable)
@@ -494,6 +494,14 @@ def build_branch(args):
         issue = R.issue.create(**issue_kwargs)
         log.info("created redmine qa issue: %s", issue.url)
 
+
+        for pr in prs:
+            log.debug(f"Posting QA Run in comment for ={pr}")
+            endpoint = f"https://api.github.com/repos/{BASE_PROJECT}/{BASE_REPO}/issues/{pr}/comments"
+            body = f"This PR is under test in [{issue.url}]({issue.url})."
+            r = session.post(endpoint, auth=gitauth(), data=json.dumps({'body':body}))
+            log.debug(f"= {r}")
+
 def main():
     parser = argparse.ArgumentParser(description="Ceph PTL tool")
     default_base = 'main'