Repos transferred into the org are not synced (no repository.transferred handler)
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 70/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
- 领域
- backend
调研方向
事件处理程序在 index.js 中注册,该文件已覆盖 repository.created、edited、renamed、archived 和 unarchived,但未覆盖 repository.transferred。请阅读 repository.created 的处理程序,并为新事件复用其同步路径。完成标准是:一次 repository.transferred 投递能触发与 repository.created 相同的合并 org、suborg 和 repo 配置同步。同时检查现有的处理程序测试仍然通过。
由索引模型根据 Issue 内容生成。
描述
Problem Description
What is actually happening
When a repository is transferred into an org that safe-settings manages, safe-settings does nothing. The org defaults, suborg settings and the repo's own .github/repos/<repo>.yml are not applied until something else triggers a sync, usually the next CRON full sync or a human editing the repo.
We hit this during an org-to-org migration:
- Merged
.github/repos/<repo>.ymlinto the admin repo while the repo still lived in the source org. The push-triggered sync failed with404 Not Foundon Autolinks, Teams and Environments for that repo, which is expected since it did not exist in the org yet. - Transferred the repo into the org.
- GitHub delivered
repository.transferredto the receiving org's installation. safe-settings logged nothing for the repo and applied nothing.
The repo stayed on its pre-transfer settings until the next cron run. In our case that meant missing team grants, missing autolinks, repo flags not matching org defaults, and environment reviewers still pointing at teams in the old org.
What is the expected behavior
A repo transferred into the org should be treated like repository.created: the merged org, suborg and repo config is applied right away.
index.js registers handlers for repository.created, edited, renamed, archived and unarchived, but not repository.transferred. Per the webhook docs, transferred is sent to the account the repo is transferred to, so the receiving installation already gets the event. It just isn't handled. The App already subscribes to repository events, so no permission or subscription change is needed.
Error output, if available
Push-triggered sync before the transfer (expected, repo not yet in the org):
ERROR (event): Error HttpError: Not Found - https://docs.github.com/rest/repos/autolinks#get-all-autolinks-of-a-repository in Autolinks for repo: {"repo":"<repo>","owner":"<org>"}
ERROR (event): Error HttpError: Not Found - https://docs.github.com/rest/repos/repos#list-repository-teams in Teams for repo: {"repo":"<repo>","owner":"<org>"}
ERROR (event): Error HttpError: Not Found - https://docs.github.com/rest/deployments/environments#list-environments in Environments for repo: {"repo":"<repo>","owner":"<org>"}
After the transfer: no log lines for the repo at all.
Context
Are you using the hosted instance of probot/settings or running your own?
Running our own (Helm chart, ghcr.io/github-community-projects/safe-settings).
If running your own instance, are you using it with github.com or GitHub Enterprise?
github.com (GitHub Enterprise Cloud)
Version of probot/settings
safe-settings 3.0.0 (also checked main-enterprise at 4dac294, same behavior)
Version of GitHub Enterprise
GHEC
Workaround
Any human edit to the repo after the transfer (for example gh repo edit <org>/<repo> --description "...") fires repository.edited and triggers a sync. Alternatively, merge the per-repo yml after the transfer so the push-triggered sync finds the repo.
I'll open a PR that adds a repository.transferred handler mirroring repository.created.
- 主要语言
- JavaScript
- 星标
- 927
- 派生
- 234
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 11
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github-community-projects/safe-settings 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 80/100
github-community-projects/safe-settings#1115 ·
维护者通常 1 天内回复
-
app_installations reports an error on every repo or suborg change when the plugin is not configured未关闭
难度 2/5 1-3 小时 新手友好度 64/100
github-community-projects/safe-settings#1111 · 2 条评论 ·
维护者通常 1 天内回复
-
Dry run only inspects the first 30 changed files (pulls.listFiles is not paginated)可能已有人在做 @3rwww1 于 41 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
github-community-projects/safe-settings#1080 ·
维护者通常 1 天内回复
-
PR comment diff table shows an empty vertical scrollbar due to malformed <tr> markup可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
github-community-projects/safe-settings#1077 ·
维护者通常 1 天内回复
-
Bug Report: environment and repo variables API calls don't paginate, failing with more than 10 items可能已有人在做 @cdav 于 94 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
github-community-projects/safe-settings#1040 ·
维护者通常 1 天内回复
查看 github-community-projects/safe-settings 的全部 Issue
相似的 Issue
-
enhancement version-minor
难度 2/5 1-3 小时 新手友好度 62/100
cuttle-cards/cuttle#1467 ·
维护者通常 1 天内回复
-
难度 2/5 3-5 天 新手友好度 62/100
career-ops-hq/career-ops#6399 · 1 条评论 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 85/100
-
automated issue report
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
area: hook area: plugin claude-code difficulty: easy dx enhancement good first issue help wanted tech: node
难度 2/5 1-3 小时 新手友好度 72/100
flisk-sh/run-my-agents#25 ·