Composite Tools Supports DefaultResults for Skippable Steps#3006
Composite Tools Supports DefaultResults for Skippable Steps#3006
Conversation
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
e4be512 to
d87b79c
Compare
There was a problem hiding this comment.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3006 +/- ##
==========================================
+ Coverage 56.39% 56.50% +0.11%
==========================================
Files 333 335 +2
Lines 33002 33183 +181
==========================================
+ Hits 18612 18751 +139
- Misses 12809 12838 +29
- Partials 1581 1594 +13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
This reverts commit 9855d28.
jhrozek
left a comment
There was a problem hiding this comment.
looks really solid after a first quick read..but the PR is quite big, will have to go over it again tomorrow. Some nits and questions inline.
really nice work!
jhrozek
left a comment
There was a problem hiding this comment.
let's clean the docs in a follow up but otherwise this is clean work, nice!
Signed-off-by: Jeremy Drouillard <jeremy@stacklok.com>
Summary
Implements
defaultResultsfor composite tool workflow steps, allowing skipped steps (due to conditions evaluating to false) or failed steps (withonError.action: continue) to provide fallback output values for downstream step templates.Closes #2989
Large PR Justification
A significant chunk of this PR is tests and documentation. If reviewers would like, I could split the validation logic into a separate PR or I could remove it entirely, because validation is a nice-to-have.
Changes
Schema & Configuration
defaultResultsfield toWorkflowStepCRD type (map[string]runtime.RawExtension)Validation
workflow_validation.godefaultResults[field]is specified when:onError.action: continue)VirtualMCPServerandVirtualMCPCompositeToolDefinitionwebhooksTemplate Reference Extraction
pkg/templates/references.gowith AST-based template parsingtext/template/parsepackage for reliable reference extraction.steps.<stepID>.output.<field>references for validationRuntime
RecordStepSkippedto accept and storedefaultResultsas step outputhandleToolStepFailureto setdefaultResultswhen continuing on errorDocumentation
virtualmcpcompositetooldefinition-guide.mdcomposite-tools-quick-reference.mdadvanced-workflow-patterns.mdExample Usage
Testing
TestVMCPServer_DefaultResults_ConditionalSkip- verifies defaults used when condition=falseTestVMCPServer_DefaultResults_ContinueOnError- verifies defaults used when step fails with continuevirtualmcp_composite_defaultresults_test.go- operator integration with conditional stepNotes
During implementation, discovered that nested access into backend tool results (e.g.,
{{.steps.step1.output.message}}) doesn't work as documented - backend tool calls store text content under a"text"key. See #2994 for more details.