[eas-build-job] Accept legacy command/path custom function shape in function.yml - #4095
Draft
sswrk wants to merge 1 commit into
Conversation
This was referenced Jul 27, 2026
Member
Author
This was referenced Jul 27, 2026
sswrk
force-pushed
the
szymonswierk/eng-25402-eas-build-job-legacy-function-shape
branch
from
July 28, 2026 09:04
e893fae to
3b018d6
Compare
sswrk
force-pushed
the
szymonswierk/eng-22387-eas-cli-validate-hook-composite-functions
branch
2 times, most recently
from
July 28, 2026 12:58
01ffc9f to
dac0ac2
Compare
sswrk
force-pushed
the
szymonswierk/eng-25402-eas-build-job-legacy-function-shape
branch
from
July 28, 2026 12:58
3b018d6 to
891ef23
Compare
sswrk
force-pushed
the
szymonswierk/eng-22387-eas-cli-validate-hook-composite-functions
branch
from
July 28, 2026 13:11
dac0ac2 to
ec45af1
Compare
sswrk
force-pushed
the
szymonswierk/eng-25402-eas-build-job-legacy-function-shape
branch
from
July 28, 2026 13:11
891ef23 to
27f53d7
Compare
sswrk
force-pushed
the
szymonswierk/eng-22387-eas-cli-validate-hook-composite-functions
branch
from
July 28, 2026 15:30
ec45af1 to
0ca9abb
Compare
sswrk
force-pushed
the
szymonswierk/eng-25402-eas-build-job-legacy-function-shape
branch
from
July 28, 2026 15:30
27f53d7 to
e8d69a0
Compare
sswrk
force-pushed
the
szymonswierk/eng-22387-eas-cli-validate-hook-composite-functions
branch
from
July 29, 2026 09:01
0ca9abb to
e71d330
Compare
sswrk
force-pushed
the
szymonswierk/eng-25402-eas-build-job-legacy-function-shape
branch
from
July 29, 2026 09:01
e8d69a0 to
702bea2
Compare
sswrk
force-pushed
the
szymonswierk/eng-22387-eas-cli-validate-hook-composite-functions
branch
from
July 29, 2026 09:28
e71d330 to
c99eeea
Compare
sswrk
force-pushed
the
szymonswierk/eng-25402-eas-build-job-legacy-function-shape
branch
from
July 29, 2026 09:28
702bea2 to
961f32c
Compare
sswrk
force-pushed
the
szymonswierk/eng-25402-eas-build-job-legacy-function-shape
branch
from
July 29, 2026 13:40
961f32c to
9d5f159
Compare
sswrk
force-pushed
the
szymonswierk/eng-22387-eas-cli-validate-hook-composite-functions
branch
from
July 29, 2026 13:40
c99eeea to
34605fd
Compare
|
⏩ The changelog entry check has been skipped since the "no changelog" label is present. |
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
First step toward grandfathering the older custom build functions into
.eas/functions.EAS Workflows can call reusable local functions defined in
.eas/functions/<name>/function.yml, but until now such a file could only describe a composite function (a named group of steps). The older custom build functions from.eas/buildconfigs (docs) are defined differently: a single shellcommandor apathto a prebuilt JS module. The body of such a function should work as afunction.ymlverbatim, so that moving one into.eas/functionsis a copy-paste. Suggested in the review of the composite functions stack (#3928).How
Widens the
function.ymlcontract in@expo/eas-build-job, the single source of truth for its shape. A file now declares eitherruns.steps(a composite function) orcommand/path(a single-step function); the two shapes are mutually exclusive and mixing them produces a clear error.LegacyFunctionConfigZ/LegacyFunctionConfigfor the single-step shape:name,description,inputs(same shape as composite inputs, so the legacy YAML copies over verbatim), array-formoutputs,command,path,shell,supported_platforms.LocalFunctionConfigZ, the union both loaders will parse with. It sniffs the shape and delegates to one branch rather than unioning two strict objects, which keeps errors precise: a bare union reports every branch's failures for a single typo. Sub-schema issues are re-emitted with their paths intact, so the existingz.prettifyErrorformatting keeps working.isLegacyFunctionConfigguard, pluscommand/path/shell/supported_platformsasz.never().optional()on the composite schema (theStepZnarrowing pattern) so the union discriminates in TypeScript.No runtime behavior changes yet. The
CompositeFunctionCatalogwidening lands in the next PR, together with the@expo/stepscode that handles both shapes, so that every commit in the stack typechecks on its own.Test Plan
cd packages/eas-build-job && yarn test src/__tests__/compositeFunction.test.tsUnit tests cover both shapes, the conflict cases (
runs+command,runs+path, bothcommandandpath, neither) with exact error messages, cross-shapeoutputsrejection, unknownsupported_platformsvalues, non-mapping input, unknown keys, and that prettified errors still point at the offending field.