[eas-cli] Accept template expressions where the workflow schema wants a URI - #4255
Open
dennytosp wants to merge 1 commit into
Open
[eas-cli] Accept template expressions where the workflow schema wants a URI#4255dennytosp wants to merge 1 commit into
dennytosp wants to merge 1 commit into
Conversation
dennytosp
force-pushed
the
fix/workflow-validate-template-expressions
branch
from
August 22, 2026 09:01
3769ee3 to
e271ec5
Compare
|
Subscribed to pull request
Generated by CodeMention Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fixes #3404.
eas workflow:validateandeas workflow:createcompile the published workflow schema with AJV, and AJV is configured withajv-formats, soformatkeywords are enforced. The schema declares the Slack job'swebhook_urlas{"type": "string", "format": "uri"}, but a${{ ... }}expression is only replaced with its value when the workflow runs.${{ env.SLACK_WEBHOOK_URL }}is not a URI, so the check fails on a workflow that is valid and that the server accepts.The consequence is worse than one wrong message. Jobs are matched with
anyOf, so the failed format drops both Slack branches and the job is then reported against every other job type. Against the schema athttps://api.expo.dev/v2/workflows/schematoday, a single interpolatedwebhook_urlproduces 71 errors, starting with the misleadingThe value at /jobs/notify/type must be equal to constant.The CLI already has this idea for build profiles, where
buildProfileIsInterpolatedskips the check for an interpolatedparams.profile.How
The workflow schema is now compiled with a validator whose formats let an interpolated value through, instead of the shared one. Each format registered on the validator is rewrapped so it first accepts a string containing a
${{ ... }}expression and otherwise defers to the original check, in whichever of the shapes AJV accepts a format (RegExp, validator function, or definition object). Number formats and formats registered astrueare left alone, since neither can hold an expression.Formats keep being enforced for everything the CLI can actually resolve: a literal
webhook_urlthat is not a URI is still rejected locally, exactly as before.uriis the only format the current schema uses, but relaxing them all means a format added to the schema later does not reintroduce the same failure.Test Plan
yarn test,yarn typecheck,yarn lintandyarn fmt:checkall pass.Added
src/commandUtils/workflow/__tests__/validation-test.ts, which runsvalidateWorkflowFileAsyncagainst a schema fixture shaped like the published one (anyOfjob types, SlackparamsasanyOf,webhook_urlwithformat: uri). It covers the three cases that matter: an interpolatedwebhook_urlvalidates, a literal URI validates, and a literal non-URI is still rejected. Onmainthe first of those fails.