Add owner attribute for repository resource
An attempt to fix #1702.
The lack of ability to specify owner for an individual repository resource makes this provider pretty much unusable in a GHES environment containing over 300 organizations – having a separate provider for every single organization is probably not a great idea.
I'm not sure my solution is ideal – the current code is quite biased on the owner being resolved automatically, so it's a bit challenging to add support for an explicit owner without introducing a breaking change.
I've tested this quite extensively manually – seems to be working as expected. If someone could help with adding some tests to confirm this, I would appreciate. Also, these changes should be applied to all repository_ resources, but prior to doing that, I wanted to get some feedback.
Before the change?
-
repositoryresource usesownerspecified at the provider level.
After the change?
-
repositoryresource supports an optionalownerargument. - If the argument is provided, the resource is managed under that specific owner.
- If the argument is not provided, the owner defined at the provider level is used.
Pull request checklist
- [ ] Tests for the changes have been added (for bug fixes / features)
- [X] Docs have been reviewed and added / updated if needed (for bug fixes / features)
Does this introduce a breaking change?
Please see our docs on breaking changes to help!
- [ ] Yes
- [X] No
This seems like a good approach to the change to me, though I also feel somewhat uncomfortable without integration tests.
Hey @tdabasinskas, just a quick follow up. Is this something that you are interested in wrapping up? I think the remaining items are:
- @kfcampbell left a quick suggestion on the docs
- Some integration tests if you get the chance
Thanks again for making things better for the community here! ❤️
Hi @nickfloyd,
Sorry for dropping a ball on this.
I've updated the docs as per @kfcampbell proposal. However, I'm not sure when I could do the integration tests, and, more importantly, add this to all the rest of repository-related resources. Being able to set owner only for repository resource but still requiring dedicated providers for all other resources, is not ideal 😕
Being able to set owner only for repository resource but still requiring dedicated providers for all other resources, is not ideal 😕
I definitely agree with this take, and this is something the provider can stand to do a lot better on. We'd definitely be receptive to anybody wanting to continue this work.
Hey every, just a heads up - I merged this branch into my own and am continuing this work there. Feedback welcome!