fix(runtime): substitute null for skipped steps in composite output.from - #165
Merged
Merged
Conversation
A composite output.from like '{"a":${steps.x},"b":${steps.y}}' now
substitutes null for references to skipped steps instead of discarding
the entire aggregate. Bare references still degrade to the step summary.
Signed-off-by: Leo Shi <scyda@outlook.com>
Contributor
Merging this PR will improve performance by 13.53%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | small |
193.6 µs | 166.2 µs | +16.5% |
| ⚡ | large |
2.4 ms | 2.1 ms | +15% |
| ⚡ | BenchmarkFindCatalogCommand |
8.7 µs | 7.5 µs | +14.92% |
| ⚡ | BenchmarkCatalogJSON |
2.9 ms | 2.6 ms | +13.1% |
| ⚡ | large |
1.6 ms | 1.4 ms | +12.76% |
| ⚡ | small |
144 µs | 127.8 µs | +12.68% |
| ⚡ | json-small |
254.6 µs | 226.8 µs | +12.22% |
| ⚡ | yaml |
5 ms | 4.5 ms | +11.13% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing scydas:fix/workflow-output-null-skipped (5152660) with main (b3b0fae)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
output.fromlike'{"a":${steps.x},"b":${steps.y}}'nowsubstitutes
nullfor references to skipped steps instead of discardingthe entire aggregate into the step summary.
output.from: ${steps.x}) still degrade to the stepsummary when the step is skipped — no behavior change there.
Motivation: a pod-diagnosis workflow aggregates get-pod + list-events +
list-pods-by-node. The node-neighbors step is guarded with
when(Pendingpods have no
spec.nodeName). Without this fix, skipping neighbors discardsthe pod and events data too — the user gets only
{"status":"ok","steps":[...]}.Test plan
TestBuildWorkflows_CompositeOutputNullsSkippedStep— composite output with one skipped step producesnullfor that key, preserves othersTestBuildWorkflows_BareOutputFromSkippedStepStillDegrades— bare reference still returns step summary (regression guard)go test ./...)