Repository navigation
Feat: name forEach items by a key - #154
Merged
Merged
Conversation
ForEach gains an optional key: paths into each item whose values, joined with "-", replace the index in the names of the item's steps (deploy-prod-us-shop rather than deploy-0). A composite key is a list of paths. The engine checks that each value is a string or an integer and that the joined keys are unique; the schema bounds the list at one to eight paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014vkPtmKeCEZo2EL7QWCMhH Signed-off-by: Brian Kane <briankane1@gmail.com>
briankane
requested review from
FogDong,
Somefive,
anoop2811,
jerrinfrancis,
jguionnet and
roguepikachu
as code owners
October 15, 2026 11:54
This was referenced Oct 15, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #154 +/- ##
==========================================
- Coverage 92.58% 92.49% -0.09%
==========================================
Files 115 115
Lines 6930 6930
==========================================
- Hits 6416 6410 -6
- Misses 514 520 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jerrinfrancis
approved these changes
Oct 15, 2026
This was referenced Oct 16, 2026
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.
Description of your changes
Adds an optional
keytoForEach, so a loop's steps can be named by each item's values rather than its position.keykey: [cluster, namespace]deploydeploy-0deploy-prod-us-shoprollout, sub-stepverifyrollout-0-verifyrollout-prod-us-shop-verifykeyis a list of paths into each item, the same dotted syntax asinputs[].from. One field is still a list (key: [name]), so the CRD and the docs have one shape.-. The engine checks each part is a string or an integer, none is missing, the joined key uses step-name characters and is unique in the loop; the schema bounds the list at one to eight paths.This is the API half. The engine is kubevela/workflow#273 and the Application support kubevela/kubevela#7468.
How has this code been tested
key, its omission when unset, and deepcopy independence.Special notes for your reviewer
Merge order: this PR first, then kubevela/workflow#273, then kubevela/kubevela#7468. The other two carry a temporary
replaceonto this branch until this merges.Summary by cubic
Adds an optional
keytoForEachso loop steps are named by each item's values instead of its position. Withkey: [cluster, namespace]over items like{cluster: prod-us, namespace: shop}, a stepdeploybecomesdeploy-prod-us-shopinstead ofdeploy-0; the Workflow CRD is regenerated.keytakes one to eight dotted paths into each item; values must be strings or integers, be present, and be unique after joining with-.kubevela/workflow) and Application (kubevela/kubevela) support land in follow-up PRs, so this PR must merge first.Written for commit 2a2c76e. Summary will update on new commits.