Skip to content

Sync ako/mxcli: escape '/' inside folder names in FOLDER paths - #1371

Merged
ako merged 2 commits into
mendixlabs:mainfrom
ako:main
Oct 9, 2026
Merged

ako merged 2 commits into
mendixlabs:mainfrom
ako:main

Conversation

@ako

@ako ako commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Syncs ako/mxcli:main into mendixlabs/mxcli:main: 1 commit since #1366, landed in the fork through ako#1084.

Folders

  • A / inside a folder name is escaped in FOLDER paths (marketplace update --save-edits + exec corrupts constant folder paths containing a literal '/' in the folder name #1367). Studio Pro allows / in a folder name, but folder paths were joined and split on a bare /. A constant in Private - String en/de-cryption > Apis was described as folder 'Private - String en/de-cryption/Apis', and replaying the describe output filed it three folders deep, with exit 0.
    • The new package mdl/folderpath writes a / in a segment as \/ and a \ as \\. Splitting is lenient (a backslash before anything else stays literal), so existing paths keep their meaning.
    • BuildFolderPath, the folder resolvers, the page builder and the project tree all use it. Describers that wrote folder '%s' unquoted now quote it, so the escape and apostrophes both survive

claude and others added 2 commits October 9, 2026 21:15
Studio Pro allows '/' in a folder name, but BuildFolderPath joined names
with a bare '/' and every folder-path walker split on it. A constant in
`Private - String en/de-cryption` > `Apis` was described as
folder 'Private - String en/de-cryption/Apis', and replaying the
--save-edits output with exec filed it three folders deep, exit 0.

New package mdl/folderpath: a '/' in a segment is written `\/`, a '\'
`\\`; Split is lenient (a backslash before anything else stays literal),
so existing paths keep their meaning. BuildFolderPath joins with it,
resolveFolder / findFolderByPath / lookupFolder / the page builder and
the project tree split with it. Describers that wrote `folder '%s'`
unquoted now use mdlQuote, so the escape (and apostrophes) survive both
string rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cj4DQ8PRitHdtF3q8pVVBQ
Fix folder path escaping for names containing slashes
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

AI Code Review

Critical Issues

None found.

Moderate Issues

None found.

Minor Issues

None found.

What Looks Good

  • The PR correctly addresses the core issue: folder names containing '/' were being misinterpreted as path separators during DESCRIBE → exec roundtrips.
  • The solution introduces a dedicated mdl/folderpath package with proper escaping/unescaping logic (\/ for '/', \\ for ''), which is:
    • Applied consistently across all folder path handling (project tree, hierarchy, resolvers, builders)
    • Used in DESCRIBE output via mdlQuote (which handles both escaping and quoting)
    • Backward-compatible (lenient splitting preserves existing paths)
  • Test coverage is excellent:
    • New unit tests for folderpath package
    • Integration test verifying DESCRIBE → exec roundtrip for slash-containing folder names
    • Added MDL example demonstrating the fix
    • Updated documentation with clear example
  • Code changes are focused and minimal:
    • Replaced ad-hoc strings.Split and manual escaping with the new package
    • Updated all folder path consumers (project tree, hierarchy, helpers, builders)
    • No changes to MDL grammar/syntax (purely a runtime fix)
  • The fix follows the project's architectural patterns:
    • New functionality properly encapsulated in its own package
    • Consistent with existing MDL property/value patterns (uses standard quoting)
    • Maintains full-stack consistency (touches all necessary layers)

Recommendation

Approve the PR. The changes are correct, well-tested, and maintain consistency with the project's architecture and conventions. The fix resolves the reported issue without introducing regressions.


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

@ako
ako merged commit a972fa3 into mendixlabs:main Oct 9, 2026
15 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