Skip to content

feat: Remove the beta endpoint for Copilot usage #3354

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

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

henriklundstrom
Copy link
Contributor

@henriklundstrom henriklundstrom commented Nov 21, 2024

Note: This is a breaking change only in the sense that it removes the endpoints added by 5e806b6, but that commit has not yet made it to any release, so in that sense it is not breaking with any previous release.

Removes support for the beta endpoint for Copilot usage metrics, which is scheduled for removal by GitHub by the end of the year, see https://github.blog/changelog/2024-10-30-github-copilot-metrics-api-ga-release-now-available/. Support for the GA endpoint was implemented by 717e93f.

@gmlewis gmlewis changed the title refactor: Remove the beta endpoint for Copilot usage feat!: Remove the beta endpoint for Copilot usage Nov 21, 2024
@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 Nov 21, 2024
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.30%. Comparing base (2b8c7fa) to head (42f8af8).
Report is 176 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3354      +/-   ##
==========================================
- Coverage   97.72%   92.30%   -5.42%     
==========================================
  Files         153      176      +23     
  Lines       13390    15031    +1641     
==========================================
+ Hits        13085    13874     +789     
- Misses        215     1064     +849     
- Partials       90       93       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@gmlewis
Copy link
Collaborator

gmlewis commented Nov 21, 2024

@henriklundstrom - I'm confused - wasn't GitHub's OpenAPI spec updated to include your new endpoints?
Should I be updating the OpenAPI spec again? (I think I updated it two days ago maybe in #3352.)

@henriklundstrom
Copy link
Contributor Author

@henriklundstrom - I'm confused - wasn't GitHub's OpenAPI spec updated to include your new endpoints? Should I be updating the OpenAPI spec again? (I think I updated it two days ago maybe in #3352.)

@gmlewis There are two sets of endpoints for Copilot metrics. They do largely the same things and both of them were launched very recently. First there was a beta launch, and then shortly thereafter a GA version to replace it.

Beta:
The usage endpoints, see https://docs.github.com/en/rest/copilot/copilot-usage?apiVersion=2022-11-28. They are in public preview, and as far as I understand it from this announcement https://github.blog/changelog/2024-10-30-github-copilot-metrics-api-ga-release-now-available/, will be discontinued by the end of the year. This PR removes support for those endpoints, which was originally added about a month ago with 5e806b6.

GA:
The metrics endpoints, see https://docs.github.com/en/rest/copilot/copilot-metrics?apiVersion=2022-11-28. They are in GA, were introduced very recently, after the usage endpoints, and as far as I understand it, are intended to replace them. These are the endpoints I implemented support for a few days ago with 717e93f, and they will remain after this PR.

@henriklundstrom
Copy link
Contributor Author

@gmlewis I should clarify as well that yes this is a breaking change in the sense that it removes the endpoints added by 5e806b6, but that commit has not yet made it to any release, so in that sense it is not breaking with any previous release.

@gmlewis gmlewis removed the Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). label Nov 22, 2024
@gmlewis gmlewis changed the title feat!: Remove the beta endpoint for Copilot usage feat: Remove the beta endpoint for Copilot usage Nov 22, 2024
@gmlewis
Copy link
Collaborator

gmlewis commented Nov 22, 2024

@henriklundstrom - thank you for the excellent explanation. That makes perfect sense.

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, @henriklundstrom !
LGTM.

Awaiting second LGTM+Approval from any other contributor to this repo before merging.

Comment on lines -501 to -505
// GetOrganizationUsage gets daily breakdown of aggregated usage metrics for Copilot completions and Copilot Chat in the IDE across an organization.
//
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-usage#get-a-summary-of-copilot-usage-for-organization-members
//
//meta:operation GET /orgs/{org}/copilot/usage
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's better to mark these functions as Deprecated: use ... instead and not removing them? We can always remove them later.

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 fine with deleting since the removed code has not been officially released in this repo with any tagged release.

That's why I removed the Breaking Change label.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's better to remove "BREAKING CHANGE" from the PR's description. This will avoid any confusion in for the future PR's readers.

image

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 updated the description, hopefully it's more clear now.

@gmlewis
Copy link
Collaborator

gmlewis commented Nov 22, 2024

Thank you, @alexandear !
Merging.

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Nov 22, 2024
@gmlewis gmlewis merged commit 45574f4 into google:master Nov 22, 2024
6 of 7 checks passed
Sign up for free to 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.

3 participants