Repository navigation
Feat(workflow): loops in the studio, the run view and pipelines (23/23) - #978
Merged
Merged
Conversation
briankane
requested review from
FogDong,
anoop2811,
barnettZQG,
chivalryq,
roguepikachu,
wangyikewxgm,
wonderflow and
yangsoon
as code owners
October 15, 2026 02:01
This was referenced Oct 15, 2026
briankane
force-pushed
the
stack/23-workflow-loops
branch
from
October 15, 2026 13:03
aa3862c to
cf33c7e
Compare
forEach landed in pkg and workflow after both moved to Go 1.27.1 and k8s 0.37 (controller-runtime 0.25), so the loop work needs that line. Pins: pkg a754071 and workflow 53204a3 (which add forEach keys, pkg#154 and workflow#273), and prism dba7491 (its own 1.27 bump, which no longer needs the apiserver-runtime replace). The replace block is the union of ours and KubeVela master's. KubeVela itself stays on the fork commit the stack pins, which carries the expression APIs this branch's features use. controller-runtime 0.25 adds Apply to client.Client and to the sub-resource clients. Both of our wrappers embed the client, so Apply went straight through: the project query guard, meant to be read-only, could write with it, and the impersonating auth client sent it as VelaUX rather than the user. Both now override Apply, with tests. CI and the Dockerfiles build with Go 1.27.1; envtest runs k8s 1.37.0; staticcheck is v0.8.2 and golangci-lint v2.14.0 (the config was already in the v2 format), installed with go install. ReverseProxy.Director is deprecated from Go 1.26; its four uses stay, marked, since Rewrite changes which headers reach the upstream. golangci-lint v2 reads the v2 config velaux already had, so it reports what 1.60 never could: 43 findings, about half already on main. Repeated strings become constants named for what they are (datastore sort and filter keys, the permission templates' scopes, effect, actions and View permission names, the definition type and data-flow kind "source"), or the existing ones where they mean the same (the expression type kinds). Three WriteString(fmt.Sprintf) become fmt.Fprintf, and DefinitionBase's deprecation notice gets its own paragraph; VelaUX still fills that field for clients that read it, marked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D7yvmmhDdoDfVVe4b5EpYY Signed-off-by: Brian Kane <briankane1@gmail.com>
A workflow step or step group with forEach runs once per item. VelaUX dropped forEach when it copied steps, and drew a loop's passes as nothing it knew. It now keeps forEach everywhere, records each loop's items and passes on the run, and edits and shows loops. - Sync, deploy and the API keep forEach. A loop's run record starts with no sub-steps and takes its passes from the status, each with the item it ran for (the engine's IterationIndex) and the alias of the body step it repeats; the items, and a keyed loop's labels, come from the workflow context. A pipeline run carries the same per loop, and no longer pads a loop with its body. - Studio: Loop in the Add menu, Repeat on a card, a loop strip with its items and mode. The wizard gains an Items stage: a list typed in (a table or YAML), an earlier step's output, or, in an application, a $( ) expression; one item at a time or all at once; and a key naming each item, checked against typed-in items as the controller checks it. Steps in a loop are offered each.item, each.index, each.key and each item key as inputs. - Run view: a loop is a stacked card, a segment per item when closed and a lane per item when open, labelled by the item or its key, with Approve on a waiting pass. The same on the pipeline run page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D7yvmmhDdoDfVVe4b5EpYY Signed-off-by: Brian Kane <briankane1@gmail.com>
briankane
force-pushed
the
stack/23-workflow-loops
branch
from
October 16, 2026 16:42
cf33c7e to
8144d61
Compare
jerrinfrancis
approved these changes
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.
Stack 23/23 · after #977 · last in the stack
Description of your changes
A workflow step or step group with
forEachruns once per item (kubevela/pkg#142, kubevela/workflow#261, kubevela/kubevela#7396), and can name each item by a key (kubevela/pkg#154, kubevela/workflow#273, kubevela/kubevela#7468). VelaUX droppedforEachwhen it copied steps, so a loop synced from the cluster ran once on the next deploy, and a run's passes matched nothing it knew. VelaUX now keeps loops, records them, and lets you build and follow them.Run view. A loop is a stacked card: a segment per item when closed, a lane per item when open, labelled by the item, with Approve on a waiting pass.
Studio. Loop in the Add menu (greyed inside a group, since only a top-level step takes
forEach), Repeat on a card's tools, and a strip on each loop with its items and mode.The wizard gains an Items stage: a list typed in (a table, or YAML), an earlier step's output, or, in an application, a
$( )expression; one item at a time or all at once. Steps in a loop are offeredeach.item,each.indexand each item key as inputs.A key names each item's passes after values in the item (
rollout-us-east-deployrather thanrollout-0-deploy). The Items stage takes one, offered from the list's columns and checked as the controller checks it; a keyed loop's lanes are labelled by their keys.Pipelines get the same studio and run view.
Server side:
forEach, includingkey.IterationIndex) and the alias of the body step it repeats (IterationTemplate). The items, and a keyed loop's labels, are the ones the engine stored in the workflow context. Before this, a looped group's record kept its body once, never started.loopson the run and its status), and no longer pads a loop with its body steps.Fixes #
I have:
yarn lintto ensure the frontend changes are ready for review.make reviewableto ensure the server changes are ready for review.backport release-x.ylabels to auto-backport this PR if necessary.How has this code been tested
forEachround trips through sync, deploy and the API; loop run records (inline steps and a referenced Workflow); pipeline run loops and the padding fix. Each bug had a failing test first.withLoops, loop edits and item validation (299 tests).?step=), the same keyed byname(passesrollout-us-east-*, labels in the record,keykept through sync), and a pipeline looping a step over three items all at once, on a workflow controller from workflow main.Special notes for your reviewer
--max-for-each-items, which a cluster can raise.