Repository navigation
Track generated example builders outside target/ and harden the generation gate - #189
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
If I am remembering correct the generated builders are linked in some markdown files. So these links need to be updated too!? |
Generated example builders were committed under example/target/generated- sources/ (via a .gitignore exception) and the CI check diffed target/, which mvn clean wipes and which can't reveal a builder that stops being generated. - Emit builders into a tracked example/generated-sources/annotations/ dir (survives mvn clean) via maven-compiler-plugin generatedSourcesDirectory. - CI regenerates from a clean slate and fails on any git drift, so stale output, a missing builder, or a new builder all fail the check. - Example tests already exercise the generated builders, so a missing/ broken builder also fails compilation independently of the diff. Refs java-helpers#167 Co-Authored-By: Andreas Igel <andreas.igel@computacenter.com>
…der, drop doc-only .gitignore, fix README links Co-Authored-By: Andreas Igel <andreas.igel@computacenter.com>
212c56a to
dbfe831
Compare
|
Good catch on the markdown links — the README linked the generated builders at |
Summary
Makes the committed example builders durable and makes the CI gate able to detect a missing builder (generator regression), not just stale output.
Fixes #167
Problem
Generated builders were committed under
example/target/generated-sources/(kept in git via anexample/.gitignoreexception), and the CI step diffedtarget/generated-sources/.target/is wiped bymvn cleanand git-ignored by convention, so the committed copies are fragile, and a builder that silently stops being generated leaves no diff → the gate passes.Changes
example/pom.xml— pointmaven-compiler-plugin'sgeneratedSourcesDirectoryat a tracked dir outsidetarget/:mvn cleanno longer wipes them; they're regenerated (deterministically) on every build.example/target/generated-sources/annotations/... → example/generated-example-builder/..., update the README links to the new path, and remove the doc-onlyexample/.gitignore(it held no ignore rules)..github/workflows/maven.yml— replace thetarget/-diff step with a clean-slate regenerate +git statusgate:BookDtoBuilder.create(),PersonDtoBuilder.create(),ProductRecordBuilder, the Jackson module), so a missing/broken builder also fails compilation independently of the diff.Validation (local)
mvn clean verify→ BUILD SUCCESS, 283 tests pass.actionlintpasses.Red
build/dependency-reviewchecks on the fork are the missingSONAR_TOKEN/CODECOV_TOKENand disabled Dependency graph — unrelated to this change.Review follow-ups (addressed): renamed the tracked dir to
generated-example-builder(clearer thangenerated-sources/annotations); removed the comment-onlyexample/.gitignore; rebased onto currentmainso the already-merged SonarCloud cache-key change (#188) no longer shows in this diff; updated the five README links to the new path.