Repos transferred into the org are not synced (no repository.transferred handler)
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 70/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
- Área
- backend
Línea de trabajo
Los manejadores de eventos se registran en index.js, que ya cubre repository.created, edited, renamed, archived y unarchived, pero no repository.transferred. Lee el manejador de repository.created y reutiliza su ruta de sincronización para el nuevo evento. Está terminado cuando una entrega de repository.transferred activa la misma sincronización de la configuración combinada de org, suborg y repo que repository.created. Comprueba que las pruebas existentes del manejador siguen pasando.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 926
- Forks
- 230
- Merge medio
- 3 d 9 h
- PR fusionados (30 d)
- 18
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github-community-projects/safe-settings
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
github-community-projects/safe-settings#1115 ·
Los mantenedores suelen responder en 1 día
-
app_installations reports an error on every repo or suborg change when the plugin is not configuredAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
github-community-projects/safe-settings#1111 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dry run only inspects the first 30 changed files (pulls.listFiles is not paginated)Posiblemente ocupada @3rwww1 la tomó hace 36 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
github-community-projects/safe-settings#1080 ·
Los mantenedores suelen responder en 1 día
-
PR comment diff table shows an empty vertical scrollbar due to malformed <tr> markupQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
github-community-projects/safe-settings#1077 ·
Los mantenedores suelen responder en 1 día
-
Bug Report: environment and repo variables API calls don't paginate, failing with more than 10 itemsPosiblemente ocupada @cdav la tomó hace 89 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
github-community-projects/safe-settings#1040 ·
Los mantenedores suelen responder en 1 día
Todos los issues de github-community-projects/safe-settings
Issues similares
-
[bug] extension mappingAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
-
bug code-annotation
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
quarto-dev/quarto-cli#15215 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
521xueweihan/HelloGitHub#4133 ·
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Hugo-SA/receita-random#20 ·
Los mantenedores suelen responder en 1 día