-
Notifications
You must be signed in to change notification settings - Fork 927
feat : Support repository property for GitHub organization ruleset #2356
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
base: main
Are you sure you want to change the base?
feat : Support repository property for GitHub organization ruleset #2356
Conversation
bb62d7a to
40c5111
Compare
|
@kfcampbell, could you take a quick look to see if I need to improve anything in this PR |
kfcampbell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Have you looked at expanding the tests in github/resource_github_organization_ruleset_test.go to cover this usecase yet?
|
A test case was added, I hope the change was not to ugly |
|
@kfcampbell can I do anything to speed up the review of this PR? |
| Elem: &schema.Schema{ | ||
| Type: schema.TypeString, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this handle properties with boolean values? From a json export which shows the use of string "false" and "true" I assume it does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I manualy tested the solution and can handle boelean custom_properties using strings
|
@Moser-ss I think you need to update the docs to reflect these changes? |
|
@stevehipwell Docs updated, thanks for catching that. |
|
@PaarthShah @kfcampbell Would you have an estimate on when this PR might be reviewed and merged? |
@wrighbr No idea, I'm not a maintainer 😅 |
|
We also need this feature. It's been stale for a little while, anything we can do to get this merged? |
|
+1 on this PR. Would be great if this can get merged soon |
|
@kfcampbell If you have a chance to review this feature it would be appreciated thanks! |
|
@kfcampbell +1, thanks! |
|
@kfcampbell would be grateful for your review here 🚀 🚀 🚀 |
|
@kfcampbell - Any chance of getting a review / approval of this PR? |
|
➕ 1️⃣ on getting this merged. Would love to migrate our bash scripts to TF, but need this functionality. |
|
+1 On desperately needing this PR to get approved :( |
|
@kfcampbell - Is there any chance we could get this merged? |
|
@tayven-bigelow check out the commit history for this repo, I don't think GitHub are providing engineering resources here at the moment. |
|
tyvm for setting up this PR, I really hope it merges in soon 🙏 |
|
hi, is there any chance to get this one merged? |
|
Hey there 👋 We're looking into getting this into a mergeable state :) This PR will need to wait until #2891 is merged as the ruleset resources in the SDK have changed. @Moser-ss Could you try rebasing and retargeting this branch to go-github-v68? |
d30875f to
16c81f2
Compare
|
@deiga, I already removed the conflicts by rebasing the branch with the main branch. But do you prefer that I rebase the branch using the branch go-github-v68 |
|
@Moser-ss nice! I think, you could try it locally, to see if anything breaks or needs changes. |
|
@stevehipwell I tried to rebase my branch using the branch go-github-v68, but it starts to be a mess, because I have already made changes from the main branch that are not present in the go-github-v68, in particular the function flattenRules So, do I wait for the changes of go-github-v68 to be in the main branch, or do I redo all my changes in a new branch from the branch go-github-v68 |
|
@Moser-ss I'd hold off working on this until that branch (currently targeting v77) has been merged. I also know we're considering re-working the ruleset code for the v7 provider release. |
46a7499 to
18674a6
Compare
|
@stevehipwell Ok, if you need to spread the work with more people, you can count on me |
|
@Moser-ss This can now be rebased and finalized! We managed to upgrade the SDK without a major release :) |
Refactor expandConditions to reduce complexity Refactor logic to reduce the cognitive complexity and add logic to handle the repository_property field Flatten conditions for repository_property and fix schemas Add test case when ruleset use repository_property Refactor repository property conditions to make them optional Flatten update Target parameters to allow the detection of changes when remote resource is updated Update documentation
- Add ValidateFunc to include.source field for consistency with exclude - Update docs to mention repository_property as third targeting option - Fix missing space in documentation
18674a6 to
0888d58
Compare
|
@deiga I just rebase with main branch |
| ExactlyOneOf: []string{"conditions.0.repository_id", "conditions.0.repository_name"}, | ||
| AtLeastOneOf: []string{"conditions.0.repository_id", "conditions.0.repository_name"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: This isn't going to work as push rulesets don't work with any of these 😬
I have a PR almost ready to build the validation logic for rulesets which you can leverage: https://github.com/integrations/terraform-provider-github/pull/2958/changes#diff-89635a4e1dcb5319cdc31ace60e4b5854c13f237e5325009e4d9897288f9d3a0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a change that I hope matches the style of the validation we want to implement with CustomizeDiff.
I tested with my testing organization
Resolves #2137
Introduces the support to use
repository_propertyto target repositories in the rulesetThe changes were manually tested against a GitHub Organization with an enterprise plan.
It is not possible to add properties with the source system because the lib version doesn't allow that. It is necessary to update to version v65
Before the change?
repository_propertyAfter the change?
repository_propertyunder the conditions blockPull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!