fix: stop nested splits at parent merge joins#456
fix: stop nested splits at parent merge joins#456hjotha wants to merge 5 commits intomendixlabs:mainfrom
Conversation
Symptom: all open PRs against main failed the shared build-and-test job in make test-integration, even when their local build/test/lint validation passed. The failures reproduced on origin/main, so they were baseline CI instability rather than PR-specific regressions. Root cause: TestWatcherDebounce could allow stale timer callbacks to send an extra message under slow scheduling, nanoflow integration fixtures used MDL syntax that no longer matched the grammar, and the doctype mx-check harness did not classify known page/nanoflow showcase consistency errors as expected limitations. Fix: guard watcher debounce callbacks with a generation counter, tighten the watcher burst test, update nanoflow fixtures to current MDL syntax, and extend the known consistency-error allowlist for showcase-only limitations. Tests: make build Tests: go test ./cmd/mxcli/tui -run TestWatcherDebounce -count=20 -v Tests: ./bin/mxcli check mdl-examples/doctype-tests/02b-nanoflow-examples.mdl Tests: go test -tags integration -count=1 -timeout 30m ./mdl/executor -run 'TestRoundtripNanoflow_(Loop|EnumParameter|Annotations)|TestMxCheck_DoctypeScripts/02b-nanoflow-examples.mdl|TestMxCheck_DoctypeScripts/03-page-examples.mdl' -v Tests: make test Tests: make lint-go Tests: make test-integration
Symptom: describe could treat a nested split's downstream common tail as the nested merge while the parent branch was supposed to stop at an earlier merge. The emitted MDL moved shared continuation into an else branch, which could leave return-valued microflows with a path lacking a return. Root cause: nested traversal trusted the precomputed split merge even when that join was reachable only after the parent merge. The empty-then swap also ran against that over-wide join. Fix: resolve nested split merges against the parent merge when the computed join is downstream, and only apply the empty-then swap when the resolved nested merge is the active parent merge. Tests: added synthetic regression coverage for downstream-vs-local nested merge resolution and ran make build && make test.
ac3c2fc to
4631ba9
Compare
|
CI stabilization note: merged #412 into this branch so it uses the same integration-CI baseline as the rest of the active PR set. |
Symptom: CI failed in TestMxCheck_DoctypeScripts/empty_java_action_argument.mdl because a Java action declared as RETURNS Void was written as an entity return type named .void, and Studio Pro reported CE1613. Root cause: the generic data-type visitor treats bare qualified names as entity/enumeration references. Java action return types reused that generic path, so the explicit Void spelling became a qualified name instead of ast.TypeVoid. Fix: add a Java-action return-type wrapper that maps unqualified Void to ast.TypeVoid while leaving generic data-type parsing unchanged for parameters and attributes. Tests: added visitor coverage for explicit RETURNS Void; verified mxcli check for the doctype fixture and the targeted integration subtest that failed in GitHub Actions.
AI Code ReviewWe are given a pull request that is focused on fixing an issue related to nested split joins and parent merge joins in microflows. The changes in the PR are:
Now, we must review this PR against the provided checklist. Since the PR is about a bug fix (as indicated by the title and the summary) and not about adding new MDL syntax, we focus on the relevant parts of the checklist. Let's break down the checklist items that are relevant: Overlap & duplication
The changes are in:
The main fix is in We must check if there is any duplication of existing code. The new functions MDL syntax design
Full-stack consistency
Test coverage
We should check if the new tests are adequate and if the changes to the doctype test file are justified. Security & robustness
Scope & atomicity
The PR description says:
The nanoflow examples cleanup does not seem to be related to the bug fix. This might be a violation of the scope and atomicity principle (each PR should do one thing). However, note that the PR also updated the roundtrip nanoflow test to reflect the changes in the example. So the cleanup of the nanoflow examples might be necessary to make the tests pass? But the bug fix is in microflows, not nanoflows. Let's look at the changes in the nanoflow examples: the original file was 86 lines and now it's 22 lines. It seems to be a cleanup to remove outdated or redundant examples. This is a refactoring of the test data. Since the PR is titled as a fix and the nanoflow cleanup is not mentioned in the summary, it might be better to split it. However, the maintainers might have considered it as part of the same effort. Given the instructions, we are to flag if the PR description needs "and" between unrelated items. The description has three items, all related to the microflow fix. The nanoflow cleanup is not mentioned. Therefore, we should consider the nanoflow cleanup as an unrelated change and flag it. But note: the PR also includes changes to the Java action visitor. This is also unrelated to the microflow fix. Let's list the changes by topic: A. TUI watcher debounce fix (watcher.go and watcher_test.go) The PR summary only mentions the microflow fix (items A, B, and D are related to the microflow fix? Actually, A is about the TUI watcher, which is unrelated to microflows). The TUI watcher change is about fixing a debounce issue in the TUI (terminal UI) when watching files. This is unrelated to the microflow fix. The Java action change is also unrelated. Therefore, this PR contains multiple unrelated changes:
This violates the scope and atomicity principle. However, note that the PR is labeled as a fix and the title is about nested splits. The maintainers might have grouped multiple small fixes together. We must decide: is it acceptable to have multiple unrelated fixes in one PR? According to the checklist:
The description does not mention the TUI watcher, the nanoflow cleanup, or the Java action fix. It only mentions the microflow fix. Therefore, we should request that the unrelated changes be split into separate PRs. But note: the nanoflow examples cleanup and the roundtrip nanoflow test adjustment might be necessary because the microflow fix changed the behavior of the microflow executor, which in turn affected the nanoflow tests? Actually, the nanoflow examples are doctype tests, and the roundtrip nanoflow test is a separate test. However, the changes to the nanoflow examples are a rewrite of the example file, which is not caused by the microflow fix. Given the above, we have: Critical Issues: Moderate Issues: Minor Issues: What Looks Good: Recommendation: We request changes to split the PR into multiple PRs, each addressing a single concern: However, note that the roundtrip test adjustments are tied to the changes in the examples and the microflow fix. We might need to adjust the plan. Alternatively, if the maintainers consider these changes as part of a single effort (which they are not, according to the description), we might allow it but note that it's not ideal. Given the strictness of the checklist, we should flag the scope issue. Since the PR description only talks about the microflow fix, we consider the other changes as out of scope. Therefore, we request changes to remove the unrelated changes and focus only on the microflow fix. But note: the nanoflow examples cleanup and the Java action change are also fixes? They might be independent. Let's check the nanoflow examples: the original file had a lot of commented out sections and example nanoflows that were not being used? The new version is much shorter and focuses on a minimal set. This might be intentional to reduce noise. However, without more context, we cannot be sure. Given the instructions, we are to review against the checklist. The checklist says: The description does not mention the TUI watcher, the nanoflow examples, or the Java action. So we flag it. We also note that the microflow fix is the main topic and the other changes are not justified in the description. Therefore, we request that the author splits the PR. However, if we are to review the PR as is, we must note the following: Since we are allowed to skip sections that are not applicable, and the main fix is in scope, we might still approve if we ignore the out-of-scope changes? But the checklist requires us to check scope. We decide to flag the scope issue as a moderate issue and request changes to split the PR. However, note that the PR might be small enough that the maintainers are okay with it. But the checklist is clear. Let's look at the number of files changed: 9 files. This is a bit large for a single fix. We will structure our review as: Recommendation: Request changes to split the PR into multiple PRs, each with a single concern. But note: the author might have intended the nanoflow examples cleanup to be part of the microflow fix because the microflow fix changed the way nanoflows are processed? Actually, the microflow fix is in the microflow executor, and the nanoflow examples are for nanoflows. They are unrelated. We stick to the scope issue. However, note that the PR also includes changes to the roundtrip doctype test and roundtrip nanoflow test. These are necessary to update the expected output due to the changes in the examples and the microflow fix. Therefore, if we split: This is a lot of splitting, but it follows the principle. However, note that the microflow fix might have caused changes in the roundtrip tests for microflows? We don't see any changes to the roundtrip microflow test in this PR. Given the time, we will flag the scope issue and request that the author splits the PR. But note: the PR is from a contributor and we are to be helpful. We will write: However, note that the nanoflow examples cleanup and the Java action fix might be considered as minor improvements that are acceptable to bundle? But the checklist says to split if the description needs "and" between unrelated items. The description does not mention any of these, so we flag it. We also note that the TUI watcher change is not related to the Mendix model manipulation at all, so it is definitely out of scope for a PR that is described as a fix for nested splits. Therefore, we request changes. If the author does not want to split, we might still accept if we consider that the TUI watcher fix and the Java action fix are trivial and the nanoflow examples cleanup is a refactoring that improves the test suite. But the checklist is strict. We decide to follow the checklist strictly. Final decision: Request changes to split the PR. However, note that the PR Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Closes #455.
Summary
Validation
make buildmake test