Skip to content

fix(doctor.sh): gate self-test copies the whole model directory, not just .mpr + mprcontents (#127) - #142

Draft
MendixMau wants to merge 1 commit into
masterfrom
fix/doctor-selftest-resources
Draft

MendixMau wants to merge 1 commit into
masterfrom
fix/doctor-selftest-resources

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

What changed and why (one paragraph)

Addresses issue #127 and a second field report of the same shape (a macOS project with a custom theme on Mendix 11.12.4): bin/doctor.sh --gate-selftest copied only the .mpr and mprcontents/ into its scratch directory, so the --target=deploy build it runs there could not resolve widgets, theme and design properties that live in theme/, resources/, widgets/ and javasource/ beside the .mpr. The self-test then reported hundreds to over a thousand Could not find widget errors as a dirty baseline while the real gate, which builds in place, passed with 0 on the same model. The scratch copy is now the whole directory holding the .mpr (project root on a single-tree checkout, app/ on two-tree) minus .git/, deployment/, node_modules/ and .mpr-snapshots/, with the copied size printed. The earlier real-basename fix from #128 is kept (every sibling is copied as itself). mxbuild --target=check was ruled out (nothing in the toolkit has ever used it), a sibling .mpr in the project dir was ruled out (collides with the project's own mprcontents/), and symlinks were ruled out (Git Bash copies through them).

Field evidence

  • Two fixture projects (single-tree, and .mpr under app/) with all four excluded dirs nested at both levels plus mprcontents/, theme/, resources/, widgets/, javasource/, and a stub mxbuild that logs the scratch contents per invocation. bin/doctor.sh --quick --gate-selftest --no-docker with real java and MXBUILD_PATH= the stub: all five resource dirs copied, all four exclusions honoured in both layouts, size note printed, verdict pass (baseline=0 known-bad=1), no leftover scratch dir after either run.
  • check-portability, check-scripts, leak guard, pr-discipline all pass. tests/wave2/test-doctor-gate-selftest.sh (10 cases) and the doctor case in tests/run-tests.sh read in full: none assert the old copy wording; not executed.
  • Not yet done: a run against a real mxbuild on the gate self-test fails on Mendix 11.14.0: StorageMprNameDiscrepancyException + dirty baseline from Atlas widgets #127 project or the macOS custom-theme project to confirm the dirty-baseline count drops to 0. Draft until cited.

Checklist

  • No client data (leak guard clean; projects described, never named)
  • Size cap: 2 files, +56/−8
  • Test tier T1 (fixture projects + stub mxbuild, both layouts)
  • Instrument rules: rules 2 and 3 done; rule 4 (one real field run) pending
  • Routing row: n/a
  • CHANGELOG line in the same commit
  • Bug entries: n/a

🤖 Generated with Claude Code

https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw


Generated by Claude Code

… model directory

The gate self-test's scratch copy previously carried only .mpr + mprcontents/. A
--target=deploy build (the same target the real gate runs, in place, against the
project as it sits on disk) also resolves widget/theme/design-property references
out of theme/, resources/, widgets/ and javasource/ sitting beside the .mpr — a
thin copy reported hundreds to 1000+ false errors as a "dirty baseline" while the
real gate passed with 0 errors on the identical model (two field reports: an Atlas
project on Mendix 11.14.0, and a project with a custom theme on Mendix 11.12.4).

Now copies the whole directory holding the .mpr (dirname "$MPR" — the model's own
root on a single-tree checkout, or app/ on a two-tree one) minus .git/,
deployment/, node_modules/ and .mpr-snapshots/, none of which mxbuild reads, and
prints the copied size (du -sh) so the cost is visible. The existing real-basename
fix (copying every sibling, including the .mpr, as itself) is unchanged.

mxbuild --target=check was ruled out: grepped for it across bin/, project-bin/,
skills/ and bug-logs/ and found no evidence it exists or is used anywhere in this
toolkit — --target=deploy is the only target ever invoked. A sibling .mpr dropped
into the project's own directory was also ruled out: MPR v2 stores an internal
record of the model's basename in mprcontents/, and a second .mpr there would
collide with the real model's own mprcontents/.

Verified against two constructed fixtures (single-tree and .mpr-under-app/) with a
stub mxbuild that logs the scratch directory's contents on every invocation: both
layouts copy in mprcontents/, theme/, resources/, widgets/, javasource/ and the
.mpr itself, exclude all four named directories (including when nested one level
under app/ on the two-tree layout), report the copied size, reach a "pass"
verdict, and leave no scratch directory behind afterward. Not run against a real
mxbuild in this environment.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VJgWP5vEoAsNsJYqCDMGNw
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