Skip to content

feat: Add repository ruleset code quality support - #4523

Open
tvost2 wants to merge 3 commits into
google:masterfrom
tvost2:fix-code-quality-ruleset
Open

feat: Add repository ruleset code quality support#4523
tvost2 wants to merge 3 commits into
google:masterfrom
tvost2:fix-code-quality-ruleset

Conversation

@tvost2

@tvost2 tvost2 commented Sep 5, 2026

Copy link
Copy Markdown

Summary

  • model the GitHub code_quality repository ruleset rule
  • preserve its severity when marshaling and unmarshaling rulesets
  • add regression coverage for round-tripping the rule

Fixes #4520

Tests

  • go test ./github -count=1

@gmlewis gmlewis changed the title Add repository ruleset code quality support feat: Add repository ruleset code quality support Sep 5, 2026
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Sep 5, 2026
@gmlewis

gmlewis commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

@tvost2 - please run step 4 of CONTRIBUTING.md and push the changes to this PR.

@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 98.53%. Comparing base (3a439fa) to head (2c92045).

Files with missing lines Patch % Lines
github/rules.go 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4523      +/-   ##
==========================================
- Coverage   98.53%   98.53%   -0.01%     
==========================================
  Files         195      195              
  Lines       17848    17862      +14     
==========================================
+ Hits        17587    17600      +13     
- Misses        261      262       +1     

☔ 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.

@tvost2

tvost2 commented Sep 5, 2026

Copy link
Copy Markdown
Author

Addressed the Codecov coverage comment by adding marshal/unmarshal regression coverage for BranchRules.CodeQuality.

Validation:

  • go test ./... -count=1 passes.
  • gofmt applied.
  • git diff --check passes.
  • script/fmt.sh and script/lint.sh could not complete in this Windows environment: the shell wrapper stalled after installing golangci-lint, and the direct linter invocation reports the repository plugin structfield is unavailable locally.

@gmlewis

gmlewis commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator
  • script/fmt.sh and script/lint.sh could not complete in this Windows environment: the shell wrapper stalled after installing golangci-lint, and the direct linter invocation reports the repository plugin structfield is unavailable locally.

Hmm... was this in a WSL or git bash window? If not, could you please try running them in one of these windows?
I don't have a Windows box available, and we have not had this report before, so I'm just guessing here.

@tvost2

tvost2 commented Sep 5, 2026

Copy link
Copy Markdown
Author

Updated the PR after the maintainer feedback:

  • ran generation in Git Bash and committed the generated CodeQuality accessors/tests;
  • added invalid-parameter regressions for repository and branch rules to cover the remaining Codecov misses;
  • focused ruleset tests pass and git diff --check passes.

The official Git Bash wrapper reaches the repository scripts, but this Windows checkout cannot execute the downloaded custom-gcl path. script/generate.sh --check now gets past the generated Go files and reports only the local toolchain changing go.sum during tidy; no dependency files were included in this PR.

@gmlewis

gmlewis commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

@tvost2 - note that issue #4520 is assigned to someone else anyway so we will wait for their response.
As covered in CONTRIBUTING.md, please sign up to address open issues before posting a PR to prevent application of effort.

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

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repository ruleset rule type code_quality is not modelled

2 participants