Repository ruleset rule type `code_quality` is not modelled
Los mantenedores suelen responder en 1 día
@etifontaine ya está trabajando en esto.
Desde el 4/9/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Summary
The repository ruleset rule type code_quality is not modelled by RepositoryRule / the ruleset rule types, so it cannot be read or written through this library. It corresponds to the "Require code quality results" checkbox on a branch ruleset, which reached general availability on 2026-07-20.
API shape
GET /repos/{owner}/{repo}/rulesets/{id} returns it as a rule alongside the existing types:
{
"id": 16352232,
"name": "Project branch",
"target": "branch",
"enforcement": "active",
"rules": [
{ "type": "code_quality", "parameters": { "severity": "errors" } },
{ "type": "copilot_code_review", "parameters": { "review_on_push": true, "review_draft_pull_requests": false } }
]
}
severity is the lowest severity level at which code quality results block a merge. I have only observed "errors" on the wire, so the full accepted set is worth confirming against the docs before fixing an enum — note the existing code_scanning rule's security_alerts_threshold already uses "errors" / "errors_and_warnings" style values in rules.go, which may or may not be the same vocabulary here.
Why it matters beyond a missing field
PUT /repos/{owner}/{repo}/rulesets/{id} replaces the entire rules array. Because the rule cannot be represented, any consumer that round-trips a ruleset — read, modify one unrelated attribute, write back — will silently drop code_quality and remove a merge gate, with nothing in the request or response to indicate it happened.
That is not hypothetical. integrations/terraform-provider-github builds its github_repository_ruleset resource on this library, and a ruleset carrying this rule imports cleanly, plans cleanly, and would lose the rule on the first apply that touched any other attribute of the resource. We ended up dropping the affected ruleset from Terraform management entirely rather than hold that risk. Modelling the type here unblocks the provider side (there is no provider-side workaround, since there is nothing to serialise).
Environment
- go-github: absent as of current
master—github/rules.gomodelscopilot_code_review,required_code_scanning,required_status_checkset al., and contains no occurrence ofcode_qualityorCodeQuality - Observed against: GitHub.com, private repository in an organisation on the Team plan
Willing to contribute
Happy to open a PR adding the rule type if a maintainer confirms the preferred shape — in particular whether severity should be a plain string or a typed constant set.
- Lenguaje dominante
- Go
- Estrellas
- 11.3k
- Forks
- 2.5k
- Merge medio
- 1 d 16 h
- PR fusionados (30 d)
- 51
Preparar el entorno
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 google/go-github
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Add actions policies endpointsPosiblemente ocupada @jndz2 la tomó hace 6 días. Abierto
google/go-github#4583 · 2 comentarios · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Add Copilot content exclusion set/get enterprise and org set endpointsPosiblemente ocupada @Tens1des la tomó hace 20 días. Abierto
google/go-github#4526 · 1 comentario · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Add Copilot custom agents enterprise endpointsPosiblemente ocupada @Tens1des la tomó hace 20 días. Abierto
google/go-github#4524 · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de google/go-github
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
siderolabs/terraform-provider-talos#414 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
JuliaComputing/jh#63 · 1 comentario ·
-
area/proxy kind/bug priority/backlog triage/accepted
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
lexfrei/cloudflare-tunnel-gateway-controller#840 ·
Los mantenedores suelen responder en 1 día
-
Priority: Normal Type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
cloudflare/cloudflared#1747 ·