Skip to content

Commit

Permalink
When listing workflows running as checks against a PR, include workfl…
Browse files Browse the repository at this point in the history
…ow name, not just job name

Fixes #6497
  • Loading branch information
alexr00 committed Dec 18, 2024
1 parent b058a0e commit f1b573d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/github/githubRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,8 @@ export class GitHubRepository extends Disposable {
state: this.mapStateAsCheckState(context.conclusion),
description: context.title,
context: context.name,
workflowName: context.checkSuite?.workflowRun?.workflow.name,
event: context.checkSuite?.workflowRun?.event,
targetUrl: context.detailsUrl,
isRequired: context.isRequired,
};
Expand All @@ -1549,6 +1551,8 @@ export class GitHubRepository extends Disposable {
state: this.mapStateAsCheckState(context.state),
description: context.description,
context: context.context,
workflowName: undefined,
event: undefined,
targetUrl: context.targetUrl,
isRequired: context.isRequired,
};
Expand All @@ -1571,6 +1575,8 @@ export class GitHubRepository extends Disposable {
state: CheckState.Pending,
description: vscode.l10n.t('Waiting for status to be reported'),
context: context,
workflowName: undefined,
event: undefined,
targetUrl: prUrl,
isRequired: true
});
Expand Down
6 changes: 6 additions & 0 deletions src/github/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,12 @@ export interface CheckRun {
logoUrl: string;
url: string;
} | null;
workflowRun?: {
event: string;
workflow: {
name: string;
};
};
};
isRequired: boolean;
}
Expand Down
4 changes: 3 additions & 1 deletion src/github/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,9 @@ export interface PullRequestCheckStatus {
state: CheckState;
description: string | null;
targetUrl: string | null;
context: string;
context: string; // Job name
workflowName: string | undefined;
event: string | undefined;
isRequired: boolean;
}

Expand Down
6 changes: 6 additions & 0 deletions src/github/queriesShared.gql
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,12 @@ query GetChecks($owner: String!, $name: String!, $number: Int!) {
logoUrl
url
}
workflowRun {
event
workflow {
name
}
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion webviews/components/merge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ const StatusCheckDetails = ( { statuses }: { statuses: PullRequestCheckStatus[]
<Avatar for={{ avatarUrl: s.avatarUrl, url: s.url }} />
<span className="status-check-detail-text">
{/* allow-any-unicode-next-line */}
{s.context} {s.description ? `— ${s.description}` : ''}
{s.workflowName ? `${s.workflowName} / ` : null}{s.context}{s.event ? ` (${s.event})` : null} {s.description ? `— ${s.description}` : null}
</span>
</div>
<div>
Expand Down

0 comments on commit f1b573d

Please sign in to comment.