OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security
TypeScript ai-securityapplication-securityclicode-scanningcodexcodex-securitycybersecuritydevsecopsnodejsnpmopenaisdksecuritytypescriptvulnerability-scanning
ci: skip container checks for edits to excluded pytest modules (#2025)
Michael D'Angelo5098ed6ee766
diff --git a/.github/scripts/check-ci-results.mjs b/.github/scripts/check-ci-results.mjsindex fe83b1f51..ca06a1de0 100644--- a/.github/scripts/check-ci-results.mjs+++ b/.github/scripts/check-ci-results.mjs@@ -8,10 +8,9 @@ export function failedChecks(needs) {const required = ["static-checks"];const groups = {"package-required": ["native", "package", "compatibility"],- "source-required": ["test", "windows-test"],+ "source-required": ["test", "windows-test", "container-validate"],"plugin-tests-required": ["mcp", "plugin-host", "plugin-source"],"workflow-quality": ["workflow-quality"],- "container-validate": ["container-validate"],"action-ci": ["action-ci"],"eval-contracts": ["eval-contracts"],};diff --git a/.github/scripts/select-ci-checks.mjs b/.github/scripts/select-ci-checks.mjsindex 61e43dc0e..ccbe2b34e 100644--- a/.github/scripts/select-ci-checks.mjs+++ b/.github/scripts/select-ci-checks.mjs@@ -94,7 +94,6 @@ export function selectChecks(paths, options) {paths.includes("sdk/typescript/tests-ts/codex-dependency-pins.test.ts"),),"workflow-quality": String(full),- "container-validate": String(source),"compatibility-matrix": JSON.stringify({include:scope === "action"diff --git a/.github/scripts/test-ci-selection.mjs b/.github/scripts/test-ci-selection.mjsindex c7f903dce..14d60f78b 100644--- a/.github/scripts/test-ci-selection.mjs+++ b/.github/scripts/test-ci-selection.mjs@@ -17,7 +17,6 @@ const regularSource = {"action-ci": "false","eval-contracts": "true","workflow-quality": "false",- "container-validate": "true","compatibility-matrix": JSON.stringify({include: [{ os: "ubuntu-latest", node: "22.13.0" },@@ -48,7 +47,6 @@ const fullQualification = {...regularSource,"action-ci": "true","workflow-quality": "true",- "container-validate": "true","compatibility-matrix": JSON.stringify({include: [{ os: "ubuntu-latest", node: "22.13.0" },@@ -86,10 +84,15 @@ const docs = {"plugin-tests-required": "false","package-required": "false","eval-contracts": "false",- "container-validate": "false",};test("only edits to existing direct pytest modules skip independent jobs", (t) => {+ 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.doesNotMatch(rules, /^\s*!/m);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");@@ -474,7 +477,14 @@ test("the final gate distinguishes a failed check from a skipped dependent job",});const needs = successfulFullRun();for (const selected of [true, false]) {- const outputs = select([selected ? "Dockerfile" : "README.md"]);+ const outputs = select(+ [+ selected+ ? "Dockerfile"+ : "plugins/codex-security/tests/test_workbench.py",+ ],+ { modifiedOnly: true },+ );for (const result of ["success", "failure", "cancelled", "skipped"]) {const verdict = run({...needs,@@ -525,7 +535,6 @@ test("documentation requires static checks and explicit selection, without skipp"action-ci","eval-contracts","workflow-quality",- "container-validate",]) {assert.deepEqual(failedChecks({diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.ymlindex c276131ef..1fbe4828e 100644--- a/.github/workflows/node-ci.yml+++ b/.github/workflows/node-ci.yml@@ -38,7 +38,6 @@ jobs:package-required: ${{ steps.scope.outputs.package-required }}action-ci: ${{ steps.scope.outputs.action-ci }}eval-contracts: ${{ steps.scope.outputs.eval-contracts }}- container-validate: ${{ steps.scope.outputs.container-validate }}workflow-quality: ${{ steps.scope.outputs.workflow-quality }}compatibility-matrix: ${{ steps.scope.outputs.compatibility-matrix }}python-matrix: ${{ steps.scope.outputs.python-matrix }}@@ -139,7 +138,7 @@ jobs:container-validate:needs: [classify-changes, native, static-checks]- if: needs.classify-changes.outputs.container-validate == 'true'+ if: needs.classify-changes.outputs.source-required == 'true'uses: ./.github/workflows/container-validate.ymlpackage:diff --git a/docs/ci.md b/docs/ci.mdindex 138dc095e..c492d9067 100644--- a/docs/ci.md+++ b/docs/ci.md@@ -62,10 +62,10 @@ lockfiles, and runs the triage, secret-discovery, Standard time-budget andworkflow-routing suites.Edits limited to existing top-level `plugins/codex-security/tests/test_*.py`-modules keep all five Python jobs, MCP, host, native, package, compatibility,-and container checks. They skip the SDK shards, Windows install checks, Action-and eval jobs. Adding, removing, or renaming modules, editing shared helpers,-or including any other path selects full qualification.+modules keep all five Python jobs, static and workflow checks, MCP, plugin host,+native builds, packaging, and Unix installs. Docker excludes these modules from+the image. Adding, removing, or renaming modules, editing shared helpers, or+including any other path selects full qualification.Inputs outside these routes select full qualification, including workflow checks,containers, current Node 26, Windows Node 24 installation, and Python 3.10 anddiff --git a/sdk/typescript/tests-ts/container-ci-workflow.test.ts b/sdk/typescript/tests-ts/container-ci-workflow.test.tsindex 7da272612..6b25df0ee 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.container-validate == 'true'",+ if: "needs.classify-changes.outputs.source-required == 'true'",uses: "./.github/workflows/container-validate.yml",});expect(container.jobs["container"]).toMatchObject({diff --git a/sdk/typescript/tests-ts/workflow-quality.test.ts b/sdk/typescript/tests-ts/workflow-quality.test.tsindex 42fc2143a..19d4cafc1 100644--- a/sdk/typescript/tests-ts/workflow-quality.test.ts+++ b/sdk/typescript/tests-ts/workflow-quality.test.ts@@ -259,7 +259,6 @@ test("classification uses the PR merge diff and validates retargeted merge paren.map((line) => line.split("=")),);expect(outputs["source-required"]).toBe("false");- expect(outputs["container-validate"]).toBe("false");expect(outputs["workflow-quality"]).toBe("false");const base = git("rev-parse", "HEAD^1").trim();