Skip to content

fix(check): accept a Data grid 2's own settings without a project - #1574

Open
stagknee wants to merge 1 commit into
mendixlabs:mainfrom
stagknee:fix/check-no-project-widget-keys
Open

stagknee wants to merge 1 commit into
mendixlabs:mainfrom
stagknee:fix/check-no-project-widget-keys

Conversation

@stagknee

@stagknee stagknee commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Part of #1573 (the check half). Please merge this before the describe PR, #1575. Once describe prints expression-typed settings such as rowClass, a no-project check of that output would otherwise report MDL-WIDGET42.

What it fixes

Without a project, check warned that every Data grid 2 setting written by its key "is not recognized and will be silently dropped on write" (MDL-WIDGET07), although exec stores it. For an expression-typed key (rowClass, a column's columnClass) it reported an MDL-WIDGET42 error, so check exited 1.

Cause and fix

DATAGRID has no embedded .def.json (sdk/widgets/definitions holds combobox, gallery, the filters, dropdownsort, image and barcodescanner). Without a project, the keyword resolved to no definition and fell into validateStaticWidgetUnknownProps. validateWidgetExpressionValues then treated every key as a plain-value property.

  • When a datagrid keyword widget and its column children have no definition, the checker now reads the property list of the embedded datagrid.json template. The grid's own keys come from the top level, and a column's keys from the columns item type. That template isn't generated by make sync-all.
  • A declared key (or the <key>Params of a text template) is accepted, and its declared type decides MDL-WIDGET42.
  • An undeclared key still draws MDL-WIDGET07, with a did-you-mean from the template, and the message now says what is true without a project: "not declared by the embedded Data grid 2 definition (11.6.3), so it cannot be verified without a project — it is silently dropped on write unless the installed widget declares it".
  • I didn't add an embedded datagrid.def.json. RefreshWidgetDefinitions skips ids the registry already holds, so it would take precedence over the project's package and change every write.
  • With -p, and for every other widget, nothing changes.
  • The template carries the same 40 grid keys and 21 column keys as the 11.12.5 package (3.4.0), set-equal.

Evidence

  • Tests: validate_widget_embedded_schema_test.go. With the embedded lookup forced off, 7 of 8 fail and list the exact false warnings and errors; the eighth guards that built-in widgets are unchanged. All pass with the fix. Two of the tests derive their keys from the template itself.
  • check over all 911 mdl-examples scripts (main vs this branch): 908 are identical, and the 3 differences are all expected:
    • 956-named-action-slots.mdl and 995-alter-page-set-named-action-slot.mdl lose false MDL-WIDGET07 warnings (onSelectionChange on a datagrid);
    • the new bug-tests/1573-datagrid-by-key-settings-check-no-project.mdl goes from exit 1 (2 errors, 13 warnings) to a pass.
  • Real run: the personalization script without a project gives 6 warnings on v0.27.0 and 0 with the fix. Misspelled keys (configurationStorageTyp, minWidthLimt) still warn, each with a did-you-mean. check -p is unchanged. exec -p of the script creates its pages, and mx check reports 0 errors.
  • Tests and vet: go test ./mdl/executor/ shows the same 28 pre-existing Windows failures as main. go vet and gofmt are 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-go all pass.
  • Also included: a CHANGELOG entry (Fixed), a finding in findings/mdl-executor/, and a note in widget-engine.md.

🤖 Generated with Claude Code

…ndixlabs#1573)

`mxcli check` without `-p` warned, for every setting a Data grid 2 takes by
its own key,

  widget `dgAttr` (datagrid) property `configurationAttribute` is not
  recognized and will be silently dropped on write [MDL-WIDGET07]

although `exec -p` stores it and `check -p` accepts it, and it refused an
Expression-typed one (`rowClass`, a column's `columnClass`) as an MDL-WIDGET42
ERROR, "a plain-value property cannot hold the expression". A script exec takes
therefore failed `make check-mdl` (exit 1 with 2 errors, measured), and so
would the output of `describe page` once it prints such settings.

DATAGRID has no embedded definition: its .def.json is generated from the
project's own package, and an embedded one would take precedence over that
package on every write (RefreshWidgetDefinitions skips a widget id the registry
already holds), so adding one would change the write path to fix a check.
Without a project the keyword resolved to no definition at all and was judged
against the vocabulary of the built-in widgets.

The check now reads the property list of the Data grid 2 template mxcli embeds,
for the grid's own keys and, for a `column` inside one, the item type of
`columns`. A key the template declares (or the `<key>Params` of a text
template) is accepted, and its declared type decides MDL-WIDGET42. The template
is the oldest-supported baseline, so a key it does not declare is still
reported by MDL-WIDGET07, with a did-you-mean from the template's names, but as
what is true without a project: it cannot be verified, and is dropped on write
unless the installed widget declares it. The Data grid 2 template carries the
same 40 grid keys and 21 column keys as the 11.12.5 package. With a project,
and for every other widget, nothing changes.

Co-Authored-By: Claude Sonnet 5.5 <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

  • The PR correctly addresses the issue where mxcli check without a project falsely reported Data grid 2 settings as unrecognized and dropped (MDL-WIDGET07) and refused expression-typed settings (MDL-WIDGET42).
  • The fix uses an embedded template for Data grid 2 (and its columns) when no project definition is available, validating properties against this baseline schema.
  • The solution is scoped precisely: only affects Data grid 2 widgets when no project is present (-p flag omitted), leaving all other widgets and project-based checks unchanged.
  • Comprehensive test coverage includes:
    • Unit tests validating declared keys, expression keys, misspelled keys, and undeclared keys.
    • Integration tests showing 908/911 mdl-examples scripts unchanged (with 3 expected improvements).
    • Real-world verification with the personalization script.
  • Documentation updates (widget-engine.md) clearly explain why Data grid 2 lacks an embedded definition and how the fallback works.
  • Changelog entry accurately describes the fix and references the issue.
  • All linting, vetting, and testing passes as reported.

Recommendation

Approve the PR. The change is minimal, well-tested, and resolves the specific issue without introducing regressions or violating project conventions. Merge before the describe PR (#DESCRIBE_PR) as requested to prevent false MDL-WIDGET42 errors when describing expression-typed Data grid 2 settings.


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

This branch has not been deployed

No deployments
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.

1 participant