Skip to content

fix: allow runtime custom step inputs#2005

Merged
yottahmd merged 5 commits intomainfrom
fix/custom-step-validation
Apr 16, 2026
Merged

fix: allow runtime custom step inputs#2005
yottahmd merged 5 commits intomainfrom
fix/custom-step-validation

Conversation

@yottahmd
Copy link
Copy Markdown
Collaborator

@yottahmd yottahmd commented Apr 16, 2026

Summary

  • allow custom step type inputs to use runtime expressions while preserving static DAG validation
  • keep non-string typed inputs conservative by requiring whole-value runtime expressions
  • split deferred custom-step validation helpers into a focused file with unit coverage

Testing

  • go test ./internal/core/spec -count=1
  • go test ./internal/core/spec ./internal/service/frontend/api/v1 ./internal/intg -run 'TestValidateCustomStepInput_DefersRuntimeExpressionLeaves|TestCustomStepTypes|TestUpdateDAGSpec_AllowsCustomStepTypeRuntimeVariableInput' -count=1
  • go test ./internal/service/frontend/api/v1 -count=1

Summary by CodeRabbit

  • New Features

    • Custom step types now accept runtime variable placeholders (e.g., ${COUNT}) in inputs across non-string and string fields; placeholders are preserved at config/load time and expanded at execution.
  • Bug Fixes

    • Validation now defers for inputs that are standalone runtime placeholders, preventing false validation failures when using runtime variables.
  • Tests

    • Added unit, integration, and API tests covering deferred validation, YAML loading with placeholders, and runtime expansion during execution.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6008ea29-53a9-43a7-9644-0ee8503f3912

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds deferred JSON Schema validation for custom step inputs: on strict-validate failure, constructs a relaxed schema that permits whole-string runtime-expression placeholders (e.g., ${COUNT}, $VAR, backtick tokens) and revalidates; if relaxed validation succeeds, input is accepted unchanged.

Changes

Cohort / File(s) Summary
Core validation update
internal/core/spec/step_types.go
Call strict validation first; on failure attempt secondary validation using a relaxed schema that allows runtime-expression placeholders.
Deferred validation implementation
internal/core/spec/step_types_deferred_validation.go
New implementation: regex detection for runtime-expression tokens, schema-cloning and recursive relaxation for object/array/string nodes, and helper canDeferCustomStepInputValue logic to decide deferral eligibility.
Unit tests (deferred validation)
internal/core/spec/step_types_deferred_validation_test.go
New table-driven tests asserting whole-string runtime expressions defer validation across multiple schema types and nested structures; embedded expressions and invalid typed values remain rejected.
Feature tests (YAML/load behavior)
internal/core/spec/step_types_feature_test.go
New feature tests asserting YAML loads with runtime placeholders for non-string-typed inputs when using WithoutEval(), and failing when placeholders are embedded within other text.
Integration tests
internal/intg/step_types_test.go
Added end-to-end tests ensuring runtime-variable inputs expand at execution time for custom step types and templates.
API tests
internal/service/frontend/api/v1/dags_internal_test.go
Added test verifying UpdateDAGSpec accepts spec updates that include custom step types with runtime-variable config values (e.g., count: ${COUNT}) without error.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: allow runtime custom step inputs' clearly and concisely summarizes the main change: enabling runtime expressions in custom step inputs while preserving static validation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/custom-step-validation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yottahmd
Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

✅ Actions performed

Full review triggered.

@yottahmd yottahmd merged commit 8914d0e into main Apr 16, 2026
10 checks passed
@yottahmd yottahmd deleted the fix/custom-step-validation branch April 16, 2026 11:37
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.

1 participant