- Core sources live under
src/main/java/io/github/thunderz99/cosmos, split intodto,impl,util, and database-specific helpers such asv4. - Public test fixtures sit in
src/test/java/io/github/thunderz99/cosmoswith resource data insrc/test/resources. - Supporting assets include
docs/for published examples,mongo/for local integration materials, and helper scriptsinstall.shanddeploy.shfor Maven workflows. - Shared build metadata is defined in
pom.xmlandsettings.xml; keep updates to these files tightly reviewed.
mvn clean verifyruns compile, unit tests, and packaging—use this before sharing change sets.mvn testexecutes the JUnit 5 suite only; prefer this for fast local checks../install.shinstalls the artifact into your local Maven repository using the customsettings.xml../deploy.shpublishes to the configured Maven repository; run only after release approval.
- Target Java 17; rely on Maven’s compiler plugin and keep source files encoded in UTF-8.
- Use four-space indentation,
UpperCamelCasefor classes,lowerCamelCasefor members, and keep package names lowercase, mirroringio.github.thunderz99.cosmos. - Favor fluent builder patterns already present (e.g.,
CosmosBuilder) and keep new utilities colocated with existing peers (impl,util, orcondition). - Run your IDE formatter before committing; align imports with the current ordering and avoid wildcard imports.
- Tests use JUnit Jupiter with AssertJ; place new cases beside the related component and follow the
ClassNameTestnaming pattern. - Create focused unit tests for each scenario, exercising both Cosmos DB and Mongo/PostgreSQL paths when logic diverges.
- Use deterministic fixtures under
src/test/resources; avoid external service calls unless guarded behind environment checks. - New behavior should ship with tests that fail pre-change; update or extend mocks rather than mutating production code for testing.
- Follow the Conventional Commits style visible in history (
feat:,fix:, etc.), optionally appending issue references like(#194). - Each commit should remain scoped to a logical change; avoid bundling unrelated refactors.
- Pull requests need a concise summary, validation notes (commands run, databases used), and any screenshots or log excerpts that clarify the effect.
- Link to the relevant issue or discussion and confirm CI status before requesting review; rerun
mvn clean verifyif rebasing.
- Never commit secrets; load connection strings through environment variables or
.envfiles consumed bydotenv-java. - Store publication credentials in
~/.m2/settings.xmlor usesettings.xmltemplates checked intodocs/as guidance. - Scrub logs before attaching them to issues to prevent leaking keys or tenant data.