feat: Add enterprise license endpoints#3755
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3755 +/- ##
==========================================
+ Coverage 91.41% 91.42% +0.01%
==========================================
Files 187 188 +1
Lines 16822 16851 +29
==========================================
+ Hits 15377 15406 +29
Misses 1257 1257
Partials 188 188 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a04735c to
b3b7258
Compare
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @MathewClegg!
Another thing we try to do in this repo is err on the side of using omitempty (with field type pointers) in the JSON field tags because GitHub is known to add/remove fields from structs, and by standardizing we also get the benefits of the auto-generated getters for fields.
Add GetConsumedLicenses and GetLicenseSyncStatus methods to EnterpriseService for retrieving license consumption data and sync status for Enterprise Server instances. Fixes google#3754 Signed-off-by: Mathew Clegg <mathew.clegg@live.se>
b3b7258 to
fec22d2
Compare
|
As explained in CONTRIBUTING.md, please do not use force-push in PRs in this repo, as it makes it difficult for reviewers to see what changed since their last review. Thanks. |
|
Thank you so much for your review. I'll make sure to not force push next time |
Add nil-safe getter methods for ServerInstanceProperties, ServerInstances, ServiceInstanceItems, and ServerItemProperties to follow go-github patterns Signed-off-by: Mathew Clegg <mathew.clegg@live.se>
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @MathewClegg!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
cc: @stevehipwell - @alexandear - @zyfy29
github/enterprise_licenses.go
Outdated
| // EnterpriseLicensedUsers represents users that hold an enterprise license. | ||
| type EnterpriseLicensedUsers struct { | ||
| GithubComLogin string `json:"github_com_login"` | ||
| GithubComName string `json:"github_com_name"` |
There was a problem hiding this comment.
According to the schema:
"github_com_name": {
"type": [
"string",
"null"
]
},
this field should be:
| GithubComName string `json:"github_com_name"` | |
| GithubComName *string `json:"github_com_name,omitempty"` |
There was a problem hiding this comment.
Please check and fix other fields in the file
There was a problem hiding this comment.
Thank you @alexandear. I've gone ahead and updated the structs and test accordingly
Use pointer types (*string, *bool) for nullable fields instead of zero values, add omitempty tags to slices, and remove deprecated field. Update tests accordingly. Signed-off-by: Mathew Clegg <mathew.clegg@live.se>
|
Thank you, @alexandear! |
Add GetConsumedLicenses and GetLicenseSyncStatus methods to EnterpriseService for retrieving license consumption data and sync status for Enterprise Server instances.
Fixes #3754