Skip to content

feat: add db quality gate#1107

Draft
SebastianSchuetze wants to merge 1 commit into
mainfrom
feature/db-quality-gate
Draft

feat: add db quality gate#1107
SebastianSchuetze wants to merge 1 commit into
mainfrom
feature/db-quality-gate

Conversation

@SebastianSchuetze
Copy link
Copy Markdown
Contributor

Adds a stable DB Quality gate so migration safety is branch-protected without blocking unrelated changes.

What changed

  • Added a new DB Quality workflow with an always-running db-quality-gate job for branch protection.
  • Reused and extended .github/scripts/ci/detect-migration-diff.sh so PR Validation and DB Quality share the same DB change detection.
  • Added an advisory migration risk scanner with unit coverage for destructive and compatibility-sensitive SQL patterns.
  • Documented expand/backfill/switch/contract migration flow and production-data guardrails.
  • Added migration-local agent rules and command safety prompts for destructive Payload database commands.
  • Fixed two Next page prop type mismatches exposed by pnpm check.

Validation

  • pnpm format
  • pnpm check
  • PAYLOAD_SECRET=dev-secret pnpm build
  • pnpm docs:check
  • pnpm ai:slop-check
  • pnpm vitest tests/unit/scripts/migration-risk-scan.test.ts tests/unit/app/frontend/home.page.test.ts tests/unit/app/frontend/admin/login/page.test.ts --run
  • Direct detector checks for workflow_dispatch and pull_request

Local actionlint was not available in this worktree; the existing Workflow Security workflow runs actionlint and zizmor on workflow changes.

Development

Closes #1106

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report for Storybook Tests

Status Category Percentage Covered / Total
🔵 Lines 73.46% (🎯 10%) 2337 / 3181
🔵 Statements 71.53% (🎯 10%) 2518 / 3520
🔵 Functions 76.85% (🎯 10%) 684 / 890
🔵 Branches 59.84% (🎯 10%) 1629 / 2722
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Unchanged Files
src/components/atoms/accordion.tsx 100% 100% 100% 100%
src/components/atoms/alert.tsx 100% 80% 100% 100%
src/components/atoms/avatar.tsx 100% 80% 100% 100%
src/components/atoms/button.tsx 100% 87.5% 100% 100%
src/components/atoms/card.tsx 100% 80% 100% 100%
src/components/atoms/carousel.tsx 76.62% 51.06% 93.33% 76.62% 36, 56, 72-86, 96, 185, 226
src/components/atoms/checkbox.tsx 100% 100% 100% 100%
src/components/atoms/combobox.tsx 75% 77.77% 75% 71.42% 70-71
src/components/atoms/command.tsx 100% 100% 100% 100%
src/components/atoms/dialog.tsx 100% 100% 100% 100%
src/components/atoms/dropdown-menu.tsx 80.76% 58.33% 50% 94.44% 19-37, 40-52, 91-111, 114-133, 160-161
src/components/atoms/input.tsx 100% 80% 100% 100%
src/components/atoms/label.tsx 100% 100% 100% 100%
src/components/atoms/pagination.tsx 100% 100% 100% 100%
src/components/atoms/popover.tsx 100% 100% 100% 100%
src/components/atoms/select.tsx 100% 100% 100% 100%
src/components/atoms/separator.tsx 100% 100% 100% 100%
src/components/atoms/slider.tsx 94.73% 54.16% 80% 94.44% 61
src/components/atoms/tabs.tsx 100% 100% 100% 100%
src/components/atoms/textarea.tsx 100% 100% 100% 100%
src/components/atoms/verification-badge.tsx 100% 71.42% 100% 100%
src/components/atoms/FallbackImage/index.tsx 100% 88.88% 100% 100%
src/components/atoms/Heading/index.tsx 100% 87.5% 100% 100%
src/components/atoms/PreviewBadge/index.tsx 100% 100% 100% 100%
src/components/molecules/Breadcrumb/index.tsx 100% 100% 100% 100%
src/components/molecules/CheckboxGroup/index.tsx 90% 70% 100% 100% 37
src/components/molecules/CheckboxWithLabel/index.tsx 63.63% 50% 75% 77.77% 28, 33-34
src/components/molecules/ClinicDetail/DoctorPreviewListItem.tsx 100% 100% 100% 100%
src/components/molecules/ClinicDetail/HeroQualitySummary.tsx 100% 76.47% 100% 100%
src/components/molecules/ClinicDetail/index.ts 0% 0% 0% 0%
src/components/molecules/ClinicSearchBar/index.tsx 42.85% 100% 33.33% 42.85% 38, 57-106
src/components/molecules/Container/index.tsx 100% 66.66% 100% 100%
src/components/molecules/ImmersiveVideoHero/index.tsx 27.77% 43.33% 28.57% 31.25% 111-160, 353-363
src/components/molecules/ImmersiveVideoHero/logic.ts 78.16% 72.09% 84% 80.95% 11, 24, 40, 99-100, 107, 116, 129, 161, 165, 169, 175-176, 184-209, 230, 235
src/components/molecules/LanguageSwitcher/index.tsx 0% 0% 0% 0% 1-37
src/components/molecules/Link/index.tsx 90.9% 90% 100% 100% 32
src/components/molecules/LocationLine/index.tsx 100% 85.71% 100% 100%
src/components/molecules/Logo/Logo.tsx 100% 100% 100% 100%
src/components/molecules/Media/index.tsx 100% 100% 100% 100%
src/components/molecules/Media/types.ts 0% 0% 0% 0%
src/components/molecules/Media/ImageMedia/index.tsx 100% 93.75% 100% 100%
src/components/molecules/Media/VideoMedia/index.tsx 90.9% 66.66% 100% 100% 22
src/components/molecules/PageRange/index.tsx 85.71% 80.76% 100% 100% 32, 35
src/components/molecules/Pagination/index.tsx 66.66% 50% 37.5% 73.68% 28, 32, 49-89
src/components/molecules/PostActionBar/index.tsx 100% 60% 100% 100%
src/components/molecules/PriceSummary/index.tsx 75% 50% 100% 100% 19
src/components/molecules/RatingFilter/index.tsx 90.9% 83.33% 100% 90.9% 30
src/components/molecules/RatingSummary/index.tsx 100% 100% 100% 100%
src/components/molecules/ScrollReveal/index.tsx 90.9% 60.86% 90% 98% 36, 39, 57, 69, 121
src/components/molecules/SectionBackground/SectionBackgroundParallax.client.tsx 87.5% 74.07% 87.5% 90.56% 40, 52-53, 65, 91-96, 123-124
src/components/molecules/SectionBackground/index.tsx 26.56% 34.37% 100% 24.19% 53-59, 65-152
src/components/molecules/SectionHeading/index.tsx 100% 83.33% 100% 100%
src/components/molecules/SocialLink/index.tsx 100% 90% 100% 100%
src/components/molecules/SortControl/index.tsx 100% 80% 100% 100%
src/components/molecules/TagList/index.tsx 100% 100% 100% 100%
src/components/molecules/WaitTime/index.tsx 100% 100% 100% 100%
src/components/organisms/AdminBar/index.tsx 81.25% 50% 50% 81.25% 69-71
src/components/organisms/AdminBranding/AdminAccountAvatar.tsx 0% 0% 0% 0% 5-168
src/components/organisms/AdminBranding/AdminLoginLogo.tsx 0% 100% 0% 0% 5-24
src/components/organisms/AdminBranding/AdminNavIcon.tsx 0% 100% 0% 0% 5-20
src/components/organisms/AdminBranding/AdminThemeProvider.tsx 0% 100% 0% 0% 7-72
src/components/organisms/AdminBranding/index.ts 0% 0% 0% 0%
src/components/organisms/Auth/ClinicRegistrationForm.tsx 100% 100% 100% 100%
src/components/organisms/Auth/FirstAdminRegistrationForm.tsx 100% 100% 100% 100%
src/components/organisms/Auth/LoginForm.tsx 86.36% 66.66% 88.23% 88.52% 35, 82-84, 97-100, 155-165
src/components/organisms/Auth/PatientRegistrationForm.tsx 100% 100% 100% 100%
src/components/organisms/Auth/RegistrationForm.tsx 100% 90.47% 100% 100%
src/components/organisms/Auth/types/loginTypes.ts 0% 0% 0% 0%
src/components/organisms/Banner/index.tsx 100% 100% 100% 100%
src/components/organisms/Blog/BlogCard/Enhanced.tsx 100% 87.87% 100% 100%
src/components/organisms/Blog/BlogCard/Overlay.tsx 100% 73.33% 100% 100%
src/components/organisms/Blog/BlogCard/Overview.tsx 100% 87.5% 100% 100%
src/components/organisms/Blog/BlogCard/Simple.tsx 100% 62.5% 100% 100%
src/components/organisms/Blog/BlogCard/index.tsx 100% 100% 100% 100%
src/components/organisms/Blog/BlogCardCollection/index.tsx 100% 91.3% 100% 100%
src/components/organisms/Blog/BlogHero/index.tsx 100% 100% 100% 100%
src/components/organisms/CallToAction/index.tsx 100% 92.3% 100% 100%
src/components/organisms/ClinicDetail/BeforeAfterCaseGallerySection.tsx 54.05% 39.62% 73.91% 54.41% 113-117, 124-127, 134-135, 141-145, 151-171, 217, 285-292
src/components/organisms/ClinicDetail/ClinicAppointmentSection.tsx 76.92% 100% 72.72% 76.92% 121-132, 180
src/components/organisms/ClinicDetail/ClinicLocationSection.tsx 87.87% 80% 90.9% 90.62% 82-85, 108, 200-201
src/components/organisms/ClinicDetail/FurtherTreatmentsSection.tsx 100% 76.92% 100% 100%
src/components/organisms/ClinicDetail/HeroOverviewSection.tsx 100% 100% 100% 100%
src/components/organisms/ClinicDetail/index.ts 0% 0% 0% 0%
src/components/organisms/ClinicDetail/types.ts 0% 0% 0% 0%
src/components/organisms/CollectionArchive/index.tsx 83.33% 70% 100% 83.33% 44
src/components/organisms/Content/index.tsx 100% 88.46% 100% 100%
src/components/organisms/CookieConsent/CookieConsentBanner.client.tsx 100% 50% 100% 100%
src/components/organisms/CookieConsent/CookieConsentDialog.client.tsx 100% 66.66% 100% 100%
src/components/organisms/CookieConsent/CookieConsentLauncher.client.tsx 100% 100% 100% 100%
src/components/organisms/CookieConsent/CookieConsentManager.client.tsx 40% 37.5% 16.66% 40% 26, 35-60
src/components/organisms/CookieConsent/useCookieConsentController.ts 78.12% 63.15% 92.3% 75% 62-76
src/components/organisms/DeveloperDashboard/index.tsx 27.77% 7.14% 25% 33.33% 19, 23-29, 72-75
src/components/organisms/DeveloperDashboard/Seeding/SeedingCard.tsx 5.01% 0% 0% 5.32% 29-42, 46, 50, 54, 65-102, 112-117, 122-140, 145-165, 169-179, 184-188, 193-198, 206-573
src/components/organisms/DeveloperDashboard/Seeding/SeedingCardView.tsx 82.78% 75.97% 81.81% 89.07% 45-56, 63-65, 69-85, 126, 127, 129, 135, 136, 148, 150, 155, 164, 644
src/components/organisms/DeveloperDashboard/Seeding/seedJobSummaries.ts 86.45% 78.04% 96.55% 90.14% 24, 27-29, 48, 51, 53, 65, 73, 81
src/components/organisms/Doctors/DoctorCard.tsx 100% 64.1% 100% 100%
src/components/organisms/Doctors/RelatedDoctorSection.client.tsx 86.66% 70% 90.9% 92.59% 23, 50, 67, 73
src/components/organisms/Doctors/RelatedDoctorSection.tsx 100% 100% 100% 100%
src/components/organisms/Doctors/index.ts 0% 0% 0% 0%
src/components/organisms/Doctors/types.ts 0% 0% 0% 0%
src/components/organisms/FAQ/index.tsx 100% 100% 100% 100%
src/components/organisms/Form/index.tsx 92.85% 75% 100% 92.85% 112
src/components/organisms/Heroes/FeatureHero/index.tsx 100% 92.85% 100% 100%
src/components/organisms/Heroes/LandingHero/LandingHeroSearchBar.client.tsx 25% 0% 50% 25% 34-46
src/components/organisms/Heroes/LandingHero/index.tsx 100% 100% 100% 100%
src/components/organisms/Heroes/PostHero/index.tsx 100% 92.85% 100% 100%
src/components/organisms/Landing/LandingCategories.shared.ts 97.56% 66.66% 100% 100% 109
src/components/organisms/Landing/LandingCategories.tsx 100% 55.55% 100% 100%
src/components/organisms/Landing/LandingCategoriesShell.tsx 94.73% 82.05% 100% 96.87% 61, 72, 98, 106
src/components/organisms/Landing/LandingContact.tsx 100% 84.61% 100% 100%
src/components/organisms/Landing/LandingFeatures.tsx 100% 76% 100% 100%
src/components/organisms/Landing/LandingPricing.tsx 100% 64.7% 100% 100%
src/components/organisms/Landing/LandingProcess.tsx 90.62% 62.06% 95.83% 95.65% 198, 203, 209-210, 226-227, 364, 390, 399, 426, 431, 436, 450, 471-474, 497, 519
src/components/organisms/Landing/LandingProcessRing.tsx 81.91% 63.33% 86.2% 84.06% 367-368, 378-379, 385, 436-437, 445-446, 460-463, 469, 471, 554-555, 596-601, 623-624, 628, 650, 656-657, 668-670, 676-678, 688-689, 696-709, 801, 804, 823-824, 828-834, 839, 861-865, 872-876, 883-887, 897-903, 943, 985, 991, 994-995, 1158
src/components/organisms/Landing/LandingTeam.tsx 88.88% 80% 100% 100% 68
src/components/organisms/Landing/LandingTestimonials.tsx 100% 100% 100% 100%
src/components/organisms/Landing/LandingTestimonials.types.ts 0% 0% 0% 0%
src/components/organisms/Landing/LandingTestimonialsCarousel.tsx 75.94% 61.11% 96.15% 85.07% 51, 75, 94, 130, 135, 149, 151, 160, 188, 212, 214, 215, 222-223, 230, 231, 237, 242-249, 254, 259-261, 267-275, 279, 412
src/components/organisms/Landing/index.ts 0% 0% 0% 0%
src/components/organisms/Listing/ListingCard.tsx 100% 70% 100% 100%
src/components/organisms/Listing/ListingFilters.tsx 80.88% 57.44% 86.66% 80.64% 41, 98, 105, 123-133, 142, 186, 198-201
src/components/organisms/Listing/index.ts 0% 0% 0% 0%
src/components/organisms/LivePreviewListener/index.tsx 100% 100% 100% 100%
src/components/organisms/MediaBlock/index.tsx 100% 100% 100% 100%
src/components/organisms/MedicalSpecialtiesAdminGuidance/index.tsx 0% 100% 0% 0% 3-20
src/components/organisms/TreatmentsStrip/index.tsx 100% 100% 100% 100%
src/components/organisms/TrustQualitySection/AnimatedCountUp.tsx 69.23% 63.15% 81.81% 72% 51, 58-60, 64-66, 70, 80-82, 93-94, 100-102
src/components/organisms/TrustQualitySection/index.tsx 100% 85% 100% 100%
src/components/shared/media/imagePlaceholderBlur.ts 100% 100% 100% 100%
src/components/templates/ClinicDetailConcepts/ClinicDetail.tsx 94.11% 82.35% 84.61% 92.85% 99, 132
src/components/templates/ClinicDetailConcepts/index.ts 0% 0% 0% 0%
src/components/templates/ClinicDetailConcepts/shared.tsx 18.57% 16.47% 19.35% 20.33% 47, 64-540
src/components/templates/ClinicDetailConcepts/types.ts 0% 0% 0% 0%
src/components/templates/ClinicDetailConcepts/hooks/clinicDetailInteraction.logic.ts 20% 7.14% 25% 11.11% 9-39
src/components/templates/ClinicDetailConcepts/hooks/useClinicDetailInteractionState.ts 54% 32% 40% 54.54% 83, 92, 101, 111, 115, 120-122, 128, 133-140, 148-154, 160-164, 169-174, 182-187, 194-196, 202-203, 207-208, 212-215
src/components/templates/Footer/Component.tsx 100% 61.53% 100% 100%
src/components/templates/Header/Component.tsx 100% 100% 100% 100%
src/components/templates/Header/PublicAccountMenu.tsx 96.66% 85% 100% 100% 91
src/components/templates/Header/Nav/index.tsx 76.69% 56.14% 75% 76.4% 26-28, 35-38, 60, 148-150, 186-187, 191-192, 228-229, 238, 242-243, 255-258, 286-288, 320
src/components/templates/HoldingPageConcept/ContactForm.client.tsx 86% 64.51% 87.5% 89.36% 39, 40, 68-71, 83-84
src/components/templates/HoldingPageConcept/contactForm.shared.ts 100% 100% 100% 100%
src/components/templates/HoldingPageConcept/index.tsx 42.3% 39.78% 43.47% 42.3% 119-344, 582-1301, 1439
src/components/templates/ListingComparison/Component.tsx 100% 80% 100% 100%
src/components/templates/ListingComparison/ListingFiltersJumpBar.client.tsx 90.47% 66.66% 90.9% 92.68% 28, 88, 110-112
src/components/templates/TemporaryLandingPage/index.tsx 0% 100% 0% 0% 15-25
Generated in workflow #2541 for commit 86a009a by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report for Integration Tests

Status Category Percentage Covered / Total
🔵 Lines 84.84% (🎯 50%) 806 / 950
🔵 Statements 81.32% (🎯 50%) 845 / 1039
🔵 Functions 97.04% (🎯 50%) 164 / 169
🔵 Branches 71.9% (🎯 50%) 663 / 922
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Unchanged Files
src/access/clinicGallery.ts 100% 100% 100% 100%
src/access/clinicMediaRead.ts 100% 100% 100% 100%
src/access/scopeFilters.ts 86.79% 81.39% 88.88% 88.46% 22, 78, 104, 111-117, 127
src/collections/Accreditation.ts 100% 100% 100% 100%
src/collections/Categories.ts 100% 100% 100% 100%
src/collections/Cities.ts 100% 100% 100% 100%
src/collections/ClinicApplications.ts 100% 100% 100% 100%
src/collections/ClinicStaff.ts 87.5% 81.81% 100% 92.3% 24, 31
src/collections/Clinics.ts 100% 100% 100% 100%
src/collections/Countries.ts 100% 100% 100% 100%
src/collections/DoctorSpecialties.ts 72.72% 62.5% 100% 100% 47, 48, 51
src/collections/DoctorTreatments.ts 78.57% 62.5% 100% 100% 46, 47, 50
src/collections/Doctors.ts 92.85% 93.33% 100% 100% 180
src/collections/FavoriteClinics.ts 92.85% 85.71% 100% 100% 22
src/collections/MedicalSpecialties.ts 100% 100% 100% 100%
src/collections/PlatformStaff.ts 100% 100% 100% 100%
src/collections/Reviews.ts 96.42% 78.37% 100% 100% 214
src/collections/Tags.ts 100% 100% 100% 100%
src/collections/Treatments.ts 100% 100% 100% 100%
src/collections/BasicUsers/index.ts 100% 100% 100% 100%
src/collections/BasicUsers/hooks/createSupabaseUser.ts 84.21% 78.57% 100% 81.25% 13, 32-34
src/collections/BasicUsers/hooks/createUserProfile.ts 76.19% 64.28% 100% 78.94% 23-24, 31-40, 46
src/collections/BasicUsers/hooks/deleteSupabaseUser.ts 65.38% 50% 100% 65.38% 20-21, 45-53, 63-70, 76-83
src/collections/ClinicGalleryEntries/index.ts 100% 100% 100% 100%
src/collections/ClinicGalleryEntries/hooks/beforeChangeClinicGalleryEntry.ts 93.75% 85.71% 100% 93.75% 14, 23
src/collections/ClinicGalleryMedia/index.ts 100% 100% 100% 100%
src/collections/ClinicMedia/index.ts 100% 100% 100% 100%
src/collections/ClinicTreatments/index.ts 100% 100% 100% 100%
src/collections/ClinicTreatments/hooks/averagePriceUtils.ts 81.81% 86.66% 100% 82.35% 31, 36-37, 57
src/collections/ClinicTreatments/hooks/updateAveragePriceAfterChange.ts 75% 60% 100% 80% 11, 21-26
src/collections/ClinicTreatments/hooks/updateAveragePriceAfterDelete.ts 81.81% 50% 100% 90% 7, 15
src/collections/DoctorMedia/index.ts 81.25% 72.72% 100% 92.85% 40, 46, 57
src/collections/DoctorMedia/hooks/beforeChangeDoctorMedia.ts 89.28% 81.08% 100% 89.28% 17, 22, 45
src/collections/MedicalSpecialties/hooks/enforceTwoLevelHierarchy.ts 81.81% 68% 100% 81.81% 9-11, 21
src/collections/Pages/index.ts 66.66% 0% 71.42% 66.66% 45-59
src/collections/Pages/legalPages.ts 72.61% 54% 100% 72.61% 129-135, 145-146, 150, 157-167, 207-213, 221-247, 255-262, 268-269, 316, 320, 328, 352
src/collections/Pages/hooks/populatePublishedAt.ts 100% 100% 100% 100%
src/collections/Pages/hooks/revalidatePage.ts 78.94% 68.75% 100% 78.94% 18-23
src/collections/Patients/index.ts 77.77% 66.66% 100% 85.71% 35, 39
src/collections/Patients/hooks/patientSupabaseCreate.ts 77.27% 62.5% 100% 80% 9, 22, 60-69
src/collections/Patients/hooks/patientSupabaseDelete.ts 64.28% 50% 100% 69.23% 8, 10-11, 16-18
src/collections/PlatformContentMedia/index.ts 100% 100% 100% 100%
src/collections/PlatformContentMedia/hooks/beforeChangePlatformContentMedia.ts 93.33% 83.33% 100% 93.33% 18
src/collections/Posts/index.ts 80% 50% 81.81% 80% 55-69
src/collections/Posts/hooks/populateAuthors.ts 78.94% 67.56% 100% 90.62% 24-27, 37, 72, 84
src/collections/Posts/hooks/revalidatePost.ts 78.94% 80% 100% 78.94% 18-23
src/collections/UserProfileMedia/index.ts 66.32% 56.19% 100% 77.33% 23-29, 37, 43-50, 55, 56, 79, 80, 88-92, 111, 114, 116, 158, 159, 162, 165, 209, 210, 212
src/collections/common/mediaCollection.ts 100% 97.22% 100% 100%
src/collections/common/mediaPathHelpers.ts 71.11% 69.87% 100% 76.38% 28, 38-61, 89, 94, 111, 116, 139, 144, 147
src/collections/common/selectionOptions.ts 100% 100% 100% 100%
src/collections/common/stableIdField.ts 100% 100% 100% 100%
src/hooks/clinicOwnership.ts 92.3% 64.28% 100% 92.1% 38, 69, 76
src/hooks/createdBy.ts 100% 84.61% 100% 100%
src/hooks/immutability.ts 90% 70% 100% 90% 41
src/hooks/publishedAt.ts 84.61% 71.42% 100% 84.61% 35, 37
src/hooks/calculations/updateAverageRatings.ts 81.57% 68.62% 100% 80.82% 18, 61-62, 89, 97, 129-130, 135-136, 141-152, 162, 189
Generated in workflow #2541 for commit 86a009a by the Vitest Coverage Report Action

@github-actions
Copy link
Copy Markdown
Contributor

Combined Coverage Summary

Source Statements Branches Functions Lines
integration 81.32% (845/1039) 71.9% (663/922) 97.04% (164/169) 84.84% (806/950)
storybook 71.53% (2518/3520) 59.84% (1629/2722) 76.85% (684/890) 73.46% (2337/3181)
unit 77.93% (4847/6219) 66.52% (3236/4864) 83.26% (960/1153) 79.43% (4545/5722)
combined 76.17% (8210/10778) 64.97% (5528/8508) 81.74% (1808/2212) 78.03% (7688/9853)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: DB quality gate for migration safety

1 participant