fix: validate workflow steps after environment substitution - #97
Shubham-Padkonde wants to merge 2 commits into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughWorkflow parsing now substitutes environment variables in each raw step before validating it. Tests cover validation of substituted names and commands, a substituted ChangesWorkflow step substitution and validation
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The reviewed workflow changes have no identified merge-blocking issue. Normal checks remain appropriate. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Workflow variables can now select operations and failure behavior. Allowed-command checks and credential requirements remain, but the trust level of variables supplied to workflows is not established. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Pull Request
Description
Workflow steps are currently validated before environment variables are expanded. This lets invalid final names through: a literal
fetchstep and a${STEP_NAME}step are accepted even whenSTEP_NAME=fetch. At runtime their outputs share the sameStepContextkey. An empty expanded name is also accepted, while valid variable-basedcommandandon_errorvalues are rejected prematurely.Substitute environment variables before applying structural validation and duplicate-name checks. Deferred
${steps.*}references retain their existing behavior.Five regression cases fail before the change and pass afterward. The complete suite passes on Windows/Python 3.13: 188 passed, 3 skipped. Ruff 0.5.5 (the project's declared version) and
git diff --checkpass for the changed files.The four new test functions now include docstrings explaining the validation invariants. After this documentation update, the complete suite again passed: 188 passed, 3 skipped. The run used Python's pytest module with a workspace temporary directory; Ruff 0.5.5 and
git diff --checkpassed for the changed files.Related Issues
No separate issue is linked.
Type of change
Checklist:
poetry run pytest- not run; the equivalent Python module invocation is reported above.poetry run ruff check- not run; Ruff 0.5.5 was invoked directly for the changed Python files.Prepared with Codex assistance. The personal self-review checkbox remains for the author to complete.
Summary by CodeRabbit