Skip to content

feat: preserve change object refresh modifier#363

Open
hjotha wants to merge 1 commit intomendixlabs:mainfrom
hjotha:submit/change-object-refresh-modifier
Open

feat: preserve change object refresh modifier#363
hjotha wants to merge 1 commit intomendixlabs:mainfrom
hjotha:submit/change-object-refresh-modifier

Conversation

@hjotha
Copy link
Copy Markdown
Contributor

@hjotha hjotha commented Apr 27, 2026

Summary

Adds explicit MDL syntax for preserving ChangeObjectAction.RefreshInClient.

Changes

  • Accepts change $Object refresh; and change $Object (...) refresh;.
  • Carries the refresh flag through the AST and builder.
  • Emits refresh when describing change-object actions with RefreshInClient=true.
  • Adds proposal docs, a doctype fixture, quick-reference entry, and skill guidance.

Validation

  • go test ./mdl/visitor -run TestChangeObjectParsesRefresh
  • go test ./mdl/executor -run 'Test(FormatAction_ChangeObject.*Refresh|ChangeObjectBuilderWritesRefreshInClient)'
  • ./bin/mxcli check mdl-examples/doctype-tests/change_refresh_modifier.test.mdl
  • make build
  • make lint-go
  • make test

Closes #345
Part of #332

Mendix change-object actions can have RefreshInClient=true even when they also change members, but MDL had no syntax for that flag. Describing and rebuilding such an action therefore rewrote the flag to false.

The grammar now accepts an optional `refresh` modifier on change-object statements, the AST carries that flag, the formatter emits it for refreshed change actions, and the builder writes it back to ChangeObjectAction.RefreshInClient.

Tests cover parser, formatter, and builder behavior with and without member assignments. The branch also adds a draft proposal, doctype fixture, quick-reference entry, and skill guidance; `mxcli check` on the fixture plus make build, make lint-go, and make test pass locally.
@hjotha hjotha force-pushed the submit/change-object-refresh-modifier branch from 4b12de0 to c1d6a85 Compare April 30, 2026 08:10
@github-actions
Copy link
Copy Markdown

AI Code Review

What Looks Good

The PR implements the change object refresh modifier feature comprehensively and correctly:

  1. Full-stack consistency: All required layers are properly updated:

    • Grammar: MDLParser.g4 updated with REFRESH? option
    • AST: ChangeObjectStmt now includes RefreshInClient bool field
    • Executor: Builder logic updated to handle the flag, formatting functions updated to emit refresh keyword
    • Tests: Added doctest fixture (change_refresh_modifier.test.mdl) and unit tests for builder and formatter
    • Documentation: Updated quick reference, skills documentation, and added proposal document
  2. MDL syntax compliance:

    • Follows standard patterns using existing change verb
    • Reads as clear English: change $Customer refresh;
    • Uses proper qualified names for variables ($Customer)
    • Consistent with existing property format patterns
    • refresh is a clear, non-overloading modifier keyword
    • Diff-friendly implementation (one-line addition for the feature)
  3. Test coverage:

    • Added doctrtest fixture demonstrating both forms
    • Added unit tests for builder serialization and formatter output
    • PR mentions running relevant validation tests
  4. Documentation:

    • Comprehensive proposal document explaining motivation and semantics
    • Updated quick reference with new syntax
    • Added examples to microflow skills documentation

Recommendation

The PR is ready for approval. It correctly implements the feature following all architectural guidelines, includes proper tests and documentation, and maintains consistency with existing MDL patterns. No changes are needed.

Approve


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

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.

Preserve refresh-in-client on change-object actions with member assignments

2 participants