[build-tools] Resolve job environment after metadata update#3899
[build-tools] Resolve job environment after metadata update#3899sjchmiela wants to merge 1 commit into
Conversation
d3ac20b to
8730d58
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## stanley/update-env-overrides-existing #3899 +/- ##
=========================================================================
+ Coverage 59.02% 59.03% +0.02%
=========================================================================
Files 935 935
Lines 40946 40947 +1
Branches 8624 8620 -4
=========================================================================
+ Hits 24165 24171 +6
+ Misses 16686 16681 -5
Partials 95 95 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c70c1b4 to
6368925
Compare
a4d5fc9 to
3e474f6
Compare
6368925 to
4350086
Compare
3e474f6 to
b14056d
Compare
4350086 to
8dbf578
Compare
b14056d to
36eb14c
Compare
8dbf578 to
d1291fa
Compare
159bcd5 to
722f6cf
Compare
There was a problem hiding this comment.
Pull request overview
This PR centralizes the mapping of “resolved job information” into EAS_BUILD_* environment variables and ensures both traditional and custom/steps builds receive the same resolved values after GitHub-triggered job metadata is updated, removing the Android Gradle-specific fallback.
Changes:
- Introduces
getResolvedJobInformationEnv(job, metadata)in@expo/build-toolsand reuses it across worker env construction and build context job updates. - Updates both
BuildContext.updateJobInformationandCustomBuildContext.updateJobInformationto apply the resolved env mapping. - Removes the Gradle-only Android version env override logic and adds/updates tests to cover the new behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/worker/src/env.ts | Uses the shared resolver to populate EAS_BUILD_* envs during initial worker env construction. |
| packages/build-tools/src/index.ts | Re-exports getResolvedJobInformationEnv from the package entrypoint. |
| packages/build-tools/src/customBuildContext.ts | Updates custom build env after job/metadata resolution using the shared resolver. |
| packages/build-tools/src/context.ts | Adds the shared resolver and applies it after updateJobInformation. |
| packages/build-tools/src/android/gradle.ts | Removes Gradle-only Android version env fallback now that envs are refreshed centrally. |
| packages/build-tools/src/tests/customBuildContext.test.ts | Adds coverage to ensure custom context env is updated after resolved job information is applied. |
| packages/build-tools/src/tests/context.test.ts | Adds coverage to ensure BuildContext env is updated after resolved job information is applied. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| this._metadata = metadata; | ||
| this.updateEnv(getResolvedJobInformationEnv(this._job, this._metadata)); |
5e42c1c to
dff7d83
Compare
e83065d to
e808064
Compare
dff7d83 to
d28e79e
Compare
e808064 to
43511f2
Compare
d28e79e to
757120e
Compare
757120e to
6b8a4dd
Compare
|
⏩ The changelog entry check has been skipped since the "no changelog" label is present. |
Summary
Stacked on #3900. Refreshes derived EAS build environment variables after GitHub-triggered job information and metadata are resolved, instead of patching Android Gradle execution directly.
I want to unify
runGradleCommandand I noticed that only one of them polyfills theEAS_environment variables for GitHub builds.Details
getResolvedJobInformationEnvhelper in@expo/build-toolsfor profile, commit hash, username, and platform version env vars.BuildContext.updateJobInformationandCustomBuildContext.updateJobInformationso traditional and custom/steps builds see the resolved env.Validation
CI should pass.