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: skip container builds for SDK test-only pull requests (#2069)

Michael D'Angelod3593955b417
diff --git a/.dockerignore b/.dockerignore
index 70ec15ed0..4cdd911d2 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,6 +1,7 @@
.git
.github
plugins/codex-security/tests
+sdk/typescript/tests-ts/*.test.ts
**/.DS_Store
**/.env
**/.env.*
diff --git a/.github/scripts/check-ci-results.mjs b/.github/scripts/check-ci-results.mjs
index ca06a1de0..2dea9b1f8 100644
--- a/.github/scripts/check-ci-results.mjs
+++ b/.github/scripts/check-ci-results.mjs
@@ -8,7 +8,8 @@ export function failedChecks(needs) {
const required = ["static-checks"];
const groups = {
"package-required": ["native", "package", "compatibility"],
- "source-required": ["test", "windows-test", "container-validate"],
+ "source-required": ["test", "windows-test"],
+ "container-required": ["container-validate"],
"plugin-tests-required": ["mcp", "plugin-host", "plugin-source"],
"workflow-quality": ["workflow-quality"],
"action-ci": ["action-ci"],
diff --git a/.github/scripts/select-ci-checks.mjs b/.github/scripts/select-ci-checks.mjs
index 25597c29f..776486494 100644
--- a/.github/scripts/select-ci-checks.mjs
+++ b/.github/scripts/select-ci-checks.mjs
@@ -86,6 +86,9 @@ export function selectChecks(paths, options) {
];
const selected = {
"source-required": String(source),
+ "container-required": String(
+ sourceBeyondSdkTests && scope !== "python-tests",
+ ),
"plugin-tests-required": String(sourceBeyondSdkTests),
"package-required": String(source || scope === "action"),
"action-ci": String(action),
diff --git a/.github/scripts/test-ci-selection.mjs b/.github/scripts/test-ci-selection.mjs
index e63acfc88..b8b91219a 100644
--- a/.github/scripts/test-ci-selection.mjs
+++ b/.github/scripts/test-ci-selection.mjs
@@ -16,6 +16,7 @@ const ubuntuNode24Install = JSON.stringify({
const regularSource = {
"source-required": "true",
+ "container-required": "true",
"plugin-tests-required": "true",
"package-required": "true",
"action-ci": "false",
@@ -85,18 +86,23 @@ const fullQualification = {
const docs = {
...regularSource,
"source-required": "false",
+ "container-required": "false",
"plugin-tests-required": "false",
"package-required": "false",
"eval-contracts": "false",
};
-test("only edits to existing direct pytest modules skip independent jobs", (t) => {
+test("the Docker context excludes the test modules skipped by container CI", () => {
const ignore = ["Dockerfile.dockerignore", ".dockerignore"]
.map((file) => new URL(`../../${file}`, import.meta.url))
.find((file) => fs.existsSync(file));
const rules = fs.readFileSync(ignore, "utf8");
assert.match(rules, /^plugins\/codex-security\/tests\r?$/m);
+ assert.match(rules, /^sdk\/typescript\/tests-ts\/\*\.test\.ts\r?$/m);
assert.doesNotMatch(rules, /^\s*!/m);
+});
+
+test("only edits to existing direct pytest modules skip independent jobs", (t) => {
const cwd = fs.mkdtempSync(resolve(tmpdir(), "ci-pytest-"));
t.after(() => fs.rmSync(cwd, { recursive: true, force: true }));
const files = join(cwd, "plugins/codex-security/tests");
@@ -134,6 +140,7 @@ test("only edits to existing direct pytest modules skip independent jobs", (t) =
).include.filter(({ os }) => os !== "windows-latest"),
}),
"source-required": "false",
+ "container-required": "false",
"action-ci": "false",
"eval-contracts": "false",
};
@@ -328,6 +335,7 @@ test("SDK test-only PRs skip independent suites and retain any changed eval inpu
];
const sdk = {
...regularSource,
+ "container-required": "false",
"plugin-tests-required": "false",
"compatibility-matrix": ubuntuNode24Install,
};
@@ -516,6 +524,7 @@ test("documentation requires static checks and explicit selection, without skipp
);
for (const key of [
"source-required",
+ "container-required",
"plugin-tests-required",
"package-required",
"action-ci",
diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml
index ab089a9e7..c2985d0b2 100644
--- a/.github/workflows/node-ci.yml
+++ b/.github/workflows/node-ci.yml
@@ -34,6 +34,7 @@ jobs:
source-run: ${{ steps.proof.outputs.source-run }}
edit-attempt: ${{ steps.proof.outputs.edit-attempt }}
source-required: ${{ steps.scope.outputs.source-required }}
+ container-required: ${{ steps.scope.outputs.container-required }}
plugin-tests-required: ${{ steps.scope.outputs.plugin-tests-required }}
package-required: ${{ steps.scope.outputs.package-required }}
action-ci: ${{ steps.scope.outputs.action-ci }}
@@ -138,7 +139,7 @@ jobs:
container-validate:
needs: [classify-changes, native, static-checks]
- if: needs.classify-changes.outputs.source-required == 'true'
+ if: needs.classify-changes.outputs.container-required == 'true'
uses: ./.github/workflows/container-validate.yml
package:
diff --git a/docs/ci.md b/docs/ci.md
index c8d8389ba..8b50da8c4 100644
--- a/docs/ci.md
+++ b/docs/ci.md
@@ -36,12 +36,13 @@ Pull requests limited to `.ts` files under `sdk/typescript/src/`,
use reduced version matrices. They test the minimum Node 22, 24, and 26 versions,
current Node 24 for the Action adapter, macOS installation, and Windows Node 22
installation. When selected, Python runs the full suite on 3.12 and the native
-subsets on macOS and Windows. All source changes still select container
-validation.
+subsets on macOS and Windows. Product source changes select container validation.
PRs limited to top-level `sdk/typescript/tests-ts/*.test.ts` keep all SDK shards,
-static checks, native builds, packaging, and containers. These files are outside
-the npm package, so one Ubuntu Node 24 install checks it and the Action adapter.
+static checks, native builds, and packaging. Docker excludes these top-level
+test modules, so these PRs skip container validation. Test support files used by
+package inspection remain in the build context. The test modules are outside the
+npm package, so one Ubuntu Node 24 install checks it and the Action adapter.
These PRs skip the plugin suites and run evals only for `codex-dependency-pins.test.ts`.
Mixed changes follow the usual source or full route.
diff --git a/sdk/typescript/tests-ts/container-ci-workflow.test.ts b/sdk/typescript/tests-ts/container-ci-workflow.test.ts
index 6b25df0ee..7037a3389 100644
--- a/sdk/typescript/tests-ts/container-ci-workflow.test.ts
+++ b/sdk/typescript/tests-ts/container-ci-workflow.test.ts
@@ -36,7 +36,7 @@ test("shares one native build and container matrix in automatic CI", () => {
).toEqual([ci.jobs["container-validate"]!]);
expect(ci.jobs["container-validate"]).toMatchObject({
needs: ["classify-changes", "native", "static-checks"],
- if: "needs.classify-changes.outputs.source-required == 'true'",
+ if: "needs.classify-changes.outputs.container-required == 'true'",
uses: "./.github/workflows/container-validate.yml",
});
expect(container.jobs["container"]).toMatchObject({