Skip to content

Commit bda0663

Browse files
filiptronicekgeropl
andcommitted
Address review comments
Co-authored-by: Gero Posmyk-Leinemann <[email protected]> Tool: gitpod/catfood.gitpod.cloud
1 parent 566d30c commit bda0663

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

components/dashboard/src/service/public-api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ function createServiceClient<T extends ServiceType>(
124124
return grpcClient;
125125
}
126126
if (preferJsonRpc) {
127-
console.debug("using preferred jsonrpc client for", type.typeName, prop);
128127
return jsonRpcOptions.client;
129128
}
130129
const featureFlags = [`dashboard_public_api_${jsonRpcOptions.featureFlagSuffix}_enabled`];

components/server/src/workspace/gitpod-server-impl.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
242242
}
243243

244244
private async listenForPrebuildUpdates(ctx?: TraceContext) {
245-
if (!this.client) {
245+
const userId = this.userID;
246+
if (!this.client || !userId) {
246247
return;
247248
}
248249

@@ -258,19 +259,19 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
258259
ctx,
259260
);
260261

261-
if (!this.disposables.disposed && this.userID) {
262+
if (!this.disposables.disposed) {
262263
await runWithRequestContext(
263264
{
264265
requestKind: "gitpod-server-impl-listener",
265266
requestMethod: "listenForPrebuildUpdates",
266267
signal: new AbortController().signal,
267-
subjectId: SubjectId.fromUserId(this.userID),
268+
subjectId: SubjectId.fromUserId(userId),
268269
},
269270
async () => {
270271
const organizations = await this.getTeams(ctx ?? {});
271272
for (const organization of organizations) {
272273
const hasPermission = await this.auth.hasPermissionOnOrganization(
273-
this.userID,
274+
userId,
274275
"read_prebuild",
275276
organization.id,
276277
);

components/spicedb/schema/schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ schema: |-
1717
1818
permission make_admin = installation->admin + organization->installation_admin
1919
20-
// administrate is for changes such as blocking or verifying, i.e. things that only admins can do on user
20+
// administrate is for changes such as blocking or verifiying, i.e. things that only admins can do on user
2121
permission admin_control = installation->admin + organization->installation_admin
2222
2323
permission read_ssh = self

components/ws-manager-bridge/src/prebuild-updater.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ export class PrebuildUpdater {
3939
const span = TraceContext.startSpan("updatePrebuiltWorkspace", ctx);
4040
try {
4141
const prebuild = await this.workspaceDB.trace({ span }).findPrebuildByWorkspaceID(status.metadata!.metaId!);
42-
const workspace = await this.workspaceDB.trace({ span }).findById(workspaceId);
4342
if (!prebuild) {
4443
log.warn(logCtx, "Headless workspace without prebuild");
4544
TraceContext.setError({ span }, new Error("headless workspace without prebuild"));
@@ -99,7 +98,7 @@ export class PrebuildUpdater {
9998
prebuildID: updatedPrebuild.id,
10099
status: updatedPrebuild.state,
101100
workspaceID: workspaceId,
102-
organizationID: workspace?.organizationId,
101+
organizationID: info.teamId,
103102
});
104103
}
105104
}
@@ -115,7 +114,6 @@ export class PrebuildUpdater {
115114
const span = TraceContext.startSpan("stopPrebuildInstance", ctx);
116115

117116
const prebuild = await this.workspaceDB.trace({}).findPrebuildByWorkspaceID(instance.workspaceId);
118-
const workspace = await this.workspaceDB.trace({}).findById(instance.workspaceId);
119117
if (prebuild) {
120118
// this is a prebuild - set it to aborted
121119
prebuild.state = "aborted";
@@ -130,7 +128,7 @@ export class PrebuildUpdater {
130128
prebuildID: prebuild.id,
131129
status: prebuild.state,
132130
workspaceID: instance.workspaceId,
133-
organizationID: workspace?.organizationId,
131+
organizationID: info.teamId,
134132
});
135133
}
136134
}

0 commit comments

Comments
 (0)