Skip to content

feat: Add support for organization rule suites - #4642

Open
JamBalaya56562 wants to merge 1 commit into
google:masterfrom
JamBalaya56562:feat/4641-org-rule-suites
Open

JamBalaya56562 wants to merge 1 commit into
google:masterfrom
JamBalaya56562:feat/4641-org-rule-suites

Conversation

@JamBalaya56562

@JamBalaya56562 JamBalaya56562 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes: #4641.
Closes: #4482.

Supersedes #4482 by @ralucas, which has been inactive since the review in late August. This builds on that implementation and addresses the open review comments. Thanks to @ralucas for the original work.

This adds the organization rule suites endpoints:

Method Endpoint
OrganizationsService.ListRuleSuites GET /orgs/{org}/rulesets/rule-suites
OrganizationsService.GetRuleSuite GET /orgs/{org}/rulesets/rule-suites/{rule_suite_id}

Changes from #4482, following the review there:

  • ListRuleSuitesOptions covers all of the documented query parameters (ref, repository_name, time_period, actor_name, rule_suite_result, evaluate_status) and embeds ListOptions for page and per_page.
  • The methods are named ListRuleSuites and GetRuleSuite, since Organization is redundant on OrganizationsService.
  • The file is named orgs_rule_suites.go.
  • The URLs are built with the usual u := fmt.Sprintf(...) / addOptions(u, opts) pattern.
  • The tests check the query parameters with testFormValues and the error paths with testBadOptions/testNewRequestAndDoFailure in the main test functions, and use referenceTimestamp.

RuleSuite, RuleEvaluation, and RuleEvaluationSource have every property of the rule-suites and rule-suite response schemas. The generated ListRuleSuitesIter iterator is included.

The repository-level rule suites endpoints are still missing and can be added separately.

Verified locally: go build ./..., go vet -tags integration ./test/integration/, go test ./... (100% coverage of both methods and the iterator), generated files idempotent, script/metadata.sh check, and custom-gcl 0 issues.

@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.62%. Comparing base (fef0352) to head (e044aa5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4642   +/-   ##
=======================================
  Coverage   98.61%   98.62%           
=======================================
  Files         199      200    +1     
  Lines       18694    18730   +36     
=======================================
+ Hits        18436    18472   +36     
  Misses        258      258           

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

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Oct 17, 2026

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @JamBalaya56562!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @Not-Dhananjay-Mishra

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.

Add support for organization rule suites

2 participants