Skip to content

[steps] Unify the default gating of steps with no if: across steps, composite scopes, and hooks - #4061

Merged
sswrk merged 2 commits into
mainfrom
szymonswierk/eng-22387-steps-unify-no-if-gating-policy
Jul 30, 2026
Merged

[steps] Unify the default gating of steps with no if: across steps, composite scopes, and hooks#4061
sswrk merged 2 commits into
mainfrom
szymonswierk/eng-22387-steps-unify-no-if-gating-policy

Conversation

@sswrk

@sswrk sswrk commented Jul 23, 2026

Copy link
Copy Markdown
Member

Why

For a step with no if:, whether the step should run was decided in 3 separate places: BuildStep.shouldExecuteStep, the composite function scope (same rule), and the hook executor (its own rule). That bypass means composite scopes never see hook defaults, which is a blocker for adding support for composite functions in hooks.

How

A single gate now decides whether any step runs, taking a single input: a bool telling whether a step with no if: should run. Composite functions called from hooks therefore inherit the hook's rule. Steps with an explicit if: are unaffected.

Behavior-preserving refactor.

Test Plan

  • Existing steps/hook tests still pass.
  • Added unit coverage for the run-by-default value on shouldExecuteStep /
    isActive, and hook sibling skip/continue cases for the before/after defaults.

@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

❌ Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.29%. Comparing base (2e8cbb5) to head (3b7eed6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/steps/src/BuildWorkflow.ts 57.15% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4061      +/-   ##
==========================================
- Coverage   62.29%   62.29%   -0.00%     
==========================================
  Files         995      995              
  Lines       44888    44885       -3     
  Branches     9435     9433       -2     
==========================================
- Hits        27960    27957       -3     
  Misses      15479    15479              
  Partials     1449     1449              

☔ 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 added the no changelog PR that doesn't require a changelog entry label Jul 23, 2026
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch 2 times, most recently from 88b25ed to afe2ad9 Compare July 23, 2026 17:06
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-cli-validate-custom-actions-in-workflow-files branch 2 times, most recently from 2e31826 to f859121 Compare July 24, 2026 11:43
@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-eas-cli-validate-custom-actions-in-workflow-files branch from f859121 to 5a62c3b Compare July 24, 2026 11:49
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from de031b5 to 73ece96 Compare July 24, 2026 11:49
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-cli-validate-custom-actions-in-workflow-files branch from 5a62c3b to 62b5bae Compare July 24, 2026 12:31
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from 73ece96 to be7ec02 Compare July 24, 2026 12:31
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-cli-validate-custom-actions-in-workflow-files branch from 62b5bae to 496e454 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-eas-cli-validate-custom-actions-in-workflow-files branch 2 times, most recently from d04c89f to b805c1f Compare July 24, 2026 14:39
@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-eas-cli-validate-custom-actions-in-workflow-files branch from b805c1f to 5113e42 Compare July 24, 2026 14:58
@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-eas-cli-validate-custom-actions-in-workflow-files branch from 5113e42 to 4c6e667 Compare July 24, 2026 15:16
@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

@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.

LGTM.

Comment thread packages/steps/src/BuildStep.ts Outdated
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-cli-validate-custom-actions-in-workflow-files branch from 18d77aa to 9551a61 Compare July 28, 2026 12:58
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch 2 times, most recently from bfe042d to c692851 Compare July 28, 2026 15:30
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-cli-validate-custom-actions-in-workflow-files branch from 9551a61 to 8364018 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-eas-cli-validate-custom-actions-in-workflow-files branch 3 times, most recently from 2f8a515 to ab74d1e Compare July 29, 2026 09:26
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch 2 times, most recently from e693624 to b7cdc4d Compare July 30, 2026 15:09
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-eas-cli-validate-custom-actions-in-workflow-files branch from ab74d1e to adf327f Compare July 30, 2026 15:09
@sswrk
sswrk changed the base branch from szymonswierk/eng-22387-eas-cli-validate-custom-actions-in-workflow-files to graphite-base/4061 July 30, 2026 15:31
@sswrk
sswrk force-pushed the graphite-base/4061 branch from adf327f to 2e8cbb5 Compare July 30, 2026 15:32
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from b7cdc4d to 30c602c Compare July 30, 2026 15:32
@graphite-app
graphite-app Bot changed the base branch from graphite-base/4061 to main July 30, 2026 15:33
@sswrk
sswrk force-pushed the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch from 30c602c to 3b7eed6 Compare July 30, 2026 15:33
@github-actions

Copy link
Copy Markdown

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

@sswrk
sswrk merged commit ee03114 into main Jul 30, 2026
11 checks passed
@sswrk
sswrk deleted the szymonswierk/eng-22387-steps-unify-no-if-gating-policy branch July 30, 2026 15:42
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