Skip to content

[eas-cli] Add lockfile existence preflight check for eas build#3665

Merged
AbbanMustafa merged 1 commit intomainfrom
mus/preflight-checks-validatelockfile
May 4, 2026
Merged

[eas-cli] Add lockfile existence preflight check for eas build#3665
AbbanMustafa merged 1 commit intomainfrom
mus/preflight-checks-validatelockfile

Conversation

@AbbanMustafa
Copy link
Copy Markdown
Contributor

@AbbanMustafa AbbanMustafa commented May 1, 2026

Why

~3k builds fail weekly during install_dependencies because of lockfile issues. The most basic failure mode, a missing lockfile, can be caught before the build is even queued, giving instant feedback instead of waiting for a remote build to fail.

This is the first of several small PRs breaking up #3434

How

Added a single preflight check in prepareAndStartBuildAsync() that verifies at least one known lockfile (package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb, bun.lock) exists in the project directory or workspace root (monorepo support via resolveWorkspaceRoot).

  • The check runs once per CLI invocation using a module-level flag, matching the existing metroConfigValidated/sdkVersionChecked pattern.
  • Skipped for local builds (localBuildMode), since local builds install deps locally.
  • Opt-out via EAS_BUILD_SKIP_LOCKFILE_CHECK=1 env var.

Test Plan

Unit tests covering all lockfile types, missing lockfile error, and monorepo scenarios

Verified cli output

eas build
✔ Select platform › Android

⚠️ Detected that your app uses Expo Go for development, this is not recommended when building production apps.
Learn more
To suppress this warning, set EAS_BUILD_NO_EXPO_GO_WARNING=true.

Resolved "production" environment for the build. Learn more
Environment variables with visibility "Plain text" and "Sensitive" loaded from the "production" environment on EAS: EAS_USE_CACHE, EAS_VERBOSE, EXPERIMENTAL_EAS_GRADLE_CACHE.

✔ Incremented versionCode from 17 to 18.
No lockfile found in the project directory.
A lockfile is required to ensure deterministic dependency installation in EAS.
Run your package manager's install command (e.g. "npm install") to generate one.
To skip this check, run this command with EAS_BUILD_SKIP_LOCKFILE_CHECK=1.
    Error: build command failed.

@AbbanMustafa AbbanMustafa added the no changelog PR that doesn't require a changelog entry label May 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

Subscribed to pull request

File Patterns Mentions
**/* @douglowder
packages/eas-cli/src/build/** @sjchmiela

Generated by CodeMention

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

❌ Patch coverage is 82.60870% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.88%. Comparing base (e74c93d) to head (20ec701).

Files with missing lines Patch % Lines
packages/eas-cli/src/build/runBuildAndSubmit.ts 33.34% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3665      +/-   ##
==========================================
+ Coverage   55.87%   55.88%   +0.02%     
==========================================
  Files         868      869       +1     
  Lines       37545    37568      +23     
  Branches     7835     7841       +6     
==========================================
+ Hits        20973    20992      +19     
- Misses      16474    16478       +4     
  Partials       98       98              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AbbanMustafa AbbanMustafa requested a review from sjchmiela May 1, 2026 17:43
@AbbanMustafa AbbanMustafa merged commit 138f797 into main May 4, 2026
10 of 11 checks passed
@AbbanMustafa AbbanMustafa deleted the mus/preflight-checks-validatelockfile branch May 4, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants