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: build the bundled plugin for rotating property tests (#2337)

Michael D'Angelod031235b91df
diff --git a/.github/workflows/test-quality.yml b/.github/workflows/test-quality.yml
index 4a2584b85..ec2a5ef29 100644
--- a/.github/workflows/test-quality.yml
+++ b/.github/workflows/test-quality.yml
@@ -30,8 +30,10 @@ env:
jobs:
native:
- if: inputs.compare-layouts && !inputs.native-artifacts-ready
+ if: ${{ !inputs.native-artifacts-ready }}
uses: ./.github/workflows/native-artifacts.yml
+ with:
+ reuse-verified: ${{ !inputs.compare-layouts }}
runner:
needs: native
@@ -97,9 +99,11 @@ jobs:
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
- - name: Prepare native runtime
+ - &download-native
+ name: Prepare native runtime
uses: ./.github/actions/download-native
- - name: Set up TypeScript tools
+ - &set-up-plugin-tools
+ name: Set up TypeScript tools
uses: ./.github/actions/setup-tools
with:
cache-dependency-path: |
@@ -109,7 +113,8 @@ jobs:
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: "1.3.14"
- - name: Install dependencies
+ - &install-plugin-dependencies
+ name: Install dependencies
shell: bash
run: |
pnpm --dir sdk/typescript install --frozen-lockfile
@@ -120,7 +125,8 @@ jobs:
id: windows-temp
shell: pwsh
run: ./sdk/typescript/scripts/prepare-windows-test-root.ps1
- - name: Build bundled plugin
+ - &build-plugin
+ name: Build bundled plugin
run: pnpm --dir sdk/typescript run build:plugin
- name: Install ripgrep
if: runner.os == 'Linux'
@@ -144,8 +150,9 @@ jobs:
retention-days: 14
properties:
+ needs: native
+ if: ${{ !cancelled() && !inputs.compare-layouts && (inputs.native-artifacts-ready || needs.native.result == 'success') }}
name: ${{ matrix.os }} / rotating properties
- if: ${{ !inputs.compare-layouts }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
env:
@@ -158,13 +165,11 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- *actions-checkout
- - &set-up-sdk-tools
- name: Set up TypeScript tools
- uses: ./.github/actions/setup-tools
+ - *download-native
+ - *set-up-plugin-tools
- *set-up-bun
- - &install-sdk-dependencies
- name: Install dependencies
- run: pnpm --dir sdk/typescript install --frozen-lockfile
+ - *install-plugin-dependencies
+ - *build-plugin
- *prepare-windows-test-root
- name: Test rotating properties
working-directory: sdk/typescript
@@ -172,9 +177,7 @@ jobs:
env: *test-temp
run: |
git grep -lzF 'support/property' -- 'tests-ts/*.test.ts' > "$RUNNER_TEMP/property-tests"
- mkdir -p reports _bundled_plugin/examples
- cp -R ../../plugins/codex-security/examples/completed-scan _bundled_plugin/examples/
- cp -R ../../plugins/codex-security/schemas _bundled_plugin/
+ mkdir -p reports
xargs -0 bun test --timeout="$CODEX_SECURITY_TEST_TIMEOUT_MS" --seed="$CODEX_SECURITY_PROPERTY_SEED" --reporter=junit --reporter-outfile=reports/properties.xml < "$RUNNER_TEMP/property-tests"
- *upload-runner-report
@@ -185,8 +188,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- *actions-checkout
- - *set-up-sdk-tools
- - *install-sdk-dependencies
+ - name: Set up TypeScript tools
+ uses: ./.github/actions/setup-tools
+ - &install-sdk-dependencies
+ name: Install dependencies
+ run: pnpm --dir sdk/typescript install --frozen-lockfile
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
pattern: runner-*
diff --git a/sdk/typescript/TESTING.md b/sdk/typescript/TESTING.md
index c43b1f45f..ed1cd80ca 100644
--- a/sdk/typescript/TESTING.md
+++ b/sdk/typescript/TESTING.md
@@ -199,9 +199,9 @@ do not. Use `python -m pytest -n 0` to reproduce Python failures serially.
Each week `test-quality` runs the mutation trial on Linux. On Linux, macOS, and
Windows it runs the test files that import the shared property options, using
-the workflow run number as the property seed. The filesystem properties read
-the plugin's checked-in schemas and example scan. Each platform uploads its JUnit
-report. To replay the weekly jobs, dispatch with `compare-layouts` disabled.
+the workflow run number as the property seed. The filesystem properties use the
+same bundled plugin as the SDK tests to read the example scan and validate its
+sealed artifacts. Each platform uploads its JUnit report. To replay the weekly jobs, dispatch with `compare-layouts` disabled.
Ordinary source pull requests run focused contracts for the shard runner, timing
metadata, report comparator, and Windows test-root helper in the required SDK suite.