Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When listing workflows running as checks against a PR, include workflow name, not just job name #6567

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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