fix: skip System.* references in mxcli check --references#523
Conversation
mxcli check --references reports `java action not found:
System.VerifyPassword` (and similar) on any microflow that calls a
Mendix runtime built-in. The validator listed only Java actions found in
the project's MPR; System-module actions like System.VerifyPassword,
System.GenerateRandomString, etc. are runtime-provided and never appear
in the MPR. Studio Pro's `mx check` resolves them against the runtime,
so they pass there — but `mxcli check --references` cannot reach the
runtime and produced false positives.
Skip Java/JavaScript action references whose qualified name starts with
the System module. The same pattern (`isBuiltinModuleEntity`) already
guards entity references in cmd_microflows_create.go and
cmd_nanoflows_create.go.
Reproduction (against any MPR — not specific to copies):
$ mxcli describe -p app.mpr microflow Administration.ChangeMyPassword > /tmp/x.mdl
$ mxcli check /tmp/x.mdl --references -p app.mpr
Reference errors:
statement 1: microflow 'Administration.ChangeMyPassword' has reference errors:
- java action not found: System.VerifyPassword (referenced by call java action)
After this PR: the same check returns "All references valid".
User-module Java actions are still validated — TestValidateMicroflowReferencesReportsMissingUserJavaAction
pins that genuine missing actions still error.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AI Code ReviewCritical IssuesNone found. Moderate IssuesNone found. Minor IssuesNone found. What Looks Good
RecommendationApprove the PR. The fix is correct, well-tested, minimal, and follows existing patterns in the codebase. It resolves the false positives without masking real errors. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
ReviewClean, minimal, approve-worthy. Two minor notes. No blockersThe fix is the right call. Minorm1 — The test sets m2 — func qualifiedNameModule(qn string) string {
if i := strings.Index(qn, "."); i >= 0 {
return qn[:i]
}
return ""
}If a reference somehow arrives without a module prefix (e.g. LGTM |
Follow-up: stronger long-term alternativesMerging this as-is is fine. For context on two longer-term approaches: Near-term: catalog parity via a virtual Java actions listSystem entities are already in the catalog because Adding one would be straightforward — same pattern as Longer-term: MCP-driven metamodel extraction
That path would make |
|
Also relevant: PR #335 ( |
Summary
mxcli check --referencesreportsjava action not found: System.VerifyPassword(and similar) on any microflow that calls a Mendix runtime built-in. The validator listed only Java actions found in the project's MPR; System-module actions are runtime-provided and never appear in the MPR.Studio Pro's
mx checkresolves them against the runtime, so they pass there — butmxcli check --referencescannot reach the runtime and produced false positives on built-in calls (System.VerifyPassword,System.GenerateRandomString,System.SubMicroflow*, etc.).Skip Java/JavaScript action references whose qualified name starts with the
Systemmodule — the same pattern (isBuiltinModuleEntity) already guards entity references incmd_microflows_create.goandcmd_nanoflows_create.go.Reproduction
Any MPR with a microflow that calls a System Java action —
Administration.ChangeMyPasswordis one example, but it affects every project that usesSystem.VerifyPassword, password handling, or other runtime built-ins.After this PR the same check returns
✓ All references valid.Test plan
TestValidateMicroflowReferencesSkipsSystemJavaAction—System.VerifyPasswordreference must not error.TestValidateMicroflowReferencesReportsMissingUserJavaAction— pins that genuine missing user-module Java actions still error (so this skip doesn't mask real typos).go test ./...passes.Administration.ChangeMyPassword: pre-fix → CE0117 reported bymxcli check; post-fix →✓ All references valid. Studio Pro'smx checkwas already happy in both cases (mpr_check_errors=0).🤖 Generated with Claude Code