Skip to content

fix: CREATE ODATA CLIENT strips uppercase MICROFLOW keyword prefix (#573)#586

Merged
ako merged 2 commits into
mainfrom
fix/573-odata-microflow-prefix
May 22, 2026
Merged

fix: CREATE ODATA CLIENT strips uppercase MICROFLOW keyword prefix (#573)#586
ako merged 2 commits into
mainfrom
fix/573-odata-microflow-prefix

Conversation

@ako
Copy link
Copy Markdown
Collaborator

@ako ako commented May 22, 2026

Fixes #573.

Summary

  • extractMicroflowRef now strips the microflow keyword prefix case-insensitively. The visitor at mdl/visitor/visitor_odata.go:269 emits uppercase "MICROFLOW " + qn for microflow Module.Name property values, but the executor was only trimming lowercase, so the keyword survived into BSON. Mendix then tried to resolve a microflow whose qualified name was literally "MICROFLOW Module.Name" and failed — exactly the error in the issue screenshot.
  • Adds two failing-first executor tests and a Studio Pro-ready bug-test MDL.
  • Adds a symptom-table entry in .claude/skills/fix-issue.md so the next visitor-emits-uppercase-but-executor-strips-lowercase mismatch gets caught immediately.

Scope

The same extractMicroflowRef helper serves three OData-client codepaths:

  • CREATE ODATA CLIENT (cmd_odata.go:1001-1002)
  • CREATE OR MODIFY ODATA CLIENT update path (cmd_odata.go:913, 916)
  • ALTER ODATA CLIENT SET … (cmd_odata.go:1152, 1154)

All three are fixed by the one-line change.

Test plan

  • TestCreateODataClient_StripsMicroflowPrefix_Issue573 — direct executor test against the proximate failure point.
  • TestCreateODataClient_VisitorRoundtrip_Issue573 — full MDL → visitor → executor pipeline using the user's exact syntax.
  • Both tests fail on main, pass with this change.
  • mdl-examples/bug-tests/573-odata-microflow-prefix.mdl — reproduction script that passes mxcli check; ready to run through mxcli exec against a real project and Studio Pro for confirmation.
  • make test passes.
  • make lint passes.

🤖 Generated with Claude Code

Closes #573.

Visitor emits "MICROFLOW Module.Name" (uppercase) for `microflow X.Y`
property values, but extractMicroflowRef only stripped lowercase "microflow ",
so the prefix survived into BSON. Mendix then tried to resolve a microflow
whose qualified name was literally "MICROFLOW Module.Name" and failed —
matching the user-reported error.

Fix is a case-insensitive prefix strip in extractMicroflowRef. Same code
path serves CREATE, CREATE OR MODIFY, and ALTER ODATA CLIENT.

Tests:
- TestCreateODataClient_StripsMicroflowPrefix_Issue573 — direct executor
  test against the proximate failure point.
- TestCreateODataClient_VisitorRoundtrip_Issue573 — full
  MDL → visitor → executor pipeline with the user's exact syntax.
- mdl-examples/bug-tests/573-odata-microflow-prefix.mdl — reproduction
  script for Studio Pro validation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

AI Code Review

Critical Issues

None found.

Moderate Issues

None found.

Minor Issues

None found.

What Looks Good

  • Bug fix correctness: The case-insensitive prefix strip in extractMicroflowRef correctly addresses the root cause where visitor-emitted uppercase "MICROFLOW " wasn't being stripped by the lowercase-only executor logic.
  • Test coverage:
    • Two new executor tests (direct strip verification + full visitor roundtrip) fail on main and pass with the fix.
    • Added Studio Pro-ready bug-test MDL (573-odata-microflow-prefix.mdl) that reproduces the issue and validates the fix.
    • Symptom table updated in .claude/skills/fix-issue.md to catch similar case-mismatch issues early.
  • Scope adherence: Fixes all three OData-client codepaths (CREATE, CREATE OR MODIFY, ALTER) with a single targeted change.
  • Quality:
    • Minimal, focused change (one function modified).
    • No duplication or overlap with existing functionality.
    • Follows established patterns (uses existing helper function, leverages mock backend for tests).
    • All make test and make lint pass.
  • Process:
    • Failing-first tests demonstrate the fix works.
    • Bug-test MDL is ready for Studio Pro validation.
    • Documentation update (symptom table) improves future maintainability.

Recommendation

Approve. The PR correctly fixes the issue with comprehensive test coverage, minimal code changes, and appropriate documentation updates. No changes needed.


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

@github-actions
Copy link
Copy Markdown

AI Code Review

Critical Issues

None found.

Moderate Issues

None found.

Minor Issues

None found.

What Looks Good

  • Targeted fix: The change correctly addresses the root cause identified in issue Consumed Odata Service - ConfigurationMicroflow and ErrorHandlingMicroflow microlfows not supported #573 - a case mismatch between what the visitor emits (uppercase "MICROFLOW ") and what the executor strips (lowercase "microflow ").
  • Minimal change: The fix is a single-line functional change to extractMicroflowRef plus comprehensive tests, following the principle of making the smallest change necessary.
  • Complete test coverage:
    • Added unit test directly testing the helper function with uppercase input
    • Added integration test verifying the full MDL → visitor → executor pipeline
    • Added bug-test MDL file for manual verification in Studio Pro
    • All tests fail on main and pass with the fix
  • Documentation update: Added symptom table entry to .claude/skills/fix-issue.md to catch similar visitor/executor case-mismatch issues in the future.
  • Atomic scope: The PR focuses solely on fixing Consumed Odata Service - ConfigurationMicroflow and ErrorHandlingMicroflow microlfows not supported #573 without bundling unrelated changes.
  • No syntax changes: Since this is a bug fix in an existing feature (not new MDL syntax), the MDL syntax design checklist items don't apply, which is correct.
  • Full-stack consistency maintained: The fix works within the existing pipeline - no changes needed to grammar, AST, visitor, LSP, or DESCRIBE because the syntax was already correct; only the executor needed adjustment.
  • Quality practices: Uses strings.EqualFold for proper case-insensitive comparison, follows existing code patterns, and maintains deterministic behavior.

Recommendation

Approve. The PR correctly fixes the bug with minimal, focused changes, includes appropriate test coverage at multiple levels, updates preventive documentation, and maintains all project quality standards. The fix resolves the exact issue where Mendix was trying to resolve microflows with literal "MICROFLOW " prefixes in their names. All checks pass and the solution aligns with the project's architecture and contribution guidelines.


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

@ako ako merged commit cd8b529 into main May 22, 2026
7 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.

Consumed Odata Service - ConfigurationMicroflow and ErrorHandlingMicroflow microlfows not supported

1 participant