Skip to content

ci: Consolidate and harden CI workflows#811

Merged
jbeckwith-oai merged 23 commits into
mainfrom
codex/fix-ci-workflows
Jul 24, 2026
Merged

ci: Consolidate and harden CI workflows#811
jbeckwith-oai merged 23 commits into
mainfrom
codex/fix-ci-workflows

Conversation

@jbeckwith-oai

@jbeckwith-oai jbeckwith-oai commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop duplicate feature-branch push and pull-request CI runs by limiting push CI to main/next and running PR CI for changes targeting those branches
  • consolidate lint, build, tests, and API compatibility behind the stable CI / required gate
  • move the live API example to a post-merge smoke-test workflow
  • consolidate automatic and manual Sonatype publishing behind one protected reusable workflow while retaining the full compile, GraalVM metadata, signing, and Maven Central publication sequence
  • give the custom CodeQL job the stable Security / CodeQL context
  • harden workflow permissions, concurrency, timeouts, runners, secret handling, and immutable action pins
  • build on test: configure Mockito as Java agent #814's explicit JDK 21 Mockito agent by making its internal configuration non-visible and removing Bedrock's unused Mockito dependencies

Why

The previous workflow layout produced duplicate feature-branch runs for the same commit, emitted skipped checks alongside successful equivalents, split API compatibility into another workflow also named CI, and duplicated the complete Sonatype publication implementation. That made required-check configuration ambiguous and allowed the publication paths to drift.

The publication steps removed from the two callers now live verbatim in .github/workflows/publish-sonatype-reusable.yml; both the release and manual workflows invoke that single implementation with the protected publish environment and the same Sonatype/GPG secrets.

The Sonatype/GPG credentials are environment secrets (not repository secrets). The reusable workflow's Publish / Sonatype job binds environment: publish, so callers intentionally do not use secrets: inherit; the called job receives the protected environment credentials directly.

Validation

  • repository Kotlin and Java lint under JDK 21
  • build and Jackson compatibility suite
  • complete 6,268-test suite, including ProGuard and R8
  • forced 42-task test run with build and configuration caches disabled
  • focused cold JDK 21 verification of the explicit Mockito-agent configuration
  • independent stress verification of the stderr fix: 10/10 focused parallel runs, the complete core/Jackson suites, and the repository-wide offline test
  • positive API compatibility run against origin/main
  • base-test restoration probe and controlled negative compatibility compiler probe
  • required-gate success/failure/skip/cancellation truth table
  • actionlint with ShellCheck, standalone ShellCheck, strict offline zizmor, YAML parsing, unsafe-pattern scan, and git diff --check
  • verified every external action reference resolves to an immutable commit
  • first GitHub-hosted run: all 9 checks passed, including CI / required and Security / CodeQL
  • pre-rebase review follow-ups: API-compat positive/missing-path probes, cold/cache-reuse agent tests, and a complete no-build-cache Bedrock test all passed; each of the final three pre-rebase commits passed all 9 hosted checks
  • rebased onto a3a50ec7 (test: configure Mockito as Java agent #814): repository lint, a cache-disabled Core/Bedrock test run, and real API compatibility passed locally; all 9 hosted checks passed on db881cca

Required-check rollout

The active main ruleset now strictly requires the emitted CI / required status check. CodeQL remains enforced by the existing code-scanning rule rather than by a duplicate status-check context.

The required gate was enabled only after CI / required passed on this PR. Strict branch freshness remains enabled. The code-owner approval, one-review minimum, CodeQL/code-quality enforcement, linear history, deletion protection, force-push protection, allowed merge methods, and existing bypass actor were preserved byte-for-byte.

Copilot AI review requested due to automatic review settings July 23, 2026 22:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates and hardens the repository’s GitHub Actions setup to reduce duplicate CI runs, create a single stable required gate, move live-API examples to a post-merge smoke test, and unify Sonatype publishing via a reusable workflow. It also makes test execution more deterministic and more stable under parallel JDK 21 execution.

Changes:

  • Restructures CI triggers and job layout, adding a single CI / required gate and moving API-compatibility checks into the main CI workflow.
  • Introduces a reusable Sonatype publishing workflow and updates manual/automatic publication workflows to call it.
  • Improves test determinism/stability (Steady seeding; SLF4J/Mockito adjustments for parallel tests).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/mock Adds a fixed Steady generator seed for deterministic mock server behavior.
scripts/detect-breaking-changes Hardens CLI usage and switches API-compat detection to compile prior tests via Gradle testClasses.
openai-java-core/build.gradle.kts Adds Mockito javaagent wiring and SLF4J nop binding for more stable parallel tests.
.github/workflows/publish-sonatype.yml Converts manual Sonatype recovery workflow to call the reusable publish workflow.
.github/workflows/publish-sonatype-reusable.yml Adds a reusable workflow encapsulating the Sonatype publish pipeline.
.github/workflows/examples.yml Adds a post-merge live API “examples smoke test” workflow on main.
.github/workflows/detect-breaking-changes.yml Removes the standalone breaking-changes workflow (folded into CI).
.github/workflows/create-releases.yml Tightens runner/timeout/concurrency and reuses Sonatype publish workflow when releases are created.
.github/workflows/codeql.yml Renames and hardens CodeQL workflow (permissions/concurrency/runner/action pins).
.github/workflows/ci.yml Consolidates lint/build/test/API-compat behind CI / required, and narrows push/PR triggers to main/next.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/publish-sonatype.yml
Comment thread .github/workflows/create-releases.yml
Comment thread .github/workflows/publish-sonatype-reusable.yml
Comment thread openai-java-core/build.gradle.kts Outdated
Copilot AI review requested due to automatic review settings July 23, 2026 22:59
@jbeckwith-oai
jbeckwith-oai force-pushed the codex/fix-ci-workflows branch from bc0ce28 to 0497669 Compare July 23, 2026 22:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (4)

openai-java-core/build.gradle.kts:88

  • Using mockitoAgent.asPath inside string interpolation forces the configuration to resolve during configuration time, which can break configuration cache and slow builds. It also implicitly allows multiple files, but -javaagent: expects a single jar path.
tasks.withType<Test>().configureEach {
    jvmArgs("-javaagent:${mockitoAgent.asPath}")
}

.github/workflows/publish-sonatype-reusable.yml:5

  • This reusable workflow consumes Sonatype/GPG secrets, but workflow_call doesn’t declare any accepted secrets. Reusable workflows only receive secrets that are explicitly passed/declared, so the publish step may run with empty credentials. Declare the required secrets in the reusable workflow interface (and have callers pass them, e.g. via secrets: inherit).
on:
  workflow_call:

.github/workflows/publish-sonatype.yml:13

  • When calling a reusable workflow, secrets are not passed by default. This job needs the Sonatype/GPG secrets used inside publish-sonatype-reusable.yml, so it should pass them (e.g. secrets: inherit) to avoid publishing failures due to missing credentials.
jobs:
  publish:
    uses: ./.github/workflows/publish-sonatype-reusable.yml

.github/workflows/create-releases.yml:43

  • The reusable Sonatype publish workflow relies on secrets, but reusable workflows don’t receive secrets unless the caller passes them. Add secrets: inherit here so the publish job has access to the required Sonatype/GPG credentials.
  publish:
    needs: release
    if: needs.release.outputs.releases_created == 'true'
    uses: ./.github/workflows/publish-sonatype-reusable.yml

Comment thread scripts/detect-breaking-changes
Copilot AI review requested due to automatic review settings July 23, 2026 23:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

openai-java-core/build.gradle.kts:88

  • jvmArgs("-javaagent:${mockitoAgent.singleFile.absolutePath}") resolves the mockitoAgent configuration during Gradle configuration time, which can break/disable the configuration cache (org.gradle.configuration-cache=true) and may cause premature dependency resolution. Prefer wiring this via jvmArgumentProviders (or a doFirst) so the configuration is resolved only at task execution time.
tasks.withType<Test>().configureEach {
    jvmArgs("-javaagent:${mockitoAgent.singleFile.absolutePath}")
}

Comment thread openai-java-core/build.gradle.kts Outdated
Copilot AI review requested due to automatic review settings July 23, 2026 23:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread buildSrc/src/main/kotlin/openai.java.gradle.kts
Copilot AI review requested due to automatic review settings July 24, 2026 00:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 24, 2026 00:57
@jbeckwith-oai
jbeckwith-oai force-pushed the codex/fix-ci-workflows branch from de38a25 to db881cc Compare July 24, 2026 00:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@jbeckwith-oai jbeckwith-oai changed the title Consolidate and harden CI workflows ci: Consolidate and harden CI workflows Jul 24, 2026
@jbeckwith-oai
jbeckwith-oai marked this pull request as ready for review July 24, 2026 01:49
@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner July 24, 2026 01:49
@openai-sdks

openai-sdks Bot commented Jul 24, 2026

Copy link
Copy Markdown

OkTest Summary

237/237 SDK tests passed in 17.813s for Java SDK PR #811.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 220ms
tests/chat-completions-create.test.ts ✅ Passed 582ms
tests/chat-completions-stream.test.ts ✅ Passed 427ms
tests/files-content-binary.test.ts ✅ Passed 293ms
tests/files-create-multipart.test.ts ✅ Passed 472ms
tests/files-list-pagination.test.ts ✅ Passed 307ms
tests/initialize-config.test.ts ✅ Passed 183ms
tests/instance-isolation.test.ts ✅ Passed 443ms
tests/models-list.test.ts ✅ Passed 188ms
tests/responses-background-lifecycle.test.ts ✅ Passed 672ms
tests/responses-body-method-errors.test.ts ✅ Passed 495ms
tests/responses-cancel-timeout.test.ts ✅ Passed 255ms
tests/responses-cancel.test.ts ✅ Passed 478ms
tests/responses-compact-retries.test.ts ✅ Passed 456ms
tests/responses-compact.test.ts ✅ Passed 328ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 534ms
tests/responses-create-advanced.test.ts ✅ Passed 1.517s
tests/responses-create-disconnect.test.ts ✅ Passed 1.098s
tests/responses-create-errors.test.ts ✅ Passed 506ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 338ms
tests/responses-create-retries.test.ts ✅ Passed 347ms
tests/responses-create-stream-failures.test.ts ✅ Passed 234ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 242ms
tests/responses-create-stream-wire.test.ts ✅ Passed 6.761s
tests/responses-create-stream.test.ts ✅ Passed 647ms
tests/responses-create-terminal-states.test.ts ✅ Passed 268ms
tests/responses-create-timeout.test.ts ✅ Passed 235ms
tests/responses-create.test.ts ✅ Passed 355ms
tests/responses-delete.test.ts ✅ Passed 288ms
tests/responses-input-items-errors.test.ts ✅ Passed 324ms
tests/responses-input-items-list.test.ts ✅ Passed 301ms
tests/responses-input-items-options.test.ts ✅ Passed 595ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 233ms
tests/responses-input-tokens-count.test.ts ✅ Passed 395ms
tests/responses-malformed-inputs.test.ts ✅ Passed 5.581s
tests/responses-not-found-errors.test.ts ✅ Passed 331ms
tests/responses-parse.test.ts ✅ Passed 821ms
tests/responses-retrieve-retries.test.ts ✅ Passed 363ms
tests/responses-retrieve.test.ts ✅ Passed 286ms
tests/responses-stored-method-errors.test.ts ✅ Passed 1.03s
tests/retry-behavior.test.ts ✅ Passed 3.558s
tests/sdk-error-shape.test.ts ✅ Passed 481ms

View OkTest run #30122524381

SDK merge (0905061e0a44) · head (0803a6926fca) · base (f99db892a480) · OkTest (91635c6a2723)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db881cca1f

ℹ️ 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".

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/examples.yml Outdated
Comment thread scripts/detect-breaking-changes Outdated
Comment thread scripts/detect-breaking-changes Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 02:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/examples.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05bed58477

ℹ️ 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".

Comment thread scripts/detect-breaking-changes Outdated
Comment thread .github/workflows/ci.yml Outdated
Copilot AI review requested due to automatic review settings July 24, 2026 02:56

@HAYDEN-OAI HAYDEN-OAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed commit 3e998e51ae00690f3246727a7b0f8dec7ef87be0, including the resolved prior threads, all changed files, the passing CI/security analyses, the effective branch rules, and the archived baseline compatibility tests. Two substantive findings remain: the new CI gate is not enforced by the live main ruleset, and the replacement fixtures do not preserve the excluded structured-output API surface. See the inline comments.

Comment thread .github/workflows/ci.yml
Comment thread openai-java-core/src/apiCompatibility/excluded-generated-tests.txt
Copilot AI review requested due to automatic review settings July 24, 2026 20:02
@jbeckwith-oai
jbeckwith-oai force-pushed the codex/fix-ci-workflows branch from 3e998e5 to 0803a69 Compare July 24, 2026 20:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

@HAYDEN-OAI HAYDEN-OAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed 0803a6926fca9d2090919c8ba971f2d63c9adde8, including the full PR, the rebased delta, and all previous discussion threads. Verified that the effective main ruleset strictly requires the actually emitted CI / required check while preserving real CodeQL code-scanning enforcement. Independently audited the structured-output policy against the source: all 638 unique public JVM method signatures across all 15 wrapper, builder, and nested/visitor types are represented, and CI successfully validates both immutable-baseline and proposed manifests and compilation. Build, lint, tests, API compatibility, the required gate, and security CodeQL all pass on this exact head. The previous findings are addressed; no substantive correctness, security, compatibility, or maintainability issues remain. Approved.

@jbeckwith-oai
jbeckwith-oai merged commit e7f446d into main Jul 24, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants