@@ -22,7 +22,6 @@ import { log } from "@gitpod/gitpod-protocol/lib/util/logging";
22
22
import { TraceContext } from "@gitpod/gitpod-protocol/lib/util/tracing" ;
23
23
import { getCommitInfo , HostContextProvider } from "../auth/host-context-provider" ;
24
24
import { ConfigProvider } from "../workspace/config-provider" ;
25
- import { WorkspaceStarter } from "../workspace/workspace-starter" ;
26
25
import { Config } from "../config" ;
27
26
import { ProjectsService } from "../projects/projects-service" ;
28
27
import { secondsBefore } from "@gitpod/gitpod-protocol/lib/util/timeutil" ;
@@ -37,7 +36,6 @@ import { ErrorCodes, ApplicationError } from "@gitpod/gitpod-protocol/lib/messag
37
36
import { UserAuthentication } from "../user/user-authentication" ;
38
37
import { EntitlementService , MayStartWorkspaceResult } from "../billing/entitlement-service" ;
39
38
import { WorkspaceService } from "../workspace/workspace-service" ;
40
- import { EnvVarService } from "../user/env-var-service" ;
41
39
42
40
export class WorkspaceRunningError extends Error {
43
41
constructor ( msg : string , public instance : WorkspaceInstance ) {
@@ -57,7 +55,6 @@ export interface StartPrebuildParams {
57
55
export class PrebuildManager {
58
56
@inject ( TracedWorkspaceDB ) protected readonly workspaceDB : DBWithTracing < WorkspaceDB > ;
59
57
@inject ( WorkspaceService ) protected readonly workspaceService : WorkspaceService ;
60
- @inject ( WorkspaceStarter ) protected readonly workspaceStarter : WorkspaceStarter ;
61
58
@inject ( HostContextProvider ) protected readonly hostContextProvider : HostContextProvider ;
62
59
@inject ( ConfigProvider ) protected readonly configProvider : ConfigProvider ;
63
60
@inject ( Config ) protected readonly config : Config ;
@@ -66,7 +63,6 @@ export class PrebuildManager {
66
63
@inject ( UserAuthentication ) protected readonly userService : UserAuthentication ;
67
64
@inject ( TeamDB ) protected readonly teamDB : TeamDB ;
68
65
@inject ( EntitlementService ) protected readonly entitlementService : EntitlementService ;
69
- @inject ( EnvVarService ) private readonly envVarService : EnvVarService ;
70
66
71
67
async abortPrebuildsForBranch ( ctx : TraceContext , project : Project , user : User , branch : string ) : Promise < void > {
72
68
const span = TraceContext . startSpan ( "abortPrebuildsForBranch" , ctx ) ;
@@ -230,13 +226,6 @@ export class PrebuildManager {
230
226
context . normalizedContextURL ! ,
231
227
) ;
232
228
233
- const envVarsPromise = this . envVarService . resolveEnvVariables (
234
- workspace . ownerId ,
235
- workspace . projectId ,
236
- workspace . type ,
237
- workspace . context ,
238
- ) ;
239
-
240
229
const prebuild = await this . workspaceDB . trace ( { span } ) . findPrebuildByWorkspaceID ( workspace . id ) ! ;
241
230
if ( ! prebuild ) {
242
231
throw new Error ( `Failed to create a prebuild for: ${ context . normalizedContextURL } ` ) ;
@@ -280,10 +269,15 @@ export class PrebuildManager {
280
269
await this . workspaceDB . trace ( { span } ) . storePrebuiltWorkspace ( prebuild ) ;
281
270
} else {
282
271
span . setTag ( "starting" , true ) ;
283
- const envVars = await envVarsPromise ;
284
- await this . workspaceStarter . startWorkspace ( { span } , workspace , user , project , envVars , {
285
- excludeFeatureFlags : [ "full_workspace_backup" ] ,
286
- } ) ;
272
+ await this . workspaceService . startWorkspace (
273
+ { span } ,
274
+ user ,
275
+ workspace . id ,
276
+ {
277
+ excludeFeatureFlags : [ "full_workspace_backup" ] ,
278
+ } ,
279
+ false ,
280
+ ) ;
287
281
}
288
282
289
283
return { prebuildId : prebuild . id , wsid : workspace . id , done : false } ;
@@ -339,13 +333,7 @@ export class PrebuildManager {
339
333
if ( ! prebuild ) {
340
334
throw new Error ( "No prebuild found for workspace " + workspaceId ) ;
341
335
}
342
- const envVars = await this . envVarService . resolveEnvVariables (
343
- workspace . ownerId ,
344
- workspace . projectId ,
345
- workspace . type ,
346
- workspace . context ,
347
- ) ;
348
- await this . workspaceStarter . startWorkspace ( { span } , workspace , user , project , envVars ) ;
336
+ await this . workspaceService . startWorkspace ( { span } , user , workspaceId , { } , false ) ;
349
337
return { prebuildId : prebuild . id , wsid : workspace . id , done : false } ;
350
338
} catch ( err ) {
351
339
TraceContext . setError ( { span } , err ) ;
0 commit comments