@@ -46,7 +46,7 @@ import { WorkspaceDeletionService } from './workspace-deletion-service';
46
46
import { WorkspaceFactory } from './workspace-factory' ;
47
47
import { WorkspaceStarter } from './workspace-starter' ;
48
48
import { HeadlessLogUrls } from "@gitpod/gitpod-protocol/lib/headless-workspace-log" ;
49
- import { HeadlessLogService , WorkspaceInstanceEndpoint } from "./headless-log-service" ;
49
+ import { HeadlessLogService , HeadlessLogEndpoint } from "./headless-log-service" ;
50
50
import { InvalidGitpodYMLError } from "./config-provider" ;
51
51
import { ProjectsService } from "../projects/projects-service" ;
52
52
import { LocalMessageBroker } from "../messaging/local-message-broker" ;
@@ -1145,14 +1145,13 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
1145
1145
1146
1146
const aborted = new Deferred < boolean > ( ) ;
1147
1147
try {
1148
- const wsiEndpoint : WorkspaceInstanceEndpoint = {
1149
- instanceId : instance . id ,
1148
+ const logEndpoint : HeadlessLogEndpoint = {
1150
1149
url : workspace . imageBuildLogInfo . url ,
1151
1150
headers : workspace . imageBuildLogInfo . headers ,
1152
1151
} ;
1153
- log . info ( `WSIE: ${ JSON . stringify ( wsiEndpoint , undefined , 2 ) } ` ) ;
1152
+ log . info ( `WSIE: ${ JSON . stringify ( logEndpoint , undefined , 2 ) } ` ) ;
1154
1153
let lineCount = 0 ;
1155
- await this . headlessLogService . streamImageBuildLog ( wsiEndpoint , async ( chunk ) => {
1154
+ await this . headlessLogService . streamImageBuildLog ( logCtx , logEndpoint , async ( chunk ) => {
1156
1155
if ( aborted . isResolved ) {
1157
1156
return ;
1158
1157
}
@@ -1209,6 +1208,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
1209
1208
traceAPIParams ( ctx , { instanceId } ) ;
1210
1209
1211
1210
this . checkAndBlockUser ( 'getHeadlessLog' , { instanceId } ) ;
1211
+ const logCtx : LogContext = { instanceId } ;
1212
1212
1213
1213
const ws = await this . workspaceDb . trace ( ctx ) . findByInstanceId ( instanceId ) ;
1214
1214
if ( ! ws ) {
@@ -1225,7 +1225,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
1225
1225
throw new ResponseError ( ErrorCodes . NOT_FOUND , `Workspace instance for ${ instanceId } not found` ) ;
1226
1226
}
1227
1227
1228
- const urls = await this . headlessLogService . getHeadlessLogURLs ( wsi , ws . ownerId ) ;
1228
+ const urls = await this . headlessLogService . getHeadlessLogURLs ( logCtx , wsi , ws . ownerId ) ;
1229
1229
if ( ! urls || ( typeof urls . streams === "object" && Object . keys ( urls . streams ) . length === 0 ) ) {
1230
1230
throw new ResponseError ( ErrorCodes . NOT_FOUND , `Headless logs for ${ instanceId } not found` ) ;
1231
1231
}
0 commit comments