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

Update summary link and update failed status description #91

Merged
merged 4 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
18 changes: 6 additions & 12 deletions dist/action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 6 additions & 12 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

18 changes: 6 additions & 12 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ async function action(pr: PullRequest): Promise<void> {
}
} else {
// Mark job in case of infrastructure issues. Report to Testing Farm team
infraError = '- Infra problems';
infraError = ' - Infra problems';
finalState = 'failure' as const;
log = 'pipeline.log';
}

notice(`Final state is: ${finalState}`);
notice(`Infra state is: ${infraError}`);
notice(`Infra state is: ${infraError === '' ? 'OK' : 'Failed'}`);

// Set outputs
setOutput('request_id', tfResponse.id);
Expand All @@ -211,7 +211,7 @@ async function action(pr: PullRequest): Promise<void> {
if (usePullRequestStatuses) {
await pr.setStatus(
finalState,
`Build finished ${infraError}`,
`Build finished${infraError}`,
`${tfArtifactUrl}/${tfResponse.id}`
);
}
Expand All @@ -231,12 +231,6 @@ async function action(pr: PullRequest): Promise<void> {

// Create Github Summary
if (getBooleanInput('create_github_summary')) {
if (infraError === '') {
infraError = 'OK';
} else {
infraError = 'Failed';
}

await summary
.addHeading('Testing Farm as a GitHub Action summary')
.addTable([
Expand All @@ -250,9 +244,9 @@ async function action(pr: PullRequest): Promise<void> {
[
getInput('compose'),
getInput('arch'),
infraError,
infraError === '' ? 'OK' : 'Failed',
finalState,
`[${tfArtifactUrl}/${tfResponse.id}/pipeline.log](pipeline.log)`,
`[pipeline.log](${tfArtifactUrl}/${tfResponse.id}/pipeline.log)`,
],
])
.write();
Expand All @@ -261,7 +255,7 @@ async function action(pr: PullRequest): Promise<void> {
// Exit with error in case of failure in test
if (finalState === 'failure') {
throw new TFError(
`Testing Farm test failed - ${
`Build finished${infraError} - ${
tfResult.result
? tfResult.result.summary ?? 'No summary provided'
: 'No summary provided'
Expand Down
Loading
Loading