Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ This is the log of notable changes to EAS CLI and related packages.

### 🐛 Bug fixes

- Fix `eas:build` bug where overages are checked before config is ready. ([#3260](https://github.com/expo/eas-cli/pull/3260) by [@mackenco](https://github.com/mackenco))

### 🧹 Chores

## [16.27.0](https://github.com/expo/eas-cli/releases/tag/v16.27.0) - 2025-11-13
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
"volta": {
"node": "20.11.0",
"yarn": "1.22.21"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
1 change: 1 addition & 0 deletions packages/eas-cli/src/build/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export interface IosBuildContext {
}

export interface BuildContext<T extends Platform> {
accountId: string;
accountName: string;
easJsonCliConfig: EasJson['cli'];
buildProfile: BuildProfile<T>;
Expand Down
1 change: 1 addition & 0 deletions packages/eas-cli/src/build/createContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export async function createBuildContextAsync<T extends Platform>({
);

const commonContext: CommonContext<T> = {
accountId,
accountName: account.name,
buildProfile,
buildProfileName,
Expand Down
11 changes: 11 additions & 0 deletions packages/eas-cli/src/build/runBuildAndSubmit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ import { downloadAndMaybeExtractAppAsync } from '../utils/download';
import { truthy } from '../utils/expodash/filter';
import { printJsonOnlyOutput } from '../utils/json';
import { ProfileData, getProfilesAsync } from '../utils/profiles';
import { maybeWarnAboutUsageOveragesAsync } from '../utils/usage/checkForOverages';
import { Client } from '../vcs/vcs';

let metroConfigValidated = false;
let sdkVersionChecked = false;
let hasWarnedAboutUsageOverages = false;

export interface BuildFlags {
requestedPlatform: RequestedPlatform;
Expand Down Expand Up @@ -409,6 +411,15 @@ async function prepareAndStartBuildAsync({
env,
});

if (!hasWarnedAboutUsageOverages && !flags.localBuildOptions.localBuildMode) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This this function could run multiple times (per build profile), we want to track if we've warned and only do it once.

hasWarnedAboutUsageOverages = true;
Log.newLine();
await maybeWarnAboutUsageOveragesAsync({ graphqlClient, accountId: buildCtx.accountId });
if (!moreBuilds) {
Log.newLine();
}
}

if (moreBuilds) {
Log.newLine();
const appPlatform = toAppPlatform(buildProfile.platform);
Expand Down
9 changes: 0 additions & 9 deletions packages/eas-cli/src/commands/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ import { EasNonInteractiveAndJsonFlags } from '../../commandUtils/flags';
import { StatuspageServiceName } from '../../graphql/generated';
import Log, { link } from '../../log';
import { RequestedPlatform, selectRequestedPlatformAsync } from '../../platform';
import { getOwnerAccountForProjectIdAsync } from '../../project/projectUtils';
import { selectAsync } from '../../prompts';
import uniq from '../../utils/expodash/uniq';
import { enableJsonOutput } from '../../utils/json';
import { ProfileData } from '../../utils/profiles';
import { maybeWarnAboutEasOutagesAsync } from '../../utils/statuspageService';
import { maybeWarnAboutUsageOveragesAsync } from '../../utils/usage/checkForOverages';

interface RawBuildFlags {
platform?: string;
Expand Down Expand Up @@ -163,13 +161,6 @@ export default class Build extends EasCommand {
? [StatuspageServiceName.EasBuild, StatuspageServiceName.EasSubmit]
: [StatuspageServiceName.EasBuild]
);

const { projectId } = await getDynamicPrivateProjectConfigAsync();
const account = await getOwnerAccountForProjectIdAsync(graphqlClient, projectId);
await maybeWarnAboutUsageOveragesAsync({
graphqlClient,
accountId: account.id,
});
}

const flagsWithPlatform = await this.ensurePlatformSelectedAsync(flags);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,11 @@ describe('maybeWarnAboutUsageOveragesAsync', () => {
AccountUsageQuery.getUsageForOverageWarningAsync
);
const mockWarn = jest.mocked(Log.warn);
const mockNewLine = jest.mocked(Log.newLine);
const mockDebug = jest.mocked(Log.debug);

beforeEach(() => {
mockGetUsageForOverageWarningAsync.mockClear();
mockWarn.mockClear();
mockNewLine.mockClear();
mockDebug.mockClear();
});

Expand Down Expand Up @@ -109,7 +107,6 @@ describe('maybeWarnAboutUsageOveragesAsync', () => {
expect(mockWarn).toHaveBeenCalledWith(
expect.stringContaining("You won't be able to start new builds once you reach the limit.")
);
expect(mockNewLine).toHaveBeenCalledTimes(1);
});

it('displays a warning for a Starter plan with high build usage', async () => {
Expand All @@ -133,7 +130,6 @@ describe('maybeWarnAboutUsageOveragesAsync', () => {
'Additional usage beyond your limit will be charged at pay-as-you-go rates.'
)
);
expect(mockNewLine).toHaveBeenCalledTimes(1);
});

it('does not display a warning when usage is below threshold', async () => {
Expand Down
1 change: 0 additions & 1 deletion packages/eas-cli/src/utils/usage/checkForOverages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,4 @@ export function displayOverageWarning({
});

Log.warn(warning);
Log.newLine();
}