fix: Treat BusinessTeam as a regular Team for Environment reviewers - #4456
fix: Treat BusinessTeam as a regular Team for Environment reviewers#4456JWilkinsonMB wants to merge 2 commits into
BusinessTeam as a regular Team for Environment reviewers#4456Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4456 +/- ##
=======================================
Coverage 97.55% 97.55%
=======================================
Files 194 194
Lines 19884 19890 +6
=======================================
+ Hits 19398 19404 +6
Misses 268 268
Partials 218 218 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
BusinessTeam as a regular Team for Environment reviewers
|
@JWilkinsonMB - once you get the Google CLA signed, please let us know, and we can then proceed with this PR. |
|
I'm still following up internally on the CLA, hopefully not too much longer |
It is now supported to use Enterprise Teams as reviewers for Environments, however the type returned by the API has changed, so that instead of Team, it is now BusinessTeam. Sample JSON below:
{ "reviewers": [ { "type": "BusinessTeam", "reviewer": { "name": "Name", "id": 123456, "node_id": "ET_xyz123456", "slug": "ent:xyz123", "description": "", "privacy": "closed", "notification_setting": "notifications_enabled", "url": "https://api.github.com/enterprises/xyz/teams/123456", "html_url": "https://github.com/enterprises/xyz/teams/ent:desktop", "members_url": "https://api.github.com/enterprises/xyz/teams/123456/memberships{/member}", "repositories_url": "https://api.github.com/enterprises/xyz/teams/123456/repos", "type": "enterprise", "enterprise_id": 123, "permission": "pull", "parent": null } } ] }Prior to this PR this leads to an unmarshaling error if an enterprise team is included as a reviewer in any environment that the library tries to read.
Whilst there are some differences between a BusinessTeam and a Team such as enterprise_id instead of organization_id, a quick workaround is to treat both types as a Team given there is sufficient overlap which allows consumers such as the Terraform provider to be able to work without any breaking changes.
Fixes #4457