Skip to content

ci: reduce CodeQL build time - #829

Merged
jbeckwith-oai merged 2 commits into
mainfrom
codex/optimize-codeql-ci
Jul 31, 2026
Merged

jbeckwith-oai merged 2 commits into
mainfrom
codex/optimize-codeql-ci

Conversation

@jbeckwith-oai

@jbeckwith-oai jbeckwith-oai commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • compile only production classes during CodeQL's manual build
  • cancel superseded CodeQL runs for the same pull request

Why

Recent CodeQL runs average 23m52s, with the manual build accounting for 19m45s. The full scripts/build path compiles test sources, runs build-logic tests and policy checks, and creates artifacts that CodeQL does not need to analyze production Java and Kotlin.

The workflow also allowed stale runs from earlier commits on the same pull request to continue consuming runner time.

Impact

classes still compiles every production source set across all eight included Gradle projects while preserving --no-build-cache, which CodeQL requires to observe compilation. Test and packaging coverage remains in the normal CI workflow.

The PR's first cold CodeQL run reduced the production build step from the 19m45s historical average to 11m25s (8m20s / 42% faster). The full job fell from 23m52s to 14m55s (8m57s / 38% faster).

Validation

  • ./scripts/gradle classes --dry-run --no-build-cache with JDK 21
  • GRADLE_OPTS=-Dkotlin.compiler.execution.strategy=in-process ./scripts/gradle classes --no-build-cache with JDK 21
  • YAML parse of .github/workflows/codeql.yml
  • thermo-nuclear code quality review
  • all pull-request checks, including both CodeQL analyses

Copilot AI review requested due to automatic review settings July 31, 2026 20:18

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 optimizes the CodeQL GitHub Actions workflow by reducing unnecessary build work during CodeQL’s manual build phase and preventing wasted runner time on superseded runs for the same PR.

Changes:

  • Add workflow-level concurrency to cancel in-progress CodeQL runs superseded by newer commits on the same pull request.
  • Replace the CodeQL manual build step from ./scripts/build to ./scripts/gradle classes to compile only production classes.

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

@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.

Approved. The production-only Gradle build retains all eight project source sets and --no-build-cache; the required CI check uses a separate concurrency group. One low-priority non-PR pending-run edge case is noted inline.

Comment thread .github/workflows/codeql.yml Outdated
Copilot AI review requested due to automatic review settings July 31, 2026 20:43

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 1 out of 1 changed files in this pull request and generated no new comments.

@jbeckwith-oai
jbeckwith-oai marked this pull request as ready for review July 31, 2026 20:47
@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner July 31, 2026 20:47
@jbeckwith-oai
jbeckwith-oai enabled auto-merge (squash) July 31, 2026 20:47
@openai-sdks

openai-sdks Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

OkTest Summary

✅ 237/237 SDK tests passed in 16.982s for Java SDK PR #829.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 921ms
tests/chat-completions-create.test.ts ✅ Passed 372ms
tests/chat-completions-stream.test.ts ✅ Passed 328ms
tests/files-content-binary.test.ts ✅ Passed 261ms
tests/files-create-multipart.test.ts ✅ Passed 314ms
tests/files-list-pagination.test.ts ✅ Passed 311ms
tests/initialize-config.test.ts ✅ Passed 250ms
tests/instance-isolation.test.ts ✅ Passed 175ms
tests/models-list.test.ts ✅ Passed 174ms
tests/responses-background-lifecycle.test.ts ✅ Passed 372ms
tests/responses-body-method-errors.test.ts ✅ Passed 531ms
tests/responses-cancel-timeout.test.ts ✅ Passed 254ms
tests/responses-cancel.test.ts ✅ Passed 383ms
tests/responses-compact-retries.test.ts ✅ Passed 409ms
tests/responses-compact.test.ts ✅ Passed 253ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 415ms
tests/responses-create-advanced.test.ts ✅ Passed 1.375s
tests/responses-create-disconnect.test.ts ✅ Passed 1.166s
tests/responses-create-errors.test.ts ✅ Passed 379ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 324ms
tests/responses-create-retries.test.ts ✅ Passed 709ms
tests/responses-create-stream-failures.test.ts ✅ Passed 233ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 254ms
tests/responses-create-stream-wire.test.ts ✅ Passed 6.338s
tests/responses-create-stream.test.ts ✅ Passed 486ms
tests/responses-create-terminal-states.test.ts ✅ Passed 460ms
tests/responses-create-timeout.test.ts ✅ Passed 277ms
tests/responses-create.test.ts ✅ Passed 225ms
tests/responses-delete.test.ts ✅ Passed 246ms
tests/responses-input-items-errors.test.ts ✅ Passed 302ms
tests/responses-input-items-list.test.ts ✅ Passed 304ms
tests/responses-input-items-options.test.ts ✅ Passed 616ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 286ms
tests/responses-input-tokens-count.test.ts ✅ Passed 385ms
tests/responses-malformed-inputs.test.ts ✅ Passed 5.202s
tests/responses-not-found-errors.test.ts ✅ Passed 508ms
tests/responses-parse.test.ts ✅ Passed 623ms
tests/responses-retrieve-retries.test.ts ✅ Passed 323ms
tests/responses-retrieve.test.ts ✅ Passed 325ms
tests/responses-stored-method-errors.test.ts ✅ Passed 978ms
tests/retry-behavior.test.ts ✅ Passed 3.422s
tests/sdk-error-shape.test.ts ✅ Passed 464ms

View OkTest run #30664224988

SDK merge (66284e4a4b7a) · head (1a1d18bb9065) · base (b6c33f5b35fa) · OkTest (91635c6a2723)

@jbeckwith-oai
jbeckwith-oai merged commit bb08dd9 into main Jul 31, 2026
14 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