Repository navigation
Feat(workflow): name forEach items by a key, with each.key typed at admission - #7468
Merged
Merged
Conversation
briankane
requested review from
FogDong,
Somefive,
anoop2811,
barnettZQG,
chivalryq,
jefree-cat,
jerrinfrancis,
jguionnet,
leejanee,
roguepikachu,
wangyikewxgm and
wonderflow
as code owners
October 15, 2026 11:54
This was referenced Oct 15, 2026
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 36 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7468 +/- ##
=======================================
Coverage 80.12% 80.13%
=======================================
Files 467 467
Lines 48619 48621 +2
=======================================
+ Hits 38958 38963 +5
+ Misses 9658 9655 -3
Partials 3 3
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:
|
briankane
force-pushed
the
feat/foreach-each-key
branch
6 times, most recently
from
October 15, 2026 16:06
8bf4768 to
b36a0a7
Compare
Picks up forEach.key from kubevela/pkg and kubevela/workflow: an Application's looped step can name its items' steps by their values, key: [cluster, namespace] giving deploy-prod-us-shop. - The Application, ApplicationRevision and Workflow CRDs gain the field. - Admission needs no code of its own: the key rules come from the engine's ValidateForEachSteps, which the webhook already runs. - An e2e spec names the items of a source-driven loop by a key. 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>
each.key, the name of a forEach item's pass, is a string to the webhook's typed reads, as each.index is an int. An e2e spec names a keyed loop's ConfigMaps from it. Signed-off-by: Brian Kane <briankane1@gmail.com>
…ch.key Signed-off-by: Brian Kane <briankane1@gmail.com>
Signed-off-by: Brian Kane <briankane1@gmail.com>
briankane
force-pushed
the
feat/foreach-each-key
branch
from
October 15, 2026 17:56
b36a0a7 to
94bc22b
Compare
jerrinfrancis
approved these changes
Oct 16, 2026
3 of 5 tasks
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
Brings
forEach.key(kubevela/pkg#154) andeach.key(kubevela/workflow#273) to an Application's workflow:forEach.key.ValidateForEachSteps, which the webhook already runs.each.keyis a string to the webhook's typed reads, aseach.indexis an int, so$(each.key)into an int parameter is refused at admission rather than at run time.Fixes #
I have:
make reviewableto ensure this PR is ready for review.backport release-x.ylabels to auto-backport this PR if necessary.How has this code been tested
EachReadKindtypeseach.keyas a string and nothing below it.$(each.key)into a string parameter is admitted, into an int parameter refused; a key naming the same path twice, or generating a name another step has, is refused.e2e-source-test): a source-driven loop names its items by a key (apply-c1,apply-c2), and a keyed loop names its ConfigMaps from$(each.key)(key-c1,key-c2). The first ran on k3d before this rebase; both run in this PR's CI.Special notes for your reviewer