-
Notifications
You must be signed in to change notification settings - Fork 0
chore: apply 51278a70d remediations onto origin/main #854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,40 @@ | |
| } | ||
| }); | ||
|
|
||
| it("keeps public redirect handlers in product routes and API handlers in the API section", () => { | ||
| const data = collectSiteMapData(); | ||
| const productSection = siteMap.slice( | ||
| siteMap.indexOf("## Main product routes"), | ||
| siteMap.indexOf("## Mode/query routes"), | ||
| ); | ||
| const apiSection = siteMap.slice(siteMap.indexOf("## API routes"), siteMap.indexOf("## Redirects")); | ||
| const expectedProductHandlers = [ | ||
| ["/applications", "src/app/applications/route.ts", "/tools"], | ||
| [ | ||
| "/differentials/presentations", | ||
| "src/app/differentials/presentations/route.ts", | ||
| "/differentials/presentations/[workflow-slug]", | ||
| ], | ||
| ["/medications", "src/app/medications/route.ts", "/?mode=prescribing"], | ||
| ] as const; | ||
|
|
||
| expect(data.apiRoutes.every((route) => route.route === "/api" || route.route.startsWith("/api/"))).toBe(true); | ||
| expect(data.publicRouteHandlers.some((route) => route.route === "/auth/callback")).toBe(true); | ||
| expect(data.publicRouteHandlers).toContainEqual({ | ||
| route: "/icons/[variant]", | ||
| file: "src/app/icons/[variant]/route.tsx", | ||
| }); | ||
| expect(apiSection).not.toContain("`/icons/[variant]`"); | ||
|
|
||
| for (const [route, file, target] of expectedProductHandlers) { | ||
| expect(data.publicRouteHandlers).toContainEqual({ route, file }); | ||
| expect(data.apiRoutes).not.toContainEqual({ route, file }); | ||
| expect(data.redirects).toContainEqual({ route, file, target }); | ||
| expect(productSection).toContain(`\`${route}\``); | ||
|
Check failure on line 129 in tests/site-map.test.ts
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The generated site map lists Useful? React with 👍 / 👎. |
||
| expect(apiSection).not.toContain(`\`${route}\``); | ||
| } | ||
| }); | ||
|
|
||
| it("documents seeded dynamic slugs", () => { | ||
| for (const service of serviceRecords) expectDocumentedRoute(service.slug); | ||
| for (const form of formRecords) expectDocumentedRoute(form.slug); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1219,7 +1219,7 @@ | |
| const migrationFiles = readdirSync(migrationDirectoryUrl) | ||
| .filter((fileName) => /^\d+_.+\.sql$/.test(fileName)) | ||
| .sort(); | ||
| expect(migrationFiles.at(-1)).toBe("20260717173000_reassert_supabase_admin_default_privileges.sql"); | ||
| expect(migrationFiles.at(-1)).toBe("20260717161000_assert_supabase_admin_default_privileges.sql"); | ||
|
Check failure on line 1222 in tests/supabase-schema.test.ts
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The migrations directory still sorts to Useful? React with 👍 / 👎. |
||
| }); | ||
|
|
||
| it("bootstraps safe default ACLs before fresh local and preview migration replay", () => { | ||
|
|
@@ -1371,7 +1371,7 @@ | |
| ); | ||
| expect(cleanup).toContain("metadata->>'registry_record_id' = old.id::text"); | ||
| expect(cleanup).toContain("metadata->>'registry_record_kind' = case tg_table_name"); | ||
| expect(cleanup).toMatch(/when 'clinical_registry_records' then (pg_catalog\.)?to_jsonb\((old|OLD)\)->>'kind'/); | ||
| expect(cleanup).toContain("when 'clinical_registry_records' then to_jsonb(old)->>'kind'"); | ||
|
Check failure on line 1374 in tests/supabase-schema.test.ts
|
||
| expect(cleanup).toContain("when 'medication_records' then 'medication'"); | ||
| expect(cleanup).toContain("when 'differential_records' then 'differential'"); | ||
| expect(cleanup).not.toContain("registry_record_id')::uuid"); | ||
|
|
@@ -1395,14 +1395,8 @@ | |
| expect(corrector).toContain("lower(canonical) % tok"); | ||
| expect(corrector).toContain("word % tok"); | ||
| expect(corrector).toContain("limit 32"); | ||
| expect(corrector).toContain("min_sim real default 0.45"); | ||
| if (corrector.includes("set pg_trgm.similarity_threshold = 0.3")) { | ||
| expect(corrector).toContain("set pg_trgm.similarity_threshold = 0.3"); | ||
| } | ||
| expect(corrector).toContain("best_sim >= min_sim"); | ||
| if (corrector.includes("min_sim is null or min_sim < 0.3 or min_sim > 1")) { | ||
| expect(corrector).toContain("min_sim is null or min_sim < 0.3 or min_sim > 1"); | ||
| } | ||
| expect(corrector).toContain("set pg_trgm.similarity_threshold = 0.3"); | ||
|
Check failure on line 1398 in tests/supabase-schema.test.ts
|
||
| expect(corrector).toContain("min_sim is null or min_sim < 0.3 or min_sim > 1"); | ||
| expect(corrector).not.toContain("array_agg(distinct term)"); | ||
| expect(corrector).not.toContain("unnest(vocab)"); | ||
| expect(sql).toContain("rag_aliases_canonical_trgm_idx"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the manifest hash to
e93fe90c…, but the normalized hash of the checked-insupabase/schema.sqlis still302a9ece…;scripts/check-drift.tsexplicitly fails fast when these differ. In any environment that runs the Supabase drift gate, this stale manifest blocks the check before live drift is compared, and the snapshot also omits objects still created by current migrations such as the registry projection and title-word artifacts. Regeneratesupabase/drift-manifest.jsonfrom the current schema.Useful? React with 👍 / 👎.