Skip to content

Fix the 10.24 nightly: version-gate DecimalScale, and guard the doctype corpus against mis-gating - #187

Merged
ako merged 1 commit into
mainfrom
claude/nightly-1024-decimalscale
Aug 19, 2026
Merged

Fix the 10.24 nightly: version-gate DecimalScale, and guard the doctype corpus against mis-gating#187
ako merged 1 commit into
mainfrom
claude/nightly-1024-decimalscale

Conversation

@ako

@ako ako commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Fixes the Mendix 10.24 nightly, which failed on that matrix entry on both engines while passing on every 11.x:

--- FAIL: TestMxCheck_DoctypeScripts/14-project-settings-examples.mdl/legacy
    Execution error: this project does not store the model setting DecimalScale

What was wrong — and what wasn't

14-project-settings-examples.mdl set DecimalScale unconditionally. Measured against blank projects of each version:

model settings stored DecimalScale
10.24 11 absent
11.6.6 12 present

It is the only difference between the two. I executed the other five settings from that statement one at a time against a real 10.24 project — every one is accepted, so DecimalScale alone is at fault.

mxcli's refusal is correct and is unchanged here. Studio Pro will not open a model carrying a property its version does not define, and mxbuild does not catch it. The bug is the ungated example — which is mildly embarrassing, because its own comment three lines above says "Which of these a project stores depends on its Mendix version… An alter naming one this project does not store is refused rather than introducing it."

Splitting it out is required, not cosmetic: the refusal covers the whole statement, so one unsupported setting was taking five portable ones down with it.

The trap, which is now the more valuable half of this PR

My first attempt gated the statement but left its /** */ comment above the directive. That made things worse — the script stopped parsing entirely, and the error was reported at the next statement, 16 lines further down:

line 127:0 mismatched input 'alter' expecting {CREATE, '@'}

which reads like an unrelated syntax error in code nobody touched. Cause: a /** */ block is a documentation comment bound to the statement that follows it. Gate the statement, leave the comment outside the section, and the comment is orphaned:

line 6:0 no viable alternative at input '/**\n * A doc comment with no statement after it.\n */'

-- line comments are free-standing and safe either side of the directive. The doc comment now sits inside the gated section, and the file says why.

New guard

TestDoctypeScriptsParseAfterVersionFiltering filters all 56 doctype scripts for each of the four versions in nightly.yml and asserts the result still parses. It needs no mxbuild, so a mis-gated script fails in seconds on push instead of hours later in a single nightly job — which is how this one was found.

It caught the .test.mdl spec files on its first run (microflow test specs with @test/@expect, a different format that does not parse as MDL even unfiltered); they are excluded, matching what TestMxCheck_DoctypeScripts already does.

Verification

  • The full doctype suite — 59 scripts × both engines — passes on 10.24, where it failed.
  • The changed script passes on 10.24, 11.6.6 and 11.13.0.
  • Control: the pre-fix file still reproduces does not store the model setting DecimalScale on 10.24.
  • Control for the guard: move the doc comment back outside the gate → fails on exactly the 10.24 entry; restore → passes.
  • 76 unit packages green; gofmt -l clean.

Caveat on the gate

11.0+ is chosen because DecimalScale is absent on 10.24 and present on 11.6.6 — I could not pin the exact 11.x minor it arrived in (the mxbuild 11.0 download produced nothing). That is conservative and correct for every version in the matrix; it would only matter if an 11.0–11.5 entry were added later.

Not in this PR


Generated by Claude Code

The nightly failed on the Mendix 10.24 matrix entry, on both engines, in
TestMxCheck_DoctypeScripts:

  Execution error: this project does not store the model setting DecimalScale

14-project-settings-examples.mdl set it unconditionally. Measured against a
blank project of each version: 10.24 stores 11 model settings, 11.6.6 stores
12, and DecimalScale is the only difference. Executing the other five
settings from that statement one at a time on 10.24, each is accepted -- so
DecimalScale alone is at fault, and because the refusal covers the WHOLE
statement it took five portable settings down with it.

mxcli's refusal is correct and is not changed here: Studio Pro will not open
a model carrying a property its version does not define, and mxbuild does not
catch it. The example was simply not version-gated, despite its own comment
three lines above explaining that which settings a project stores depends on
its version.

Also adds TestDoctypeScriptsParseAfterVersionFiltering, which filters every
doctype script for each version in the nightly matrix and asserts the result
still parses. It needs no mxbuild, so a mis-gated script fails in seconds on
push instead of hours later in one nightly job.

Writing that guard found the trap that makes this easy to get wrong, and the
first attempt at this fix walked straight into it: a `/** */` block is a
DOCUMENTATION comment bound to the statement after it. Gating the statement
while leaving its doc comment outside the section orphans the comment, and
the script dies with "no viable alternative at input '/**...'" -- reported at
the NEXT statement, tens of lines further down, so it reads like an unrelated
syntax error in code nobody touched. The comment now sits inside the gated
section; `--` line comments are free-standing and safe either side.

Verified: the full doctype suite (59 scripts, both engines) passes on 10.24,
where it failed before; the changed script passes on 10.24, 11.6.6 and
11.13.0; the control -- the pre-fix file -- still reproduces the reported
error on 10.24; and the new guard, with the doc comment moved back outside
the gate, fails on exactly the 10.24 entry and passes once restored.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013uQvFDd5R4eNqqita59jM8
@ako
ako merged commit f478721 into main Aug 19, 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.

2 participants