Skip to content

Comments

chore: migrate /ccu-info to new v1/user-info API#432

Merged
hjjackyang merged 6 commits intomainfrom
migrate-ccu-info
Feb 21, 2026
Merged

chore: migrate /ccu-info to new v1/user-info API#432
hjjackyang merged 6 commits intomainfrom
migrate-ccu-info

Conversation

@hjjackyang
Copy link
Contributor

@hjjackyang hjjackyang commented Feb 19, 2026

Why? Colab is in the process of deprecating old /tun/m/* APIs. This PR migrates getCcuInfo (also renamed to getConsumptionUserInfo) from /ccu-info to new v1/user-info API with get_ccu_consumption_info=true.

Demo screencast showing GPU/TPU selector still working and new API calls logged with status 200.


There are 2 optimizations as part of this migration:

  1. assignServer used to call both getSubscriptionTier and getCcuInfo to retrieve server descriptors. After this migration, we can get everything we need to assign a server from the basic getUserInfo call, reducing 2 HTTP calls to one.
  2. ConsumptionNotifier used to call getSubscriptionTier while it already has access to a ConsumptionUserInfo instance via event emitter. After this migration, we can directly get subscription tier from ConsumptionUserInfo without needing to call getUserInfo again, removing the redundant HTTP call.

Internal tracking bug: b/485350944

Copy link

@colaboratory-team colaboratory-team left a comment

Choose a reason for hiding this comment

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

Oh my, thanks for such a massive change for the migration. Hope it wasn't too bad. I can only say my review was cursory at best, and I depend on the passing tests. I believe this will be also soon used for integration tests (Kokoro?) and hit the real sandbox endpoints soon? Thanks again!

Copy link

@hosungs hosungs left a comment

Choose a reason for hiding this comment

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

Oops, reviewed/approved as colaboratory-team, may not matter, but just in case, approving as hosungs too. :) Thanks again!

@hjjackyang
Copy link
Contributor Author

@hosungs - Thanks for the quick review!

I believe this will be also soon used for integration tests (Kokoro?) and hit the real sandbox endpoints soon?

Actually, our E2E tests run as part of this PR pre-merge checks, and they hit real production endpoints I believe:
https://github.com/googlecolab/colab-vscode/actions/runs/22204531648/job/64225543737?pr=432

So rest assured!

Copy link
Contributor

@amtoney524 amtoney524 left a comment

Choose a reason for hiding this comment

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

lgtm - really nice refactor on top of the migration!! thanks Jack!

@hjjackyang hjjackyang merged commit 72b0e8c into main Feb 21, 2026
10 checks passed
@hjjackyang hjjackyang deleted the migrate-ccu-info branch February 21, 2026 00:31
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.

4 participants