[FEAT] Add support for Enterprise Teams#3008
[FEAT] Add support for Enterprise Teams#3008vmvarela wants to merge 7 commits intointegrations:mainfrom
Conversation
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
|
Hey @vmvarela 👋 Thank you for your contribution! We've started migration towards Context-aware provider functions, could you update the CRUD methods to those? So changing |
4e6cb30 to
17ba121
Compare
b070f07 to
a586037
Compare
deiga
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
The Enteprise Teams functionality isn't yet published in the go-github SDK, but it will most likely be coming in v81. I would suggest to refactor this PR to use the upcoming release of the SDK instead of making our own API interactions.
We most likely won't get to merging this before we release v7 of the provider, where we'll hopefully quickly get to latest SDK version.
A few other notes:
- Try to leverage
ValidateDiagFuncin the Schema as much as possible, instead of failing in the CRUD provider functions on missing information. For more complex validations using aCustomizeDifffunction is a good option as well. That will allow the user to get errors onplaninstead ofapply - Please add top-level
Descriptionfields to all Schemata and ensure that allDescriptionfields contain same information as the docs pages. We'll be moving to generated docs pages in the near future
2997703 to
9fc330c
Compare
35c1022 to
c830136
Compare
All It is completed @deiga |
c830136 to
82f05fe
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds comprehensive support for managing GitHub Enterprise Teams at the enterprise level, enabling users to create and manage teams, memberships, and organization assignments through Terraform.
Key Changes:
- Implementation of 3 new resources for managing enterprise teams, team memberships, and organization assignments
- Addition of 4 new data sources for querying enterprise team information
- Custom API client utilities to handle enterprise teams endpoints (currently in preview with API version 2022-11-28)
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
github/util_enterprise_teams.go |
Core utility functions for interacting with GitHub's Enterprise Teams API, including CRUD operations and custom request handling for the preview API |
github/resource_github_enterprise_team.go |
Resource implementation for creating/updating/deleting enterprise teams with support for organization selection and IdP group mapping |
github/resource_github_enterprise_team_membership.go |
Resource for managing individual user memberships within enterprise teams |
github/resource_github_enterprise_team_organizations.go |
Resource for assigning enterprise teams to specific organizations within the enterprise |
github/data_source_github_enterprise_team.go |
Data source for retrieving enterprise team information by slug or ID |
github/data_source_github_enterprise_teams.go |
Data source for listing all enterprise teams in an enterprise |
github/data_source_github_enterprise_team_membership.go |
Data source for checking user membership status in enterprise teams |
github/data_source_github_enterprise_team_organizations.go |
Data source for listing organizations assigned to an enterprise team |
github/provider.go |
Provider registration for all new resources and data sources |
github/resource_github_enterprise_team_test.go |
Acceptance tests for enterprise team resources |
github/data_source_github_enterprise_team_test.go |
Acceptance tests for enterprise team data sources |
github/data_source_github_enterprise_teams_test.go |
Acceptance tests for enterprise teams listing data source |
website/docs/r/enterprise_team.html.markdown |
Documentation for the enterprise team resource |
website/docs/r/enterprise_team_membership.html.markdown |
Documentation for the enterprise team membership resource |
website/docs/r/enterprise_team_organizations.html.markdown |
Documentation for the enterprise team organizations resource |
website/docs/d/enterprise_team.html.markdown |
Documentation for the enterprise team data source |
website/docs/d/enterprise_teams.html.markdown |
Documentation for the enterprise teams listing data source |
website/docs/d/enterprise_team_membership.html.markdown |
Documentation for the enterprise team membership data source |
website/docs/d/enterprise_team_organizations.html.markdown |
Documentation for the enterprise team organizations data source |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1443050 to
e8c1079
Compare
deiga
left a comment
There was a problem hiding this comment.
Half-way though. Looking good!
746f7b0 to
3334713
Compare
Thanks for your support, @deiga . |
9eddee1 to
9969a2f
Compare
|
Hi @deiga, thanks for the review! I've addressed your feedback and made a comprehensive refactor:
Ready for another look when you have time! |
Co-authored-by: vmvarela <11040851+vmvarela@users.noreply.github.com>
1bb8034 to
4d9a880
Compare
4d9a880 to
857e188
Compare
110512d to
d1bc71d
Compare
c9670c8 to
855d9bb
Compare
|
Commit history reorganized 🔄 Hi @deiga, I've reorganized the commit history as requested. The changes are now split into logical, granular commits:
Each commit is self-contained and can be reviewed independently. Going forward, I'll create new commits for any review feedback instead of amending. Sorry for the confusion with the previous workflow - I appreciate your patience and feedback on improving my contribution process. |
Add util_enterprise_teams.go with helper functions for managing enterprise team resources.
Manages GitHub Enterprise team entities (create, read, update, delete). Includes: - Resource implementation with CRUD operations - Acceptance tests - Documentation
Manages membership of users in GitHub Enterprise teams. Includes: - Resource implementation - Documentation
…urce Manages organization assignments to GitHub Enterprise teams. Includes: - Resource implementation - Documentation
Add data sources: - github_enterprise_team: retrieve a team by slug or ID - github_enterprise_teams: list all teams in an enterprise - github_enterprise_team_membership: get team members - github_enterprise_team_organizations: get team organizations Includes: - Data source implementations - Acceptance tests - Documentation
…ources - Register 3 resources in provider.go: - github_enterprise_team - github_enterprise_team_membership - github_enterprise_team_organizations - Register 4 data sources in provider.go: - github_enterprise_team - github_enterprise_teams - github_enterprise_team_membership - github_enterprise_team_organizations
Update import paths from go-github/v81 to go-github/v82 to match the current version in upstream/main.
855d9bb to
3d9ae09
Compare
Add support for managing GitHub Enterprise Teams (enterprise-level teams):
Resources:
Data sources:
Note: These endpoints require GitHub Enterprise Cloud with a classic PAT that has enterprise admin permissions.
Resolves #3001
Before the change?
After the change?
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!