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

Added Support preview Team Sync API for GitHub Enterprise Cloud users #1212

Merged
merged 3 commits into from
Jul 8, 2019

Conversation

vaibhavsingh97
Copy link
Contributor

Fixes #1200

@googlebot googlebot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label Jun 29, 2019
Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

It's looking good, @vaibhavsingh97! Thank you.

Just a few changes, please, and then I think we will be ready for a first and second LGTM.

github/github.go Outdated
@@ -147,6 +147,9 @@ const (

// https://developer.github.com/changes/2019-04-11-pulls-branches-for-commit/
mediaTypeListPullsOrBranchesForCommitPreview = "application/vnd.github.groot-preview+json"

// https://developer.github.com/changes/2019-06-12-team-sync/
mediaTypeTeamSync = "application/vnd.github.team-sync-preview+json"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you please add Preview to the name to make it mediaTypeTeamSyncPreview ?

github/teams.go Outdated
@@ -476,3 +476,88 @@ func (s *TeamsService) RemoveTeamProject(ctx context.Context, teamID int64, proj

return s.client.Do(ctx, req, nil)
}

// GroupObject reprents list of Idp Group.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change this to: // IDPGroupList represents a list of external identity provider (IDP) groups.
I know GitHub spells it IdP, but Go always uses ID for "identification", so let's stick to the Go standard here too.
😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should I also change the name of struct to IDPGroupList ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, please.

github/teams.go Outdated
}

// Group represents an Idp group status.
type Group struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change this to: // IDPGroup represents an external identity provider (IDP) group.

github/teams.go Outdated
GroupDescription *string `json:"group_description,omitempty"`
}

// ListIDPGroupsInOrganization list IdP groups available in an organization.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please change list IdP to lists IDP.

github/teams.go Outdated

// ListIDPGroupsInOrganization list IdP groups available in an organization.
//
// Github API docs: https://developer.github.com/v3/teams/team_sync/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use the official capitalization for GitHub.

URL should be: https://developer.github.com/v3/teams/team_sync/#list-idp-groups-in-an-organization

github/teams.go Outdated

groups := new(GroupObject)
resp, err := s.client.Do(ctx, req, groups)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please delete this blank line between the err and its test.

github/teams.go Outdated

// ListIDPGroupsForTeam list IdP groups connected to a team on GitHub.
//
// Github API docs: https://developer.github.com/v3/teams/team_sync/
Copy link
Collaborator

Choose a reason for hiding this comment

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

github/teams.go Outdated
// CreateOrUpdateIDPGroupConnections creates, updates, or removes a connection between a team
// and an IdP group.
//
// Github API docs: https://developer.github.com/v3/teams/team_sync/
Copy link
Collaborator

Choose a reason for hiding this comment

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

github/teams.go Outdated
}

// CreateOrUpdateIDPGroupConnections creates, updates, or removes a connection between a team
// and an IdP group.
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/IdP/IDP/

@codecov
Copy link

codecov bot commented Jun 30, 2019

Codecov Report

Merging #1212 into master will decrease coverage by 0.07%.
The diff coverage is 61.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1212      +/-   ##
==========================================
- Coverage   73.39%   73.31%   -0.08%     
==========================================
  Files          84       84              
  Lines        5949     5985      +36     
==========================================
+ Hits         4366     4388      +22     
- Misses        825      832       +7     
- Partials      758      765       +7
Impacted Files Coverage Δ
github/github.go 89.31% <ø> (ø) ⬆️
github/teams.go 71.83% <61.11%> (-2.19%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ffc27d...9a3b64a. Read the comment docs.

Signed-off-by: Vaibhav Singh <[email protected]>
@vaibhavsingh97
Copy link
Contributor Author

@gmlewis Done with changes, please review 😄

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @vaibhavsingh97!
LGTM.

Awaiting second LGTM before merging.

@gmlewis gmlewis requested a review from gauntface July 1, 2019 11:28
@gmlewis
Copy link
Collaborator

gmlewis commented Jul 8, 2019

Thank you, @gauntface!
Merging.

@gmlewis gmlewis merged commit 60c47f3 into google:master Jul 8, 2019
@vaibhavsingh97 vaibhavsingh97 deleted the PR_1200 branch July 9, 2019 17:46
n1lesh pushed a commit to n1lesh/go-github that referenced this pull request Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indication that the PR author has signed a Google Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support preview Team Sync API for GitHub Enterprise Cloud users
4 participants