Repository navigation
fix(syntax): add a rename topic so RENAME is discoverable (mendixlabs/mxcli#1318) - #1009
Merged
Merged
Conversation
…#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
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.
mxcli syntax renameprinted "Unknown topic: rename" although RENAMEMICROFLOW/PAGE/ENTITY/... parse, run, and are documented by
mxcli help rename. An agent consultingsyntaxconcluded MDL could notrename a microflow and rebuilt it by hand.
renametopic: every RENAME target, DRY RUN, RENAME MODULE, whatthe reference rewrite covers (exact/prefix qualified-name strings, not
names inside expressions), the ALTER forms for members, and the
mxcli renameCLI form with the types it lacks (JAVA ACTION, WORKFLOW).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