Commit ea2cc83
authored
Grant meta-codesync GitHub App write-equivalent bot permissions (#8208)
## Summary
`meta-codesync[bot]` authenticates via a GitHub App installation, not as
a repo collaborator, so `getCollaboratorPermissionLevel` returns `none`
for it and `hasWritePermissions` denies it. This blocked the bot from
using the `@pytorchbot merge -i` flag, which requires write permissions.
Example: on pytorch/pytorch#187360 the bot commented `@pytorchbot merge
-i` and was rejected with *"`-i` flag is only allowed for users with
write permissions."*
This allowlists `meta-codesync[bot]` in `hasWritePermissions`, the same
way `facebook-github-tools[bot]` is already handled. Since
`hasRebasePermissions` and `hasWorkflowRunningPermissions` delegate to
`hasWritePermissions`, this also covers those checks.
## Context
The `meta-codesync` app installation already has read/write scopes on
the repo, but GitHub does not surface App installation scopes through
the collaborator-permission API (or `authorAssociation`), so the
collaborator check can never pass for an app. An explicit username
allowlist is the established pattern here.
## Companion change
The revert path is gated separately in `pytorch/pytorch`
(`validate_revert` in `.github/scripts/trymerge.py`), which keys off the
app **URL** rather than the username. That companion PR:
pytorch/pytorch#187873.
---
This PR was authored with the assistance of an AI coding assistant.1 parent 5250da8 commit ea2cc83
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
| |||
0 commit comments