[eas-cli] fix: When warning about usage overages, the build profile's env was not applied before evaluating config #3257
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
#3236 was recently merged, adding a check for the EAS account's build usage and issuing a warning before running a build. It introduced a bug: it evaluates the project's config to get the EAS projectId, but it doesn't apply the
envfrom the build profile beforehand. All other code that reads the config will firstThis created an issue in my CI builds where I am pinned to the latest CLI version. Because my
app.config.tsdepends on certain values being set in the environment (and throws if they aren't): this caused the entire build command to fail. It seems sensible to keep the previous behaviour whereeas buildwill always applyenvfrom the relevant build profile before evaluatingapp.config.ts.How
Move the code that issues the warning to deeper within the runBuildAndSubmitAsync flow, after the build profile has been read, and the
envfrom that profile is available and used when evaluating the project config.Test Plan
The test added in #3236 is still passing, and this PR removes the problematic behaviour (evaluating the project config without applying env from the build profile).