fix: traverse through unpaired ExclusiveMerge in describe (#281)#285
Open
hjotha wants to merge 1 commit intomendixlabs:mainfrom
Open
fix: traverse through unpaired ExclusiveMerge in describe (#281)#285hjotha wants to merge 1 commit intomendixlabs:mainfrom
hjotha wants to merge 1 commit intomendixlabs:mainfrom
Conversation
AI Code ReviewCritical Issues
Moderate Issues
Minor Issues
What Looks Good
RecommendationApprove. The PR correctly resolves issue #281 with minimal, well-tested changes that follow the project's architectural patterns. No modifications to MDL syntax or full-stack pipeline are needed since this is an executor-level bug fix in an existing command. The test coverage is appropriate for the scope, and all validation passes. Ready for merge. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
…#281) `DESCRIBE MICROFLOW` silently truncated its output at an `ExclusiveMerge` that wasn't the matching end-of-branch point of an `ExclusiveSplit`. Every activity downstream of the merge was dropped. The issue reporter hit this on a manual retry-loop pattern — setup activities feed into a merge, the merge feeds into a REST call, and a back-edge from a "change retry count + delay" branch loops back into the same merge — so the describer stopped right after the retry-count declaration and never emitted the REST call, the retry branch, or anything else on the diagram. Root cause: `traverseFlow` returned unconditionally on every `ExclusiveMerge`, assuming the node was going to be handled by the split's branch traversal. That's true when the merge closes an IF/ELSE, but not when it's a pure junction for converging flows outside of a split. Fix: early-return only when the merge appears as a value in `splitMergeMap` (i.e. it is the paired end point of some split). When the merge isn't paired, walk through it as a pass-through — the same behaviour `traverseFlowUntilMerge` already has for intermediate merges. Added three focused regression tests: - `TestTraverseFlow_UnpairedMergeIsPassThrough` — the minimal case; also asserts no stray `end if;` is emitted. - `TestTraverseFlow_PairedMergeStillClosesIfElse` — regression guard for normal IF/ELSE; still closes with exactly one `end if;`. - `TestTraverseFlow_ManualRetryLoopPatternEmitsEverything` — closer shape of the user's microflow (setup → merge → call → decide → change → delay → merge loop back), verifies every activity shows up. Fixes mendixlabs#281. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0906e41 to
7d3b4d8
Compare
AI Code ReviewCritical Issues
Moderate Issues
Minor Issues
What Looks Good
RecommendationApprove. The PR is ready for merge. It resolves issue #281 with a targeted fix, robust test coverage, and no regressions. No changes are needed. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
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.
Fixes #281.
Summary
DESCRIBE MICROFLOWsilently truncated its output at anExclusiveMergethat wasn't the matching end-of-branch point of anExclusiveSplit. Every activity downstream of the merge was dropped — in the reporter's case, that was the REST CALL, the retry-decision split, and the retry branch.Root cause
traverseFlowinmdl/executor/cmd_microflows_show_helpers.goreturned unconditionally on everyExclusiveMerge, assuming the node would be handled by the matching split's branch traversal:That's correct when the merge closes an IF/ELSE block, but not when it's a pure junction — e.g. the manual retry-loop pattern from issue #281 where a back-edge from "change retry count + delay" routes back into a merge that sits between the setup activities and the REST call. That merge isn't a value in
splitMergeMap(no split points at it as its end-of-branch), so skipping it drops everything after.Fix
Early-return only when the merge is paired with a split in
splitMergeMap. Otherwise walk through it as pass-through, following its outgoing flow — the same behaviourtraverseFlowUntilMergealready has for intermediate merges (line 348-354 of the same file, predating this PR).A small
isMergePairedWithSplithelper does the lookup.Tests
Three focused regression tests in
cmd_microflows_unpaired_merge_test.go:TestTraverseFlow_UnpairedMergeIsPassThrough— minimal repro (start → act1 → merge → act2 → end, emptysplitMergeMap): asserts both activities appear in the output and no strayend if;is emitted.TestTraverseFlow_PairedMergeStillClosesIfElse— regression guard: an IF/ELSE still closes with exactly oneend if;, neither zero nor duplicated.TestTraverseFlow_ManualRetryLoopPatternEmitsEverything— closer shape of the user's microflow (start → setup → merge → call → decide → [retry branch] → change → delay → merge), verifies every activity shows up in describe output.Validation
go test ./...passesgo test -race ./mdl/executor/passesgo build -tags integration ./...builds cleanThe three new tests each fail on
origin/mainwith the expected "activity dropped" symptom and pass after the fix.Test plan
end if;go test ./...clean-raceclean🤖 Generated with Claude Code