Repository navigation
ci(release): require service evidence before packaging starts #8523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -517,6 +517,18 @@ describe("release pipeline contract", () => { | |
| const publish = release.jobs?.publish?.steps?.find(step => step.name === "Recheck source CI and service evidence")?.run; | ||
| expect(verify).toBeDefined(); | ||
| expect(publish).toBe(verify); | ||
| // validate-dispatch answers the same gate before any runner packages (run 42951296881 packaged | ||
| // and then failed in verify-npm on missing service evidence), with the identical script. | ||
| const early = release.jobs?.["validate-dispatch"]?.steps?.find(step => step.name === "Require source CI and service evidence before packaging") as | ||
| { run?: string; env?: Record<string, string> } | undefined; | ||
| expect(early?.run).toBe(verify); | ||
|
Comment on lines
+522
to
+524
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Early-gate test lacks a no-tags case.
Add an assertion on the
|
||
| expect(early?.env).toMatchObject({ | ||
| SOURCE_SHA: "${{ steps.source.outputs.source_sha }}", | ||
| RELEASE_VERSION: "${{ steps.version.outputs.version }}", | ||
| }); | ||
| const earlySteps = release.jobs?.["validate-dispatch"]?.steps?.map(step => step.name) ?? []; | ||
| expect(earlySteps.indexOf("Require source CI and service evidence before packaging")) | ||
| .toBeGreaterThan(earlySteps.indexOf("Resolve release version")); | ||
| const root = mkdtempSync(join(tmpdir(), "ocx-release-evidence-")); | ||
| try { | ||
| const calls = join(root, "calls"), source = "a".repeat(40), baseline = "b".repeat(40); | ||
|
|
@@ -537,13 +549,16 @@ describe("release pipeline contract", () => { | |
| PATH: process.env.PATH ?? "/usr/bin:/bin", SOURCE_SHA: source, BASE_SHA: baseline, RELEASE_VERSION: "2.1.0", | ||
| BASELINE: "yes", DRAFT: "false", REQUIRED: "true", CI_STATUS: "0", SERVICE_STATUS: "0", CALLS: calls, ...extra, | ||
| }, stdout: "pipe", stderr: "pipe" }); | ||
| return { code: result.exitCode, calls: readFileSync(calls, "utf8"), stderr: result.stderr.toString() }; | ||
| return { code: result.exitCode, calls: readFileSync(calls, "utf8"), stderr: result.stderr.toString(), stdout: result.stdout.toString() }; | ||
| }; | ||
| const required = execute(); | ||
| expect(required.code, required.stderr).toBe(0); | ||
| expect(required.calls).toContain(`check ${source}`); | ||
| expect(required.calls).toContain(`service-range ${source} ${baseline}`); | ||
| expect(required.calls).toContain(`service ${source}`); | ||
| const missing = execute({ SERVICE_STATUS: "1" }); | ||
| expect(missing.code).not.toBe(0); | ||
| expect(missing.stdout).toContain(`gh workflow run service-lifecycle.yml --ref dev -f source_sha=${source}`); | ||
| const unchanged = execute({ REQUIRED: "false" }); | ||
| expect(unchanged.code, unchanged.stderr).toBe(0); | ||
| expect(unchanged.calls).not.toContain(`service ${source}`); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
State when service evidence is required.
The release workflow checks for a service run only when
service-rangemarks the selected range as requiring one. A release with no matching changes can proceed without a service run. Describe the baseline comparison and qualify the missing-run failure accordingly. (raw.githubusercontent.com)As per coding guidelines, a
structure/doc states “the contract that holds right now.”Source: Coding guidelines