KamoCRM

Fail the build when a repository package is missing from the scan

TestSecurityService
Shipped
3 ஆகஸ்ட், 2026 அன்று 3:16 PM UTC
Author
Kamo
Commit
a2bcf71

This service has @ComponentScan("com.kamo") but an EXPLICIT @EnableJpaRepositories list. The moment a bean here needs a repository outside that list, the repository has no bean, the bean needing it cannot be built, and the context fails to start — the service CrashLoops and takes its whole function with it. It has happened twice. **************** CrashLooped two deploys. Then today com.kamo.z.shared.mfa.repos took EVERY LOGIN on the platform offline. Warning comments were already in SecurityServiceApplication both times; a comment cannot fail a build. Verified by mutation against the real incident: deleting the "com.kamo.z.shared.mfa" entry makes this test fail and name com.kamo.z.shared.mfa.repos. It would have caught today's outage before it shipped. Static rather than a @SpringBootTest deliberately. Booting the context here connects to the PRODUCTION database, so a context test would either migrate production or need infrastructure that does not exist. Worth noting that SecurityServiceApplicationTests nominally exists but sits in package com.retval.SecurityService, cannot find a @SpringBootConfiguration, and therefore asserts nothing — it is the guard everyone assumes is there and it has never run.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing