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

Add summary-only flag to github_team data source #1379

Merged
merged 3 commits into from
Nov 28, 2022

Conversation

david-bain
Copy link
Contributor

@david-bain david-bain commented Nov 21, 2022

Add a flag input to optionally skip returning the repositories and members on calling the github_team data source.

This improves performance of the data source call when only summary information is needed.
Especially important on orgs with large numbers of teams/members.

  • Add summary_only optional flag input to skip returning members and repositories
  • Add 'results_per_page' optional int to reduce the results per page returned.
  • Update docs to reflect changes

Resolves #1377


Behavior

Before the change?

Each call to github_teams would also make a call to get the team members and repositories. When there are a large number of teams that need querying, this could add additional time when only the team details were needed.

After the change?

This improves performance of the data source when only summary information is needed by skipping API calls to get repositories and members. Especially important on orgs with large numbers of teams/members that require calling this data source multiple times.

Other information

Basically a replication of #1176 but for single teams.


Additional info

Pull request checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Added the appropriate label for the given change

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes (Please add the Type: Breaking change label)
  • No
  • [ ]
    No, additional inputs are optional with defaults if not set resulting in no change to behaviour.

If Yes, what's the impact:

  • N/A

Pull request type

Please add the corresponding label for change this PR introduces:

  • Bugfix: Type: Bug
  • Feature/model/API additions: Type: Feature
  • Updates to docs or samples: Type: Documentation
  • Dependencies/code cleanup: Type: Maintenance

…mbers on calling the github_team data source.

This improves performance of the data source when only summary information is needed by skipping API calls to get repositories and members.
Especially important on orgs with large numbers of teams/members that require
calling this data source multiple times.

Add summary_only optional flag input to skip returning members and repositories
Add 'results_per_page' optional int to reduce the results per page returned.
Update docs to reflect change
Copy link

@alexlo03 alexlo03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (FWIW)

Note that team members and repositories are not returned if `summary_only = true`
@david-bain david-bain changed the title Add a flag input to optionally skip returning the repositories and me… Add summary-only flag to github_team data source Nov 23, 2022
Copy link
Member

@kfcampbell kfcampbell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming that integration tests are passing for me locally. Thanks for contributing again, @david-bain!

@kfcampbell kfcampbell merged commit 45dd0fc into integrations:main Nov 28, 2022
kazaker pushed a commit to auto1-oss/terraform-provider-github that referenced this pull request Dec 28, 2022
* Add a flag input to optionally skip returning the repositories and members on calling the github_team data source.

This improves performance of the data source when only summary information is needed by skipping API calls to get repositories and members.
Especially important on orgs with large numbers of teams/members that require
calling this data source multiple times.

Add summary_only optional flag input to skip returning members and repositories
Add 'results_per_page' optional int to reduce the results per page returned.
Update docs to reflect change

* clarify docs

Note that team members and repositories are not returned if `summary_only = true`

Co-authored-by: Keegan Campbell <me@kfcampbell.com>
avidspartan1 pushed a commit to avidspartan1/terraform-provider-github that referenced this pull request Feb 5, 2024
* Add a flag input to optionally skip returning the repositories and members on calling the github_team data source.

This improves performance of the data source when only summary information is needed by skipping API calls to get repositories and members.
Especially important on orgs with large numbers of teams/members that require
calling this data source multiple times.

Add summary_only optional flag input to skip returning members and repositories
Add 'results_per_page' optional int to reduce the results per page returned.
Update docs to reflect change

* clarify docs

Note that team members and repositories are not returned if `summary_only = true`

Co-authored-by: Keegan Campbell <me@kfcampbell.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT]: Add data.github_team summary_only flag
3 participants