Skip to content

fix(octo-sts): grant pull_requests:write so GitLab CI can post PR comments#595

Merged
jbachorik merged 3 commits into
mainfrom
fix/octo-sts-pr-comment-write
Jun 12, 2026
Merged

fix(octo-sts): grant pull_requests:write so GitLab CI can post PR comments#595
jbachorik merged 3 commits into
mainfrom
fix/octo-sts-pr-comment-write

Conversation

@jbachorik

@jbachorik jbachorik commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?:

  1. Changes the async-profiler-build.ci Octo-STS trust policy permission pull_requests from read to write.
  2. Updates the PR template to drop the defunct @DataDog/security-design-and-guidance handle and reference the current security-review process.

Motivation:

GitLab CI back-reports benchmark and reliability/chaos results to the PR by upserting a comment via the GitHub REST API (POST /repos/DataDog/java-profiler/issues/{n}/comments, see .gitlab/scripts/upsert-github-pr-comment.sh). Because the target issue is a pull request, that endpoint requires pull_requests: write. With read, the call fails:

HTTP 403 {"message":"Resource not accessible by integration"}

The PR-lookup and comment-list (read) calls succeed; only the write fails. The GitHub Actions path already works because its policy (self.pr-comment) grants pull_requests: write.

Octo-STS evaluates trust policies from the repository's default branch, so this must land on main before the GitLab commenters can post. Split out from #589 so it can merge independently and unblock back-reporting.

Additional Notes:

The policy already grants contents: write and issues: write; this only widens pull_requests from read to write, consistent with its stated purpose ("manage issues").

Security review: per the current Change Review Policy, bewaire runs automatically on this PR. This change touches an Octo-STS credential policy — for explicit sign-off run the dd:platform-security-review skill or file the PSEC review form (https://datadoghq.atlassian.net/jira/software/c/projects/PSEC/forms/form/direct/7861446195161534/37715). The old @DataDog/security-design-and-guidance team is defunct (404) and is not a collaborator on this repo, so it cannot be requested as a reviewer.

How to test the change?:

After merge, a GitLab pipeline on an open PR runs the benchmark/reliability comment jobs; post-benchmarks-pr-comment / post-reliability-pr-comment should post a PR comment instead of returning HTTP 403.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a security review (bewaire auto-runs; dd:platform-security-review / PSEC form available for explicit sign-off).
  • This PR doesn't touch any of that.
  • JIRA: [JIRA-XXXX]

@jbachorik jbachorik added the AI label Jun 12, 2026
jbachorik added a commit that referenced this pull request Jun 12, 2026
@datadog-official

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #27416911650 | Commit: 66b0516 | Duration: 12m 58s (longest job)

All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - - -
8-ibm - - -
8-j9 - -
8-librca - -
8-orcl - - -
11 - - -
11-j9 - -
11-librca - -
17 - -
17-graal - -
17-j9 - -
17-librca - -
21 - -
21-graal - -
21-librca - -
25 - -
25-graal - -
25-librca - -

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-06-12 13:10:58 UTC

@jbachorik jbachorik marked this pull request as ready for review June 12, 2026 11:03
@jbachorik jbachorik requested a review from a team as a code owner June 12, 2026 11:03

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af3ceda5fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/chainguard/async-profiler-build.ci.sts.yaml
@jbachorik jbachorik merged commit 206cd28 into main Jun 12, 2026
109 checks passed
@jbachorik jbachorik deleted the fix/octo-sts-pr-comment-write branch June 12, 2026 12:54
@github-actions github-actions Bot added this to the 1.45.0 milestone Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant