Skip to content

Add support in rulesets for including or excluding repos based on properties - #3194

Merged
gmlewis merged 7 commits into
google:masterfrom
nordnet:repo-property-ruleset-conditions
Jun 26, 2024
Merged

Add support in rulesets for including or excluding repos based on properties#3194
gmlewis merged 7 commits into
google:masterfrom
nordnet:repo-property-ruleset-conditions

Conversation

@claystation

Copy link
Copy Markdown
Contributor

Github recently introduced Repository Properties. Rulesets can include or exclude repositories based on these properties.
The PR implements those conditions.

According to Github API docs:
https://docs.github.com/en/rest/orgs/rules?apiVersion=2022-11-28#create-an-organization-repository-ruleset

Changed comment on RulesetConditions struct to say either use Name, ID OR repo property. The docs have not been super clear on this but i assume so because when creating rulesets trough UI you can either select repositories based on name or on property.

Please let me know what you think!

@claystationclaystation changed the title Repo property ruleset conditionsAdd support in rulesets for including or excluding repositories based on repo propertiesJun 25, 2024
@codecov

codecovBot commented Jun 25, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.90%. Comparing base (2b8c7fa) to head (f594bc7).
Report is 74 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #3194 +/- ##
==========================================
- Coverage 97.72% 92.90% -4.82% 
==========================================
Files 153 171 +18 Lines 13390 11548 -1842 ==========================================
- Hits 13085 10729 -2356 - Misses 215 726 +511 - Partials 90 93 +3 

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

@gmlewisgmlewis changed the title Add support in rulesets for including or excluding repositories based on repo propertiesAdd support in rulesets for including or excluding repos based on propertiesJun 25, 2024
@gmlewisgmlewis added the NeedsReview PR is awaiting a review before merging. label Jun 25, 2024

@gmlewisgmlewis 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, @claystation !
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

@ysoldakysoldak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@claystation

Copy link
Copy Markdown
ContributorAuthor

@gmlewis i had to fix a small bug by removing omitempty from include and exclude directives in RulesetRepositoryPropertyConditionParameters struct. This is because the Github API requires them even when empty. Would you like to re-review?

@gmlewisgmlewis removed the NeedsReview PR is awaiting a review before merging. label Jun 26, 2024
@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @ysoldak and @claystation !
LGTM.
Merging.

@gmlewis
gmlewis merged commit 42ae4fe into google:masterJun 26, 2024
@claystation
claystation deleted the repo-property-ruleset-conditions branch June 27, 2024 14:52
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto 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.

3 participants

@claystation@gmlewis@ysoldak