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

addition of team sync support #400

Merged
merged 24 commits into from
May 5, 2020
Merged

addition of team sync support #400

merged 24 commits into from
May 5, 2020

Conversation

anGie44
Copy link
Contributor

@anGie44 anGie44 commented Mar 30, 2020

Addition of team_sync_groups data source and team_sync_group_mapping resource to address GitHub's new Team Sync capabilities as discussed in issue: https://github.com/terraform-providers/terraform-provider-github/issues/293

@ghost ghost added the size/XL label Mar 30, 2020
@aareet aareet linked an issue Mar 30, 2020 that may be closed by this pull request
@anGie44 anGie44 changed the title team sync support addition of team sync support Mar 30, 2020
@anGie44 anGie44 requested a review from megan07 March 30, 2020 20:57
@jopedros
Copy link

Hi @anGie44 I'm not a contributor in this provider, but should not you create also the documentation pages in /website/docs/r|d ?

Thanks!

@anGie44
Copy link
Contributor Author

anGie44 commented Mar 31, 2020

ah yes great catch @jopedros, thank you! i'll make the addition.

@ghost ghost added the Type: Documentation Improvements or additions to documentation label Mar 31, 2020
Copy link
Contributor

@megan07 megan07 left a comment

Choose a reason for hiding this comment

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

Looks really good! A few comments, but it's a great first PR! Nice work!

github/data_source_github_team_sync_groups.go Outdated Show resolved Hide resolved
github/data_source_github_team_sync_groups.go Outdated Show resolved Hide resolved
github/data_source_github_team_sync_groups.go Outdated Show resolved Hide resolved
github/data_source_github_team_sync_groups_test.go Outdated Show resolved Hide resolved
github/resource_github_team_sync_group_mapping.go Outdated Show resolved Hide resolved
github/resource_github_team_sync_group_mapping_test.go Outdated Show resolved Hide resolved
github/resource_github_team_sync_group_mapping_test.go Outdated Show resolved Hide resolved
github/resource_github_team_sync_group_mapping_test.go Outdated Show resolved Hide resolved
@anGie44 anGie44 requested a review from megan07 April 2, 2020 16:32
Copy link
Contributor

@megan07 megan07 left a comment

Choose a reason for hiding this comment

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

Great changes! Looks good, thanks!

@anGie44 anGie44 requested a review from a team April 3, 2020 03:07
Copy link
Contributor

@megan07 megan07 left a comment

Choose a reason for hiding this comment

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

LGTM! Great work!

@anGie44
Copy link
Contributor Author

anGie44 commented Apr 9, 2020

@megan07 I was finally able to test the data/resource w/my test github enterprise cloud org configured w/SAML and Azure AD. The changes I pushed up reflect some bugs I found but the API calls are still error prone -- filed the issue/PR here: google/go-github#1484

In the meantime, the tests catch the 404 errors/missing state:

make testacc TEST=./github TESTARGS='-run=TestAccGithubOrganizationTeam'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./github -v -run=TestAccGithubOrganizationTeam -timeout 120m
=== RUN   TestAccGithubOrganizationTeamSyncGroupsDataSource_existing
=== PAUSE TestAccGithubOrganizationTeamSyncGroupsDataSource_existing
=== CONT  TestAccGithubOrganizationTeamSyncGroupsDataSource_existing
--- PASS: TestAccGithubOrganizationTeamSyncGroupsDataSource_existing (4.10s)
PASS
ok      github.com/terraform-providers/terraform-provider-github/github 4.503s
make testacc TEST=./github TESTARGS='-run=TestAccGithubTeamSync'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./github -v -run=TestAccGithubTeamSync -timeout 120m
=== RUN   TestAccGithubTeamSyncGroupMapping_basic
=== PAUSE TestAccGithubTeamSyncGroupMapping_basic
=== RUN   TestAccGithubTeamSyncGroupMapping_empty
=== PAUSE TestAccGithubTeamSyncGroupMapping_empty
=== CONT  TestAccGithubTeamSyncGroupMapping_basic
=== CONT  TestAccGithubTeamSyncGroupMapping_empty
--- PASS: TestAccGithubTeamSyncGroupMapping_basic (5.66s)
--- PASS: TestAccGithubTeamSyncGroupMapping_empty (6.15s)
PASS
ok      github.com/terraform-providers/terraform-provider-github/github 6.544s

@gmlewis
Copy link

gmlewis commented Apr 10, 2020

@anGie44 - https://github.com/google/go-github/releases/tag/v31.0.0 has been released, as requested. Thank you for your contributions! They are greatly appreciated!

@anGie44
Copy link
Contributor Author

anGie44 commented Apr 10, 2020

Note: these changes (and subsequent changes to handle API calls) will be contingent on upgrade to go-github v31.0.0 with https://github.com/terraform-providers/terraform-provider-github/pull/424

@anGie44 anGie44 force-pushed the ap_team_sync_support branch from f1cb72d to 7fa1d3f Compare April 17, 2020 21:22
@jlpedrosa
Copy link

Hi @megan07

Is this PR ready to be merged? I don't know if you have any ETA for the merge, we would probably go with a custom build from master when this patch is merged.

@anGie44
Copy link
Contributor Author

anGie44 commented Apr 21, 2020

hi @jlpedrosa - thanks for following up on this PR! the changes still depend on an upgrade to the provider's go-github library (upgrade submitted in PR #424). once that change is in, the work here can be safely merged and use the updated API methods that the go-github v31.0.0 will support for team-sync usage. currently this is marked for the v.2.8.0 milestone but we can discuss here on prioritizing this PR (and #424) if possible with @jcudit :)

@anGie44
Copy link
Contributor Author

anGie44 commented May 5, 2020

Output of acceptance testing (with enterprise account):

--- PASS: TestAccGithubTeamSyncGroupMapping_empty (12.61s)
--- PASS: TestAccGithubTeamSyncGroupMapping_basic (17.53s)
--- PASS: TestAccGithubTeamSyncGroupMapping_disappears (18.78s)
--- PASS: TestAccGithubTeamSyncGroupMapping_update (30.68s)
--- PASS: TestAccGithubOrganizationTeamSyncGroupsDataSource_existing (3.39s)

@anGie44 anGie44 merged commit 0c84c21 into master May 5, 2020
@anGie44 anGie44 deleted the ap_team_sync_support branch May 5, 2020 14:26
anGie44 added a commit that referenced this pull request May 5, 2020
@anGie44
Copy link
Contributor Author

anGie44 commented May 5, 2020

Hi @jlpedrosa 👋, please find the changes now in master. Let us know if you have any further questions or if we can help in any way. thanks in advance!

@jlpedrosa
Copy link

Hi @anGie44

Thanks for the follow up! As soon as it is released we will incorporate it in out project. Will let you know if there's any feedback we can give.

kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
…sync_support

addition of team sync support
kfcampbell pushed a commit to kfcampbell/terraform-provider-github that referenced this pull request Jul 26, 2022
"group": {
Type: schema.TypeSet,
Optional: true,
ForceNew: true,

Choose a reason for hiding this comment

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

@anGie44 I know this has been long part of the provider, but what was the reasoning for this? At first sight, it doesn't seem like an update to the groups should require a new resource. Why wasn't in-place updating possible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL Type: Documentation Improvements or additions to documentation Upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: GitHub IdP Teams Sync support
7 participants