From 4bed2efdb7417876553c1d364958d6b9ec9aecb2 Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Fri, 21 Feb 2025 09:55:43 -0800 Subject: [PATCH 1/3] tc --- torchci/components/JobLinks.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/torchci/components/JobLinks.tsx b/torchci/components/JobLinks.tsx index 471d1107df..e3c5bb0f2b 100644 --- a/torchci/components/JobLinks.tsx +++ b/torchci/components/JobLinks.tsx @@ -10,6 +10,7 @@ import styles from "./JobLinks.module.css"; import ReproductionCommand from "./ReproductionCommand"; import { durationDisplay, LocalTimeHuman } from "./TimeUtils"; +const DEFAULT_REPO = "pytorch/pytorch"; export default function JobLinks({ job, showCommitLink = false, @@ -24,7 +25,9 @@ export default function JobLinks({ Commit From db9fa92dc4cd508b17dfa0fe6cb9c61b55e6fd7a Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Fri, 21 Feb 2025 10:01:08 -0800 Subject: [PATCH 2/3] tc --- torchci/components/JobLinks.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/torchci/components/JobLinks.tsx b/torchci/components/JobLinks.tsx index e3c5bb0f2b..e9b602528e 100644 --- a/torchci/components/JobLinks.tsx +++ b/torchci/components/JobLinks.tsx @@ -25,9 +25,7 @@ export default function JobLinks({ Commit From 44e291f6c88fbc5fa3e6e3f6b4d87ae9b2606aa7 Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Fri, 21 Feb 2025 10:17:11 -0800 Subject: [PATCH 3/3] tc --- torchci/components/JobLinks.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/torchci/components/JobLinks.tsx b/torchci/components/JobLinks.tsx index e9b602528e..521887252b 100644 --- a/torchci/components/JobLinks.tsx +++ b/torchci/components/JobLinks.tsx @@ -11,6 +11,19 @@ import ReproductionCommand from "./ReproductionCommand"; import { durationDisplay, LocalTimeHuman } from "./TimeUtils"; const DEFAULT_REPO = "pytorch/pytorch"; +function getRepoFromHtmlURL(htmlUrl?: string) { + if (htmlUrl === undefined) { + return DEFAULT_REPO; + } + const repoMatch = htmlUrl.match( + /https:\/\/github.com\/([^\/]+\/[^\/]+)\/actions/ + ); + if (repoMatch === null) { + return DEFAULT_REPO; + } + return repoMatch[1]; +} + export default function JobLinks({ job, showCommitLink = false, @@ -19,13 +32,16 @@ export default function JobLinks({ showCommitLink?: boolean; }) { const subInfo = []; + if (job.repo === undefined) { + job.repo = getRepoFromHtmlURL(job.htmlUrl); + } if (showCommitLink) { subInfo.push( Commit