The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Tier documents and require explicit shared-tier coverage (#82542)
Fraser46541523bc6b
diff --git a/frontend/lint/shared-tiers.mjs b/frontend/lint/shared-tiers.mjsindex ca31106c95f..fdf23574762 100644--- a/frontend/lint/shared-tiers.mjs+++ b/frontend/lint/shared-tiers.mjs@@ -49,8 +49,8 @@ const SHARED_UTILS_LEVELS = [];const SHARED_PLATFORM_LEVELS = [- // P0 — independent peers: the data grid and writeback actions.- ["shared/data-grid", "shared/actions"],+ // P0 — independent peers: the data grid, writeback actions and comments.+ ["shared/data-grid", "shared/actions", "shared/comments"],// P1 — independent peers: chart rendering and database metadata/forms.["shared/visualizations", "shared/databases"],// P2 — independent peers with no edges between them.@@ -59,7 +59,12 @@ const SHARED_PLATFORM_LEVELS = [// DetailViewPage.tsx importing the nav layout constants (#79119 moves them).["shared/querying", "shared/pulse", "shared/detail-view"],// P3 — building blocks over querying, mutually independent.- ["shared/metadata", "shared/parameters", "shared/questions"],+ [+ "shared/metadata",+ "shared/parameters",+ "shared/questions",+ "shared/timelines",+ ],// P4 — the metabot agent, which transforms and nav compose.// metabot keeps its enforceSharedTiers flag for one upward edge,// Metabot.tsx importing Sidebar from the main navbar.@@ -67,8 +72,8 @@ const SHARED_PLATFORM_LEVELS = [];const SHARED_DOMAIN = [- "shared/comments","shared/custom-viz",+ "shared/documents","shared/embedding-ee","shared/metrics-ui","shared/nav",@@ -77,7 +82,6 @@ const SHARED_DOMAIN = ["shared/segments","shared/static-viz","shared/status",- "shared/timelines","shared/transforms","shared/visualizer",];@@ -99,7 +103,7 @@ const levelAllows = (levels, base = []) =>const sharedRules = [// Later rules win, so these must come after the baseline shared/* allow they narrow.- // Edges to untiered modules (common, embedding, documents) fall through to that allow.+ // Edges to untiered shared modules fall through to that allow.{from: SHARED_UTILS,disallow: TIERED_SHARED,@@ -134,4 +138,4 @@ const sharedRules = [},];-export { sharedRules };+export { TIERED_SHARED, sharedRules };diff --git a/frontend/lint/tests/module-boundaries.unit.spec.js b/frontend/lint/tests/module-boundaries.unit.spec.jsindex 8fe6b5a0622..95b77f23d21 100644--- a/frontend/lint/tests/module-boundaries.unit.spec.js+++ b/frontend/lint/tests/module-boundaries.unit.spec.js@@ -3,6 +3,7 @@ import path from "path";import glob from "glob";import { elements } from "../module-boundaries.mjs";+import { TIERED_SHARED } from "../shared-tiers.mjs";const REPO_ROOT = path.resolve(__dirname, "../../..");@@ -22,3 +23,34 @@ describe("module-boundaries elements", () => {expect(stale).toEqual([]);});});++describe("shared tier coverage", () => {+ // A shared module can have multiple element patterns.+ const sharedTypes = new Set(+ elements+ .map(({ type }) => type)+ .filter((type) => type.startsWith("shared/")),+ );++ it("only leaves the existing migration backlog untiered", () => {+ // Only shrink this list: new shared modules must have a tier.+ expect(+ [...sharedTypes].filter((type) => !TIERED_SHARED.includes(type)).sort(),+ ).toEqual([+ "shared/common",+ "shared/data-studio-ui",+ "shared/embedding",+ "shared/embedding-sdk",+ "shared/embedding-sdk-shared",+ "shared/embedding-sdk-window-bridge",+ ]);+ });++ it("assigns each tiered module exactly once", () => {+ expect(TIERED_SHARED.length).toBe(new Set(TIERED_SHARED).size);+ });++ it("only assigns tiers to existing shared modules", () => {+ expect(TIERED_SHARED.filter((type) => !sharedTypes.has(type))).toEqual([]);+ });+});