Skip to content

Support repository_id in org ruleset conditions - #2825

Merged
gmlewis merged 2 commits into
google:masterfrom
ysoldak:rulesets-repo-id
Jul 15, 2023
Merged

Support repository_id in org ruleset conditions#2825
gmlewis merged 2 commits into
google:masterfrom
ysoldak:rulesets-repo-id

Conversation

@ysoldak

Copy link
Copy Markdown
Contributor

This PR adds support for referencing repositories by ID in Ruleset conditions.
See https://docs.github.com/en/rest/orgs/rules?apiVersion=2022-11-28#create-an-organization-repository-ruleset

API is changed a bit, probably a low impact since v53.2.0 (with ruleset support added) was released just recently and hopefully not many have code using it in production.

The change RulesetRepositoryConditionParameters -> RulesetRepositoryNamesConditionParameters

I'm open for suggestions for a change that would not shake the API.

@google-cla

google-claBot commented Jul 3, 2023

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@codecov

codecovBot commented Jul 4, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2825 (3881d6f) into master (9f7124c) will not change coverage.
The diff coverage is n/a.

@@ Coverage Diff @@## master #2825 +/- ##
=======================================
Coverage 98.06% 98.06% =======================================
Files 136 136 Lines 12279 12279 =======================================
Hits 12041 12041 Misses 162 162 Partials 76 76 
Impacted FilesCoverage Δ
github/repos_rules.go100.00% <ø> (ø)

@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, @ysoldak !
Just a few tweaks, please, then we will be ready for a second LGTM+Approval before merging.

Comment threadgithub/repos_rules.go Outdated
Comment threadgithub/repos_rules.go Outdated
Comment threadgithub/repos_rules.go Outdated
Comment threadgithub/orgs_rules_test.go Outdated
Comment threadgithub/orgs_rules_test.go Outdated
@gmlewisgmlewis added NeedsReview PR is awaiting a review before merging. Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). labels Jul 4, 2023
@ysoldak
ysoldak requested a review from gmlewisJuly 4, 2023 18:18
@gmlewis

Copy link
Copy Markdown
Collaborator

Please also update the unit tests so that go test ./... passes on your local machine.

ysoldakand others added 2 commits July 4, 2023 22:15
Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
@ysoldak

Copy link
Copy Markdown
ContributorAuthor

🤦 PTAL

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

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

@ysoldak

Copy link
Copy Markdown
ContributorAuthor

Thanks, @gmlewis

I thought worth to reference GitHub's own statement about API change:
https://github.blog/changelog/2023-06-27-repository-rules-public-beta-updates/

The part this PR addresses is "Added a repository picker to target select repositories for organization rulesets."

@liaodanielliaodaniel 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

@gmlewisgmlewis removed the NeedsReview PR is awaiting a review before merging. label Jul 15, 2023
@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @liaodaniel !
Merging.

@gmlewis
gmlewis merged commit bedd4e3 into google:masterJul 15, 2023
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

Breaking API ChangePR will require a bump to the major version num in next release. Look here to see the change(s).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ysoldak@gmlewis@liaodaniel