Repository navigation
Conversation
Adds dangling-entity-ref and wrong-type-entity-ref, from a per-model table of the entity ids each file references (src/entity-refs.ts), as Metabase's deserialization-dependencies read them. The built-in transform tags and common.py need no file.
Walk visualization settings, card parameter and dimension mappings, and action settings as Metabase does; hold a [dashboard, tab] reference to that dashboard's tabs; read only ProseMirror documents; allow-list instance analytics content from a vendored list, and drop common.py.
galdre
force-pushed
the
galdre/lint-parity-api-probes
branch
6 times, most recently
from
November 4, 2026 21:32
7dbe8ca to
625f394
Compare
Contributor
Author
|
Bryan's agent: closing, this work was cancelled. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #51. Adds two lint rules,
dangling-entity-refandwrong-type-entity-ref, so the lint checks references between every entity type, not only transforms, tables and transform tests (Linear VER-30, VER-46).Why, and where the line is
A remote-sync repo must be self-contained: everything a synced item needs must be in a synced collection (Metabase
docs/data-modeling/semantic-layer/remote-sync.md:295-303,447). Metabase enforces that when content is saved, not on import: on import, a reference to an entity the repo doesn't hold falls back to the target instance, and fails with "<Model>'<id>' was not found" when it isn't there (serialization/v2/load.clj:176-184).The rule follows the lint's existing principle (err on the side of what Metabase accepts) with a testable line: an error only when Metabase refuses on a fresh instance, which is what CI imports into. So:
057_update_migrations.yaml:990-994) and instance-analytics content (104 entities, vendored fromresources/instance_analyticsat Metabase714a9e49117invendor/instance-analytics.json, regenerated byscripts/update-instance-analytics.ts). Each allowed id counts only for its own model.mb cileaves them to a real Metabase instance (VER-23, VER-51).How it works
src/entity-refs.tsholds one plain finder per model (ENTITY_REF_FINDERS), each returning{path, entityId, allowedModels}and commented with the Metabaseserdes/dependenciescode it mirrors. The query and visualization-settings walker copies Metabase'smbql-deps(source-card, NanoID source-table, snippet-id, card-id, metric/segment/measure clauses, link and click-behavior targets, visualizer sources). Models: Card, Dashboard (dashcards, series, tabs, parameter mappings), Document (prose-mirror only), Collection, NativeQuerySnippet, Action, DataApp, Timeline, TableUserSettings, Metabot, Segment, Measure, Table, Transform, TransformJob, OsiAiContext. References already covered bydangling-transform-idandtransform-collectionstay with those rules.Validation
bun test: 825 pass (was 799 on Compare transform API refusals with the lint's target rules #51). Unit tests per finder; mutationsdangling-entity-refandwrong-type-entity-refwith snapshots; tests confirmed to fail when the tab check or the legacy MBQL 4 branch is broken.examples/v1: 0 findings. Metabase's own serialization baseline (165 files): 0 findings.main(1,954 files, about 1,100 references checked): 0 findings. Deleting one Collection file in a copy gives 3dangling-entity-ref, as expected.Known gaps
scripts/check-metabase-sources.ts; not done.