integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
870 stars 710 forks source link

[FEAT]: Support filter parameter on github_organization_team_sync_groups data source #1809

Open janslow opened 12 months ago

janslow commented 12 months ago

Describe the need

Currently, the github_organization_team_sync_groups data source fetches all groups (in fixed page sizes of 100). This causes performance issues if a large number of groups are synced into GitHub (we have about 3000 groups being pushed to GitHub, so the refresh of github_organization_team_sync_groups takes 20+ seconds).

As a feature request, please expose the q query parameter, to allow the data source to be scoped to a subset of all groups:

Filters the results to return only those that begin with the value specified by this parameter. For example, a value of ab will return results that begin with "ab".

For example,

data "github_organization_team_sync_groups" "filtered" {
  q = "myprefix_"
}

SDK Version

No response

API Version

REST API 2022-11-28 (Enterprise Cloud)

Relevant log output

No response

Code of Conduct

cardoe commented 10 months ago

Could this be related to #560?

janslow commented 10 months ago

Could this be related to #560?

Not as far as I can see.

The #560 issue seems to be related to a server error from the Github API, so probably can't be solved by a change in the Terraform provide

This issue is a request to expose an existing feature of the Github API via the provider

There doesn't seem to be any overlapping symptoms between the two

github-actions[bot] commented 1 month ago

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

laughedelic commented 2 weeks ago

This is still very much relevant. Can we reopen it? The data source in the current state is not usable when the IdP has thousands of groups, it should be possible to filter the groups by id or name.

laughedelic commented 2 weeks ago

This is a limitation of the go-github library, so I opened a request upstream: https://github.com/google/go-github/issues/3196 / https://github.com/google/go-github/pull/3197