Skip to content

fix(ci): Max concurrent typegen#2177

Merged
evanhutnik merged 3 commits intomainfrom
evan/max-concurrent-typegen
Mar 25, 2026
Merged

fix(ci): Max concurrent typegen#2177
evanhutnik merged 3 commits intomainfrom
evan/max-concurrent-typegen

Conversation

@evanhutnik
Copy link
Copy Markdown
Contributor

@evanhutnik evanhutnik commented Mar 25, 2026

Building too many services at once was causing CI to get stuck (I think). Going to try this to see if it fixes

@evanhutnik evanhutnik requested a review from a team as a code owner March 25, 2026 17:56
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

Walkthrough

The buildOpenApiBinaries function in js/app/scripts/generate-api-schema.ts was restructured to implement batching behavior. A MAX_CONCURRENCY constant set to 6 was added. The function now accepts an options object containing checkMode. When check mode is enabled, crates are processed in sequential batches of up to six crates, each running a separate cargo build command. The conditional logic for including the document_cognition_service_models binary was moved from a single global check to per-batch evaluation. Logging was updated to report progress per batch during batching operations. The main() function was modified to pass the checkMode option when calling buildOpenApiBinaries.

Poem

🐰 Six crates hop along in a batching parade,
Sequential cargo builds, perfectly made,
Per-batch progress glows, concurrency shines,
Cognition service models check batch by batch line,
Efficiency hops forward—what a sight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(ci): Max concurrent typegen' directly relates to the main change: adding concurrency limits to the build process to prevent CI from getting stuck.
Description check ✅ Passed The description explains the motivation for the change (CI getting stuck due to too many services building at once) and aligns with the implementation of limiting concurrent operations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch evan/max-concurrent-typegen

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@js/app/scripts/generate-api-schema.ts`:
- Around line 183-184: The comment above the call to
buildOpenApiBinaries(crateNames, { checkMode }) is outdated: update it to say
that binaries are built in a single cargo invocation in normal mode but when
checkMode is true the builds are split into multiple batched cargo invocations;
reference crateNames and checkMode in the comment so readers know the behavior
depends on that flag and the call site is buildOpenApiBinaries.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 241e8957-59c7-4a42-8e25-a5f119c14d2a

📥 Commits

Reviewing files that changed from the base of the PR and between 11cd3f2 and 1854aa1.

📒 Files selected for processing (1)
  • js/app/scripts/generate-api-schema.ts

Comment on lines 183 to +184
// Phase 1: Build all binaries in a single cargo invocation (parallelized by cargo)
await buildOpenApiBinaries(crateNames);
await buildOpenApiBinaries(crateNames, { checkMode });
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.

🧹 Nitpick | 🔵 Trivial

Update the comment to reflect the new batching behavior.

The comment states "Build all binaries in a single cargo invocation" but this is no longer accurate when checkMode is true—the build now runs in multiple batched invocations.

📝 Suggested comment update
-  // Phase 1: Build all binaries in a single cargo invocation (parallelized by cargo)
+  // Phase 1: Build all binaries (batched in CI to limit resource usage, single invocation otherwise)
   await buildOpenApiBinaries(crateNames, { checkMode });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Phase 1: Build all binaries in a single cargo invocation (parallelized by cargo)
await buildOpenApiBinaries(crateNames);
await buildOpenApiBinaries(crateNames, { checkMode });
// Phase 1: Build all binaries (batched in CI to limit resource usage, single invocation otherwise)
await buildOpenApiBinaries(crateNames, { checkMode });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@js/app/scripts/generate-api-schema.ts` around lines 183 - 184, The comment
above the call to buildOpenApiBinaries(crateNames, { checkMode }) is outdated:
update it to say that binaries are built in a single cargo invocation in normal
mode but when checkMode is true the builds are split into multiple batched cargo
invocations; reference crateNames and checkMode in the comment so readers know
the behavior depends on that flag and the call site is buildOpenApiBinaries.

@evanhutnik evanhutnik merged commit d4adc7b into main Mar 25, 2026
25 checks passed
@evanhutnik evanhutnik deleted the evan/max-concurrent-typegen branch March 25, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant