diff --git a/src/Runner.Server/Controllers/MessageController.cs b/src/Runner.Server/Controllers/MessageController.cs index ddc6ed77c45..621b54cbab4 100644 --- a/src/Runner.Server/Controllers/MessageController.cs +++ b/src/Runner.Server/Controllers/MessageController.cs @@ -6502,7 +6502,9 @@ async Task SendJob(Guid sessionId, Session session, KeyValuePair< session.JobAccepted = false; agentlabels = queues[i].Key; TimeLineWebConsoleLogController.AppendTimelineRecordFeed(new TimelineRecordFeedLinesWrapper(req.JobId, new List { $"Read Job from Queue: {req.name} assigned to Runner Name:{session.Agent.TaskAgent.Name} Labels:{string.Join(",", agentlabels)}" }), req.TimeLineId, req.JobId); + _context.Attach(req); req.SessionId = sessionId; + _context.SaveChanges(); if (req.CancelRequest.IsCancellationRequested) { TimeLineWebConsoleLogController.AppendTimelineRecordFeed(new TimelineRecordFeedLinesWrapper(req.JobId, new List { $"Cancelled Job: {req.name} unassigned from Runner Name:{session.Agent.TaskAgent.Name} Labels:{string.Join(",", agentlabels)}" }), req.TimeLineId, req.JobId); diff --git a/src/runner-server-vscode/treeItemProvider.ts b/src/runner-server-vscode/treeItemProvider.ts index ac1bdba2357..d0431a1187c 100644 --- a/src/runner-server-vscode/treeItemProvider.ts +++ b/src/runner-server-vscode/treeItemProvider.ts @@ -40,6 +40,8 @@ function getAbsoluteStatusIcon(_context : ExtensionContext, status: string) { return getAbsoluteIconPath(_context, "workflowruns/wr_skipped.svg"); case "canceled": return getAbsoluteIconPath(_context, "workflowruns/wr_cancelled.svg"); + case "queued": + return getAbsoluteIconPath(_context, "workflowruns/wr_queued.svg"); default: return null; } @@ -56,6 +58,7 @@ interface IJob { errors: string[], result: string, attempt: number + sessionId: string } export class RSTreeDataProvider implements TreeDataProvider { @@ -124,7 +127,7 @@ export class RSTreeDataProvider implements TreeDataProvider { var result : IJob[] = await (await fetch(`${this.ghHostApiUrl}/_apis/v1/Message?page=${encodeURIComponent("0")}&runid=${encodeURIComponent(element.command.arguments[0])}`)).json(); return result.map(r => { var item = new TreeItem(`${r.name ?? r.name} #${r.attempt}`, TreeItemCollapsibleState.None); - item.iconPath = getAbsoluteStatusIcon(this._context, r.result ?? "inprogress"); + item.iconPath = getAbsoluteStatusIcon(this._context, r.result ?? (r.sessionId === '00000000-0000-0000-0000-000000000000' ? "queued" : "inprogress")); item.contextValue = `/job/${r.result ? "completed" : "inprogress"}/`; item.command = { title: "Open Job",