Repository navigation
fix(check): resolve the pages and flows a navigation or menu document names - #1570
Merged
Merged
Conversation
… names (mendixlabs#1569) A navigation profile points at documents in six places: the home page (and one per user role), a home flow, the login page, the not-found page and every menu item at any depth. A standalone menu document carries the same menu items. Nothing resolved any of them, so `check -p` said "Check passed!", `exec` wrote the profile, and only `mx check` objected (CE1613 "The selected page ... no longer exists.", once for the home page and once per menu item). CREATE OR REPLACE NAVIGATION rewrites the whole profile, and the menu builder stores a target by name and never fails on it. check -p now reports each unresolved target with the profile or menu document, the menu item path and the missing name, using the lookups every other page, microflow, nanoflow and entity reference is resolved with. exec runs the same check in the handler before it reads or writes anything, so `exec --no-check` is covered too. A menu document stored as excluded only warns. A target the script creates resolves. One created further down also resolves in a run that rolls back (plain exec, check), as a call to a flow created further down does (mendixlabs#1405): upstream accepts a navigation written before its pages and mx check reports 0 errors for it, so refusing it would break a working script. exec --continue-on-error, the REPL and -c cannot roll back and refuse it, from validateForwardDefRefs. Measured on a Mendix 11.12.5 app: 4 x CE1613 before for the reported script, refused by check -p and exec after, and a valid navigation (existing pages, a Marketplace-module page, a page created in the same script) still passes check and exec with 0 errors from mx check. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
AI Code ReviewCritical IssuesNone found. Moderate IssuesNone found. Minor IssuesNone found. What Looks Good
RecommendationThe pull request fully addresses issue #1569 by adding validation for navigation and menu targets before they are written to the model. It is thoroughly tested, properly integrated, and follows established project patterns. The fix ensures that Approve the pull request. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
ako
pushed a commit
to ako/mxcli
that referenced
this pull request
Oct 19, 2026
mendixlabs#1570 makes exec refuse a navigation target it cannot find, and the doctype example named the login page Administration.login. The page is Administration.Login, as everywhere else in the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiMsnXa9crge2qnSk9S7Zn
ako
pushed a commit
to ako/mxcli
that referenced
this pull request
Oct 19, 2026
mendixlabs#1570 resolved the login page like the home and not-found pages. The sign-in page may be the theme's static login.html rather than a page document, so a login page the project does not have is not a dangling reference, and mx check accepts it: the doctype navigation example names Administration.login, which the test project does not have, and builds clean. The check refused it. The login page is no longer a target. A new test pairs a login page outside the project (accepted) with a missing not-found page (still refused) as its control, and the "login page" case leaves the every-kind table. The navigation example goes back to main's version (undoing b43f1d7 and 2f9876b), so it now also covers a login page outside the project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiMsnXa9crge2qnSk9S7Zn
ako
added a commit
to ako/mxcli
that referenced
this pull request
Oct 19, 2026
Integrate wave 1 of the upstream PRs (mendixlabs/mxcli mendixlabs#1574 mendixlabs#1575 mendixlabs#1572 mendixlabs#1570 mendixlabs#1563 mendixlabs#1561 mendixlabs#1568 mendixlabs#1566 #1368), with review follow-ups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiMsnXa9crge2qnSk9S7Zn
ako
pushed a commit
that referenced
this pull request
Oct 20, 2026
…check Review note on #1570: the len(known) == 0 guard reads like a gap. It is the price of not turning a failed read into a false "not found". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QiMsnXa9crge2qnSk9S7Zn
ako
added a commit
that referenced
this pull request
Oct 20, 2026
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.
Closes #1569.
What it fixes
A navigation profile, or a
create menudocument, whose home page, role home page, login or not-found page, or menu-item page, microflow or nanoflow doesn't exist passedcheck -pand was written byexec. Onlymx checkreported it (CE1613).How
navigationTargets(new,validate_navigation_targets.go) lists every target of anAlterNavigationStmtorCreateMenuStmt:It reads both syntaxes:
Page/Microflowon an item when noActionis set.sign outandopen linkhave no target.Resolution uses the same lookups as the existing
show page/call microflowchecks, plus the script's own definitions, with the same wording ("page not found: X").check -pruns it invalidateProgramWithWarnings, soexec's pre-flight gets it too. The handlers (execAlterNavigation,execCreateMenu) also run it first, before anything is read or written, soexec --no-checkis covered and a stated menu is never half-replaced. Only the clauses the statement states are checked, which fits the Navigation: an undefined glyph kills mxbuild with no error file, a partial create or modify navigation resets the menu #1522 rule that an omitted clause keeps its stored value.A target the script creates further down follows the rule from Describe emits catalog order; exec and check refuse forward and cross-module references, so mutual recursion cannot be created #1405 for flow calls.
exec, andcheck), it resolves. That shape works onmaintoday:execstores it by name andmx checkreports 0 errors.exec --continue-on-error, the REPL and-crefuse it up front ("references page X before it is created … this run cannot be rolled back"). That is new behaviour for those modes only.When a backend returns an empty listing for a document kind, that kind is not checked, as in
validateForwardDefRefs.Also included: the
check-syntaxskill'sreferences-resolved.md, a CHANGELOG entry (Fixed), a finding infindings/mdl-executor/, andmdl-examples/bug-tests/1569-navigation-target-not-found.mdl. The latter is a positive script; the negative cases need a project, so they're in the Go tests.Evidence
Tests: 25 tests and subtests in
validate_navigation_targets_test.go, covering:--no-check, and forward references per run mode.Control run: against
main, 9 tests fail and 4 controls pass (existing targets, a target created earlier, a valid navigation written, a navigation written before its page). All pass with the fix.Real run (Mendix 11.12.5 scratch app):
check -pexecmx check: 4 × CE1613mdl 1form)mx check: 3 × CE1613mx check0 errorsmx check0 errorsWindows:
go test ./mdl/executor/shows the same 28 pre-existing failures asmain(the sorted lists are identical).go vetandgofmtare clean.Linux (
golang:1.26.6-bookworm, ANTLR 4.13.2):make grammar build test check-mdl check-findings check-conformance check-migration-reference lint-goall pass, on the branch before its rebase onto Sync ako/mxcli: Business Events channel identity, describe/write round-trip fixes, more check coverage #1564. After the rebase there were no conflicts;go vetis clean and the navigation and menu executor tests pass.Not covered
syncentities in an offline profile's block are entity references, and I haven't verified them againstmx check, because a native profile can't be created from MDL.🤖 Generated with Claude Code