fix(catalog): bump the schema version for the two columns that skipped it - #1230
Conversation
…d it permissions_data.DefaultMemberAccessRights (mendixlabs#1179) and activities_data.UseRequestTimeout / TimeoutExpression (mendixlabs#1181) were both added without bumping CatalogSchemaVersion. CREATE TABLE IF NOT EXISTS does not add a column to a table that already exists, and the cache is only dropped when the recorded version differs, so a cached full-mode catalog keeps the old shape. The activity pair was rescued by accident: 14 landed after mendixlabs#1181 for an unrelated reason and rebuilt those caches. The permissions column landed after 14 and is still live — PermissionsFor and Permissions both SELECT it, so on any catalog built at 14 every permissions query fails with "no such column: DefaultMemberAccessRights". mxcli lint surfaces that through QueryErrors; mxcli report builds the same LintContext, never calls it, and scores the project with every entity access rule silently finding nothing. Also adds the builder test the activities columns should have shipped with, asserting both the toggle and the expression reach the row. It covers the case that matters: unticking "Use a timeout" in Studio Pro leaves the seconds in place, so a rule keyed on the expression rather than the toggle passes a call that has no timeout.
AI Code ReviewReview SummaryThis PR fixes a critical schema versioning oversight where two columns ( What Looks Good
Minor Issues
Checklist Compliance
RecommendationApprove. The PR correctly resolves the schema versioning bug with minimal, well-documented changes and adequate test coverage. The minor test gap for the permissions column is acceptable given the version bump mechanism is validated via the activity test, and the permissions column fix follows the same pattern. No blocking issues remain. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Reply to post @ako's review on #1181
Thanks — the blocker is right, and chasing it turned up something worse.
The version bump. Correct on all counts: CREATE TABLE IF NOT EXISTS never adds a column, the guard only drops on a version difference, and the precedent (6291374) is exact. I should have followed it.
But #1181 is no longer the live case. Timeline in UTC on 25 Sept:
09:30 #1181 merged — UseRequestTimeout / TimeoutExpression, no bump
11:14 33fb2a9 bumps 12 → 14 (unrelated, mappings)
13:53 #1179 merged — DefaultMemberAccessRights, no bump
So the activity columns were rescued by accident: 14 landed after them and rebuilt those caches. The permissions column landed after 14 and is still broken on main today. PermissionsFor and Permissions bothSELECT COALESCE(DefaultMemberAccessRights, ''), so on any catalog built at 14 every permissions query fails with no such column. That takes out SEC001, SEC007 and CONV006/007/008 — and your point about mxcli report applies with more force there, since entity access rules do produce findings on a normal project, so the silent score divergence you couldn't demonstrate is reachable.
Both of those columns were mine, so this is one bug I shipped twice.
PR # bumps to 15 and documents both entries honestly — the accidental rescue included, so the next person reading the history doesn't conclude the gap never existed.
The test. Agreed the catalog-column precedent is the applicable one. Addedbuilder_rest_timeout_test.go, modelled on builder_audit_members_test.go: one ticked activity, one unticked, asserting both the toggle and the expression reach activities_data. It covers the case that motivated the columns — unticking "Use a timeout" leaves the seconds in place, so a rule keyed on the expression rather than the toggle passes a call that has no timeout.
Minor 1. You're right and I'll correct the record rather than the code — the case is applied in two loops; the rules loop passes constants, and a web-service activity in a rule is CE0009 anyway. Thanks for checking before flagging.
Minor 2. UseRequestTimeOut mirrors the storage name and the rest follow Go and Starlark idiom. The struct comment says so, but you're right that grepping one spelling misses the other. Happy to take a suggestion if you'd rather have one spelling throughout.
Minor 3. Agreed on its own issue — I'll open one formicroflow_write.go:1594 and microflow_webservice_write.go:154. Now that the value is read, wiring it through is a one-liner, but it changes what an MDL-authored REST call writes by default and that needs Mendix's own default settled first.
On reproducing. The relative-vs-absolute -p detail is a good catch and worth having in writing — a cache that silently rebuilds turns this class of bug invisible. Noted for the schema-version test I'd like to add next: a guard that fails when a column is added to createTables without the constant moving, so this stops depending on review catching it.
See task progress for longer tasks.
0001-fix-catalog-bump-the-schema-version-for-the-two-colu.patchreview-reply.md
mxclietest-main