Skip to content

Commit e0212a6

Browse files
authored
Just ran yarn format to lint (enjoy the github copilot poem) (#4098)
<!-- copilot:all --> ### <samp>🤖 Generated by Copilot at 32ccfc2</samp> ### Summary 🎨📝🤖 <!-- 1. 🎨 - This emoji is often used to indicate code style or formatting improvements, such as changing the color codes, adding spaces, or fixing indentation. It could be used for changes 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, and 18. 2. 📝 - This emoji is often used to indicate documentation updates, such as improving the markdown formatting, adding or removing sections, or fixing typos. It could be used for changes 15 and 19. 3. 🤖 - This emoji is often used to indicate changes related to bots or automation, such as adding or modifying bot logic, handling bot events, or configuring bot settings. It could be used for changes 10, 16, 17, and 18. --> This pull request applies various minor code formatting and style improvements to the TypeScript and JSX files in the `torchci` repository, as well as some markdown formatting fixes to the documentation files. The purpose of these changes is to enhance the readability, consistency, and quality of the code and the documentation. > _We are the code warriors, fighting for the style_ > _We break the lines and add the semicolons, to make the code worthwhile_ > _We follow the guides and fix the issues, to avoid the doom and despair_ > _We improve the readability and consistency, to show the world we care_ ### Walkthrough * Simplify and improve the code formatting and style of the TypeScript components in the `torchci/components` folder ([link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-8a80fbc8ad1a121c161cb109e5e870eb3134ef0aafad1c7515f121ff89fc66bbL17-R17), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-8a80fbc8ad1a121c161cb109e5e870eb3134ef0aafad1c7515f121ff89fc66bbL29-R34), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-5ac26ab69a5d9f07dfb3357050d731ce5b998f280530773b972e12cde475d280L52-R52), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-4b09d3593d1810df79348dec904d97d1e5adbcd5da97032f812b93e52c8e2d2eL6-R6), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-4b09d3593d1810df79348dec904d97d1e5adbcd5da97032f812b93e52c8e2d2eL30-R33), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-4b09d3593d1810df79348dec904d97d1e5adbcd5da97032f812b93e52c8e2d2eL64-R67), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-4b09d3593d1810df79348dec904d97d1e5adbcd5da97032f812b93e52c8e2d2eL71-R74), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-f4c9b47d71f75a84ec5127fe4cd176da1d697522e55a661242f38ded535b2d92L23-R23), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-81affb142346ee48a93add49a4bb0842218f8cbde94f1a2b333db39a0602cf57L6-R6), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-81affb142346ee48a93add49a4bb0842218f8cbde94f1a2b333db39a0602cf57L20-R40), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-81affb142346ee48a93add49a4bb0842218f8cbde94f1a2b333db39a0602cf57L50-R46), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-81affb142346ee48a93add49a4bb0842218f8cbde94f1a2b333db39a0602cf57L59-R57), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-bbf7dacc5b732e589c1d30c010dcaf2a01f8a92de50463e5ce955e55a64efb94L17-R17), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-ac846518926a6f5519a079779c896811109fe40c6a853aea3e3708fcbd1c1b60L10-R44), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-ac846518926a6f5519a079779c896811109fe40c6a853aea3e3708fcbd1c1b60L66-R77), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-ac846518926a6f5519a079779c896811109fe40c6a853aea3e3708fcbd1c1b60L75-R86), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-a2688e6b4d058bc2c20a50ba9101456ae3f15aefb4aafcd05ee6fe40d089b61bL2-R3), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-a2688e6b4d058bc2c20a50ba9101456ae3f15aefb4aafcd05ee6fe40d089b61bL15-R172)) * Add and improve the blank lines, line breaks, indentation, and link references of the markdown documents in the `torchci/docs` and `torchci` folders ([link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-f8ef068c3b2daac027ce6cfa9a0580e4fafcafd43932b2711cf04a5bc1460d67L43-R46), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-f8ef068c3b2daac027ce6cfa9a0580e4fafcafd43932b2711cf04a5bc1460d67R112), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-f8ef068c3b2daac027ce6cfa9a0580e4fafcafd43932b2711cf04a5bc1460d67R120), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-073864f18143fbc79c97b3e73a88a622e3effb589cb0d5f18b98637b9d09a190L2-R4), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-073864f18143fbc79c97b3e73a88a622e3effb589cb0d5f18b98637b9d09a190L28-R36), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-073864f18143fbc79c97b3e73a88a622e3effb589cb0d5f18b98637b9d09a190R44), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-073864f18143fbc79c97b3e73a88a622e3effb589cb0d5f18b98637b9d09a190R52), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-073864f18143fbc79c97b3e73a88a622e3effb589cb0d5f18b98637b9d09a190L53-R58), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-073864f18143fbc79c97b3e73a88a622e3effb589cb0d5f18b98637b9d09a190L61-R70), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-073864f18143fbc79c97b3e73a88a622e3effb589cb0d5f18b98637b9d09a190L72-R80), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-073864f18143fbc79c97b3e73a88a622e3effb589cb0d5f18b98637b9d09a190L82-R91), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-073864f18143fbc79c97b3e73a88a622e3effb589cb0d5f18b98637b9d09a190L91-R100)) * Add and improve the line breaks, indentation, semicolons, and parentheses of the TypeScript files in the `torchci/lib/bot` folder ([link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-69a75b4a6c4e66b050b2b353864e5f98c62e2876c4a017a5cc487e24563d1481L12), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-e4f4665d0f3ac2d622dfc2b7e67e3a3eed8f700cb75d1b06a53e73ade8a214d5L84-R86), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L4), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L47-R49), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L105-R109), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L118-R130), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L151-R159), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L188-R194), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L206-R210), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L226-R236), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L234-R245), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L252-R266), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L261-R282), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L270-R295), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L302-R332), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-94e9ccdc8fb9199064513b2d4da9b18882aeb330e2a7962a1a61bfb45fa70bf7L315-R344), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-9243088b1169f0ca593d62c8f9267f023fe1e96d19bd310a93aa6f4e2fea1dd3L2-R6), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-9243088b1169f0ca593d62c8f9267f023fe1e96d19bd310a93aa6f4e2fea1dd3L145-R152), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-9243088b1169f0ca593d62c8f9267f023fe1e96d19bd310a93aa6f4e2fea1dd3L158-R171), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-9243088b1169f0ca593d62c8f9267f023fe1e96d19bd310a93aa6f4e2fea1dd3L168-R181), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-13a00d5da9dcd58533c8ed0f232841812cc813becd789b043216a11f6dd547c8L55-R57), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-9575795d240c509115ffdd60ce97304dfca7830cd507a3bc9fe8c46553aa8983L2-R12), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-9575795d240c509115ffdd60ce97304dfca7830cd507a3bc9fe8c46553aa8983L16-R37), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-1f9ab2bf1603b2f1ca01b027741b9c297beb80f2af7d0a189b85d54b4be3a623L29-R29), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-176d31b83f6ffe33b280475aab6ac84a545ae432e2055e7ec1fabc0d4d8c991aL30-R33), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-176d31b83f6ffe33b280475aab6ac84a545ae432e2055e7ec1fabc0d4d8c991aL167-R167), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-176d31b83f6ffe33b280475aab6ac84a545ae432e2055e7ec1fabc0d4d8c991aL177-R177), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-176d31b83f6ffe33b280475aab6ac84a545ae432e2055e7ec1fabc0d4d8c991aL183-R230), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-176d31b83f6ffe33b280475aab6ac84a545ae432e2055e7ec1fabc0d4d8c991aL239-R256), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-176d31b83f6ffe33b280475aab6ac84a545ae432e2055e7ec1fabc0d4d8c991aL259-R274), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-176d31b83f6ffe33b280475aab6ac84a545ae432e2055e7ec1fabc0d4d8c991aL270-R293), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-13d358a854f91c9e7c8cecf5acbff761357274670b585e1ab859840223c6bf63L18-R19), [link](https://github.com/pytorch/test-infra/pull/4098/files?diff=unified&w=0#diff-c450c99d043f2eca202639410bd5b7c9d3f645c3d9b9128e2368ca856c11e7ffL20-R23))
1 parent 0d98d06 commit e0212a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2073
-1790
lines changed

torchci/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ following resources:
4040
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
4141

4242
## Testing
43+
4344
To run tests first make sure you're in the `torchci` folder and then:
4445

45-
- To run all tests:
46+
- To run all tests:
4647
- `yarn test`
4748
- To run all tests in a specific file:
4849
- `yarn test <path-to-file>`
@@ -108,13 +109,15 @@ Github Issue.
108109
A Meta internal Butterfly bot rule will trigger when the task is created or updated to assign the task to the oncall to notify the DevX team.
109110

110111
Butterfly bot links:
112+
111113
- [When a new alert is created](https://www.internalfb.com/butterfly/rule/5455687371213466)
112114
- [When pytorch/pytorch failures are edited](https://www.internalfb.com/butterfly/rule/2024866984357962)
113115
- [When flaky test detector bot alerts are edited](https://www.internalfb.com/butterfly/rule/741489054164977)
114116

115117
## Modifying Deployment Settings
116118

117119
If you ever need to modify the deployment settings like the oauth callbacks, domain names, there's a few places that you need to change these settings in. Here's a list:
120+
118121
1. [DNS Registry/Certificates](https://fb.workplace.com/groups/osssupport) (Contact the the OSS team)
119122
2. [Environment Variables](https://vercel.com/fbopensource/torchci/settings/environment-variables)
120123
3. [OAuth Project](https://github.com/settings/applications/1973779) / [OAuth Project Local](https://github.com/settings/applications/1976306)

torchci/components/JobAnnotationToggle.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function JobAnnotationToggle({
1414
annotation: JobAnnotation;
1515
repo?: string | null;
1616
}) {
17-
const allJobs = (similarJobs ?? []);
17+
const allJobs = similarJobs ?? [];
1818
allJobs.push(job);
1919

2020
const [state, setState] = React.useState<JobAnnotation>(
@@ -26,15 +26,12 @@ export default function JobAnnotationToggle({
2626
newState: JobAnnotation
2727
) {
2828
setState(newState);
29-
await fetch(
30-
`/api/job_annotation/${repo ?? job.repo}/${newState}`,
31-
{
32-
method: "POST",
33-
// Also send over the list of similar jobs so that they can be annotated
34-
// in one API call
35-
body: JSON.stringify(allJobs.map((job) => job.id)),
36-
}
37-
);
29+
await fetch(`/api/job_annotation/${repo ?? job.repo}/${newState}`, {
30+
method: "POST",
31+
// Also send over the list of similar jobs so that they can be annotated
32+
// in one API call
33+
body: JSON.stringify(allJobs.map((job) => job.id)),
34+
});
3835
}
3936

4037
return (

torchci/components/JobConclusion.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@
4949
}
5050

5151
.warning {
52-
color: #F8B88B;
52+
color: #f8b88b;
5353
}

torchci/components/JobLinks.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import useSWR from "swr";
33
import React from "react";
44
import { IssueData, JobData } from "../lib/types";
55
import styles from "./JobLinks.module.css";
6-
import TestInsightsLink from "./TestInsights"
6+
import TestInsightsLink from "./TestInsights";
77

88
export default function JobLinks({ job }: { job: JobData }) {
99
const rawLogs =
@@ -27,7 +27,10 @@ export default function JobLinks({ job }: { job: JobData }) {
2727

2828
const eventTime =
2929
job.time != null ? (
30-
<span>{` | Started: `}<LocalTimeHuman timestamp={job.time} /></span>
30+
<span>
31+
{` | Started: `}
32+
<LocalTimeHuman timestamp={job.time} />
33+
</span>
3134
) : null;
3235

3336
const failureCaptures =
@@ -61,14 +64,14 @@ const fetcher = (url: string) => fetch(url).then((res) => res.json());
6164

6265
const unittestFailureRe = /^(?:FAIL|ERROR) \[.*\]: (test_.* \(.*Test.*\))/;
6366
const pytestFailureRe = /^FAILED .*.py::(.*)::(test_\S*)/;
64-
function getTestName(failureCapture: string) {
67+
function getTestName(failureCapture: string) {
6568
const unittestMatch = failureCapture.match(unittestFailureRe);
6669
if (unittestMatch !== null) {
6770
return unittestMatch[1];
6871
}
6972
const pytestMatch = failureCapture.match(pytestFailureRe);
7073
if (pytestMatch !== null) {
71-
return `${pytestMatch[2]} (__main__.${pytestMatch[1]})`
74+
return `${pytestMatch[2]} (__main__.${pytestMatch[1]})`;
7275
}
7376
return null;
7477
}

torchci/components/NavBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function NavBar() {
2020
</li>
2121
<li>
2222
<Link prefetch={false} href="/hud/pytorch/pytorch/main">
23-
Main
23+
Main
2424
</Link>
2525
</li>
2626
<li>

torchci/components/TestInsights.tsx

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import React from "react";
33

44
// The following jobs are not supported at the moment because neither the monitoring
55
// script is running there at the moment (libtorch, bazel, android)
6-
const NOT_SUPPORTED_JOBS = [
7-
"android",
8-
"bazel",
9-
"libtorch",
10-
];
6+
const NOT_SUPPORTED_JOBS = ["android", "bazel", "libtorch"];
117

128
export default function TestInsightsLink({
139
job,
@@ -17,37 +13,37 @@ export default function TestInsightsLink({
1713
separator: string;
1814
}) {
1915
if (job === null) {
20-
return (<></>);
16+
return <></>;
2117
}
2218

2319
if (job.conclusion === "pending") {
2420
// If the job is pending, there is no test insights available yet
25-
return (<></>);
21+
return <></>;
2622
}
2723

2824
const workflowId = job.htmlUrl?.match(
2925
// https://github.com/pytorch/pytorch/actions/runs/3228501114/jobs/5284857665
30-
new RegExp("^.+\/(?<workflowId>\\d+)\/jobs\/.+$")
26+
new RegExp("^.+/(?<workflowId>\\d+)/jobs/.+$")
3127
)?.groups?.workflowId;
3228

3329
const jobId = job.logUrl?.match(
3430
// https://ossci-raw-job-status.s3.amazonaws.com/log/9018026324
35-
new RegExp("^.+\/log\/(?<jobId>\\d+)$")
31+
new RegExp("^.+/log/(?<jobId>\\d+)$")
3632
)?.groups?.jobId;
3733

3834
if (workflowId === null || jobId === null) {
39-
return (<></>);
35+
return <></>;
4036
}
4137

4238
for (const name of NOT_SUPPORTED_JOBS) {
4339
if (job.jobName?.includes(name)) {
44-
return (<></>);
40+
return <></>;
4541
}
4642
}
4743

4844
// Only show test insight link for test jobs
4945
if (!job.jobName?.includes("test")) {
50-
return (<></>);
46+
return <></>;
5147
}
5248

5349
return (
@@ -56,7 +52,9 @@ export default function TestInsightsLink({
5652
<a
5753
target="_blank"
5854
rel="noreferrer"
59-
href={`/test/insights?jobName=${encodeURIComponent(job.jobName)}&workflowId=${workflowId}&jobId=${jobId}`}
55+
href={`/test/insights?jobName=${encodeURIComponent(
56+
job.jobName
57+
)}&workflowId=${workflowId}&jobId=${jobId}`}
6058
>
6159
Test insights
6260
</a>

torchci/components/TimeUtils.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function LocalTimeHuman({ timestamp }: { timestamp: string }) {
1414
const time = dayjs(timestamp).local();
1515
if (dayjs().isSame(time, "day")) {
1616
setTime(time.format("h:mm a"));
17-
} else if (dayjs().subtract(7, 'days').isBefore(time, 'day')) {
17+
} else if (dayjs().subtract(7, "days").isBefore(time, "day")) {
1818
setTime(time.format("ddd h:mm a"));
1919
} else {
2020
setTime(time.format("M/D h:mm a"));

torchci/components/WorkflowBox.tsx

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,41 @@ import JobArtifact from "./JobArtifact";
77
import JobSummary from "./JobSummary";
88
import LogViewer from "./LogViewer";
99
import { getConclusionSeverityForSorting } from "../lib/JobClassifierUtil";
10-
import TestInsightsLink from "./TestInsights"
10+
import TestInsightsLink from "./TestInsights";
1111

12-
function sortJobsByConclusion( jobA: JobData, jobB: JobData): number {
12+
function sortJobsByConclusion(jobA: JobData, jobB: JobData): number {
1313
// Show failed jobs first, then pending jobs, then successful jobs
1414
if (jobA.conclusion !== jobB.conclusion) {
15-
return getConclusionSeverityForSorting(jobB.conclusion) - getConclusionSeverityForSorting(jobA.conclusion);
15+
return (
16+
getConclusionSeverityForSorting(jobB.conclusion) -
17+
getConclusionSeverityForSorting(jobA.conclusion)
18+
);
1619
}
1720

1821
// Jobs with the same conclusion are sorted alphabetically
19-
return ('' + jobA.jobName).localeCompare('' + jobB.jobName); // the '' forces the type to be a string
22+
return ("" + jobA.jobName).localeCompare("" + jobB.jobName); // the '' forces the type to be a string
2023
}
2124

2225
function getWorkflowJobSummary(job: JobData) {
23-
var queueTimeInfo = null
26+
var queueTimeInfo = null;
2427
if (job.queueTimeS != null) {
25-
queueTimeInfo = <><i>Queued:</i> {Math.max(Math.round(job.queueTimeS / 60), 0)} mins</>;
28+
queueTimeInfo = (
29+
<>
30+
<i>Queued:</i> {Math.max(Math.round(job.queueTimeS / 60), 0)} mins
31+
</>
32+
);
2633
}
2734

28-
var durationInfo = null
35+
var durationInfo = null;
2936
if (job.durationS != null) {
30-
durationInfo = <><i>Duration:</i> {Math.round((job.durationS / 60))} mins</>;
37+
durationInfo = (
38+
<>
39+
<i>Duration:</i> {Math.round(job.durationS / 60)} mins
40+
</>
41+
);
3142
}
3243

33-
var separator = (queueTimeInfo && durationInfo) ? ", ": ""
44+
var separator = queueTimeInfo && durationInfo ? ", " : "";
3445

3546
return (
3647
<>
@@ -63,7 +74,7 @@ export default function WorkflowBox({
6374
: styles.workflowBoxSuccess;
6475

6576
const workflowId = jobs[0].workflowId;
66-
const anchorName = encodeURIComponent(workflowName.toLowerCase())
77+
const anchorName = encodeURIComponent(workflowName.toLowerCase());
6778
return (
6879
<div id={anchorName} className={workflowClass}>
6980
<h3>{workflowName}</h3>
@@ -72,7 +83,7 @@ export default function WorkflowBox({
7283
{jobs.sort(sortJobsByConclusion).map((job) => (
7384
<div key={job.id}>
7485
{getWorkflowJobSummary(job)}
75-
{isFailedJob(job) && (<LogViewer job={job} />)}
86+
{isFailedJob(job) && <LogViewer job={job} />}
7687
</div>
7788
))}
7889
</>

0 commit comments

Comments
 (0)