From 720e2c1d8bb28c816a07b180dd5db0477d170f89 Mon Sep 17 00:00:00 2001 From: squarepots <46488165+squarepots@users.noreply.github.com> Date: Wed, 9 Sep 2026 19:01:04 +0800 Subject: [PATCH 01/10] test(e2e): carry trusted manual publication provenance Reuse the upstream-tested publication selector changes so trusted manual main publications can be validated with exact workflow, SHA, attempt, publisher-job, and managed-image promotion evidence. Signed-off-by: Joe Zhu <46488165+squarepots@users.noreply.github.com> --- .../support/base-image-publication.test.ts | 106 ++++++++++++++++++ tools/e2e/base-image-publication.mts | 62 ++++++++-- 2 files changed, 156 insertions(+), 12 deletions(-) diff --git a/test/e2e/support/base-image-publication.test.ts b/test/e2e/support/base-image-publication.test.ts index 121d68155b6..66d91adfcb1 100644 --- a/test/e2e/support/base-image-publication.test.ts +++ b/test/e2e/support/base-image-publication.test.ts @@ -120,6 +120,7 @@ function selectedRun(overrides: Partial = {}): PublicationRun { return { id: RUN_ID, attempt: 1, + event: "push", workflowId: WORKFLOW_ID, headSha: RELEVANT_SHA, status: "completed", @@ -163,6 +164,16 @@ function successfulJobs(overrides: { runAttempt?: number } = {}): Record[] { + return [ + ...successfulJobs(), + publisherJob( + "Publish complete managed images / Promote complete multi-platform managed image cohort", + { id: 4 }, + ), + ]; +} + describe("base-image publication evidence", () => { it("publishes after a root package manifest changes", () => { const workflowSource = fs.readFileSync( @@ -490,6 +501,53 @@ describe("base-image publication evidence", () => { }); }); + it("accepts an exact successful manual main publication for branch reuse", () => { + const selection = selectPublicationRun( + runsPayload([workflowRun({ event: "workflow_dispatch" })]), + history(), + WORKFLOW_ID, + { allowWorkflowDispatch: true, completedSuccessOnly: true }, + ); + + expect(selection).toMatchObject({ + state: "selected", + run: { + id: RUN_ID, + event: "workflow_dispatch", + headSha: RELEVANT_SHA, + conclusion: "success", + }, + }); + expect(() => + selectPublicationRun( + runsPayload([workflowRun({ event: "workflow_dispatch" })]), + history(), + WORKFLOW_ID, + ), + ).toThrow(/event must be push/u); + }); + + it("prefers a successful push over a successful manual publication at the same commit", () => { + const pushRunId = RUN_ID + 1; + const selection = selectPublicationRun( + runsPayload([ + workflowRun({ event: "workflow_dispatch" }), + workflowRun({ + id: pushRunId, + html_url: `${RUN_URL_ROOT}/${pushRunId}`, + }), + ]), + history(), + WORKFLOW_ID, + { allowWorkflowDispatch: true, completedSuccessOnly: true }, + ); + + expect(selection).toMatchObject({ + state: "selected", + run: { id: pushRunId, event: "push", headSha: RELEVANT_SHA }, + }); + }); + it("accepts the renamed trusted workflow while selecting branch reuse", () => { const selection = selectPublicationRun( runsPayload([workflowRun({ name: "Images / Base Images" })]), @@ -621,6 +679,23 @@ describe("base-image publication evidence", () => { ).toThrow(/provenance does not match/u); }); + it("requires exact managed-image promotion from a manual publication", () => { + const manualRun = selectedRun({ event: "workflow_dispatch" }); + + expect(() => + validatePublisherJobs( + { total_count: successfulJobs().length, jobs: successfulJobs() }, + manualRun, + ), + ).toThrow(/missing required Publish complete managed images/u); + expect( + validatePublisherJobs( + { total_count: successfulManualJobs().length, jobs: successfulManualJobs() }, + manualRun, + ), + ).toBe("ready"); + }); + it("accepts the renamed trusted publisher jobs", () => { const jobs = [ publisherJob("Manifests / OpenClaw", { id: 1 }), @@ -846,6 +921,37 @@ describe("base-image publication evidence", () => { ).resolves.toEqual(selectedRun()); }); + it("uses a successful manual main publication for branch reuse", async () => { + const manualRun = workflowRun({ event: "workflow_dispatch" }); + const responses = [ + workflowMetadata(), + runsPayload([manualRun]), + { total_count: 4, jobs: successfulManualJobs() }, + manualRun, + ]; + const requests: string[] = []; + + await expect( + waitForBaseImagePublication({ + history: history(), + request: async (requestPath) => { + requests.push(requestPath); + return responses.shift(); + }, + requireWorkflowSuccess: true, + selectNearestSuccessfulRun: true, + waitMs: 100, + pollMs: 10, + }), + ).resolves.toEqual(selectedRun({ event: "workflow_dispatch" })); + expect(requests).toEqual([ + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml", + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", + `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}/attempts/1/jobs?per_page=100&page=1`, + `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}`, + ]); + }); + it("rejects failed managed-image publication before E2E consumers start", async () => { const failedRun = workflowRun({ conclusion: "failure" }); const responses = [ diff --git a/tools/e2e/base-image-publication.mts b/tools/e2e/base-image-publication.mts index d010fd6a718..24ccb285bb2 100644 --- a/tools/e2e/base-image-publication.mts +++ b/tools/e2e/base-image-publication.mts @@ -87,13 +87,19 @@ export const REQUIRED_PUBLISHER_JOBS = [ "Build and push Hermes base image", "Build and push Deep Agents Code base image", ] as const; -const PUBLISHER_JOB_ALIASES = new Map([ +const REQUIRED_MANUAL_MANAGED_IMAGE_JOB = + "Publish complete managed images / Promote complete multi-platform managed image cohort"; +type RequiredPublisherJob = + | (typeof REQUIRED_PUBLISHER_JOBS)[number] + | typeof REQUIRED_MANUAL_MANAGED_IMAGE_JOB; +const PUBLISHER_JOB_ALIASES = new Map([ ["Build and push OpenClaw base image", "Build and push OpenClaw base image"], ["Manifests / OpenClaw", "Build and push OpenClaw base image"], ["Build and push Hermes base image", "Build and push Hermes base image"], ["Manifests / Hermes", "Build and push Hermes base image"], ["Build and push Deep Agents Code base image", "Build and push Deep Agents Code base image"], ["Manifests / Deep Agents Code", "Build and push Deep Agents Code base image"], + [REQUIRED_MANUAL_MANAGED_IMAGE_JOB, REQUIRED_MANUAL_MANAGED_IMAGE_JOB], ]); type JsonRecord = Record; @@ -108,6 +114,7 @@ export interface FirstParentHistory { export interface PublicationRun { id: number; attempt: number; + event: "push" | "workflow_dispatch"; workflowId: number; headSha: string; status: string; @@ -429,7 +436,12 @@ export function validateWorkflow(payload: unknown): number { return workflowId; } -function validateRun(value: unknown, index: number, expectedWorkflowId: number): PublicationRun { +function validateRun( + value: unknown, + index: number, + expectedWorkflowId: number, + allowWorkflowDispatch = false, +): PublicationRun { const run = asRecord(value); const id = positiveSafeInteger(run.id, `workflow run ${index} id`); const attempt = positiveSafeInteger(run.run_attempt, `workflow run ${index} attempt`); @@ -439,7 +451,12 @@ function validateRun(value: unknown, index: number, expectedWorkflowId: number): throw new Error(`workflow run ${index} workflow id does not match the base-image workflow`); } const headSha = sha(run.head_sha, `workflow run ${index} head SHA`); - exactString(run.event, "push", `workflow run ${index} event`); + const event = run.event; + if (event !== "push" && !(allowWorkflowDispatch && event === "workflow_dispatch")) { + throw new Error( + `workflow run ${index} event must be push${allowWorkflowDispatch ? " or workflow_dispatch" : ""}`, + ); + } exactString(run.head_branch, MAIN_BRANCH, `workflow run ${index} branch`); exactString(run.path, WORKFLOW_PATH, `workflow run ${index} path`); trustedWorkflowName(run.name, `workflow run ${index} name`); @@ -468,6 +485,7 @@ function validateRun(value: unknown, index: number, expectedWorkflowId: number): return { id, attempt, + event, workflowId: expectedWorkflowId, headSha, status, @@ -480,7 +498,10 @@ export function selectPublicationRun( payload: unknown, history: FirstParentHistory, workflowId: number, - options: { readonly completedSuccessOnly?: boolean } = {}, + options: { + readonly allowWorkflowDispatch?: boolean; + readonly completedSuccessOnly?: boolean; + } = {}, ): PublicationSelection { positiveSafeInteger(workflowId, "base-image workflow id"); const response = asRecord(payload); @@ -495,7 +516,7 @@ export function selectPublicationRun( const runs = response.workflow_runs.flatMap((value, index) => { const run = asRecord(value); return typeof run.head_sha === "string" && history.distanceBySha.has(run.head_sha) - ? [validateRun(run, index, workflowId)] + ? [validateRun(run, index, workflowId, options.allowWorkflowDispatch === true)] : []; }); if (new Set(runs.map((run) => run.id)).size !== runs.length) { @@ -512,12 +533,16 @@ export function selectPublicationRun( const nearestDistance = Math.min(...selectable.map(({ distance }) => distance)); const nearest = selectable.filter(({ distance }) => distance === nearestDistance); - if (nearest.length !== 1) { + const preferredEvent = nearest.some(({ run }) => run.event === "push") + ? "push" + : "workflow_dispatch"; + const preferred = nearest.filter(({ run }) => run.event === preferredEvent); + if (preferred.length !== 1) { throw new Error( - `multiple trusted base-image workflow runs match ${nearest[0]?.run.headSha ?? history.relevantSha}`, + `multiple trusted ${preferredEvent} base-image workflow runs match ${preferred[0]?.run.headSha ?? history.relevantSha}: ${preferred.map(({ run }) => run.url).join(", ")}`, ); } - const run = nearest[0].run; + const run = preferred[0].run; return { state: "selected", run }; } @@ -566,7 +591,11 @@ export function validatePublisherJobs(payload: unknown, run: PublicationRun): "p } let pending = false; - for (const requiredName of REQUIRED_PUBLISHER_JOBS) { + const requiredJobs: readonly RequiredPublisherJob[] = + run.event === "workflow_dispatch" + ? [...REQUIRED_PUBLISHER_JOBS, REQUIRED_MANUAL_MANAGED_IMAGE_JOB] + : REQUIRED_PUBLISHER_JOBS; + for (const requiredName of requiredJobs) { const current = jobsByName.get(requiredName); if (!current) { if (run.status === "completed") { @@ -596,10 +625,16 @@ export function validatePublisherJobs(payload: unknown, run: PublicationRun): "p } export function validateBoundRun(payload: unknown, expected: PublicationRun): PublicationRun { - const actual = validateRun(payload, 0, expected.workflowId); + const actual = validateRun( + payload, + 0, + expected.workflowId, + expected.event === "workflow_dispatch", + ); if ( actual.id !== expected.id || actual.attempt !== expected.attempt || + actual.event !== expected.event || actual.headSha !== expected.headSha ) { throw new Error( @@ -753,10 +788,13 @@ export async function waitForBaseImagePublication( const workflowId = validateWorkflow( await request(`/repos/${REPOSITORY}/actions/workflows/${WORKFLOW_FILE}`), ); - const runsPath = `/repos/${REPOSITORY}/actions/workflows/${WORKFLOW_FILE}/runs?branch=${MAIN_BRANCH}&event=push&per_page=100`; + const allowWorkflowDispatch = options.selectNearestSuccessfulRun === true; + const eventFilter = allowWorkflowDispatch ? "" : "&event=push"; + const runsPath = `/repos/${REPOSITORY}/actions/workflows/${WORKFLOW_FILE}/runs?branch=${MAIN_BRANCH}${eventFilter}&per_page=100`; while (true) { const runs = await collectPaginated(request, runsPath, "workflow_runs"); const selection = selectPublicationRun(runs, options.history, workflowId, { + allowWorkflowDispatch, completedSuccessOnly: options.selectNearestSuccessfulRun === true, }); if (selection.state === "selected") { @@ -825,7 +863,7 @@ export async function waitForBaseImagePublication( notice( selection.state === "selected" ? `Required base image publishers are not complete for ${selection.run.headSha}; selected workflow run status ${selection.run.status}; ${selection.run.url}` - : `Waiting for a trusted base-image push run covering ${options.history.relevantSha}`, + : `Waiting for a trusted base-image publication run covering ${options.history.relevantSha}`, ); await sleep(Math.min(options.pollMs, Math.max(1, deadline - now()))); } From 114e9ed9572f4de11007a381e8b8df72525303e8 Mon Sep 17 00:00:00 2001 From: SquarePots <46488165+squarepots@users.noreply.github.com> Date: Wed, 9 Sep 2026 19:26:06 +0800 Subject: [PATCH 02/10] fix(e2e): accept manual main image publication Signed-off-by: SquarePots <46488165+squarepots@users.noreply.github.com> --- .github/workflows/e2e.yaml | 7 ++++++- .../base-image-publication-workflow-boundary.test.ts | 2 +- tools/e2e/operations-workflow-boundary.mts | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 04ee7d70595..7f8ef2eb936 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -204,11 +204,16 @@ jobs: run: | set -euo pipefail case "${REPOSITORY}:${REF}:${EVENT_NAME}:${CHECKOUT_SHA:+controller}" in - NVIDIA/NemoClaw:refs/heads/main:push:|NVIDIA/NemoClaw:refs/heads/main:workflow_dispatch:) + NVIDIA/NemoClaw:refs/heads/main:push:) expected_sha="$WORKFLOW_SHA" allow_non_head=0 select_nearest_successful=0 ;; + NVIDIA/NemoClaw:refs/heads/main:workflow_dispatch:) + expected_sha="$WORKFLOW_SHA" + allow_non_head=0 + select_nearest_successful=1 + ;; NVIDIA/NemoClaw:refs/heads/*:workflow_dispatch:controller) [[ "$BASE_SHA" =~ ^[a-f0-9]{40}$ ]] || { echo "::error::manual PR publication selection requires an exact base SHA" >&2 diff --git a/test/e2e/support/base-image-publication-workflow-boundary.test.ts b/test/e2e/support/base-image-publication-workflow-boundary.test.ts index 5260d0ae127..03ba667251f 100644 --- a/test/e2e/support/base-image-publication-workflow-boundary.test.ts +++ b/test/e2e/support/base-image-publication-workflow-boundary.test.ts @@ -113,7 +113,7 @@ describe("base-image publication workflow boundary (#7372)", () => { it.each([ ["push to main", "push", "", "refs/heads/main", "0", "c".repeat(40), "0"], - ["manual main", "workflow_dispatch", "", "refs/heads/main", "0", "c".repeat(40), "0"], + ["manual main", "workflow_dispatch", "", "refs/heads/main", "0", "c".repeat(40), "1"], [ "controller-selected PR", "workflow_dispatch", diff --git a/tools/e2e/operations-workflow-boundary.mts b/tools/e2e/operations-workflow-boundary.mts index c24d0c22dbb..70da46f975d 100644 --- a/tools/e2e/operations-workflow-boundary.mts +++ b/tools/e2e/operations-workflow-boundary.mts @@ -79,11 +79,16 @@ const PUBLICATION_CLASSIFIER_SCRIPT = [ "set -euo pipefail", 'case "${REPOSITORY}:${REF}:${EVENT_NAME}:${CHECKOUT_SHA:+controller}" in', - " NVIDIA/NemoClaw:refs/heads/main:push:|NVIDIA/NemoClaw:refs/heads/main:workflow_dispatch:)", + " NVIDIA/NemoClaw:refs/heads/main:push:)", ' expected_sha="$WORKFLOW_SHA"', " allow_non_head=0", " select_nearest_successful=0", " ;;", + " NVIDIA/NemoClaw:refs/heads/main:workflow_dispatch:)", + ' expected_sha="$WORKFLOW_SHA"', + " allow_non_head=0", + " select_nearest_successful=1", + " ;;", " NVIDIA/NemoClaw:refs/heads/*:workflow_dispatch:controller)", ' [[ "$BASE_SHA" =~ ^[a-f0-9]{40}$ ]] || {', ' echo "::error::manual PR publication selection requires an exact base SHA" >&2', From 0fbca5c748b9add95dac5a74dfb230255c3391a0 Mon Sep 17 00:00:00 2001 From: SquarePots <46488165+squarepots@users.noreply.github.com> Date: Wed, 9 Sep 2026 19:30:13 +0800 Subject: [PATCH 03/10] docs(e2e): describe manual main publication evidence Signed-off-by: SquarePots <46488165+squarepots@users.noreply.github.com> --- .github/workflows/base-image.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/base-image.yaml b/.github/workflows/base-image.yaml index 01572ee0834..629af79bf24 100644 --- a/.github/workflows/base-image.yaml +++ b/.github/workflows/base-image.yaml @@ -6,7 +6,8 @@ # Triggers: # - Push to main when a base- or managed-image input changes # - Manual dispatch for ad-hoc rebuilds -# E2E publication verification accepts push builds, not manual rebuilds. +# E2E publication verification accepts push builds and trusted manual main +# rebuilds only when the complete managed-image promotion job succeeds. # # Base images contain the expensive, rarely-changing layers. Complete image # publication consumes exact base digests from the same trusted workflow run. From a0a4b288718383a96e052aec644d68e8facb9cce Mon Sep 17 00:00:00 2001 From: SquarePots <46488165+squarepots@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:33:46 +0800 Subject: [PATCH 04/10] fix(e2e): skip incomplete manual publications Signed-off-by: SquarePots <46488165+squarepots@users.noreply.github.com> --- .github/workflows/base-image.yaml | 3 +- .../support/base-image-publication.test.ts | 45 +++++++++++++++++++ tools/e2e/base-image-publication.mts | 26 ++++++++--- 3 files changed, 67 insertions(+), 7 deletions(-) diff --git a/.github/workflows/base-image.yaml b/.github/workflows/base-image.yaml index 629af79bf24..453346214eb 100644 --- a/.github/workflows/base-image.yaml +++ b/.github/workflows/base-image.yaml @@ -6,8 +6,7 @@ # Triggers: # - Push to main when a base- or managed-image input changes # - Manual dispatch for ad-hoc rebuilds -# E2E publication verification accepts push builds and trusted manual main -# rebuilds only when the complete managed-image promotion job succeeds. +# Trusted manual publications require complete managed-image promotion. # # Base images contain the expensive, rarely-changing layers. Complete image # publication consumes exact base digests from the same trusted workflow run. diff --git a/test/e2e/support/base-image-publication.test.ts b/test/e2e/support/base-image-publication.test.ts index 66d91adfcb1..933855ea82d 100644 --- a/test/e2e/support/base-image-publication.test.ts +++ b/test/e2e/support/base-image-publication.test.ts @@ -952,6 +952,51 @@ describe("base-image publication evidence", () => { ]); }); + it("selects an older eligible push after skipping a newer manual run without managed-image promotion (#11289)", async () => { + const manualRunId = RUN_ID + 1; + const manualRun = workflowRun({ + id: manualRunId, + event: "workflow_dispatch", + head_sha: DESCENDANT_SHA, + html_url: `${RUN_URL_ROOT}/${manualRunId}`, + }); + const manualJobs = successfulJobs().map((job) => ({ + ...job, + run_id: manualRunId, + head_sha: DESCENDANT_SHA, + })); + const pushRun = workflowRun(); + const responses = [ + workflowMetadata(), + runsPayload([manualRun, pushRun]), + { total_count: manualJobs.length, jobs: manualJobs }, + { total_count: successfulJobs().length, jobs: successfulJobs() }, + pushRun, + ]; + const requests: string[] = []; + + await expect( + waitForBaseImagePublication({ + history: history(), + request: async (requestPath) => { + requests.push(requestPath); + return responses.shift(); + }, + requireWorkflowSuccess: true, + selectNearestSuccessfulRun: true, + waitMs: 100, + pollMs: 10, + }), + ).resolves.toEqual(selectedRun()); + expect(requests).toEqual([ + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml", + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", + `/repos/NVIDIA/NemoClaw/actions/runs/${manualRunId}/attempts/1/jobs?per_page=100&page=1`, + `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}/attempts/1/jobs?per_page=100&page=1`, + `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}`, + ]); + }); + it("rejects failed managed-image publication before E2E consumers start", async () => { const failedRun = workflowRun({ conclusion: "failure" }); const responses = [ diff --git a/tools/e2e/base-image-publication.mts b/tools/e2e/base-image-publication.mts index 24ccb285bb2..90eecf5a824 100644 --- a/tools/e2e/base-image-publication.mts +++ b/tools/e2e/base-image-publication.mts @@ -501,6 +501,7 @@ export function selectPublicationRun( options: { readonly allowWorkflowDispatch?: boolean; readonly completedSuccessOnly?: boolean; + readonly excludedRunIds?: ReadonlySet; } = {}, ): PublicationSelection { positiveSafeInteger(workflowId, "base-image workflow id"); @@ -523,6 +524,7 @@ export function selectPublicationRun( throw new Error("workflow run listing contains duplicate run ids"); } const eligible = runs.flatMap((run) => { + if (options.excludedRunIds?.has(run.id)) return []; const distance = history.distanceBySha.get(run.headSha); return distance === undefined ? [] : [{ run, distance }]; }); @@ -793,11 +795,15 @@ export async function waitForBaseImagePublication( const runsPath = `/repos/${REPOSITORY}/actions/workflows/${WORKFLOW_FILE}/runs?branch=${MAIN_BRANCH}${eventFilter}&per_page=100`; while (true) { const runs = await collectPaginated(request, runsPath, "workflow_runs"); - const selection = selectPublicationRun(runs, options.history, workflowId, { - allowWorkflowDispatch, - completedSuccessOnly: options.selectNearestSuccessfulRun === true, - }); - if (selection.state === "selected") { + const excludedRunIds = new Set(); + const select = () => + selectPublicationRun(runs, options.history, workflowId, { + allowWorkflowDispatch, + completedSuccessOnly: options.selectNearestSuccessfulRun === true, + excludedRunIds, + }); + let selection = select(); + while (selection.state === "selected") { if (now() > deadline) { throw new Error( `timed out validating base-image publication for ${selection.run.headSha}; ${selection.run.url}`, @@ -842,6 +848,15 @@ export async function waitForBaseImagePublication( } } } catch (error) { + if ( + selection.run.event === "workflow_dispatch" && + error instanceof Error && + error.message.includes(REQUIRED_MANUAL_MANAGED_IMAGE_JOB) + ) { + excludedRunIds.add(selection.run.id); + selection = select(); + continue; + } throw publicationEvidenceError(error, selection.run); } if (publisherState === "ready") { @@ -852,6 +867,7 @@ export async function waitForBaseImagePublication( } return validatedRun; } + break; } if (now() >= deadline) { From 2eabc1a468c9ae9cbaa94ae17b09f101c83d4661 Mon Sep 17 00:00:00 2001 From: SquarePots <46488165+squarepots@users.noreply.github.com> Date: Wed, 9 Sep 2026 21:41:42 +0800 Subject: [PATCH 05/10] fix(e2e): narrow manual publication fallback Signed-off-by: SquarePots <46488165+squarepots@users.noreply.github.com> --- .../support/base-image-publication.test.ts | 49 +++++++++++++++++-- tools/e2e/base-image-publication.mts | 23 +++++++-- 2 files changed, 63 insertions(+), 9 deletions(-) diff --git a/test/e2e/support/base-image-publication.test.ts b/test/e2e/support/base-image-publication.test.ts index 933855ea82d..50701e5c215 100644 --- a/test/e2e/support/base-image-publication.test.ts +++ b/test/e2e/support/base-image-publication.test.ts @@ -34,6 +34,8 @@ const RUN_ID = 29891942278; const WORKFLOW_ID = 251475843; const RUN_URL_ROOT = "https://github.com/NVIDIA/NemoClaw/actions/runs"; const RUN_URL = `https://github.com/NVIDIA/NemoClaw/actions/runs/${RUN_ID}`; +const MANAGED_IMAGE_PROMOTION_JOB = + "Publish complete managed images / Promote complete multi-platform managed image cohort"; const WORKFLOW_SOURCE = `on: push: branches: [main] @@ -167,10 +169,7 @@ function successfulJobs(overrides: { runAttempt?: number } = {}): Record[] { return [ ...successfulJobs(), - publisherJob( - "Publish complete managed images / Promote complete multi-platform managed image cohort", - { id: 4 }, - ), + publisherJob(MANAGED_IMAGE_PROMOTION_JOB, { id: 4 }), ]; } @@ -997,6 +996,48 @@ describe("base-image publication evidence", () => { ]); }); + it("rejects malformed manual promotion evidence instead of falling back to a push (#11289)", async () => { + const manualRunId = RUN_ID + 1; + const manualRun = workflowRun({ + id: manualRunId, + event: "workflow_dispatch", + head_sha: DESCENDANT_SHA, + html_url: `${RUN_URL_ROOT}/${manualRunId}`, + }); + const malformedManualJobs = successfulManualJobs().map((job) => ({ + ...job, + run_id: manualRunId, + head_sha: DESCENDANT_SHA, + ...(job.name === MANAGED_IMAGE_PROMOTION_JOB ? { conclusion: "not-a-conclusion" } : {}), + })); + const pushRun = workflowRun(); + const responses = [ + workflowMetadata(), + runsPayload([manualRun, pushRun]), + { total_count: malformedManualJobs.length, jobs: malformedManualJobs }, + ]; + const requests: string[] = []; + + await expect( + waitForBaseImagePublication({ + history: history(), + request: async (requestPath) => { + requests.push(requestPath); + return responses.shift(); + }, + requireWorkflowSuccess: true, + selectNearestSuccessfulRun: true, + waitMs: 100, + pollMs: 10, + }), + ).rejects.toThrow(/conclusion is invalid/u); + expect(requests).toEqual([ + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml", + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", + `/repos/NVIDIA/NemoClaw/actions/runs/${manualRunId}/attempts/1/jobs?per_page=100&page=1`, + ]); + }); + it("rejects failed managed-image publication before E2E consumers start", async () => { const failedRun = workflowRun({ conclusion: "failure" }); const responses = [ diff --git a/tools/e2e/base-image-publication.mts b/tools/e2e/base-image-publication.mts index 90eecf5a824..56ce58c81d2 100644 --- a/tools/e2e/base-image-publication.mts +++ b/tools/e2e/base-image-publication.mts @@ -102,6 +102,17 @@ const PUBLISHER_JOB_ALIASES = new Map([ [REQUIRED_MANUAL_MANAGED_IMAGE_JOB, REQUIRED_MANUAL_MANAGED_IMAGE_JOB], ]); +class IneligibleManualManagedImagePromotionError extends Error {} + +function requiredPublisherIneligibilityError( + requiredName: RequiredPublisherJob, + message: string, +): Error { + return requiredName === REQUIRED_MANUAL_MANAGED_IMAGE_JOB + ? new IneligibleManualManagedImagePromotionError(message) + : new Error(message); +} + type JsonRecord = Record; export interface FirstParentHistory { @@ -601,7 +612,8 @@ export function validatePublisherJobs(payload: unknown, run: PublicationRun): "p const current = jobsByName.get(requiredName); if (!current) { if (run.status === "completed") { - throw new Error( + throw requiredPublisherIneligibilityError( + requiredName, `missing required ${requiredName} job in attempt ${run.attempt}; ${run.url}`, ); } @@ -610,7 +622,8 @@ export function validatePublisherJobs(payload: unknown, run: PublicationRun): "p } if (current.status !== "completed") { if (run.status === "completed") { - throw new Error( + throw requiredPublisherIneligibilityError( + requiredName, `${requiredName} job is not complete in terminal attempt ${run.attempt}; ${run.url}`, ); } @@ -618,7 +631,8 @@ export function validatePublisherJobs(payload: unknown, run: PublicationRun): "p continue; } if (current.conclusion !== "success") { - throw new Error( + throw requiredPublisherIneligibilityError( + requiredName, `${requiredName} job did not complete successfully in attempt ${run.attempt}; ${run.url}`, ); } @@ -850,8 +864,7 @@ export async function waitForBaseImagePublication( } catch (error) { if ( selection.run.event === "workflow_dispatch" && - error instanceof Error && - error.message.includes(REQUIRED_MANUAL_MANAGED_IMAGE_JOB) + error instanceof IneligibleManualManagedImagePromotionError ) { excludedRunIds.add(selection.run.id); selection = select(); From b7f55d184d4e81a745d65b1f19e027970323e680 Mon Sep 17 00:00:00 2001 From: SquarePots <46488165+squarepots@users.noreply.github.com> Date: Wed, 9 Sep 2026 22:45:12 +0800 Subject: [PATCH 06/10] fix(e2e): resolve manual publication ambiguity Signed-off-by: SquarePots <46488165+squarepots@users.noreply.github.com> --- .../support/base-image-publication.test.ts | 27 +++++++++++++++++++ tools/e2e/base-image-publication.mts | 4 +-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/test/e2e/support/base-image-publication.test.ts b/test/e2e/support/base-image-publication.test.ts index 50701e5c215..68f0e6509b8 100644 --- a/test/e2e/support/base-image-publication.test.ts +++ b/test/e2e/support/base-image-publication.test.ts @@ -951,6 +951,33 @@ describe("base-image publication evidence", () => { ]); }); + it("selects the newest tied manual publication deterministically (#11289)", () => { + const olderManualRunId = RUN_ID + 1; + const newerManualRunId = RUN_ID + 2; + + expect( + selectPublicationRun( + runsPayload([ + workflowRun({ + id: olderManualRunId, + event: "workflow_dispatch", + head_sha: DESCENDANT_SHA, + html_url: `${RUN_URL_ROOT}/${olderManualRunId}`, + }), + workflowRun({ + id: newerManualRunId, + event: "workflow_dispatch", + head_sha: DESCENDANT_SHA, + html_url: `${RUN_URL_ROOT}/${newerManualRunId}`, + }), + ]), + history(), + WORKFLOW_ID, + { allowWorkflowDispatch: true, completedSuccessOnly: true }, + ), + ).toMatchObject({ state: "selected", run: { id: newerManualRunId, event: "workflow_dispatch" } }); + }); + it("selects an older eligible push after skipping a newer manual run without managed-image promotion (#11289)", async () => { const manualRunId = RUN_ID + 1; const manualRun = workflowRun({ diff --git a/tools/e2e/base-image-publication.mts b/tools/e2e/base-image-publication.mts index 56ce58c81d2..da8332dd12f 100644 --- a/tools/e2e/base-image-publication.mts +++ b/tools/e2e/base-image-publication.mts @@ -550,12 +550,12 @@ export function selectPublicationRun( ? "push" : "workflow_dispatch"; const preferred = nearest.filter(({ run }) => run.event === preferredEvent); - if (preferred.length !== 1) { + if (preferredEvent === "push" && preferred.length !== 1) { throw new Error( `multiple trusted ${preferredEvent} base-image workflow runs match ${preferred[0]?.run.headSha ?? history.relevantSha}: ${preferred.map(({ run }) => run.url).join(", ")}`, ); } - const run = preferred[0].run; + const run = [...preferred].sort((left, right) => right.run.id - left.run.id)[0].run; return { state: "selected", run }; } From 7f4c22aa3f5057e285776a95fd0d14548d45fc12 Mon Sep 17 00:00:00 2001 From: SquarePots <46488165+squarepots@users.noreply.github.com> Date: Wed, 9 Sep 2026 22:50:25 +0800 Subject: [PATCH 07/10] test(e2e): cover manual publication fallback Signed-off-by: SquarePots <46488165+squarepots@users.noreply.github.com> --- .../support/base-image-publication.test.ts | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/test/e2e/support/base-image-publication.test.ts b/test/e2e/support/base-image-publication.test.ts index 68f0e6509b8..912b09b45f8 100644 --- a/test/e2e/support/base-image-publication.test.ts +++ b/test/e2e/support/base-image-publication.test.ts @@ -644,6 +644,7 @@ describe("base-image publication evidence", () => { ]), history(), WORKFLOW_ID, + { allowWorkflowDispatch: true, completedSuccessOnly: true }, ), ).toThrow(/multiple trusted/u); expect(() => @@ -978,6 +979,54 @@ describe("base-image publication evidence", () => { ).toMatchObject({ state: "selected", run: { id: newerManualRunId, event: "workflow_dispatch" } }); }); + it("falls back through multiple ineligible manual publications to an older push (#11289)", async () => { + const olderManualRunId = RUN_ID + 1; + const newerManualRunId = RUN_ID + 2; + const manualRun = (id: number) => + workflowRun({ + id, + event: "workflow_dispatch", + head_sha: DESCENDANT_SHA, + html_url: `${RUN_URL_ROOT}/${id}`, + }); + const manualJobs = (runId: number) => + successfulJobs().map((job) => ({ ...job, run_id: runId, head_sha: DESCENDANT_SHA })); + const olderManualRun = manualRun(olderManualRunId); + const newerManualRun = manualRun(newerManualRunId); + const pushRun = workflowRun(); + const responses = [ + workflowMetadata(), + runsPayload([olderManualRun, newerManualRun, pushRun]), + { total_count: manualJobs(newerManualRunId).length, jobs: manualJobs(newerManualRunId) }, + { total_count: manualJobs(olderManualRunId).length, jobs: manualJobs(olderManualRunId) }, + { total_count: successfulJobs().length, jobs: successfulJobs() }, + pushRun, + ]; + const requests: string[] = []; + + await expect( + waitForBaseImagePublication({ + history: history(), + request: async (requestPath) => { + requests.push(requestPath); + return responses.shift(); + }, + requireWorkflowSuccess: true, + selectNearestSuccessfulRun: true, + waitMs: 100, + pollMs: 10, + }), + ).resolves.toEqual(selectedRun()); + expect(requests).toEqual([ + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml", + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", + `/repos/NVIDIA/NemoClaw/actions/runs/${newerManualRunId}/attempts/1/jobs?per_page=100&page=1`, + `/repos/NVIDIA/NemoClaw/actions/runs/${olderManualRunId}/attempts/1/jobs?per_page=100&page=1`, + `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}/attempts/1/jobs?per_page=100&page=1`, + `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}`, + ]); + }); + it("selects an older eligible push after skipping a newer manual run without managed-image promotion (#11289)", async () => { const manualRunId = RUN_ID + 1; const manualRun = workflowRun({ From 79be9b6b46dac80cba2f9ec986bdb7a1d6eabd0d Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Wed, 9 Sep 2026 10:52:06 -0700 Subject: [PATCH 08/10] fix(e2e): accept manual publications for automatic main runs Signed-off-by: Carlos Villela --- .../support/base-image-publication.test.ts | 86 ++++++++++--------- tools/e2e/base-image-publication.mts | 6 +- 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/test/e2e/support/base-image-publication.test.ts b/test/e2e/support/base-image-publication.test.ts index 912b09b45f8..4d5ae58011d 100644 --- a/test/e2e/support/base-image-publication.test.ts +++ b/test/e2e/support/base-image-publication.test.ts @@ -167,10 +167,7 @@ function successfulJobs(overrides: { runAttempt?: number } = {}): Record[] { - return [ - ...successfulJobs(), - publisherJob(MANAGED_IMAGE_PROMOTION_JOB, { id: 4 }), - ]; + return [...successfulJobs(), publisherJob(MANAGED_IMAGE_PROMOTION_JOB, { id: 4 })]; } describe("base-image publication evidence", () => { @@ -828,10 +825,10 @@ describe("base-image publication evidence", () => { expect(run.id).toBe(RUN_ID); expect(requests).toEqual([ "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml", - "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&event=push&per_page=100&page=1", - "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&event=push&per_page=100&page=1", + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}/attempts/1/jobs?per_page=100&page=1`, - "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&event=push&per_page=100&page=1", + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}/attempts/1/jobs?per_page=100&page=1`, `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}`, ]); @@ -921,36 +918,42 @@ describe("base-image publication evidence", () => { ).resolves.toEqual(selectedRun()); }); - it("uses a successful manual main publication for branch reuse", async () => { - const manualRun = workflowRun({ event: "workflow_dispatch" }); - const responses = [ - workflowMetadata(), - runsPayload([manualRun]), - { total_count: 4, jobs: successfulManualJobs() }, - manualRun, - ]; - const requests: string[] = []; + it.each([ + { context: "automatic main", selectNearestSuccessfulRun: false }, + { context: "manual main", selectNearestSuccessfulRun: true }, + ])( + "uses a successful manual publication for $context E2E", + async ({ selectNearestSuccessfulRun }) => { + const manualRun = workflowRun({ event: "workflow_dispatch" }); + const responses = [ + workflowMetadata(), + runsPayload([manualRun]), + { total_count: 4, jobs: successfulManualJobs() }, + manualRun, + ]; + const requests: string[] = []; - await expect( - waitForBaseImagePublication({ - history: history(), - request: async (requestPath) => { - requests.push(requestPath); - return responses.shift(); - }, - requireWorkflowSuccess: true, - selectNearestSuccessfulRun: true, - waitMs: 100, - pollMs: 10, - }), - ).resolves.toEqual(selectedRun({ event: "workflow_dispatch" })); - expect(requests).toEqual([ - "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml", - "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", - `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}/attempts/1/jobs?per_page=100&page=1`, - `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}`, - ]); - }); + await expect( + waitForBaseImagePublication({ + history: history(), + request: async (requestPath) => { + requests.push(requestPath); + return responses.shift(); + }, + requireWorkflowSuccess: true, + selectNearestSuccessfulRun, + waitMs: 100, + pollMs: 10, + }), + ).resolves.toEqual(selectedRun({ event: "workflow_dispatch" })); + expect(requests).toEqual([ + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml", + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", + `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}/attempts/1/jobs?per_page=100&page=1`, + `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}`, + ]); + }, + ); it("selects the newest tied manual publication deterministically (#11289)", () => { const olderManualRunId = RUN_ID + 1; @@ -976,7 +979,10 @@ describe("base-image publication evidence", () => { WORKFLOW_ID, { allowWorkflowDispatch: true, completedSuccessOnly: true }, ), - ).toMatchObject({ state: "selected", run: { id: newerManualRunId, event: "workflow_dispatch" } }); + ).toMatchObject({ + state: "selected", + run: { id: newerManualRunId, event: "workflow_dispatch" }, + }); }); it("falls back through multiple ineligible manual publications to an older push (#11289)", async () => { @@ -1169,7 +1175,7 @@ describe("base-image publication evidence", () => { ).resolves.toMatchObject({ id: RUN_ID, attempt: 1, conclusion: "success" }); expect(requests).toEqual([ "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml", - "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&event=push&per_page=100&page=1", + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", ...Array.from( { length: 11 }, (_, index) => `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}/attempts/${11 - index}`, @@ -1203,7 +1209,7 @@ describe("base-image publication evidence", () => { ).rejects.toThrow(/selected base-image workflow changed while evidence was verified/u); expect(requests).toEqual([ "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml", - "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&event=push&per_page=100&page=1", + "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", `/repos/NVIDIA/NemoClaw/actions/runs/${RUN_ID}/attempts/2`, ]); }); @@ -1241,7 +1247,7 @@ describe("base-image publication evidence", () => { budgetMs: 100, }, { - path: "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&event=push&per_page=100&page=1", + path: "/repos/NVIDIA/NemoClaw/actions/workflows/base-image.yaml/runs?branch=main&per_page=100&page=1", budgetMs: 100, }, { diff --git a/tools/e2e/base-image-publication.mts b/tools/e2e/base-image-publication.mts index da8332dd12f..387aa4a5ea6 100644 --- a/tools/e2e/base-image-publication.mts +++ b/tools/e2e/base-image-publication.mts @@ -804,15 +804,13 @@ export async function waitForBaseImagePublication( const workflowId = validateWorkflow( await request(`/repos/${REPOSITORY}/actions/workflows/${WORKFLOW_FILE}`), ); - const allowWorkflowDispatch = options.selectNearestSuccessfulRun === true; - const eventFilter = allowWorkflowDispatch ? "" : "&event=push"; - const runsPath = `/repos/${REPOSITORY}/actions/workflows/${WORKFLOW_FILE}/runs?branch=${MAIN_BRANCH}${eventFilter}&per_page=100`; + const runsPath = `/repos/${REPOSITORY}/actions/workflows/${WORKFLOW_FILE}/runs?branch=${MAIN_BRANCH}&per_page=100`; while (true) { const runs = await collectPaginated(request, runsPath, "workflow_runs"); const excludedRunIds = new Set(); const select = () => selectPublicationRun(runs, options.history, workflowId, { - allowWorkflowDispatch, + allowWorkflowDispatch: true, completedSuccessOnly: options.selectNearestSuccessfulRun === true, excludedRunIds, }); From 5b133c05a7919a369000500cca849d5b1f21345f Mon Sep 17 00:00:00 2001 From: Carlos Villela Date: Wed, 9 Sep 2026 11:33:27 -0700 Subject: [PATCH 09/10] fix(e2e): exclude unsuccessful manual publications Signed-off-by: Carlos Villela --- .../support/base-image-publication.test.ts | 53 +++++++++++-------- tools/e2e/base-image-publication.mts | 9 ++-- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/test/e2e/support/base-image-publication.test.ts b/test/e2e/support/base-image-publication.test.ts index 4d5ae58011d..efcc2bdb3b3 100644 --- a/test/e2e/support/base-image-publication.test.ts +++ b/test/e2e/support/base-image-publication.test.ts @@ -474,28 +474,39 @@ describe("base-image publication evidence", () => { }); }); - it("selects the nearest fully successful trusted run for branch reuse", () => { - const failedRunId = RUN_ID + 1; - const selection = selectPublicationRun( - runsPayload([ - workflowRun({ - id: failedRunId, - head_sha: DESCENDANT_SHA, - conclusion: "failure", - html_url: `${RUN_URL_ROOT}/${failedRunId}`, - }), - workflowRun(), - ]), - history(), - WORKFLOW_ID, - { completedSuccessOnly: true }, - ); + it.each([ + ["push", "completed", "failure", true], + ["workflow_dispatch", "completed", "failure", false], + ["workflow_dispatch", "completed", "cancelled", false], + ["workflow_dispatch", "completed", "timed_out", false], + ["workflow_dispatch", "in_progress", null, false], + ] as const)( + "keeps a valid publication when a newer %s rebuild is %s/%s", + (event, status, conclusion, completedSuccessOnly) => { + const newerRunId = RUN_ID + 1; + const selection = selectPublicationRun( + runsPayload([ + workflowRun({ + id: newerRunId, + head_sha: DESCENDANT_SHA, + html_url: `${RUN_URL_ROOT}/${newerRunId}`, + event, + status, + conclusion, + }), + workflowRun(), + ]), + history(), + WORKFLOW_ID, + { allowWorkflowDispatch: true, completedSuccessOnly }, + ); - expect(selection).toMatchObject({ - state: "selected", - run: { id: RUN_ID, headSha: RELEVANT_SHA, conclusion: "success" }, - }); - }); + expect(selection).toMatchObject({ + state: "selected", + run: { id: RUN_ID, headSha: RELEVANT_SHA, conclusion: "success" }, + }); + }, + ); it("accepts an exact successful manual main publication for branch reuse", () => { const selection = selectPublicationRun( diff --git a/tools/e2e/base-image-publication.mts b/tools/e2e/base-image-publication.mts index 387aa4a5ea6..5c431e3fbde 100644 --- a/tools/e2e/base-image-publication.mts +++ b/tools/e2e/base-image-publication.mts @@ -539,9 +539,12 @@ export function selectPublicationRun( const distance = history.distanceBySha.get(run.headSha); return distance === undefined ? [] : [{ run, distance }]; }); - const selectable = options.completedSuccessOnly - ? eligible.filter(({ run }) => run.status === "completed" && run.conclusion === "success") - : eligible; + const selectable = eligible.filter(({ run }) => { + if (options.completedSuccessOnly || run.event === "workflow_dispatch") { + return run.status === "completed" && run.conclusion === "success"; + } + return true; + }); if (selectable.length === 0) return { state: "missing" }; const nearestDistance = Math.min(...selectable.map(({ distance }) => distance)); From bd5c2e615ab4122574309d30d7b3b120ccbe63c5 Mon Sep 17 00:00:00 2001 From: Rebecca Sliter <571084+rsliter@users.noreply.github.com> Date: Thu, 10 Sep 2026 09:41:15 -0700 Subject: [PATCH 10/10] test(e2e): isolate publication event precedence Signed-off-by: Rebecca Sliter <571084+rsliter@users.noreply.github.com> --- test/e2e/support/base-image-publication.test.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/e2e/support/base-image-publication.test.ts b/test/e2e/support/base-image-publication.test.ts index e6fa89883d0..fbc18343ca9 100644 --- a/test/e2e/support/base-image-publication.test.ts +++ b/test/e2e/support/base-image-publication.test.ts @@ -535,14 +535,15 @@ describe("base-image publication evidence", () => { }); it("prefers a successful push over a successful manual publication at the same commit", () => { - const pushRunId = RUN_ID + 1; + const manualRunId = RUN_ID + 1; const selection = selectPublicationRun( runsPayload([ - workflowRun({ event: "workflow_dispatch" }), workflowRun({ - id: pushRunId, - html_url: `${RUN_URL_ROOT}/${pushRunId}`, + id: manualRunId, + html_url: `${RUN_URL_ROOT}/${manualRunId}`, + event: "workflow_dispatch", }), + workflowRun(), ]), history(), WORKFLOW_ID, @@ -551,7 +552,7 @@ describe("base-image publication evidence", () => { expect(selection).toMatchObject({ state: "selected", - run: { id: pushRunId, event: "push", headSha: RELEVANT_SHA }, + run: { id: RUN_ID, event: "push", headSha: RELEVANT_SHA }, }); });