Skip to content

ci: run CodeQL only on main - #832

Merged
jbeckwith-oai merged 6 commits into
mainfrom
codex/codeql-main-only
Aug 3, 2026
Merged

ci: run CodeQL only on main#832
jbeckwith-oai merged 6 commits into
mainfrom
codex/codeql-main-only

Conversation

@jbeckwith-oai

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

Copy link
Copy Markdown
Contributor

Summary

  • remove the security-query CodeQL workflow from pull requests while keeping push-to-main and manual scans
  • cancel superseded CodeQL scans for the same ref
  • leave release creation and Maven publication unchanged; CodeQL remains informational

Impact

The generated PR-time code-quality scan remains in place, while the repository's roughly 15–18 minute security-query scan moves off the pull-request critical path. Releases continue to trigger directly from pushes to main and do not wait for CodeQL results.

Validation

  • actionlint v1.7.7 on both workflow files
  • Ruby YAML parsing on both workflow files
  • git diff --check
  • thermo-nuclear code-quality review completed with no findings

Copilot AI review requested due to automatic review settings July 31, 2026 21:56

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 adjusts the repository’s CodeQL GitHub Actions workflow so security analysis runs only after changes are merged to the default branch, reducing CI usage on pull requests.

Changes:

  • Removed pull_request and workflow_dispatch triggers from the CodeQL workflow.
  • Removed the PR-specific concurrency configuration.

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

Comment thread .github/workflows/codeql.yml
@jbeckwith-oai
jbeckwith-oai marked this pull request as ready for review July 31, 2026 22:02
@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner July 31, 2026 22:02
@openai-sdks

openai-sdks Bot commented Jul 31, 2026

Copy link
Copy Markdown

OkTest Summary

237/237 SDK tests passed in 16.17s for Java SDK PR #832.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 526ms
tests/chat-completions-create.test.ts ✅ Passed 629ms
tests/chat-completions-stream.test.ts ✅ Passed 455ms
tests/files-content-binary.test.ts ✅ Passed 288ms
tests/files-create-multipart.test.ts ✅ Passed 349ms
tests/files-list-pagination.test.ts ✅ Passed 285ms
tests/initialize-config.test.ts ✅ Passed 172ms
tests/instance-isolation.test.ts ✅ Passed 181ms
tests/models-list.test.ts ✅ Passed 169ms
tests/responses-background-lifecycle.test.ts ✅ Passed 359ms
tests/responses-body-method-errors.test.ts ✅ Passed 459ms
tests/responses-cancel-timeout.test.ts ✅ Passed 258ms
tests/responses-cancel.test.ts ✅ Passed 268ms
tests/responses-compact-retries.test.ts ✅ Passed 259ms
tests/responses-compact.test.ts ✅ Passed 301ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 234ms
tests/responses-create-advanced.test.ts ✅ Passed 1.247s
tests/responses-create-disconnect.test.ts ✅ Passed 1.034s
tests/responses-create-errors.test.ts ✅ Passed 354ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 330ms
tests/responses-create-retries.test.ts ✅ Passed 246ms
tests/responses-create-stream-failures.test.ts ✅ Passed 201ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 254ms
tests/responses-create-stream-wire.test.ts ✅ Passed 6.04s
tests/responses-create-stream.test.ts ✅ Passed 160ms
tests/responses-create-terminal-states.test.ts ✅ Passed 369ms
tests/responses-create-timeout.test.ts ✅ Passed 257ms
tests/responses-create.test.ts ✅ Passed 265ms
tests/responses-delete.test.ts ✅ Passed 268ms
tests/responses-input-items-errors.test.ts ✅ Passed 318ms
tests/responses-input-items-list.test.ts ✅ Passed 355ms
tests/responses-input-items-options.test.ts ✅ Passed 217ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 242ms
tests/responses-input-tokens-count.test.ts ✅ Passed 692ms
tests/responses-malformed-inputs.test.ts ✅ Passed 4.661s
tests/responses-not-found-errors.test.ts ✅ Passed 376ms
tests/responses-parse.test.ts ✅ Passed 727ms
tests/responses-retrieve-retries.test.ts ✅ Passed 891ms
tests/responses-retrieve.test.ts ✅ Passed 247ms
tests/responses-stored-method-errors.test.ts ✅ Passed 1.035s
tests/retry-behavior.test.ts ✅ Passed 3.618s
tests/sdk-error-shape.test.ts ✅ Passed 468ms

View OkTest run #30829553422

SDK merge (875ccc169258) · head (9f69c3cb2813) · base (52e3c64215b6) · OkTest (91635c6a2723)

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

One substantive security issue: making the security CodeQL workflow main-only allows release creation and Maven publication to begin before the released commit has completed its first security scan. Details and a concrete observed release/scan timeline are in the inline comment.

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

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

Suppressed comments (2)

.github/workflows/codeql.yml:7

  • Removing concurrency means multiple pushes to main can run CodeQL in parallel, consuming extra CI minutes and generating redundant workflow_run completions (even if downstream release creation later skips stale SHAs). Since this workflow now only runs on push to main, consider adding a simple concurrency group (e.g., by ref) with cancel-in-progress: true so only the latest main analysis runs.
on:
  push:
    branches:
      - main

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

  • With --limit 1, this step will fail immediately if the CodeQL run for SOURCE_SHA is still queued/in_progress or not yet indexed (common right after a push). That can make the scheduled/manual paths flaky even though CodeQL will eventually succeed. Consider polling gh run list until the run is completed/success (with a reasonable timeout) or skipping the schedule path and relying on the workflow_run trigger as the authoritative gate.
          run_json="$(
            gh run list \
              --repo "$GITHUB_REPOSITORY" \
              --workflow codeql.yml \
              --commit "$SOURCE_SHA" \

Copilot AI review requested due to automatic review settings July 31, 2026 23:06
@jbeckwith-oai
jbeckwith-oai force-pushed the codex/codeql-main-only branch from c09243a to 45d93a0 Compare July 31, 2026 23:06

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

Suppressed comments (1)

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

  • workflow_run triggers for completed runs of the CodeQL workflow regardless of how that CodeQL run was started (push, workflow_dispatch, re-run, etc.). The current job-level if only checks conclusion == 'success', so a manually-dispatched CodeQL run on main can unintentionally trigger the automatic release selection path. If releases should only be triggered by the push-to-main CodeQL analysis, also gate on github.event.workflow_run.event == 'push'.
    if: >-
      github.repository == 'openai/openai-java' &&
      ((github.event_name == 'workflow_run' &&
      github.event.workflow_run.conclusion == 'success') ||
      (github.event_name != 'workflow_run' && github.ref == 'refs/heads/main'))

@jbeckwith-oai

Copy link
Copy Markdown
Contributor Author

Follow-up from the latest automated review: a successful manually dispatched CodeQL run on main could also satisfy the workflow_run trigger and start automatic release selection. Fixed in a6cf6f8 by requiring workflow_run.event == push. On-demand scans remain available, but only push-originated scans can initiate automatic releases. Actionlint, YAML parsing, diff checks, and thermo-nuclear review pass.

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

Suppressed comments (3)

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

  • This CodeQL verification only inspects the most recent run for the commit (--limit 1). If there are multiple push-triggered CodeQL runs for the same commit (e.g., reruns), a newer non-successful run can cause releases to be blocked even when an earlier successful analysis exists. It’s safer to look for any completed+successful run for the SHA.
              --workflow codeql.yml \
              --commit "$SOURCE_SHA" \
              --event push \
              --limit 1 \
              --json conclusion,headSha,status,url

.github/workflows/codeql.yml:11

  • concurrency.group is now identical for push and workflow_dispatch runs on the same branch (github.ref). A manually dispatched CodeQL scan on main can therefore cancel an in-progress push scan for main, and the Create releases workflow intentionally ignores workflow_dispatch CodeQL completions (it only reacts to workflow_run.event == 'push'). This can unintentionally block automatic release selection until the next successful push scan completes.
concurrency:
  group: codeql-${{ github.ref }}
  cancel-in-progress: true

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

  • Ensure automatic source is still current runs after the CodeQL lookup. On scheduled runs, if main advances after the workflow starts, the CodeQL lookup may fail (or find only canceled/incomplete runs) for the now-stale github.sha and abort the job before it can gracefully skip as stale. Consider moving the staleness check before the CodeQL verification, or making the CodeQL verification conditional on the source still matching current main.

This issue also appears on line 140 of the same file.

      - name: Verify successful CodeQL analysis
        if: github.event_name != 'workflow_run'
        env:
          GH_TOKEN: ${{ github.token }}
          SOURCE_SHA: ${{ steps.retry.outputs.source_sha || github.sha }}

Copilot AI review requested due to automatic review settings July 31, 2026 23:39
@jbeckwith-oai

Copy link
Copy Markdown
Contributor Author

Addressed the three latest orchestration findings in 5479eb1: push and manual CodeQL runs now use separate concurrency groups; automatic source staleness is checked before scheduled CodeQL verification; and scheduled/retry verification accepts any completed successful push analysis for the exact source SHA rather than only the newest run. Actionlint, YAML parsing, diff checks, jq success-selection coverage, and thermo-nuclear review all pass.

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

Fresh follow-up at exact head 5479eb1. The push-event provenance guard and manual/push scan separation are fixed, but one P1 security gap and one P2 release-concurrency failure remain; details are inline.

Comment thread .github/workflows/create-releases.yml Outdated
Comment thread .github/workflows/create-releases.yml Outdated

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

Suppressed comments (1)

.github/workflows/codeql.yml:11

  • The CodeQL concurrency.group includes github.event_name, so a manual workflow_dispatch run on the same ref will not cancel (or be canceled by) an in-flight push run for that ref. This contradicts the PR goal of canceling superseded CodeQL scans for the same ref and can lead to duplicate long-running analyses on main.
concurrency:
  group: codeql-${{ github.event_name }}-${{ github.ref }}
  cancel-in-progress: true

Copilot AI review requested due to automatic review settings August 3, 2026 15:52
@jbeckwith-oai
jbeckwith-oai force-pushed the codex/codeql-main-only branch from 5479eb1 to 9f69c3c Compare August 3, 2026 15:52

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.

@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: 9f69c3cb28

ℹ️ 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/codeql.yml

@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 exact head 9f69c3c and every prior review thread. The final diff only removes the repository CodeQL pull-request trigger and keeps ref-scoped cancellation; main-push and manual scans remain available. create-releases.yml is byte-for-byte identical to main, the managed PR code-quality scan remains active, and the previous exact-SHA and release-concurrency findings no longer apply after the explicitly confirmed decision that CodeQL is informational and must not gate releases. No substantive correctness, security, release-orchestration, or concurrency issues found.

@jbeckwith-oai
jbeckwith-oai merged commit c4a8d6c into main Aug 3, 2026
12 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