Skip to content

Commit

Permalink
Show queued vs. inprogress (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherHX authored Jan 6, 2025
1 parent 1de78d0 commit 92c6228
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Runner.Server/Controllers/MessageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6502,7 +6502,9 @@ async Task<IActionResult> SendJob(Guid sessionId, Session session, KeyValuePair<
session.JobAccepted = false;
agentlabels = queues[i].Key;
TimeLineWebConsoleLogController.AppendTimelineRecordFeed(new TimelineRecordFeedLinesWrapper(req.JobId, new List<string> { $"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<string> { $"Cancelled Job: {req.name} unassigned from Runner Name:{session.Agent.TaskAgent.Name} Labels:{string.Join(",", agentlabels)}" }), req.TimeLineId, req.JobId);
Expand Down
5 changes: 4 additions & 1 deletion src/runner-server-vscode/treeItemProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -56,6 +58,7 @@ interface IJob {
errors: string[],
result: string,
attempt: number
sessionId: string
}

export class RSTreeDataProvider implements TreeDataProvider<TreeItem> {
Expand Down Expand Up @@ -124,7 +127,7 @@ export class RSTreeDataProvider implements TreeDataProvider<TreeItem> {
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",
Expand Down

0 comments on commit 92c6228

Please sign in to comment.