Skip to content

feat: Remove the beta endpoint for Copilot usage - #3354

Merged
gmlewis merged 1 commit into
google:masterfrom
nordnet:remove-copilot-usage
Nov 22, 2024
Merged

feat: Remove the beta endpoint for Copilot usage#3354
gmlewis merged 1 commit into
google:masterfrom
nordnet:remove-copilot-usage

Conversation

@henriklundstrom

@henriklundstromhenriklundstrom commented Nov 21, 2024

Copy link
Copy Markdown
Contributor

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.

@gmlewisgmlewis changed the title refactor: Remove the beta endpoint for Copilot usagefeat!: Remove the beta endpoint for Copilot usageNov 21, 2024
@gmlewisgmlewis 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
@codecov

codecovBot commented Nov 21, 2024

Copy link
Copy Markdown

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
Copy Markdown
Collaborator

@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
Copy Markdown
ContributorAuthor

@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
Copy Markdown
ContributorAuthor

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

@gmlewisgmlewis 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
@gmlewisgmlewis changed the title feat!: Remove the beta endpoint for Copilot usagefeat: Remove the beta endpoint for Copilot usageNov 22, 2024
@gmlewis

Copy link
Copy Markdown
Collaborator

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

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

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

Comment threadgithub/copilot.go
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
Collaborator

Thank you, @alexandear !
Merging.

@gmlewisgmlewis removed the NeedsReview PR is awaiting a review before merging. label Nov 22, 2024
@gmlewis
gmlewis merged commit 45574f4 into google:masterNov 22, 2024
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.

3 participants

@henriklundstrom@gmlewis@alexandear