Skip to content

ci: speed up lint checks - #330

Merged
jbeckwith-oai merged 3 commits into
mainfrom
codex/speed-up-ci-checks
Aug 3, 2026
Merged

ci: speed up lint checks#330
jbeckwith-oai merged 3 commits into
mainfrom
codex/speed-up-ci-checks

Conversation

@jbeckwith-oai

@jbeckwith-oai jbeckwith-oai commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • split RuboCop and RBI/RBS typechecking into independent parallel CI jobs
  • replace the nested xargs RuboCop fan-out with one native parallel RuboCop invocation
  • enable the supported ruby/setup-ruby Bundler cache for every Ruby job
  • persist RuboCop's content-aware cache between runs
  • configure eight Steep workers at the GitHub Actions boundary while retaining Steep's upstream default elsewhere
  • remove the redundant scripts/lint pass-through wrapper and use the canonical Rake task
  • keep branch protection on the stable ci / ci-required aggregate check

Why

On PR #326, the lint job took 6m24s end to end. Its explicit bundle install took 31s, and the combined RuboCop/Sorbet/Steep step took 5m45s. The three tools competed for one runner, while the xargs RuboCop batches each enabled RuboCop's own parallel execution.

This change isolates the tools on separate runners, removes nested RuboCop process pools and a redundant shell wrapper, and caches both gems and RuboCop results.

CI results

Measured from GitHub Actions timestamps, comparing PR #326's run with this PR:

Measurement Before This PR, cold cache This PR, warm-cache observations Observed warm improvement
Lint job 6m24s 1m08s 14–19s 95–96%
RuboCop/combined lint step 5m45s 28s 3s 99%
Required CI gate 6m49s 5m58s 3m54s–5m07s 25–43%

Steep is now the remaining critical path. The four-worker run took 4m51s; two eight-worker runs took 4m35s and 3m33s. The range reflects normal hosted-runner variance, so the PR reports the observations rather than attributing all of the difference to worker count.

Validation

  • Ruby 4.0.6
  • bundle exec rake lint:rubocop
  • bundle exec rake typecheck:sorbet
  • CI=1 STEEP_JOBS=8 bundle exec rake typecheck:steep
  • ./scripts/test — 468 runs, 1,514 assertions
  • bundle exec rake build:gem
  • actionlint .github/workflows/ci-checks.yml
  • shellcheck scripts/detect-breaking-changes
  • exact old/new RuboCop target-list comparison — 2,587 files
  • thermo-nuclear maintainability review
  • three complete GitHub Actions runs; all required checks green

Local RuboCop benchmark

Same checkout, Ruby 3.3.12, RuboCop 1.81.7, 16 CPUs, separate empty/restored cache directories:

RuboCop orchestration Empty cache Restored cache
Existing xargs batches 9.62s 5.19s
Native RuboCop runner 6.90s 1.44s
Improvement 28% 72%

Copilot AI review requested due to automatic review settings August 3, 2026 18:22

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 Ruby CI “lint” portion by parallelizing previously-serialized checks, removing nested RuboCop parallelism in the Rake task, and enabling caching (Bundler + RuboCop) to reduce repeat work across runs.

Changes:

  • Split RuboCop vs. typechecking (Sorbet/Steep) into separate parallel GitHub Actions jobs while keeping the stable ci-required aggregate check.
  • Replace the prior find | xargs rubocop ... fan-out with a native RuboCop::RakeTask using RuboCop’s own --parallel.
  • Enable ruby/setup-ruby’s supported bundler-cache across Ruby jobs and persist RuboCop cache between runs.

Reviewed changes

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

File Description
Rakefile Switches RuboCop linting to RuboCop::RakeTask with --parallel; sizes Steep workers to available CPUs and emits GitHub-formatted output in CI.
.github/workflows/ci-checks.yml Splits lint/typecheck into parallel jobs; enables Bundler caching everywhere; adds a persisted RuboCop cache; updates the required aggregate job dependencies accordingly.

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

Copilot AI review requested due to automatic review settings August 3, 2026 18:31

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)

Rakefile:139

  • The PR description says Steep workers are sized to the runner’s available CPUs, but this task hard-codes --jobs=8. On smaller runners this can oversubscribe CPU and slow down typechecking; on larger runners it underutilizes available cores. Consider deriving the job count from Etc.nprocessors (already required at the top of the Rakefile).
  steep = %w[steep check]
  # Steep defaults to two workers in CI; eight is the tested balance for this project's runner.
  steep += %w[--jobs=8 --format=github] if ENV.key?("CI")
  sh(*steep)

@jbeckwith-oai
jbeckwith-oai marked this pull request as ready for review August 3, 2026 18:38
@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner August 3, 2026 18:38
@openai-sdks

openai-sdks Bot commented Aug 3, 2026

Copy link
Copy Markdown

OkTest Summary

237/237 SDK tests passed in 7.881s for Ruby SDK PR #330.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 144ms
tests/chat-completions-create.test.ts ✅ Passed 258ms
tests/chat-completions-stream.test.ts ✅ Passed 108ms
tests/files-content-binary.test.ts ✅ Passed 263ms
tests/files-create-multipart.test.ts ✅ Passed 167ms
tests/files-list-pagination.test.ts ✅ Passed 163ms
tests/initialize-config.test.ts ✅ Passed 162ms
tests/instance-isolation.test.ts ✅ Passed 232ms
tests/models-list.test.ts ✅ Passed 173ms
tests/responses-background-lifecycle.test.ts ✅ Passed 205ms
tests/responses-body-method-errors.test.ts ✅ Passed 359ms
tests/responses-cancel-timeout.test.ts ✅ Passed 191ms
tests/responses-cancel.test.ts ✅ Passed 229ms
tests/responses-compact-retries.test.ts ✅ Passed 253ms
tests/responses-compact.test.ts ✅ Passed 183ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 158ms
tests/responses-create-advanced.test.ts ✅ Passed 188ms
tests/responses-create-disconnect.test.ts ✅ Passed 139ms
tests/responses-create-errors.test.ts ✅ Passed 211ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 122ms
tests/responses-create-retries.test.ts ✅ Passed 252ms
tests/responses-create-stream-failures.test.ts ✅ Passed 122ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 222ms
tests/responses-create-stream-wire.test.ts ✅ Passed 1.805s
tests/responses-create-stream.test.ts ✅ Passed 75ms
tests/responses-create-terminal-states.test.ts ✅ Passed 213ms
tests/responses-create-timeout.test.ts ✅ Passed 185ms
tests/responses-create.test.ts ✅ Passed 254ms
tests/responses-delete.test.ts ✅ Passed 261ms
tests/responses-input-items-errors.test.ts ✅ Passed 160ms
tests/responses-input-items-list.test.ts ✅ Passed 178ms
tests/responses-input-items-options.test.ts ✅ Passed 219ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 254ms
tests/responses-input-tokens-count.test.ts ✅ Passed 201ms
tests/responses-malformed-inputs.test.ts ✅ Passed 1.918s
tests/responses-not-found-errors.test.ts ✅ Passed 371ms
tests/responses-parse.test.ts ✅ Passed 192ms
tests/responses-retrieve-retries.test.ts ✅ Passed 230ms
tests/responses-retrieve.test.ts ✅ Passed 200ms
tests/responses-stored-method-errors.test.ts ✅ Passed 650ms
tests/retry-behavior.test.ts ✅ Passed 1.88s
tests/sdk-error-shape.test.ts ✅ Passed 314ms

View OkTest run #30843070103

SDK merge (602dd882d3f9) · head (fb11844191a9) · base (d46c2e336f3c) · 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.

Reviewed commit 7469348. The RuboCop target set is unchanged (2,587 files), Sorbet and Steep remain independently covered by the required CI gate, and Bundler/RuboCop cache invalidation, least-privilege permissions, pinned actions, fork behavior, and cold/warm execution all look sound.

Copilot AI review requested due to automatic review settings August 3, 2026 18:50

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 4 out of 4 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 the full PR and subsequent changes at fb11844. RuboCop still covers the same 2,587 files; all removed lint-wrapper callers were updated; Sorbet and Steep remain independently required; and the configurable eight-worker Steep command, cache invalidation, pinned actions, least-privilege/fork behavior, and exact-head CI results all check out.

@jbeckwith-oai
jbeckwith-oai merged commit 4ef6e6c into main Aug 3, 2026
15 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the codex/speed-up-ci-checks branch August 3, 2026 19:06
@jbeckwith-oai jbeckwith-oai added the generator Touches generated SDK files label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

generator Touches generated SDK files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants