Skip to content

fix: address merged-PR ako follow-up polish items#469

Open
hjotha wants to merge 1 commit intomendixlabs:mainfrom
hjotha:submit/merged-pr-ako-polish
Open

fix: address merged-PR ako follow-up polish items#469
hjotha wants to merge 1 commit intomendixlabs:mainfrom
hjotha:submit/merged-pr-ako-polish

Conversation

@hjotha
Copy link
Copy Markdown
Contributor

@hjotha hjotha commented May 1, 2026

Batches the remaining polish items ako flagged in reviews of PRs that already merged.

Scope

PR #357 — Java return-type inference

  • Remove the dead case javaactions.ListType: value form from inferGenericJavaActionReturnType. The parser always stores ListType as a pointer.
  • Replace the `exprToString` → strip quotes → strip `$` → look up in varTypes string-mangling with a direct *ast.VariableExpr type assertion. The old form only worked for simple variable references and silently produced garbage keys for any compound expression.
  • Add TestAddJavaAction_EntityReturnRegistersEntityType — the EntityType case was the only return shape without a unit test.

PR #363 — change refresh modifier

  • Restore the CE0032 reference in the addChangeObjectAction comment. Developers searching for the Studio Pro error code no longer hit a dead end.

PR #364 — enum split

  • Collapse the dual return true branches of isTerminalStmt's EnumSplitStmt arm into one return true and expand the comment documenting the intentional divergence from bodyReturns in validate_microflow.go.
  • Add a doc comment on hasExplicitFalseBranchAnchor explaining the AnchorTop → AnchorBottom heuristic.
  • Add TestHasExplicitFalseBranchAnchor covering nil, default right→left, split default bottom→top, authored top→bottom, and both single-sided-customised edge cases.

Validation

  • `make build`
  • `go test ./mdl/executor -run 'TestAddJavaAction_EntityReturn|TestHasExplicitFalseBranchAnchor' -count=1`
  • `make test`
  • `make lint-go`

Related

🤖 Generated with Claude Code

Batches the remaining polish items ako flagged in PRs that already
merged:

- PR mendixlabs#357 (Java return-type inference): remove the dead
  `case javaactions.ListType:` value form, replace the
  exprToString→strip→lookup string-mangling with a direct
  `*ast.VariableExpr` type assertion, and add the missing unit test
  for `*javaactions.EntityType` return registration.

- PR mendixlabs#363 (change refresh modifier): restore the CE0032 reference in
  the `addChangeObjectAction` comment so developers searching for the
  Studio Pro error code find the inference logic.

- PR mendixlabs#364 (enum split): collapse the dual `return true` branches of
  `isTerminalStmt`'s EnumSplitStmt arm into one and expand the comment
  documenting the intentional divergence from `bodyReturns`.

- PR mendixlabs#364 minor: add a doc comment on `hasExplicitFalseBranchAnchor`
  explaining the Top→Bottom heuristic, and add
  TestHasExplicitFalseBranchAnchor covering nil, default, and
  single-sided cases.

Validation: make build, make test, make lint-go.

Related: mendixlabs#463 (walkStatements refactor), mendixlabs#468 (TitleOverride nil).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

AI Code Review

Review Summary

This PR addresses follow-up polish items from three previously merged PRs (#357, #363, #364). It contains:

  1. Comment improvements and clarification in change object action handling
  2. Refactoring of Java return-type inference with improved test coverage
  3. Microflow control flow logic improvements with added tests
  4. New test files for explicit false branch anchor and Java action entity return

Critical Issues

None found.

Moderate Issues

None found.

Minor Issues

  • The PR description mentions "ako flagged in reviews" but doesn't specify who "ako" is - minor documentation clarity issue
  • Some comment lines exceed 80 characters (e.g., in cmd_microflows_builder_actions.go), but this is consistent with existing codebase style

What Looks Good

  • Java return-type inference fix: The replacement of fragile string-mangling with direct type assertion is a significant improvement that fixes silent bugs with compound expressions
  • Test coverage: Added missing test for EntityType return case and comprehensive test for explicit false branch anchor heuristic
  • Code clarity: Improved comments explaining CE0032 behavior and enum split termination logic make the intent clearer
  • Dead code removal: Eliminated unused javaactions.ListType value form case
  • Deterministic logic: The hasExplicitFalseBranchAnchor function now has exhaustive test coverage for all edge cases

Recommendation

Approve - The PR consists of safe, focused improvements that address review feedback from previously merged PRs. Changes are limited to refactoring, documentation, and test coverage without altering functionality. All validation steps passed and the changes follow the project's code quality standards. The PR maintains atomicity by addressing related follow-up items from the same general area (microflow executor). No new MDL syntax is introduced, so full-stack consistency checks are not applicable.


Automated review via OpenRouter (Nemotron Super 120B) — workflow source

hjotha pushed a commit to hjotha/mxcli that referenced this pull request May 1, 2026
The IF-header duplication fix (commit 13d21427, PR mendixlabs#469) was lost
when merging fork/submit/merged-pr-ako-polish into the combined
validation branch — the merge kept the pre-swap emit block that
was supposed to be removed. As a result, every IF with a non-
empty body emitted the @position/@annotation/if … then block
twice, and re-exec failed with "Parse error: missing IF at ';'".

Removed the duplicate emit blocks in both traverseFlow (line ~694)
and traverseFlowUntilMerge (line ~873). Only the post-swap emit
remains, so the negate-and-swap transformation updates the
header before it is written out.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hjotha pushed a commit to hjotha/mxcli that referenced this pull request May 1, 2026
The IF-header duplication fix (commit 13d21427, PR mendixlabs#469) was lost
when merging fork/submit/merged-pr-ako-polish into the combined
validation branch — the merge kept the pre-swap emit block that
was supposed to be removed. As a result, every IF with a non-
empty body emitted the @position/@annotation/if … then block
twice, and re-exec failed with "Parse error: missing IF at ';'".

Removed the duplicate emit blocks in both traverseFlow (line ~694)
and traverseFlowUntilMerge (line ~873). Only the post-swap emit
remains, so the negate-and-swap transformation updates the
header before it is written out.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants