Skip to content

feat: Add enterprise license endpoints - #3755

Merged
gmlewis merged 4 commits into
google:masterfrom
MathewClegg:implement-enterprise-license-endpoints
Oct 13, 2025
Merged

feat: Add enterprise license endpoints#3755
gmlewis merged 4 commits into
google:masterfrom
MathewClegg:implement-enterprise-license-endpoints

Conversation

@MathewClegg

Copy link
Copy Markdown
Contributor

Add GetConsumedLicenses and GetLicenseSyncStatus methods to EnterpriseService for retrieving license consumption data and sync status for Enterprise Server instances.

Fixes#3754

@codecov

codecovBot commented Oct 4, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.42%. Comparing base (06b8b3a) to head (3698620).
⚠️ Report is 2 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment threadgithub/enterprise_licenses.go
@MathewClegg
MathewCleggforce-pushed the implement-enterprise-license-endpoints branch from a04735c to b3b7258CompareOctober 4, 2025 16:51

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Comment threadgithub/enterprise_licenses.go Outdated
Comment threadgithub/enterprise_licenses.go Outdated
Comment threadgithub/enterprise_licenses.go Outdated
Comment threadgithub/enterprise_licenses.go Outdated
Comment threadgithub/enterprise_licenses.go Outdated
Comment threadgithub/enterprise_licenses.go Outdated
Comment threadgithub/enterprise_licenses.go Outdated
Comment threadgithub/enterprise_licenses.go Outdated
Comment threadgithub/enterprise_licenses.go Outdated
Comment threadgithub/enterprise_licenses.go Outdated
Add GetConsumedLicenses and GetLicenseSyncStatus methods to
EnterpriseService for retrieving license consumption data and
sync status for Enterprise Server instances.
Fixesgoogle#3754
Signed-off-by: Mathew Clegg <mathew.clegg@live.se>
@MathewClegg
MathewCleggforce-pushed the implement-enterprise-license-endpoints branch from b3b7258 to fec22d2CompareOctober 5, 2025 12:01
@gmlewis

Copy link
Copy Markdown
Collaborator

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.

@MathewClegg

Copy link
Copy Markdown
ContributorAuthor

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>
@gmlewisgmlewis added the NeedsReview PR is awaiting a review before merging. label Oct 5, 2025

@gmlewisgmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @MathewClegg!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @zyfy29

@stevehipwellstevehipwell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment threadgithub/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"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

According to the schema:

 "github_com_name": {
"type": [
"string",
"null"
]
},

this field should be:

Suggested change
GithubComNamestring`json:"github_com_name"`
GithubComName*string`json:"github_com_name,omitempty"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please check and fix other fields in the file

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

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>
@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @alexandear!
Merging.

@gmlewisgmlewis removed the NeedsReview PR is awaiting a review before merging. label Oct 13, 2025
@gmlewis
gmlewis merged commit 62a754f into google:masterOct 13, 2025
7 checks passed
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Enterprise License API endpoints.

4 participants

@MathewClegg@gmlewis@alexandear@stevehipwell