-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[server] make gRPC clients viable in non-HTTP/2-compatible environments #20565
Conversation
Tool: gitpod/catfood.gitpod.cloud
@@ -17,7 +17,7 @@ schema: |- | |||
|
|||
permission make_admin = installation->admin + organization->installation_admin | |||
|
|||
// administrate is for changes such as blocking or verifiying, i.e. things that only admins can do on user | |||
// administrate is for changes such as blocking or verifying, i.e. things that only admins can do on user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not change this if not needed, I'm 95% sure it will trigger a spicedb rollover which I'd like to avoid, because it has the tendency to take long time to cycle and not behave well in the meantim.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, good point! Will revert to not cause unnecessary trouble
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in bda0663
(#20565)
@@ -39,6 +39,7 @@ export class PrebuildUpdater { | |||
const span = TraceContext.startSpan("updatePrebuiltWorkspace", ctx); | |||
try { | |||
const prebuild = await this.workspaceDB.trace({ span }).findPrebuildByWorkspaceID(status.metadata!.metaId!); | |||
const workspace = await this.workspaceDB.trace({ span }).findById(workspaceId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit weird that PrebuiltWorkspace has a projectId but no organizationId... 😬 But it is what it is I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, tested and works! ✔️
minus the nits commented
Co-authored-by: Gero Posmyk-Leinemann <[email protected]> Tool: gitpod/catfood.gitpod.cloud
@@ -241,7 +187,8 @@ function createServiceClient<T extends ServiceType>( | |||
} | |||
return (async function* () { | |||
try { | |||
const client = await resolveClient(); | |||
// for server streaming, we prefer jsonRPC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for future reference: the only streaming methods we implement in our public api v1 are:
WorkspaceService.WatchWorkspaceStatus
PrebuildService.WatchPrebuild
Description
This PR makes a couple of related changes:
disableWebsocketPrebuildUpdates
, and instead introduces a by-organization subscription for prebuild updates. This makes the listening much more efficient (requiring way fewer listeners) and scales well even with thousands of projects. Permission-wise, it relies on the organization'sread_prebuild
permission.Related Issue(s)
Fixes CLC-1106
How to test