Repository navigation
test(ci): cover release gate and document CI policy - #2589
Conversation
Castiron custom code✅ No new custom-code files detected. 45 mixed files remain; 0 existing customizations changed. Compared 45 existing customizations unchanged
5 more in the full report. A changed generated baseline means this report cannot reliably identify which handwritten lines changed. Inspect the custom-code diffDownload the exact patch produced by this run (requires repository access): gh run download 35128161193 --repo openai/openai-node \
--name castiron-custom-code-35128161193-1 --dir /tmp/castiron-custom-code-35128161193-1
git apply --stat /tmp/castiron-custom-code-35128161193-1/custom-code.patch
cat /tmp/castiron-custom-code-35128161193-1/custom-code.patchOr reproduce it from an SDK checkout containing the vendored reporter: git fetch --no-tags origin 58fa72a5a241521412775e691e6a1331f89ee245 bd6b499014eea7f6c2c128a99c6720f10290df25
python3 scripts/castiron/custom_code_report.py report \
--base 58fa72a5a241521412775e691e6a1331f89ee245 \
--head bd6b499014eea7f6c2c128a99c6720f10290df25 --fetch --require-head-hash --public \
--out /tmp/castiron-custom-code-bd6b499014ee
cat /tmp/castiron-custom-code-bd6b499014ee/custom-code.patchThis is the current full custom patch for mixed files, not an attribution of only the handwritten lines changed by this PR. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd5187c7cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Blocking: the new release-gate test fixture shells out to jq, but jq is not a documented prerequisite or repository-managed dependency. On supported developer setups without jq, the canonical test fails with ENOENT before exercising the gate. Please make the fixture evaluation self-contained in Node; the existing unresolved review thread identifies the same issue.
85b3823 to
493e3fd
Compare
493e3fd to
bc8e214
Compare
- [x] I understand that this repository is auto-generated and my pull request may not be merged ## Changes being requested Reduce repeated setup work in handwritten tests that intermittently exceed the Node 22 CI deadlines: - Run the real `pnpm lint` → `pnpm format` → `pnpm lint` integration in a small temporary project containing the repository's actual aliases, scripts, and configs. Give the fixture its own offline pnpm state and link the installed tools. This avoids whole-repository scans and writes into other tests' temporary fixtures while preserving generated-import assertions and checking handwritten formatting. - Select ts-node's existing SWC backend in the eight executable-example subprocess suites. Each child still runs the actual example against SDK source and synthetic local services, but avoids repeatedly compiling the SDK import graph with TypeScript. SWC is already a repository dependency. - Disable npm's update notifier in the existing offline ecosystem fixtures. Main already contains their project-local offline configuration; preserve that configuration and its current smoke and credential coverage. The existing 15-second child deadlines, 30-second test deadline, assertions, and worker modes remain. No production code, dependencies, lockfile, workflow policy, or generated files change. Main's newer LF and audio-input regression tests are preserved. ## Validation - The equivalent test changes passed the full Node 22/24/26 suites: 7,329 handwritten tests and 556 generated tests per runtime, retaining the existing two generated skips; all 14 ecosystem projects and packaging/runtime-floor checks passed. Previously timing-out Node 22 WebSocket/audio cases completed in approximately two seconds under the same 15-second deadline. - Independent review verified the public port preserves newer main-branch coverage and carries the same fixture and subprocess behavior. `git diff --check` passes. - A fresh local frozen installation on the latest public base is blocked because the configured registry omits publication metadata for `[email protected]`, also reported in [PR 2589](openai#2589). A fresh metadata cache gives the same missing-version result. The lockfile and dependency policies remain unchanged; this PR's CI will validate the current base.
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
The fixture is much stronger now that it no longer depends on a host jq: the sentinel binary guarantees the gate only uses the controlled gh response path. Executing the workflow-owned Bash against success, failure, cancellation, missing-run and mismatched-SHA cases makes the release-SHA publication dependency executable rather than merely documented. The earlier portability blocker looks addressed.
## Problem On a supported Windows contributor checkout without a host `jq` binary, the existing historical release-publisher cases in `tests/release-publish-workflow.test.ts` fail before they exercise the captured publisher: ```text ./bin/check-npm-version: line 7: jq: command not found Test Files 1 failed (1) Tests 3 failed | 1 passed (4) ``` `jq` is not a documented repository setup prerequisite. The test already supplies controlled `npm` and `pnpm` executables, but still depends on the host for JSON evaluation. ## Root cause The fixture executes the real `bin/publish-npm` and `bin/check-npm-version` scripts. Those scripts invoke four small `jq` expressions, while the fixture does not provide `jq` when it is absent from the contributor environment. ## Fix Provide a fixture-local Node executable when `jq --version` is unavailable. It implements only the exact controlled expressions used by the captured publisher and fails on any unexpected expression. Environments with a real `jq` continue using it. ## Tests Windows 11, Node 24.19.0, pnpm 11.5.1: - Baseline `./scripts/test tests/release-publish-workflow.test.ts`: 3 failed / 1 passed (`jq: command not found`). - Fixed `./scripts/test tests/release-publish-workflow.test.ts`: 4 passed. - `pnpm install --frozen-lockfile`: passed, including supply-chain policy verification. - `pnpm lint`: passed. - `pnpm exec tsc --noEmit`: passed. - `pnpm build`: passed, including CJS/ESM and Bedrock import checks. - `git diff --check`: passed. A broader pre-fix `pnpm test:unit` run completed with 7,490 passed and 80 failed. Three failures were the cases fixed here; the remaining failures are in unrelated Windows-sensitive Cloudflare credential, child-process, X.509 timing, and mock-cleanup suites. This PR does not weaken or skip those tests, and does not claim the full Windows unit suite passes. ## Compatibility / Risk Test-only change; no SDK runtime, declarations, generated code, workflow, dependency, lockfile, or release behavior changes. The fallback is used only when host `jq` is unavailable, accepts synthetic fixture data only, and rejects unsupported expressions. Duplicate search found no equivalent open PR. openai#2589 also edits this test file for separate release-CI gate coverage, but does not make the existing historical publisher fixture independent of a host `jq` installation.
markstuart-oai
left a comment
There was a problem hiding this comment.
Reviewed both changed files and the underlying CI/release workflows. The coverage table matches the event conditions and publication dependencies. The tests reuse the workflow-owned Bash, isolate GitHub responses and credentials, and resolve the earlier undeclared jq dependency without adding a general-purpose parser. No substantive issues found.
Validation: all 11 release-publication tests passed on Node 24.19.0. Independent mutation checks caught removal of the publication dependency, release-SHA filter, and --exit-status flag. Pinned formatting/lint checks and git diff --check passed. No live release or publication was executed.
## Summary Serialize only the `release` job that updates the shared release-please branch. Nearby main pushes currently run this job concurrently. The observed failure is on actual main automation: [run 33946334884](https://github.com/openai/openai-node/actions/runs/33946334884) failed updating the release branch to `168584ab68eeed5d7710f3fe4652d3745e175430`, while [an overlapping run](https://github.com/openai/openai-node/actions/runs/33946334127) successfully applied that exact commit 89 milliseconds earlier. A successful sibling subsequently updated the existing release PR with the same intended contents; no recovery or publication action is needed for the historical failure. Add a stable, per-ref concurrency group to `jobs.release`, with `cancel-in-progress: false` and `queue: max`. This prevents these jobs from writing the release branch concurrently without cancelling an active update. Unlike the default single pending slot, `queue: max` retains up to 100 pending jobs. See [GitHub's concurrency rules](https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency). PR version validation, downstream release CI/build checks, and the existing per-release-SHA npm publication lock remain independent. Token creation stays inside the scheduled release job. No triggers, permissions, action pins, release content, or publication safeguards change. ## Verification **CI update at `71f3c0c`:** all 38 repository checks are terminal (22 successful, 16 skipped), with no failures. [Full CI](https://github.com/openai/openai-node/actions/runs/33946893551) passes 7,635 unit tests and 556 generated tests on each Node 22/24/26 run, including the new concurrency regressions. Packed-package checks, the exact Node 22.0.0 consumer, pinned formatting/linting, and both 14-project ecosystem runs pass. [External OkTest](https://github.com/openai/ok-test/actions/runs/33946903576) passes all 237 tests across 42 suites and completes all three jobs against the exact base/head merge. The [normal Create releases PR run](https://github.com/openai/openai-node/actions/runs/33946902724) accepts this exact changed workflow and skips all seven jobs as intended, without executing release steps. An automated unsupported-key finding is [answered with GitHub's May 7, 2026 announcement, immutable job-level schema, and native-run evidence](openai#2631 (comment)); it does not require removing the supported `queue` key. Both automated reviews completed, and a maintainer approved this exact head. - The new regression fails on unchanged main because the release job has no concurrency policy; it passes with this change. - Canonical `./scripts/test tests/release-concurrency-workflow.test.ts tests/release-publish-workflow.test.ts tests/node-matrix-workflow.test.ts`: all 9 tests pass on Node 24.19.0. Local execution used the existing Vitest 4.1.10 installation; repository CI pins 4.1.11. - Mutation checks fail as expected for a single pending slot, active-job cancellation, a per-run group, and workflow-wide locking. The exact final workflow was restored and the passing suite repeated afterward. - Parsing the complete workflow as YAML and removing only `jobs.release.concurrency` produces the same object as main: all other workflow configuration is unchanged. - TypeScript 6.0.3 no-emit checking, pinned Oxfmt 0.62.0 on both files, pinned Oxlint 1.79.0 on the test, and `git diff --check` pass. - Repeated adversarial review covered cancellation, queue scope, token lifetime, dependency cycles, PR validation, publication isolation, and the final regression tests. No further changes were required. These are configuration/artifact checks, not a simulation or manual rerun of GitHub's scheduler. No releases, live API calls, or workflow reruns were initiated for verification. ## Scope and limits The production change is four YAML lines, plus one small regression file. Both files are wholly handwritten and absent from the verified pure-generated snapshot. No SDK code, dependencies, lockfiles, generation metadata, or custom-code policy changes. This lock covers this job's future runs, not other branch writers or already-running workflows using the old definition. GitHub's queue is bounded at 100 pending jobs and does not guarantee push-SHA order. The existing `target-branch: main` behavior is unchanged. Existing PR openai#2589 covers publication CI-gate tests and documentation, not release-please serialization; this change uses a separate test file and does not overlap its files.
|
@jbeckwith-oai The fixture now evaluates both queries directly in Node, with a failing |
jbeckwith-oai
left a comment
There was a problem hiding this comment.
Re-reviewed the exact current head. The prior blocker is resolved: the synthetic gh fixture evaluates the two fixed --jq expressions in Node and puts a failing jq sentinel first on PATH, so the focused test cannot silently depend on a host jq. I also checked the release-gate scenarios, immutable-SHA selection/watch behavior, publication dependency assertions, and CI-policy table against the current workflows. Locally, the frozen install, git diff --check, all 11 focused release-workflow tests on Node 24, lint, and TypeScript checking passed. The prior thread is resolved and exact-head CI, CodeQL, and Castiron are green. No blocking findings.
The release-SHA CI gate added in #2543 has no focused regression coverage, and maintainers lack a single table showing which checks run before merge and block npm publication.
Document the PR, merge-queue, main, release-PR, and publication coverage, including skipped live checks and advisory checks. Extend the existing release workflow tests to execute the actual gate Bash against synthetic GitHub responses, covering successful, failed, cancelled, missing, mismatched-SHA, and API-error results. The tests also protect the publication dependency and ensure selection excludes other commits, events, and branches.
Validation on Node 24:
./scripts/test tests/release-publish-workflow.test.ts— 11 passed../scripts/test tests/ecosystem-cli.test.ts tests/node-matrix-workflow.test.ts— 26 passed../scripts/lintandnode node_modules/typescript/bin/tsc --noEmit— passed.--exit-status; the workflow was restored afterward.A fresh frozen installation was blocked by missing publication-time metadata for
[email protected]in the configured registry. Checks used an existing installation with matching test/lint tooling and relevant type dependency graphs. No dependency policy or lockfile changes were made, and no live examples or publication were executed.Closes #2509.