Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

ci: consolidate required check forwarding into one matrix (#1938)

Michael D'Angelo1b38d38b1304
diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml
index 5d99e4ad7..683389268 100644
--- a/.github/workflows/node-ci.yml
+++ b/.github/workflows/node-ci.yml
@@ -488,8 +488,9 @@ jobs:
if: *source-aggregate
runs-on: ubuntu-latest
strategy:
+ fail-fast: false
matrix:
- os: [ubuntu-latest, macos-latest]
+ os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Require CI gate
if: needs.ci.result != 'success'
@@ -573,16 +574,3 @@ jobs:
working-directory: sdk/typescript
shell: bash
run: node scripts/check-package.mjs ../../dist/*.tgz
-
- windows:
- name: ${{ github.event_name == 'pull_request' && github.event.action == 'edited' && github.event.changes.base == null && 'metadata / ' || '' }}windows-latest / node-${{ matrix.node == '22.13.0' && '22' || matrix.node }}
- runs-on: ubuntu-latest
- if: *source-aggregate
- needs: [classify-changes, ci]
- strategy:
- matrix:
- node: ["22.13.0", "24"]
- steps:
- - name: Require CI gate
- if: needs.ci.result != 'success'
- run: exit 1
diff --git a/docs/ci.md b/docs/ci.md
index f4b349ee4..49283610c 100644
--- a/docs/ci.md
+++ b/docs/ci.md
@@ -63,14 +63,15 @@ job can be skipped. Static checks are always required. The separate `test-qualit
workflow runs weekly property and mutation tests. Dispatch it to compare full SDK
shard layouts.
-The existing OS-named check contexts temporarily forward the `ci` result so
-repository branch rules continue to work during migration. To finish migration:
+One compatibility matrix forwards the `ci` result to the three OS-named Node 22
+checks required by the current `main` ruleset. Migrate the required checks in
+this order.
1. Merge the workflow change and verify that `ci` is reported for source and
documentation pull requests, including a failing selected-check example.
2. Change the repository's required status checks to `ci` and `Validate PR Title`,
preserving their GitHub Actions integration and all unrelated protection rules.
-3. Remove the compatibility jobs `required-test` and `windows` in a follow-up.
+3. Remove the compatibility matrix `required-test` in a follow-up.
Do not remove the old contexts before changing the rules. The workflow change
itself does not change repository protection settings.
diff --git a/sdk/typescript/tests-ts/devcontainer-cooldown.test.ts b/sdk/typescript/tests-ts/devcontainer-cooldown.test.ts
index 45a64ff2f..85e4fdac6 100644
--- a/sdk/typescript/tests-ts/devcontainer-cooldown.test.ts
+++ b/sdk/typescript/tests-ts/devcontainer-cooldown.test.ts
@@ -371,14 +371,4 @@ test("runs the guard with package metadata access inside the existing required c
env: { CI_RESULTS: "${{ toJSON(needs) }}" },
}),
);
- for (const name of ["required-test", "windows"]) {
- const required = workflow.jobs[name]!;
- expect(required.needs).toContain("ci");
- expect(
- required.steps.some(
- (step) =>
- step.run === "exit 1" && step.if === "needs.ci.result != 'success'",
- ),
- ).toBe(true);
- }
});
diff --git a/sdk/typescript/tests-ts/release-automation.test.ts b/sdk/typescript/tests-ts/release-automation.test.ts
index 61716faaf..6ea8ea03c 100644
--- a/sdk/typescript/tests-ts/release-automation.test.ts
+++ b/sdk/typescript/tests-ts/release-automation.test.ts
@@ -3859,7 +3859,7 @@ describe("GitHub release workflow safeguards", () => {
});
expect(checkout).not.toHaveProperty("if");
- const aggregates = ["ci", "required-test", "windows"];
+ const aggregates = ["ci", "required-test"];
const checks = Object.entries(workflow.jobs).filter(
([name]) => name !== "classify-changes" && !aggregates.includes(name),
);
@@ -3916,28 +3916,6 @@ describe("GitHub release workflow safeguards", () => {
run: "node .github/scripts/check-ci-results.mjs",
env: { CI_RESULTS: "${{ toJSON(needs) }}" },
});
-
- const conditionCases = [];
- for (const name of ["required-test", "windows"]) {
- const job = workflow.jobs[name]!;
- expect(new Set([job.needs].flat())).toEqual(
- new Set(["classify-changes", "ci"]),
- );
- const gate = job.steps.find(({ name }) => name === "Require CI gate");
- expect(gate?.run).toBe("exit 1");
- for (const result of ["success", "failure", "cancelled", "skipped"]) {
- conditionCases.push({
- condition: gate?.if ?? "",
- values: { "needs.ci.result": result },
- expected: result !== "success",
- message: `${name}: ${result}`,
- });
- }
- }
- const conditions = await evaluateWorkflowConditions(conditionCases);
- for (const [index, item] of conditionCases.entries()) {
- expect(conditions[index], item.message).toBe(item.expected);
- }
});
test("documents a canonical historical-summary prefix block", () => {
diff --git a/sdk/typescript/tests-ts/workflow-quality.test.ts b/sdk/typescript/tests-ts/workflow-quality.test.ts
index e77346eef..8187830be 100644
--- a/sdk/typescript/tests-ts/workflow-quality.test.ts
+++ b/sdk/typescript/tests-ts/workflow-quality.test.ts
@@ -19,7 +19,7 @@ const ci = Bun.YAML.parse(
name: string;
needs?: string | string[];
if?: string;
- strategy?: { matrix: Record<string, string[]> };
+ strategy?: { matrix: Record<string, string[]>; "fail-fast"?: boolean };
steps: { name: string; if?: string; run: string }[];
}
>;
@@ -64,14 +64,6 @@ const aggregates = [
...ci.jobs["required-test"]!.strategy!.matrix["os"]!.map(
(os) => ["required-test", { os }, `${os} / node-22`] as const,
),
- ...ci.jobs["windows"]!.strategy!.matrix["node"]!.map(
- (node) =>
- [
- "windows",
- { node },
- `windows-latest / node-${node === "22.13.0" ? "22" : node}`,
- ] as const,
- ),
];
test.each([
@@ -114,7 +106,6 @@ test("all source jobs depend on classification and titles cannot block source ch
"ubuntu-latest / node-22",
"macos-latest / node-22",
"windows-latest / node-22",
- "windows-latest / node-24",
]);
expect(ci.on.pull_request.types).toEqual([
"opened",
@@ -399,18 +390,17 @@ for (const target of musl.jobs.primitives.strategy.matrix.include) {
}
test("legacy required check names propagate the final CI gate result", () => {
- for (const id of ["required-test", "windows"]) {
- const aggregate = ci.jobs[id]!;
- expect(aggregate.needs).toContain("ci");
- expect(aggregate.if).toContain("always()");
- const gate = aggregate.steps.find(
- (step) => step.name === "Require CI gate",
- )!;
- expect(gate.run).toBe("exit 1");
- for (const result of ["success", "failure", "cancelled", "skipped"]) {
- expect(expression(gate.if!, { needs: { ci: { result } } })).toBe(
- result !== "success",
- );
- }
+ const forwarder = ci.jobs["required-test"]!;
+ expect(forwarder.strategy?.["fail-fast"]).toBe(false);
+ expect(new Set([forwarder.needs].flat())).toEqual(
+ new Set(["classify-changes", "ci"]),
+ );
+ expect(forwarder.if).toContain("always()");
+ const gate = forwarder.steps.find((step) => step.name === "Require CI gate")!;
+ expect(gate.run).toBe("exit 1");
+ for (const result of ["success", "failure", "cancelled", "skipped"]) {
+ expect(expression(gate.if!, { needs: { ci: { result } } })).toBe(
+ result !== "success",
+ );
}
});