Skip to content

Commit b7198a7

Browse files
committed
0.1.2: rename env vars off EAS_BUILD_* (collision with EAS Build reserved namespace)
Root cause of EAS Workflow custom jobs failing silently after PREPARE_PROJECT: the worker reads process.env.EAS_BUILD_ID to construct /v2/turtle-job-runs/<id>/download-project-archive. Setting EAS_BUILD_ID in the job's env: block (to forward the upstream build_id) clobbered the worker's own job-run identifier, breaking the project-archive refresh endpoint, falling back to ArchiveSourceType.NONE (empty project), killing the run before PARSE_CUSTOM_WORKFLOW_CONFIG. Reproduced isolated via bisection: same job structure, EAS_BUILD_ID in env: fails; DCD_BUILD_ID in env: succeeds. Fix: prefix all wrapper-defined env vars with DCD_ to avoid the EAS_BUILD_* reserved namespace. Renames are non-backward-compatible but only affect 0.1.0/0.1.1 users (none in production yet, @latest is still 0.1.0 awaiting public release).
1 parent 39616dd commit b7198a7

6 files changed

Lines changed: 33 additions & 23 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
needs: [build_android]
1717
runs_on: linux-medium
1818
steps:
19+
- uses: eas/checkout
1920
- id: download
2021
uses: eas/download_build
2122
with:
@@ -27,6 +28,8 @@ jobs:
2728
--flows ./.maestro
2829
```
2930
31+
> **Don't** name your env-block keys `EAS_BUILD_ID` or anything starting with `EAS_BUILD_*` — that namespace is reserved by EAS Build workers, and clobbering `EAS_BUILD_ID` will cause your custom job to fail silently after `PREPARE_PROJECT` with no error message. Use the wrapper's `DCD_EAS_*` env-var contract instead (see [examples/](./examples/)).
32+
3033
Before running, store your DeviceCloud API key as an EAS project secret named `DEVICE_CLOUD_API_KEY`:
3134

3235
```bash

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/android.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ jobs:
1414
needs: [build_android]
1515
runs_on: linux-medium
1616
env:
17-
EAS_BUILD_ID: ${{ needs.build_android.outputs.build_id }}
18-
EAS_BUILD_PLATFORM: ${{ needs.build_android.outputs.platform }}
19-
EAS_APP_VERSION: ${{ needs.build_android.outputs.app_version }}
20-
EAS_GH_SHA: ${{ github.sha }}
21-
EAS_GH_BRANCH: ${{ github.ref_name }}
17+
DCD_EAS_BUILD_ID: ${{ needs.build_android.outputs.build_id }}
18+
DCD_EAS_PLATFORM: ${{ needs.build_android.outputs.platform }}
19+
DCD_EAS_APP_VERSION: ${{ needs.build_android.outputs.app_version }}
20+
DCD_GH_SHA: ${{ github.sha }}
21+
DCD_GH_BRANCH: ${{ github.ref_name }}
2222
outputs:
2323
console_url: ${{ steps.dcd.outputs.console_url }}
2424
status: ${{ steps.dcd.outputs.upload_status }}
2525
flow_results: ${{ steps.dcd.outputs.flow_results }}
2626
steps:
27+
- uses: eas/checkout
2728
- id: download
2829
uses: eas/download_build
2930
with:

examples/ios.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ jobs:
1414
needs: [build_ios]
1515
runs_on: linux-medium
1616
env:
17-
EAS_BUILD_ID: ${{ needs.build_ios.outputs.build_id }}
18-
EAS_BUILD_PLATFORM: ${{ needs.build_ios.outputs.platform }}
19-
EAS_APP_VERSION: ${{ needs.build_ios.outputs.app_version }}
20-
EAS_GH_SHA: ${{ github.sha }}
21-
EAS_GH_BRANCH: ${{ github.ref_name }}
17+
DCD_EAS_BUILD_ID: ${{ needs.build_ios.outputs.build_id }}
18+
DCD_EAS_PLATFORM: ${{ needs.build_ios.outputs.platform }}
19+
DCD_EAS_APP_VERSION: ${{ needs.build_ios.outputs.app_version }}
20+
DCD_GH_SHA: ${{ github.sha }}
21+
DCD_GH_BRANCH: ${{ github.ref_name }}
2222
outputs:
2323
console_url: ${{ steps.dcd.outputs.console_url }}
2424
status: ${{ steps.dcd.outputs.upload_status }}
2525
flow_results: ${{ steps.dcd.outputs.flow_results }}
2626
steps:
27+
- uses: eas/checkout
2728
- id: download
2829
uses: eas/download_build
2930
with:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@devicecloud.dev/eas-workflow",
33
"description": "Run Maestro tests on devicecloud.dev from EAS Workflows",
44
"author": "devicecloud.dev",
5-
"version": "0.1.1",
5+
"version": "0.1.2",
66
"main": "dist/index.js",
77
"bin": {
88
"eas-workflow": "dist/index.js"

src/methods/env.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ export interface EasEnv {
66
metadata: string[];
77
}
88

9+
// IMPORTANT: env var names must NOT use the `EAS_BUILD_*` prefix.
10+
// EAS Build workers reserve that namespace for system env vars
11+
// (EAS_BUILD_ID, EAS_BUILD_PROJECT_ID, EAS_BUILD_WORKINGDIR, ...).
12+
// Collisions overwrite the worker's own job-run ID and break the
13+
// project-archive refresh, killing the run silently after PREPARE_PROJECT.
914
const metadataMappings: Array<[envVar: string, metadataKey: string]> = [
10-
['EAS_BUILD_ID', 'eas_build_id'],
11-
['EAS_BUILD_PLATFORM', 'eas_platform'],
12-
['EAS_BUILD_PROFILE', 'eas_profile'],
13-
['EAS_APP_VERSION', 'eas_app_version'],
14-
['EAS_GH_SHA', 'gh_sha'],
15-
['EAS_GH_BRANCH', 'gh_branch'],
16-
['EAS_GH_PR_NUMBER', 'gh_pr_number'],
17-
['EAS_GH_PR_URL', 'gh_pr_url'],
18-
['EAS_GH_REPO', 'gh_repo'],
19-
['EAS_GH_RUN_ID', 'gh_run_id'],
15+
['DCD_EAS_BUILD_ID', 'eas_build_id'],
16+
['DCD_EAS_PLATFORM', 'eas_platform'],
17+
['DCD_EAS_PROFILE', 'eas_profile'],
18+
['DCD_EAS_APP_VERSION', 'eas_app_version'],
19+
['DCD_GH_SHA', 'gh_sha'],
20+
['DCD_GH_BRANCH', 'gh_branch'],
21+
['DCD_GH_PR_NUMBER', 'gh_pr_number'],
22+
['DCD_GH_PR_URL', 'gh_pr_url'],
23+
['DCD_GH_REPO', 'gh_repo'],
24+
['DCD_GH_RUN_ID', 'gh_run_id'],
2025
];
2126

2227
export function getEnv(): EasEnv {
@@ -39,7 +44,7 @@ export function getEnv(): EasEnv {
3944
return {
4045
apiKey,
4146
apiUrl: process.env.DEVICE_CLOUD_API_URL || undefined,
42-
buildUrl: process.env.EAS_BUILD_URL || undefined,
47+
buildUrl: process.env.DCD_EAS_BUILD_URL || undefined,
4348
useBeta: process.env.DCD_USE_BETA === 'true',
4449
metadata,
4550
};

0 commit comments

Comments
 (0)