diff --git a/web/stovepipe/controller/projects.ts b/web/stovepipe/controller/projects.ts
index d98108cee..92e2778db 100644
--- a/web/stovepipe/controller/projects.ts
+++ b/web/stovepipe/controller/projects.ts
@@ -33,13 +33,17 @@ export async function loadProjectStatus(
pageSizeChoices: projectPageSizes.map(value => ({
value, href: paths.request(queue, requestId, "", value),
})),
- projects: result.projects.map((entry) => ({
- project: entry.project,
- projectType: entry.projectType,
- issuesHref: paths.projectIssues(queue, requestId, entry.project, pageToken, pageSize),
- breakageDegree: entry.result.case === "breakageDegree"
- ? breakageDegree(entry.result.value) : null,
- })),
+ projects: result.projects.map((entry) => {
+ const degree = entry.result.case === "breakageDegree"
+ ? breakageDegree(entry.result.value) : null;
+ return {
+ project: entry.project,
+ projectType: entry.projectType,
+ issuesHref: degree !== null && degree > 0
+ ? paths.projectIssues(queue, requestId, entry.project, pageToken, pageSize) : null,
+ breakageDegree: degree,
+ };
+ }),
firstHref: pageToken ? paths.request(queue, requestId, "", pageSize) : null,
nextHref: result.nextPageToken
? paths.request(queue, requestId, result.nextPageToken, pageSize)
diff --git a/web/stovepipe/entity/index.ts b/web/stovepipe/entity/index.ts
index 5ecbd0622..c40fd5ea8 100644
--- a/web/stovepipe/entity/index.ts
+++ b/web/stovepipe/entity/index.ts
@@ -136,8 +136,8 @@ export interface ProjectStatusModel {
pageSize: number;
/** Supported page sizes and their first-page URLs for this request. */
pageSizeChoices: { value: number; href: string }[];
- /** Recorded projects on this page; null breakage means no result. */
- projects: { project: string; projectType: string; breakageDegree: number | null; issuesHref: string }[];
+ /** Recorded projects on this page; null breakage means no result. Issue links are only available for recorded breakage. */
+ projects: { project: string; projectType: string; breakageDegree: number | null; issuesHref: string | null }[];
/** First project page for this request; null on the first page. */
firstHref: string | null;
/** Opaque project continuation URL; null on the final page. */
diff --git a/web/stovepipe/module.test.ts b/web/stovepipe/module.test.ts
index ce0cc08b2..61a032930 100644
--- a/web/stovepipe/module.test.ts
+++ b/web/stovepipe/module.test.ts
@@ -473,9 +473,10 @@ describe("Stovepipe page loading", () => {
repositoryBreakageDegree: 0,
complete: false,
projects: [
- { project: "green", projectType: "service", breakageDegree: 0 },
- { project: "broken", projectType: "future-type", breakageDegree: 0.25 },
- { project: "unknown", projectType: "", breakageDegree: null },
+ { project: "green", projectType: "service", breakageDegree: 0, issuesHref: null },
+ { project: "broken", projectType: "future-type", breakageDegree: 0.25,
+ issuesHref: paths.projectIssues(summary.queue, summary.requestId, "broken", "opaque+/=", 50) },
+ { project: "unknown", projectType: "", breakageDegree: null, issuesHref: null },
],
firstHref: paths.request(summary.queue, summary.requestId),
nextHref: paths.request(summary.queue, summary.requestId, "next+/="),
diff --git a/web/stovepipe/view/app.test.tsx b/web/stovepipe/view/app.test.tsx
index 5d728cb48..d28793f6a 100644
--- a/web/stovepipe/view/app.test.tsx
+++ b/web/stovepipe/view/app.test.tsx
@@ -29,10 +29,10 @@ const model: StovepipePageModel = {
value, href: "/repo%2Fmain/request/7?projectPageSize=" + value,
})),
projects: [
- { project: "green-project", projectType: "service", breakageDegree: 0, issuesHref: "/project-issues" },
+ { project: "green-project", projectType: "service", breakageDegree: 0, issuesHref: null },
{ project: "partial-breakage-project", projectType: "future-type", breakageDegree: 0.25, issuesHref: "/project-issues" },
{ project: "broken-project", projectType: "", breakageDegree: 1, issuesHref: "/project-issues" },
- { project: "unknown-project", projectType: "", breakageDegree: null, issuesHref: "/project-issues" },
+ { project: "unknown-project", projectType: "", breakageDegree: null, issuesHref: null },
],
firstHref: null,
nextHref: "/repo%2Fmain/request/7?projects=opaque%2B%2F%3D",
@@ -235,7 +235,7 @@ it.each(["projects=next", "projectPageSize=25"])("preserves the request summary
key: "/repo%2Fmain/request/7?" + query,
projectStatus: { ok: true, data: {
...model.projectStatus.data,
- projects: [{ project: "next-project", projectType: "", breakageDegree: 0, issuesHref: "/project-issues" }],
+ projects: [{ project: "next-project", projectType: "", breakageDegree: 0, issuesHref: null }],
} },
}} />);
expect(screen.getByText("git://repo/sha")).toBeVisible();
diff --git a/web/stovepipe/view/issues.test.tsx b/web/stovepipe/view/issues.test.tsx
index 6f970ba43..85ef31a56 100644
--- a/web/stovepipe/view/issues.test.tsx
+++ b/web/stovepipe/view/issues.test.tsx
@@ -239,3 +239,17 @@ it("shows paginated affected projects and keeps the collapse action on failure",
expect(screen.getByRole("alert")).toHaveTextContent("Projects unavailable");
expect(screen.getByRole("link", { name: "Hide projects" })).toHaveAttribute("href", "/issues");
});
+
+it("removes stale affected projects when an issue becomes resolved", () => {
+ const issue = { taskId: "test", unitId: "unit", kind: "existing", buildId: "build/7", firstSeenBuildId: "build/1", projectsHref: "/projects" };
+ const model = { status: "complete", firstHref: null, nextHref: null, issues: [issue] };
+ const selection = { taskId: "test", unitId: "unit", key: "selection", closeHref: "/issues", result: { ok: true as const, data: {
+ projects: ["project-1"], complete: true, firstHref: null, nextHref: null,
+ } } };
+ const { rerender } = render(