From: Patrick Donnelly Date: Sat, 11 Jul 2026 01:00:13 +0000 (-0400) Subject: Merge PR #69464 into main X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d80ccc8cc13f18317f1ad89338cf9e12f7485905;p=ceph.git Merge PR #69464 into main * refs/pull/69464/head: script/ptl-tool: do not update PRs for private QA Reviewed-by: Yuri Weinstein --- d80ccc8cc13f18317f1ad89338cf9e12f7485905 diff --cc src/script/ptl-tool.py index 50e48a40182,0591c59b661..02cd58065f0 --- a/src/script/ptl-tool.py +++ b/src/script/ptl-tool.py @@@ -1604,32 -1604,35 +1604,35 @@@ def manage_qa_tracker(args, R, session log.error(f"failed to update {issue}") sys.exit(1) - for pr in added_prs: - body = f"This PR has been added to [{issue.subject}]({issue_url})." - if args.dry_run: - log.info(f"[DRY RUN] Would post comment to added PR #{pr}: {body}") - else: - endpoint = f"https://api.github.com/repos/{BASE_PROJECT}/{BASE_REPO}/issues/{pr}/comments" - r = session.post(endpoint, auth=GithubBearerAuth(), data=json.dumps({'body':body})) - if r.status_code == 201: - log.info(f"Successfully posted added comment to PR #{pr}") + if getattr(issue, 'is_private', False): + log.info(f"QA ticket {issue.url} is private. Skipping GitHub PR updates for added/removed PRs.") + else: + for pr in added_prs: + body = f"This PR has been added to [{issue.subject}]({issue_url})." + if args.dry_run: + log.info(f"[DRY RUN] Would post comment to added PR #{pr}: {body}") else: - log.error(f"Failed to post comment: {r.status_code} {r.text}") + endpoint = f"https://api.github.com/repos/{BASE_PROJECT}/{BASE_REPO}/issues/{pr}/comments" + r = session.post(endpoint, auth=GithubBearerAuth(), data=json.dumps({'body':body})) + if r.status_code == 201: + log.info(f"Successfully posted added comment to PR #{pr}") + else: + log.error(f"Failed to post comment: {r.status_code} {r.text}") - for pr in removed_prs: - body = f"This PR has been removed from [{issue.subject}]({issue_url})." - if args.dry_run: - log.info(f"[DRY RUN] Would post comment to removed PR #{pr}: {body}") - else: - endpoint = f"https://api.github.com/repos/{BASE_PROJECT}/{BASE_REPO}/issues/{pr}/comments" - r = session.post(endpoint, auth=GithubBearerAuth(), data=json.dumps({'body':body})) - if r.status_code == 201: - log.info(f"Successfully posted removed comment to PR #{pr}") + for pr in removed_prs: + body = f"This PR has been removed from [{issue.subject}]({issue_url})." + if args.dry_run: + log.info(f"[DRY RUN] Would post comment to removed PR #{pr}: {body}") else: - log.error(f"Failed to post comment: {r.status_code} {r.text}") + endpoint = f"https://api.github.com/repos/{BASE_PROJECT}/{BASE_REPO}/issues/{pr}/comments" + r = session.post(endpoint, auth=GithubBearerAuth(), data=json.dumps({'body':body})) + if r.status_code == 201: + log.info(f"Successfully posted removed comment to PR #{pr}") + else: + log.error(f"Failed to post comment: {r.status_code} {r.text}") elif args.create_qa: - now_str = datetime.datetime.utcnow().strftime("%Y-%m-%d-%H:%M") + now_str = datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%d-%H:%M") default_subject = f"{base} integration testing by {USER} started {now_str}" issue_kwargs['subject'] = args.qa_subject if args.qa_subject else default_subject