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.
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? |
|
@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? |
These tests check validation that was handover to the Terraform built-in validation
Improve e2e tests for the ruleset and improve documentation
Setup the tests case using the config instead of using the API
… in organization ruleset
…zation ruleset tests
|
Really looking forward to this capability. 🚀 |
…ory conditions ExactlyOneOf has known issues with nested optional list blocks in Terraform SDK. Use ConflictsWith + AtLeastOneOf pattern for reliable "exactly one" validation across repository_name, repository_id, and repository_property conditions. Updated test expectations to match new error message format from ConflictsWith. Addresses feedback from PR integrations#2356 comment r2968116244, references fix from integrations#3235
4ea85bf to
1bf703e
Compare
|
@deiga PR rebased, and applied the changes requested by @mkushakov |
|
@stevehipwell @robert-crandall this has been stuck with problems on our side very long. |
|
@robert-crandall could you please review this? |
|
@robert-crandall Thanks! Could you check the mergeability if this PR? At some point it was blocked due to open comments, which we couldn't resolve |
@deiga if you click this small icon, it should show you unresolved comments which are sometimes invisible due to force-pushing or long PR discussions: |
|
@mkushakov Thanks, I think we checked those and they were missing any way to resolve them 😬 |
|
@deiga can you try to click this small check button? |
|
@deiga Can you try resolving conversations with blocking changes requested? For example, #2356 (comment) |
That's not mine, so I can't 😬 @Moser-ss maybe can? The one comment which is mine just shows an error when clicking on the resolve button... |
|
@deiga I've resolved the remaining unresolved conversations, you are good to merge this now. |
…ntegrations#2356) * Define schema for repository_property 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 * Apply format in the code base * Fix repository_property validation and docs - 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 * Support repository_property in push rulesets * Remove unused customdiff imports * Replace custom validation with built-in ExactlyOneOf for repo targeting Add ExactlyOneOf/AtLeastOneOf to repository_property, repository_name,repository_id fields. Remove manual validation counting in util_ruleset_validation.Add 3 validation tests for single/multiple/missing repo targeting options. Addresses PR integrations#2356 review feedback - simplifies validation using schema constraints. * Rever unintencial change * Add tests, docs, and fix default handling for repository_property - Add doc example for repository_property usage - Add tests for exclude block, multiple properties, and updates - Fix source field default handling in flatten function to prevent diffs * Apply suggestions from PR comment * Add unit tests * Remove redundant condition * Updated description based in the GitHub API docs * Apply linter and fmt * Remove unnecessary checks * Remove tests These tests check validation that was handover to the Terraform built-in validation * Improve syntax for include and exclude property Improve e2e tests for the ruleset and improve documentation * Use t context * Rewrite tests using the resource_github_organization_custom_properties Setup the tests case using the config instead of using the API * Refactor repository property names in organization ruleset tests for consistency * Refactor tests to use state checks for repository property validation in organization ruleset * Update repository property references to use default_branch in organization ruleset tests * Fix: Replace ExactlyOneOf with ConflictsWith/AtLeastOneOf for repository conditions ExactlyOneOf has known issues with nested optional list blocks in Terraform SDK. Use ConflictsWith + AtLeastOneOf pattern for reliable "exactly one" validation across repository_name, repository_id, and repository_property conditions. Updated test expectations to match new error message format from ConflictsWith. Addresses feedback from PR integrations#2356 comment r2968116244, references fix from integrations#3235 * Apply lint



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!