Skip to content

Commit 8d91ea9

Browse files
committed
Add in repo name
1 parent 91db74f commit 8d91ea9

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

src/treeViews/combinedWorkflows.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {canReachGitHubAPI} from "../api/canReachGitHubAPI";
44
import {getGitHubContext} from "../git/repository";
55
import {logDebug, logError} from "../log";
66
import {RunStore} from "../store/store";
7+
import {CombinedWorkflowRunNode} from "./combinedWorkflows/combinedWorkflowRunNode";
78
import {AttemptNode} from "./shared/attemptNode";
89
import {AuthenticationNode} from "./shared/authenticationNode";
910
import {ErrorNode} from "./shared/errorNode";
@@ -65,7 +66,7 @@ export class CombinedWorkflowsTreeProvider
6566
return [];
6667
}
6768

68-
const allRuns: WorkflowRunNode[] = [];
69+
const allRuns: CombinedWorkflowRunNode[] = [];
6970

7071
for (const repo of gitHubContext.repos) {
7172
try {
@@ -75,7 +76,17 @@ export class CombinedWorkflowsTreeProvider
7576
per_page: 20
7677
});
7778

78-
const runs = this.runNodes(repo, result.data.workflow_runs, true);
79+
const runs = result.data.workflow_runs.map(runData => {
80+
const workflowRun = this.store.addRun(repo, runData);
81+
const node = new CombinedWorkflowRunNode(
82+
this.store,
83+
repo,
84+
workflowRun,
85+
workflowRun.run.name || undefined
86+
);
87+
this._runNodes.set(runData.id, node);
88+
return node;
89+
});
7990
allRuns.push(...runs);
8091
} catch (e) {
8192
logError(e as Error, `Failed to fetch runs for ${repo.owner}/${repo.name}`);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {GitHubRepoContext} from "../../git/repository";
2+
import {RunStore} from "../../store/store";
3+
import {WorkflowRun} from "../../store/workflowRun";
4+
import {WorkflowRunNode} from "../shared/workflowRunNode";
5+
6+
export class CombinedWorkflowRunNode extends WorkflowRunNode {
7+
constructor(
8+
store: RunStore,
9+
gitHubRepoContext: GitHubRepoContext,
10+
run: WorkflowRun,
11+
workflowName?: string
12+
) {
13+
super(store, gitHubRepoContext, run, workflowName);
14+
this.description = `${gitHubRepoContext.owner}/${gitHubRepoContext.name}`;
15+
}
16+
}

0 commit comments

Comments
 (0)