Skip to content

feat: Add support for code quality ruleset rule type - #4648

Open
reginaldalfret wants to merge 1 commit into
google:masterfrom
reginaldalfret:fix/reginald-go-github-code-quality-ruleset
Open

reginaldalfret wants to merge 1 commit into
google:masterfrom
reginaldalfret:fix/reginald-go-github-code-quality-ruleset

Conversation

@reginaldalfret

Copy link
Copy Markdown

Fixes #4520

Summary

This PR adds support for the repository ruleset rule type code_quality, corresponding to the "Require code quality results" branch protection rule.

Changes

  • Added RulesetRuleTypeCodeQuality RepositoryRuleType = "code_quality"
  • Defined CodeQualityRuleParameters with Severity string json:"severity,omitempty"``
  • Defined CodeQualityBranchRule representing the branch rule metadata and parameters
  • Added CodeQuality field to RepositoryRulesetRules and BranchRules
  • Handled serialization and deserialization in RepositoryRulesetRules, BranchRules, and RepositoryRule
  • Added comprehensive unit tests in rules_test.go (TestCodeQualityRuleRoundTrip and TestCodeQualityRuleInvalidParameters)

@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.42105% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.59%. Comparing base (28d2616) to head (2d60fd1).

Files with missing lines Patch % Lines
github/rules.go 68.42% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4648      +/-   ##
==========================================
- Coverage   98.62%   98.59%   -0.04%     
==========================================
  Files         201      201              
  Lines       18811    18830      +19     
==========================================
+ Hits        18553    18566      +13     
- Misses        258      264       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repository ruleset rule type code_quality is not modelled

1 participant