Skip to content

fix(syntax): add a rename topic so RENAME is discoverable (mendixlabs/mxcli#1318) - #1009

Merged
ako merged 4 commits into
mainfrom
claude/mxcli-issue-1318-dmzmxt
Oct 7, 2026
Merged

ako merged 4 commits into
mainfrom
claude/mxcli-issue-1318-dmzmxt

Conversation

@ako

@ako ako commented Oct 7, 2026

Copy link
Copy Markdown
Owner

mxcli syntax rename printed "Unknown topic: rename" although RENAME
MICROFLOW/PAGE/ENTITY/... parse, run, and are documented by
mxcli help rename. An agent consulting syntax concluded MDL could not
rename a microflow and rebuilt it by hand.

  • New rename topic: every RENAME target, DRY RUN, RENAME MODULE, what
    the reference rewrite covers (exact/prefix qualified-name strings, not
    names inside expressions), the ALTER forms for members, and the
    mxcli rename CLI form with the types it lacks (JAVA ACTION, WORKFLOW).
  • see_also to it from microflow, page, domain-model.entity and move.
  • rename_topic_test.go reads the renameTarget rule from MDLParser.g4 and
    requires every alternative in the topic, so a new target cannot ship
    undocumented.

Control: with the topic reverted the built binary prints
"Unknown topic: rename" and TestSyntaxRenameTopic fails; dropping the
RENAME WORKFLOW line fails the grammar guard.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01YRKF4gDAitr4oNz6DrtBaz

claude and others added 4 commits October 6, 2026 19:10
…#1318)

`mxcli syntax rename` printed "Unknown topic: rename" although RENAME
MICROFLOW/PAGE/ENTITY/... parse, run, and are documented by
`mxcli help rename`. An agent consulting `syntax` concluded MDL could not
rename a microflow and rebuilt it by hand.

- New `rename` topic: every RENAME target, DRY RUN, RENAME MODULE, what
  the reference rewrite covers (exact/prefix qualified-name strings, not
  names inside expressions), the ALTER forms for members, and the
  `mxcli rename` CLI form with the types it lacks (JAVA ACTION, WORKFLOW).
- see_also to it from microflow, page, domain-model.entity and move.
- rename_topic_test.go reads the renameTarget rule from MDLParser.g4 and
  requires every alternative in the topic, so a new target cannot ship
  undocumented.

Control: with the topic reverted the built binary prints
"Unknown topic: rename" and TestSyntaxRenameTopic fails; dropping the
RENAME WORKFLOW line fails the grammar guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YRKF4gDAitr4oNz6DrtBaz
The subcommand offered eight of the ten targets RENAME accepts: JAVA
ACTION and WORKFLOW were reachable only from MDL, because the subcommand
kept its own switch of types and nothing tied it to the grammar
(follow-up to mendixlabs#1318).

- One table maps the type argument to the RENAME keyword; java-action
  also accepts java_action / javaaction.
- cmd_rename_test.go reads renameTarget from MDLParser.g4 and requires
  every target to be reachable and to parse to the RENAME it names.
- Brain anchors are rewritten for Java actions and workflows too.
- Help text, `mxcli syntax rename` and CHANGELOG updated.

Control: with the table holding only the old eight types, the new tests
fail with "unknown type: java-action" / "unknown type: workflow".
Run on an 11.14 project: both renames, with and without --dry-run,
re-point the calling microflow / parent workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YRKF4gDAitr4oNz6DrtBaz
Renaming M.JA_Old to JA_New moved javasource/m/actions/JA_Old.java to
JA_New.java and left `public class JA_Old`, its constructor and
toString's "JA_Old" inside. javac:

  class JA_Old is public, should be declared in a file named JA_Old.java

`mxcli docker build` still reported BUILD SUCCEEDED, because mxbuild
regenerates the stub in its own copy; the file on disk is what
`run --local --watch` hot reload and IDEs compile.

RenameJavaSourceFile now rewrites those three places, and only those,
via javaactions.RenameSource. The oracle is mxbuild itself: run in place
on a renamed action with an extra import, extra code and user code that
mention the old name, it changed exactly those three lines and kept the
rest byte-for-byte, CRLF included. That pair is the new golden
(testdata/mxbuild/JA_Renamed*).

Control, on a fresh 11.14.0 app: unfixed binary -> javac error above on
the renamed file; fixed -> javac exit 0, docker build BUILD SUCCEEDED.
The backend test fails against the old os.Rename-only code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YRKF4gDAitr4oNz6DrtBaz
@ako
ako merged commit 2c33e0d into main Oct 7, 2026
28 checks passed
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