Skip to content

[steps] Support local composite functions in hook steps - #4062

Merged
sswrk merged 5 commits into
mainfrom
szymonswierk/eng-22387-steps-composite-functions-in-hooks
Jul 30, 2026
Merged

[steps] Support local composite functions in hook steps#4062
sswrk merged 5 commits into
mainfrom
szymonswierk/eng-22387-steps-composite-functions-in-hooks

Conversation

@sswrk

@sswrk sswrk commented Jul 23, 2026

Copy link
Copy Markdown
Member

Why

Hook steps currently reject uses: ./... local composite functions. Users should be able to reuse the same composites in hooks as in the main workflow.

How

A composite function used in a hook is expanded into its inner steps at parse time, the same way it is in the main workflow, and the whole expansion becomes a single hook entry. The step's if: gates the expansion as a whole.

Hook construction now takes a catalog of composite functions. Without it, referencing a composite fails with a missing-function error instead of the previous "not supported in hooks" error.

Wiring reading the composite functions files will be added in follow-up PRs in the stack.

Test Plan

Added unit tests.

@linear-code

linear-code Bot commented Jul 23, 2026

Copy link
Copy Markdown

ENG-22387

sswrk commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.32%. Comparing base (ee03114) to head (e260a74).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4062      +/-   ##
==========================================
+ Coverage   62.32%   62.32%   +0.01%     
==========================================
  Files         995      995              
  Lines       44923    44933      +10     
  Branches     9440     9443       +3     
==========================================
+ Hits        27992    28002      +10     
  Misses      15483    15483              
  Partials     1448     1448              

☔ 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-unify-no-if-gating-policy branch from ccd27cf to 88b25ed Compare July 23, 2026 16:17
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch 2 times, most recently from e118ae0 to 5a88848 Compare July 23, 2026 17:06
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from 88b25ed to afe2ad9 Compare July 23, 2026 17:06
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from afe2ad9 to de031b5 Compare July 24, 2026 11:43
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch 2 times, most recently from 642f105 to 40b60f7 Compare July 24, 2026 11:49
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch 2 times, most recently from 73ece96 to be7ec02 Compare July 24, 2026 12:31
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch 2 times, most recently from fd5922a to 44fec11 Compare July 24, 2026 13:02
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch 2 times, most recently from 0236cea to f14d4f6 Compare July 24, 2026 14:12
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from 44fec11 to 56907d3 Compare July 24, 2026 14:12
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from f14d4f6 to fb5d85f Compare July 24, 2026 14:40
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from 56907d3 to a107305 Compare July 24, 2026 14:41
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from fb5d85f to 0a629b7 Compare July 24, 2026 14:59
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from a107305 to 95e91de Compare July 24, 2026 14:59
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from 0a629b7 to 32f79bd Compare July 24, 2026 15:16
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from 336986e to bfe042d Compare July 28, 2026 12:58
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from 98ef96f to ff9cb50 Compare July 28, 2026 12:58
@sswrk

sswrk commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

@hSATAC Thank you for noting that, and yes, this was done like that for the sake of consistency. But taking a step back, as a user I'd expect composite functions/function groups to fast-fail within them even in the after_* hook (and then let the next steps in the hook run).

Corrected the behavior for both composite functions and function groups.

@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from ff9cb50 to 4a56ee2 Compare July 28, 2026 13:11
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from bfe042d to c692851 Compare July 28, 2026 15:30
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from 4a56ee2 to 70ce854 Compare July 28, 2026 15:30
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from c692851 to f9f51cc Compare July 29, 2026 09:01
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from 70ce854 to 3702906 Compare July 29, 2026 09:01
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from f9f51cc to e693624 Compare July 29, 2026 09:26
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from 3702906 to 7136a56 Compare July 29, 2026 09:27
@sswrk
sswrk requested a review from hSATAC July 29, 2026 13:49
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from e693624 to b7cdc4d Compare July 30, 2026 15:09
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from 72786a9 to 87f0562 Compare July 30, 2026 15:09
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch 2 times, most recently from 30c602c to 3b7eed6 Compare July 30, 2026 15:33
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from 87f0562 to fc23482 Compare July 30, 2026 15:33
@sswrk
sswrk changed the base branch from szymonswierk/eng-22387-steps-unify-no-if-gating-policy to graphite-base/4062 July 30, 2026 15:42
@sswrk
sswrk force-pushed the graphite-base/4062 branch from 3b7eed6 to ee03114 Compare July 30, 2026 15:42
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from fc23482 to b14106c Compare July 30, 2026 15:42
@graphite-app
graphite-app Bot changed the base branch from graphite-base/4062 to main July 30, 2026 15:43
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch from b14106c to e260a74 Compare July 30, 2026 15:43
@github-actions

Copy link
Copy Markdown

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

@sswrk
sswrk merged commit a6ce70e into main Jul 30, 2026
11 checks passed
@sswrk
sswrk deleted the szymonswierk/eng-22387-steps-composite-functions-in-hooks branch July 30, 2026 16:11
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