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

[FEAT]: github_collaborators data_source should allow filtering based on permission #2381

Closed
1 task done
felixlut opened this issue Sep 6, 2024 · 2 comments · Fixed by #2382
Closed
1 task done
Labels
Type: Feature New feature or request

Comments

@felixlut
Copy link
Contributor

felixlut commented Sep 6, 2024

Describe the need

Currently the github_collaborators data_source always returns all users that have access to the repo (unless you filter on affiliation, see last paragraph for limitation on that). This becomes a problem in large organizations with many users and some permission (like read) being granted to all repos by default. The result is that any call to this datasource have to list all the users in the entire organization, taking quite a long time.

The underlying API endpoint /repos/OWNER/REPO/collaborators supports filtering via permission, but the Terraform data source does not. This is what this issue is for!

The underlying go-github SDK already support this, so the change in this repo would be pretty straight forward.

Note that it is currently possible to filter on affiliation in the data source, but this is quite limited. You can only get:

  • outside - All outside collaborators with access to the repo
  • direct - All users which have direct access to the repo (notably this does not include users with access to the repo via a team assignment)
  • all - Every user with any access to the repo

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@felixlut felixlut added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Sep 6, 2024
@felixlut
Copy link
Contributor Author

felixlut commented Sep 6, 2024

I can work on this also!

@github-project-automation github-project-automation bot moved this to 🆕 Triage in 🧰 Octokit Active Sep 6, 2024
@kfcampbell kfcampbell moved this from 🆕 Triage to 🏗 In progress in 🧰 Octokit Active Sep 9, 2024
@kfcampbell kfcampbell removed the Status: Triage This is being looked at and prioritized label Sep 9, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in 🧰 Octokit Active Sep 9, 2024
@felixlut
Copy link
Contributor Author

Ty @kfcampbell !

Any chance of a new release in the near future? I have some Terraform that will be running quite a lot faster once we upgrade 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request
Projects
None yet
2 participants