fix(octo-sts): grant pull_requests:write so GitLab CI can post PR comments#595
Merged
Conversation
jbachorik
added a commit
that referenced
this pull request
Jun 12, 2026
This comment has been minimized.
This comment has been minimized.
Contributor
CI Test ResultsRun: #27416911650 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-06-12 13:10:58 UTC |
There was a problem hiding this comment.
💡 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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
async-profiler-build.ciOcto-STS trust policy permissionpull_requestsfromreadtowrite.@DataDog/security-design-and-guidancehandle 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 requirespull_requests: write. Withread, the call fails: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) grantspull_requests: write.Octo-STS evaluates trust policies from the repository's default branch, so this must land on
mainbefore 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: writeandissues: write; this only widenspull_requestsfrom read to write, consistent with its stated purpose ("manage issues").Security review: per the current Change Review Policy,
bewaireruns automatically on this PR. This change touches an Octo-STS credential policy — for explicit sign-off run thedd:platform-security-reviewskill 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-guidanceteam 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-commentshould post a PR comment instead of returning HTTP 403.For Datadog employees:
dd:platform-security-review/ PSEC form available for explicit sign-off).