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 missing fields to user and org types #1548

Merged
merged 2 commits into from May 31, 2020

Conversation

nightlark
Copy link
Contributor

I noticed that there were a few fields in the User and Organization responses from GitHub that weren't in the types defined here.

https://developer.github.com/v3/users/
https://developer.github.com/v3/orgs/

For both: twitter_username
For orgs: is_verified, has_organization_projects, has_repository_projects

@googlebot googlebot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label May 31, 2020
@codecov
Copy link

codecov bot commented May 31, 2020

Codecov Report

Merging #1548 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1548   +/-   ##
=======================================
  Coverage   67.92%   67.92%           
=======================================
  Files          94       94           
  Lines        8670     8670           
=======================================
  Hits         5889     5889           
  Misses       1880     1880           
  Partials      901      901           
Impacted Files Coverage Δ
github/orgs.go 69.69% <ø> (ø)
github/users.go 53.39% <ø> (ø)

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 407d736...3e258f8. Read the comment docs.

github/orgs.go Outdated
@@ -45,6 +46,9 @@ type Organization struct {
Type *string `json:"type,omitempty"`
Plan *Plan `json:"plan,omitempty"`
TwoFactorRequirementEnabled *bool `json:"two_factor_requirement_enabled,omitempty"`
IsVerified *bool `json:"is_verified,omitempty"`
HasOrgProjects *bool `json:"has_organization_projects,omitempty"`
HasRepoProjects *bool `json:"has_repository_projects,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

In this repo, we have tried to keep a 1:1 transliteration of the JSON field names to the Go field names, (despite taking the liberty of shortening the API endpoint names)... so if you don't mind, could we please make these fields:

HasOrganizationProjects
HasRepositoryProjects

respectively?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I expanded the abbreviations. The naming was following the shortening used for the MemberCan* permissions (which are already much longer even without shortening).

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not finding MemberCan... in this repo, but if they are not a 1:1 transliteration of the JSON field names, then I probably made a mistake in allowing them in.
Thanks for the changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, missed an s. This struct has several fields starting with MembersCan and DefaultRepo that are shortened.

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.

LGTM.
Merging.

@gmlewis gmlewis merged commit 2c8de65 into google:master May 31, 2020
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.

None yet

3 participants