Skip to content

fix: skip alias rendering when a step's if condition is false - #6744

Open
ausias-armesto wants to merge 1 commit into
keephq:mainfrom
ausias-armesto:ausias/fix-step-alias-skip-eval-upstream
Open

fix: skip alias rendering when a step's if condition is false#6744
ausias-armesto wants to merge 1 commit into
keephq:mainfrom
ausias-armesto:ausias/fix-step-alias-skip-eval-upstream

Conversation

@ausias-armesto

@ausias-armesto ausias-armesto commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #6743

Summary

Aliases were rendered unconditionally before the if check, so an
alias referencing another (skipped) step's result could raise a
SyntaxError instead of the step being cleanly skipped. This moves
alias rendering to after the if check, once we know the step will
actually run.

Changes

  • keep/step/step.py: alias rendering moved from the top of
    _run_single to after the if check passes.
  • tests/test_steps.py: adds
    test_run_single_if_false_skips_alias_evaluation covering the
    scenario above.

Test plan

  • pytest tests/test_steps.py -k alias

Previously aliases were rendered unconditionally before the if-check,
so an alias referencing another (skipped) step's result could raise a
SyntaxError instead of the step being cleanly skipped. Aliases are now
only rendered after we know the step will actually run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Step alias rendering raises SyntaxError when the step's if condition is false

1 participant