Skip to content

Commit cca2400

Browse files
authored
Set the correct repo link in mark unstable job button in commit and PR pages (#5343)
This is a miss from #5122 where I failed to check that the repo field in JobData is optional and wasn't set in HUD commit and PR pages. So, marking an unstable job link works correctly in main HUD page like https://hud.pytorch.org/hud/pytorch/executorch/main where the data comes from `fetchHud`, but it uses the default link pointing to `pytorch/pytorch` in: * Commit page https://hud.pytorch.org/pytorch/executorch/commit/7c0f4c2b6f87369ee20544aada33dc55078c6bc6 * and PR page https://hud.pytorch.org/pr/pytorch/executorch/3972 The fix here is to populate the repo field if it's not there ### Testing Verify this locally (need to login to HUD) * http://localhost:3000/pytorch/executorch/commit/7c0f4c2b6f87369ee20544aada33dc55078c6bc6 * http://localhost:3000/pr/pytorch/executorch/3972
1 parent 4efc01f commit cca2400

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

torchci/components/CommitStatus.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ export default function CommitStatus({
119119
const session = useSession();
120120
const isAuthenticated = session.status === "authenticated";
121121

122+
// Populate the repo field if it's not yet set in the job data
123+
jobs.forEach((job) => {
124+
job.repo = job.repo ?? `${repoOwner}/${repoName}`;
125+
});
126+
122127
return (
123128
<>
124129
<VersionControlLinks

0 commit comments

Comments
 (0)