Skip to content

Conversation

@davidkonigsberg
Copy link
Collaborator

Description

Refs: https://github.com/fern-api/fern/actions/runs/21298381788/job/61309835788

Fixes intermittent CI failures where TypeScript compilation fails with TS2306: File is not a module errors for core-utils/lib/index.d.ts.

Changes Made

  • Expanded the pre-build step to include path-utils, fs-utils, and logger in addition to core-utils
  • Added --concurrency 1 to ensure sequential builds of foundational packages
  • Added documentation explaining the dependency order

Root Cause Analysis

The previous pre-build step only built @fern-api/core-utils, but race conditions were still occurring because:

  1. path-utils (a leaf package) was being built in parallel with packages that depend on it
  2. When rust-base compiled, it triggered compilation of logger, which tried to import from core-utils while files were potentially still being written

The fix pre-builds all foundational packages sequentially before parallel compilation begins.

Testing

  • Manual testing not possible for CI workflow changes
  • Analysis based on CI failure logs showing the race condition pattern

Human Review Checklist

  • Verify the dependency analysis: core-utils and path-utils are leaf packages; fs-utils depends on both; logger depends on core-utils
  • Consider if additional packages should be included in the pre-build
  • Evaluate performance trade-off of sequential pre-builds vs. reliability

Requested by: David Konigsberg (@davidkonigsberg)
Link to Devin run: https://app.devin.ai/sessions/557fd9a0710846909fef8a0351ef63ea

The previous pre-build step only built @fern-api/core-utils, but race
conditions were still occurring because other foundational packages
(path-utils, fs-utils, logger) were being built in parallel with
packages that depend on them.

This change:
- Adds path-utils (leaf package with no dependencies)
- Adds fs-utils (depends on core-utils, path-utils)
- Adds logger (depends on core-utils)
- Uses --concurrency 1 to ensure sequential builds

Building these packages sequentially before the parallel compilation
ensures their output files are fully written before dependent packages
start compiling, preventing TS2306 'is not a module' errors.

Co-Authored-By: David Konigsberg <[email protected]>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

🌱 Seed Test Selector

Select languages to run seed tests for:

  • Python
  • TypeScript
  • Java
  • Go
  • Ruby
  • C#
  • PHP
  • Swift
  • Rust
  • OpenAPI
  • Postman

How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants