integrations / integrations/terraform-provider-github

[FEAT]: Refactor owner implementation

Open
#2,940 4 comments 0 reactions 0 assignees View on GitHub
Needs Discussion Type: Feature
Dominant language
Go
Stars
1.2k
Forks
1k
Avg merge
1d 14h
Merged PRs (30d)
8

Description

### Describe the need

The current provider implementation requires the owner to be specified either explicitly with parameters or implicitly via a PAT, this design decision has limitations and the constraints when it was made are no longer the same. I think we should consider changing this constraint to allow us to unlock more use cases.

I think we have 3 potential new patterns with the danger that if we don't do anything about this now we're implicitly choosing option 1.

1. Status quo (do nothing) - Add owner to resources or data sources as the need arises.
2. Breaking - Remove owner from the provider parameter and require it to be set on all resources and data sources that need it.
3. Backward compatibility - Refactor the provider to support `default_owner` and support explicitly setting the owner on resources or data sources that that need it.

My preference would be to go for option 3. I'd also suggest that we could do this by making the provider changes (removing `owner`, `organization`, etc in favour of `default_owner`) as a major version change without having to support all of the resource or data sources from day 1. We could still leave logic in place to get the default owner from a PAT token, but when using an app token not setting the default should error.

### SDK Version

_No response_

### API Version

_No response_

### Relevant log output

```shell

```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.