workflow:validate crashes with "Cannot read properties of undefined (reading 'const')" when the published schema has a job entry without properties.type
I maintainer di solito rispondono entro 3 giorni
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- cli
Direzione di ricerca
Inizia da build/commandUtils/workflow/validation.js, in jobTypesFromWorkflowSchema e nella sua chiamata da validateWorkflowJobTypes. Riproduci il problema con eas workflow:validate .eas/workflows/build-preview.yml --non-interactive oppure usa EXPO_TESTING_WORKFLOW_SCHEMA_PATH con lo schema che contiene la voce di job catch-all. Il lavoro è completato quando il validatore non genera più un’eccezione e valida correttamente il workflow invariato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
eas workflow:validate fails for every workflow file with:
- Validating the workflow YAML file…
✖ Workflow configuration YAML is not valid.
Error: Cannot read properties of undefined (reading 'const')
The failure happens before any workflow is validated, so it is not caused by the workflow content. It reproduces on a workflow that a previous CLI release reported as valid.
Cause
eas workflow:validate fetches the published workflow schema from GET /v2/workflows/schema and then builds its job-type allowlist in build/commandUtils/workflow/validation.js:
function jobTypesFromWorkflowSchema(workflowJsonSchema) {
return workflowJsonSchema?.properties?.jobs?.additionalProperties?.anyOf.map(
(props) => props.properties.type.const,
);
}
validateWorkflowJobTypes calls this before validateWorkflowStructure, so a TypeError here aborts validation entirely.
The published schema now also contains a catch-all job entry that has no properties.type (its shape is name/if/… plus additionalProperties, used for job types outside the named set). Reading props.properties.type.const on that entry throws the observed TypeError.
Entries 0-17 of anyOf all carry properties.type.const (build, custom, deploy, fingerprint, get-build, maestro-cloud, maestro, require-approval, apple-device-registration-request, submit, testflight, update, slack, doc, repack, github-comment, branch-delete, update-rollout); the additional entry does not.
Reproduction
Any project with a workflow file:
eas workflow:validate .eas/workflows/build-preview.yml --non-interactive
Checked versions: 22.6.0, 23.0.0, 24.0.0, 24.4.0, 24.8.0 (latest) — all contain the same expression and all fail.
Workaround
Point the validator at a copy of the schema without the catch-all entry, using the existing hook in fetchWorkflowSchemaAsync:
EXPO_TESTING_WORKFLOW_SCHEMA_PATH=/path/to/schema-without-catch-all.json \
eas workflow:validate .eas/workflows/build-preview.yml --non-interactive
With that entry removed the same CLI reports the unmodified workflow as valid, so the workflow content itself is fine.
Suggested fix
Collect job types defensively, ignoring entries that do not declare one:
return (workflowJsonSchema?.properties?.jobs?.additionalProperties?.anyOf ?? [])
.map((props) => props?.properties?.type?.const)
.filter((type) => typeof type === 'string');
Ideally the catch-all entry would also be distinguishable without relying on its position in anyOf.
- Lingua principale
- TypeScript
- Stelle
- 1.4k
- Fork
- 254
- Merge medio
- 4g 41m
- PR unite (30g)
- 113
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di expo/eas-cli
-
ASC API key auth fails with Apple 401 because @expo/apple-utils signs JWTs with exactly the 1200 s maximum lifetimeForse già presa @ceydaakin l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 3 giorni
-
metadata:push: `apple.info.restrictedWords` flags "beta" inside other words (e.g. Danish "Betal")Forse già presa @DYNOSuprovo l’ha presa 14 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 3 giorni
-
Token Mint Clock Skew IssueApertaneeds review
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 3 giorni
-
`--no-auto-testflight-setup` is ignored when the submit profile has no `ascAppId`: `Team (Expo)` is still created and all Admins enrolled (opt-out lost in 22.0.0)Forse già presa @tahakocal l’ha presa 29 giorni fa. Apertastale
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
expo/eas-cli#4397 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
Handle missing node_modules betterForse già presa @LizunovSergey l’ha presa 41 giorni fa. Apertaneeds review
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di expo/eas-cli
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 75/100
siyuan-note/siyuan#20629 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Volume eject does not refuse system, root or /home mountsForse già presa @bernardopg l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
spacedriveapp/spacedrive#3159 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
melgarafael/DeskcommCRM#3000 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
callstackincubator/simlock#639 ·
I maintainer di solito rispondono entro 1 giorno