Skip to content

[steps][2/4] Expand composite function references into build steps - #3929

Merged
sswrk merged 8 commits into
mainfrom
szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time
Jul 24, 2026
Merged

[steps][2/4] Expand composite function references into build steps#3929
sswrk merged 8 commits into
mainfrom
szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time

Conversation

@sswrk

@sswrk sswrk commented Jul 1, 2026

Copy link
Copy Markdown
Member

Why

EAS workflows need reusable local composite functions: a step like uses: ./.eas/functions/setup should run the steps defined in function.yml, not be treated as a built-in function.

This PR adds the structural layer for that: turning a composite function call into concrete workflow steps with correct ids, scoping, and control flow. Input interpolation, outputs, and loading function.yml from disk are handled in separate PRs.

How

When StepsConfigParser sees a local uses: path (./ or ../), CompositeFunctionExpander replaces the call with a flat list of inner steps:

  • ID namespacing: inner step read under caller setup becomes setup__read
  • Each expanded step carries a BuildStepCompositeFunctionScope so ${{ steps.* }} and ${{ inputs.* }} resolve against composite-function-local names
  • Nested local composite functions are expanded recursively with cycle and depth checks
  • Local composite functions are rejected in hooks

Test Plan

Added expansion unit tests covering nesting, cycles, depth limits, and id collisions.

@linear-code

linear-code Bot commented Jul 1, 2026

Copy link
Copy Markdown

ENG-22387

sswrk commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-build-job-local-action-schema branch from 95118f3 to 622179a Compare July 1, 2026 16:50
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from 72189ae to 4764420 Compare July 1, 2026 16:50
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-build-job-local-action-schema branch from 622179a to ff953ae Compare July 2, 2026 16:56
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from 4764420 to 56ee52f Compare July 2, 2026 16:56
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.29%. Comparing base (fcea341) to head (8c0a57d).

Files with missing lines Patch % Lines
...kages/steps/src/BuildStepCompositeFunctionScope.ts 63.64% 12 Missing ⚠️
packages/steps/src/CompositeBuildStep.ts 56.53% 10 Missing ⚠️
packages/steps/src/BuildStep.ts 94.24% 2 Missing and 1 partial ⚠️
packages/steps/src/BuildStepInput.ts 60.00% 1 Missing and 1 partial ⚠️
packages/steps/src/CompositeFunctionExpander.ts 97.81% 2 Missing ⚠️
packages/steps/src/StepsConfigParser.ts 95.66% 1 Missing ⚠️
...tepsConfigParser-composite-functions-test-utils.ts 95.00% 1 Missing ⚠️
...ackages/steps/src/utils/localCompositeFunctions.ts 94.12% 1 Missing ⚠️
packages/steps/src/utils/step.ts 92.31% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3929      +/-   ##
==========================================
+ Coverage   61.13%   61.29%   +0.16%     
==========================================
  Files         972      977       +5     
  Lines       43439    43687     +248     
  Branches     9137     9186      +49     
==========================================
+ Hits        26554    26774     +220     
- Misses      15439    15465      +26     
- Partials     1446     1448       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from 56ee52f to e436769 Compare July 3, 2026 13:43
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-build-job-local-action-schema branch from ff953ae to 77773ec Compare July 3, 2026 13:43
@sswrk sswrk changed the title [steps] Expand custom actions at parse time [steps] Expand local actions at parse time Jul 3, 2026
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-build-job-local-action-schema branch from 77773ec to d1bbabd Compare July 3, 2026 14:08
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch 2 times, most recently from 92fe812 to 3e774f9 Compare July 3, 2026 14:46
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-build-job-local-action-schema branch from d1bbabd to 6cd3f30 Compare July 3, 2026 14:46
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from 3e774f9 to f74b6da Compare July 3, 2026 14:58
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-build-job-local-action-schema branch from 6cd3f30 to 85cc322 Compare July 3, 2026 14:58
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from f74b6da to b5be21a Compare July 3, 2026 15:40
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-build-job-local-action-schema branch 2 times, most recently from 244427d to e64f37d Compare July 3, 2026 15:48
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from b5be21a to 1e89296 Compare July 3, 2026 15:48
@sswrk
sswrk changed the base branch from szymonswierk/eng-22387-eas-build-job-local-action-schema to graphite-base/3929 July 6, 2026 12:11
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from 1e89296 to 4f79fdc Compare July 6, 2026 12:11
@sswrk
sswrk changed the base branch from graphite-base/3929 to szymonswierk/eng-22387-steps-local-action-discovery July 6, 2026 12:11
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-local-action-discovery branch from 2046da9 to bf2e850 Compare July 6, 2026 13:23
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch 2 times, most recently from 2190527 to 8d70398 Compare July 6, 2026 13:51
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from f3e1220 to 0333696 Compare July 14, 2026 17:37
@sswrk
sswrk requested a review from sjchmiela July 14, 2026 18:05
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from 062f7d5 to 97bab28 Compare July 15, 2026 12:06
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-local-action-discovery branch from 098fd12 to 0d0bb34 Compare July 15, 2026 12:06
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from 97bab28 to a9e4e38 Compare July 15, 2026 12:43
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-local-action-discovery branch from 0d0bb34 to 1524069 Compare July 15, 2026 12:43
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from 7c8b3bc to b5d4bce Compare July 15, 2026 14:02
@sswrk sswrk changed the title [steps][2/5] Expand action references into build steps [steps][2/4] Expand action references into build steps Jul 15, 2026
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-expand-custom-actions-at-parse-time branch from b5d4bce to abaf7ea Compare July 16, 2026 00:43

@hSATAC hSATAC left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this looks solid — expansion, namespacing, cycle/depth, the if gating all read well. Two small notes inline, nothing blocking.

Comment thread packages/steps/src/StepsConfigParser.ts Outdated
Comment thread packages/steps/src/BuildStep.ts Outdated
Comment thread packages/steps/src/utils/localCompositeFunctions.ts Outdated
Comment thread packages/steps/src/hooks.ts
Comment thread packages/steps/src/StepsConfigParser.ts Outdated
Comment thread packages/steps/src/utils/localCompositeFunctions.ts Outdated
Comment thread packages/steps/src/CompositeBuildStep.ts
@github-actions

Copy link
Copy Markdown

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants