Repository Guidelines
Project Structure & Module Organization
src/main/kotlin/jhkim105/dualcachehouses the Spring Boot entry pointDualCacheApplication.ktand cache orchestration logic; group new features in cohesive packages under this root.src/main/resourcesstoresapplication.propertiesplus Redis/cache overrides; add profile-specific variants asapplication-{profile}.properties.src/test/kotlinmirrors the main packages; co-locate fixtures with the code they verify. Gradle outputs land inbuild/and stay untracked.
Build, Test, and Development Commands
./gradlew buildcompiles Kotlin sources, runs the full test suite, and produces the bootable jar underbuild/libs/../gradlew testexecutes the JUnit 5 suites; append-ior--tests '*Cache*'to trace a failing scenario../gradlew bootRunlaunches the local service using the Redis endpoints declared inapplication.properties../gradlew cleanclears generated outputs—run it before reproducing CI-only cache issues.
Coding Style & Naming Conventions
- Use 4-space indentation, idiomatic
valdefaults, and expression-bodied functions when they improve readability. - Classes stay in
PascalCase, functions and properties incamelCase, and constants inUPPER_SNAKE_CASE. - Keep all code under the
jhkim105.dualcachepackage; align filenames with their primary class (e.g.,CacheWarmService.kt).
Testing Guidelines
- Tests rely on
spring-boot-starter-testpluskotlin-test-junit5; name files*Tests.ktand functionsshould...for clarity. - Mock external Redis calls in unit tests; reserve embedded Redis or Testcontainers checks for tagged integration suites.
- Target >80% line coverage on new cache flows and include hit/miss regression cases before opening a PR.
Commit & Pull Request Guidelines
- Follow the concise, imperative format seen in history (
envelopmessage json,distinctBy); keep subjects under ~50 characters. - Pull requests should describe the cache scenario addressed, list manual verification steps, and link tracking issues when available.
- Include screenshots or
curltranscripts for HTTP changes and call out any new configuration keys added toapplication.properties.
Security & Configuration Tips
- Never commit Redis credentials; inject them via environment variables or secrets managers and document required keys in the PR.
- Validate dual-cache fallbacks by toggling
spring.data.redis.*properties locally before pushing to avoid production regressions.