Fork PRs created from the GitHub Copilot app can't enable "Allow edits by maintainers" (`maintainer_can_modify` silently ignored)
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- github, github-actions, python
研究方向
Start by tracing how the Copilot app provides GH_TOKEN to remote sessions and how the CLI creates fork pull requests with gh pr create. Compare the token permissions and the maintainer_can_modify value during creation and update; the issue does not name source files or tests. Done means fork PRs have maintainer edits enabled by default, or the app clearly reports when its token cannot set the option.
由索引模型根據 Issue 內容生成。
描述
Describe the bug
When the Copilot agent opens a PR from the user's fork into an upstream repo (gh pr create --head <user>:<branch>, using the GH_TOKEN the GitHub Copilot app provides), the PR is created with "Allow edits by maintainers" off. Trying to turn it on afterwards with PATCH /repos/{owner}/{repo}/pulls/{n} and maintainer_can_modify=true returns success but leaves the value false. gh pr edit on the same PR fails with Resource not accessible by integration.
The token appears to be a GitHub App user token (X-OAuth-Scopes is empty). My guess is that it lacks the access to the fork that this setting needs, and GitHub drops the field without reporting an error.
Impact: maintainer and bot workflows can't push to these PRs. For example, our /fix:link-cache bot falls back to pushing to refs/pull/<n>/head and fails with ! [remote rejected] HEAD -> refs/pull/12889/head (deny updating a hidden ref).
Affected version
Copilot CLI 1.0.109, run by the GitHub Copilot app in a remote (cloud) session.
Steps to reproduce the behavior
- In a Copilot app session on an upstream repo where you have a fork, have the agent push a branch to the fork and run
gh pr create -R <upstream> --head <user>:<branch> .... Maintainer edits aren't turned off (no--no-maintainer-edit). - Run
gh pr view <n> --json maintainerCanModifyand getfalse. - Run
gh api -X PATCH repos/<upstream>/pulls/<n> -F maintainer_can_modify=true --jq .maintainer_can_modify. It exits 0 and printsfalse. - Example: open-telemetry/opentelemetry.io#12889, which has
maintainerCanModify: false, and its failed bot push in https://github.com/open-telemetry/opentelemetry.io/actions/runs/46047662218
Expected behavior
Fork PRs created by the agent have "Allow edits by maintainers" on, matching gh pr create's default. If the token can't set it, the agent or app reports that instead of failing silently. A setting to choose the default would also help.
Additional context
- I couldn't find a setting for this in the app's
.github/github-app.ymlreference or in the cloud agent customization docs. - Workaround: tick the checkbox by hand on each PR.
- Possibly related: PyGithub/PyGithub#3297 (discussion:
maintainer_can_modifyhas no effect). - Side note: in the same session,
gh issue create -R github/copilot-cliwith the app's token also failed withResource not accessible by integration (createIssue).
- 主要語言
- Python
- 星號
- 11.5k
- 分支
- 2k
- 平均合併
- 6 小時 34 分鐘
- 30 天內合併 PR
- 3
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/copilot-cli 的其他 Issue
-
area:plugins
難度 2/5 1-3 小時 新手友好度 75/100
github/copilot-cli#5567 ·
-
難度 1/5 1-3 小時 新手友好度 78/100
github/copilot-cli#5489 ·
-
Built-in functions.view returns no content for large files despite documenting automatic truncation未關閉area:tools
難度 2/5 1-3 小時 新手友好度 72/100
github/copilot-cli#5476 ·
-
triage
難度 1/5 1 小時以內 新手友好度 74/100
github/copilot-cli#5377 ·
-
area:platform-windows area:tools
難度 1/5 1 小時以內 新手友好度 74/100
github/copilot-cli#5340 ·
查看 github/copilot-cli 的全部 Issue
相似的 Issue
-
fidelity
難度 2/5 1-3 小時 新手友好度 68/100
維護者通常 1 天內回覆
-
backlog
難度 2/5 1-3 小時 新手友好度 72/100
sagemathinc/sagebrush#3434 ·
維護者通常 1 天內回覆
-
marketing
難度 2/5 1-3 小時 新手友好度 85/100
維護者通常 1 天內回覆
-
documentation good first issue help wanted
難度 2/5 1-3 小時 新手友好度 78/100
wuisabel-gif/MemWhale#576 ·
維護者通常 1 天內回覆
-
Status: Triage Suggestion
難度 2/5 1-3 小時 新手友好度 68/100
GTNewHorizons/GT-New-Horizons-Modpack#27957 ·
維護者通常 1 天內回覆