Repository ruleset rule type `code_quality` is not modelled
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 11.3k
- Fork
- 2.6k
- Merge trung bình
- 2 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/go-github
-
http.Client.Timeout is ignored by redirect-aware requestsCó thể đã có người làm @sb123sb123 đã nhận 19 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add Copilot content exclusion set/get enterprise and org set endpointsCó thể đã có người làm @Tens1des đã nhận 33 ngày trước. Đang mở
google/go-github#4526 · 1 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add Copilot custom agents enterprise endpointsCó thể đã có người làm @Tens1des đã nhận 33 ngày trước. Đang mở
google/go-github#4524 · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Including an enterprise team as a reviewer for an environment results an unmarshal errorCó thể đã có người làm @JWilkinsonMB đã nhận 52 ngày trước. Đang mở
google/go-github#4457 · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add additional functionality for enterprise budgetsCó thể đã có người làm @wtneff đã nhận 78 ngày trước. Đang mở
google/go-github#4408 · 2 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của google/go-github
Issue tương tự
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
FairwindsOps/nova#484 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
automated-analysis code-quality cookie
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
github/gh-aw#67517 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[otelcol] print-config help text still requires the removed otelcol.printInitialConfig feature gateCó thể đã có người làm @girishkvs đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
open-telemetry/opentelemetry-collector#16143 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue load-balancing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ktrubilo9/edge-proxy#53 ·