;
page: number;
pageCount: number;
onPageChange?: (page: number) => void;
@@ -28,6 +31,7 @@
ref,
commits,
tagsByCommit = {},
+ pipelineStatuses,
page,
pageCount,
onPageChange
@@ -114,6 +118,20 @@
{#each tagsByCommit[commit.hash] ?? [] as name (name)}
{name}
{/each}
+ {#if pipelineStatuses}
+ {#await pipelineStatuses then statuses}
+ {#if statuses[commit.hash]}
+
+
+
+ {/if}
+ {/await}
+ {/if}
{#if commit.body && expanded[commit.hash]}
diff --git a/web/src/lib/components/repo/CommitView.svelte b/web/src/lib/components/repo/CommitView.svelte
index 2be385e89..68cfdfe86 100644
--- a/web/src/lib/components/repo/CommitView.svelte
+++ b/web/src/lib/components/repo/CommitView.svelte
@@ -7,6 +7,7 @@
import DiffView from "./DiffView.svelte";
import type { DiffStyle } from "./pierre";
import TabPanel from "$lib/components/ui/TabPanel.svelte";
+ import type { CommitStatuses } from "$lib/api/commitStatuses";
interface Props {
ownerHandle: string;
@@ -23,6 +24,7 @@
diffStyle?: DiffStyle;
// server-prerendered shadow dom per row key, only for the initial ssr
prerendered?: Record;
+ pipelineStatuses?: Promise;
}
let {
@@ -35,7 +37,8 @@
files,
stat,
diffStyle = "unified",
- prerendered
+ prerendered,
+ pipelineStatuses
}: Props = $props();
const base = $derived(`/${ownerHandle}/${repoName}`);
@@ -54,7 +57,7 @@
-
+
diff --git a/web/src/lib/components/repo/RepoIndexView.stories.svelte b/web/src/lib/components/repo/RepoIndexView.stories.svelte
index 84149b4d9..ab68140b2 100644
--- a/web/src/lib/components/repo/RepoIndexView.stories.svelte
+++ b/web/src/lib/components/repo/RepoIndexView.stories.svelte
@@ -58,8 +58,6 @@
readmeHtml: "tangled
",
commits,
tagsByCommit: {},
- // every third commit is left without a run, so all three cases show
- pipelinesByCommit: pipelinesByCommitHash(commits.map((commit) => commit.hash)),
totalCommits: 42,
branches: [
{
@@ -92,7 +90,6 @@
readmeHtml: null,
commits: [],
tagsByCommit: {},
- pipelinesByCommit: {},
totalCommits: 0,
branches: [],
totalBranches: 0,
@@ -106,7 +103,13 @@
title: "Repo/RepoIndexView",
component: RepoIndexView,
tags: ["autodocs"],
- args: { repo, data, bobbinUrl: "https://bobbin.example.test" }
+ args: {
+ repo,
+ data,
+ bobbinUrl: "https://bobbin.example.test",
+ // every third commit is left without a run, so all three cases show
+ pipelineStatuses: Promise.resolve(pipelinesByCommitHash(commits.map((commit) => commit.hash)))
+ }
});
diff --git a/web/src/lib/components/repo/RepoIndexView.svelte b/web/src/lib/components/repo/RepoIndexView.svelte
index 97552513a..a17372534 100644
--- a/web/src/lib/components/repo/RepoIndexView.svelte
+++ b/web/src/lib/components/repo/RepoIndexView.svelte
@@ -14,15 +14,17 @@
import TagList from "./TagList.svelte";
import TabPanel from "$lib/components/ui/TabPanel.svelte";
import type { loadRepoIndex } from "$lib/api/repoIndex";
+ import type { CommitStatuses } from "$lib/api/commitStatuses";
import type { RepoInfo } from "./types";
interface Props {
repo: RepoInfo;
data: Awaited>;
bobbinUrl: string;
+ pipelineStatuses?: Promise;
}
- let { repo, data, bobbinUrl }: Props = $props();
+ let { repo, data, bobbinUrl, pipelineStatuses }: Props = $props();
const base = $derived(`/${repo.ownerHandle}/${repo.name}`);
const encodedRef = $derived(encodeURIComponent(data.ref));
@@ -95,7 +97,7 @@
repoName={repo.name}
commits={data.commits}
tagsByCommit={data.tagsByCommit}
- pipelinesByCommit={data.pipelinesByCommit}
+ {pipelineStatuses}
/>
{/if}
diff --git a/web/src/lib/components/repo/pipelines/mock.ts b/web/src/lib/components/repo/pipelines/mock.ts
index 111327558..14d1782f4 100644
--- a/web/src/lib/components/repo/pipelines/mock.ts
+++ b/web/src/lib/components/repo/pipelines/mock.ts
@@ -89,11 +89,9 @@ export const pipelines: PipelineSummary[] = [
}
];
-/**
- * fake per-commit runs for the repo overview's commit list. the real call is
- * the spindle's ci.queryPipelines with a commits filter, one run per commit.
- * every third commit is left without a run so the gap renders too.
- */
+// fake per-commit runs for the commit list and header stories. the real call
+// is the spindle's ci.queryPipelines with a commits filter, one run per
+// commit. every third commit is left without a run so the gap renders too.
export const pipelinesByCommitHash = (hashes: string[]): Record => {
const byHash: Record = {};
hashes.forEach((hash, index) => {
diff --git a/web/src/routes/[handle]/[repo]/+page.svelte b/web/src/routes/[handle]/[repo]/+page.svelte
index 3415ce397..7c469da9b 100644
--- a/web/src/routes/[handle]/[repo]/+page.svelte
+++ b/web/src/routes/[handle]/[repo]/+page.svelte
@@ -1,7 +1,17 @@
-
+
diff --git a/web/src/routes/[handle]/[repo]/commit/[ref]/+page.svelte b/web/src/routes/[handle]/[repo]/commit/[ref]/+page.svelte
index 46647de99..33ff333b3 100644
--- a/web/src/routes/[handle]/[repo]/commit/[ref]/+page.svelte
+++ b/web/src/routes/[handle]/[repo]/commit/[ref]/+page.svelte
@@ -1,5 +1,6 @@
diff --git a/web/src/routes/[handle]/[repo]/commits/[ref]/+page.svelte b/web/src/routes/[handle]/[repo]/commits/[ref]/+page.svelte
index bf9bcaba7..533eb4619 100644
--- a/web/src/routes/[handle]/[repo]/commits/[ref]/+page.svelte
+++ b/web/src/routes/[handle]/[repo]/commits/[ref]/+page.svelte
@@ -1,10 +1,20 @@
-
+