Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support repository_id in org ruleset conditions #2825

Merged
merged 2 commits into from Jul 15, 2023

Conversation

ysoldak
Copy link
Contributor

@ysoldak ysoldak commented Jul 3, 2023

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
Copy link

google-cla bot commented Jul 3, 2023

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
Copy link

codecov bot commented Jul 4, 2023

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 Files Coverage Δ
github/repos_rules.go 100.00% <ø> (ø)

Copy link
Collaborator

@gmlewis gmlewis left a comment

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.

github/repos_rules.go Outdated Show resolved Hide resolved
github/repos_rules.go Outdated Show resolved Hide resolved
github/repos_rules.go Outdated Show resolved Hide resolved
github/orgs_rules_test.go Outdated Show resolved Hide resolved
github/orgs_rules_test.go Outdated Show resolved Hide resolved
@gmlewis gmlewis 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 gmlewis July 4, 2023 18:18
@gmlewis
Copy link
Collaborator

gmlewis commented Jul 4, 2023

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

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

ysoldak commented Jul 4, 2023

🤦 PTAL

Copy link
Collaborator

@gmlewis gmlewis left a comment

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
Contributor Author

ysoldak commented Jul 5, 2023

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

Copy link
Contributor

@liaodaniel liaodaniel left a comment

Choose a reason for hiding this comment

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

LGTM

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

gmlewis commented Jul 15, 2023

Thank you, @liaodaniel !
Merging.

@gmlewis gmlewis merged commit bedd4e3 into google:master Jul 15, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking API Change PR 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.

None yet

3 participants