Skip to content

fix!: Fix LicenseStatus response and Supportkey type#4297

Open
s4mur4i wants to merge 3 commits into
google:masterfrom
s4mur4i:master
Open

fix!: Fix LicenseStatus response and Supportkey type#4297
s4mur4i wants to merge 3 commits into
google:masterfrom
s4mur4i:master

Conversation

@s4mur4i

@s4mur4i s4mur4i commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

BREAKING CHANGE: LicenseStatus.SupportKey type changed from *string to *bool and License return type is no longer a slice.

Closes: #4296

License status response was implemented according to documentation, which is not according to actual response.

Fix:
Corrected the response
Fixed incorrect data type for SupportKey
Fixed tests

@gmlewis gmlewis changed the title fix: Fix License Status response and Supportkey type fix!: Fix License Status response and Supportkey type Jun 12, 2026
@gmlewis gmlewis changed the title fix!: Fix License Status response and Supportkey type fix!: Fix LicenseStatus response and Supportkey type Jun 12, 2026
@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). labels Jun 12, 2026
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.47%. Comparing base (952dff0) to head (77c8570).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4297   +/-   ##
=======================================
  Coverage   97.46%   97.47%           
=======================================
  Files         192      192           
  Lines       19258    19310   +52     
=======================================
+ Hits        18770    18822   +52     
  Misses        270      270           
  Partials      218      218           

☔ View full report in Codecov by Harness.
📢 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.

@gmlewis gmlewis 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, @s4mur4i!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @alexandear - @zyfy29 - @Not-Dhananjay-Mishra

//
//meta:operation GET /manage/v1/config/license
func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Response, error) {
func (s *EnterpriseService) License(ctx context.Context) (*LicenseStatus, *Response, error) {

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.

Let's add a comment to the function that GitHub documentation is wrong about the response.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Their last response was:

We’ll treat this as a documentation/schema mismatch and route it for review so the example can be corrected to match the actual GHES behavior.

Eventually it should be corrected, in that case wouldn't that cause confusion?

Comment thread github/enterprise_manage_ghes_config.go Outdated
Comment on lines 354 to +360
// License gets the current license information for the GitHub Enterprise instance.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information
//
//meta:operation GET /manage/v1/config/license
func (s *EnterpriseService) License(ctx context.Context) ([]*LicenseStatus, *Response, error) {
// Current Docs shouw incorrect return type. They list as [{...}] but actual is {...}
// TODO: Remove comment after github updates schema documentation

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.

I propose adding a note:

// License gets the current license information for the GitHub Enterprise instance.
//
// NOTE: The GitHub documentation incorrectly shows the return type as a list ([{...}]),
// but the actual response is a single object ({...}).
// TODO: Remove this note once GitHub corrects the schema documentation.
//
// GitHub API docs: https://docs.github.com/enterprise-server@3.21/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information
//
//meta:operation GET /manage/v1/config/license

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I cannot accept this, should I just update with commit?

Comment thread github/enterprise_manage_ghes_config.go Outdated
Co-authored-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect return and data type in license api

3 participants