Report build validation failures with Problems API#881
Open
alvarosanchez wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds structured reporting of selected Micronaut Build validation failures via Gradle’s Problems API (targeting the Gradle 9 line), while preserving existing fail-fast exception messages and improving sanitization of diagnostic output.
Changes:
- Introduce
MicronautBuildProblemshelper to define stable problem groups/IDs and to report failures viaProblemsreporter. - Emit Problems API entries for common validation failures across plugins/tasks (BOM enforcement, version mismatch, unsupported test framework, POM checks, Asciidoc output validation, Maven Central publishing).
- Add documentation and new unit/functional tests, including sanitization + bounded diagnostics and Problems report assertions.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents Problems API diagnostics behavior, report path, and stable IDs. |
| micronaut-gradle-plugins/src/main/java/io/micronaut/build/problems/MicronautBuildProblems.java | New helper for problem groups/IDs, reporting, and diagnostic sanitization. |
| micronaut-gradle-plugins/src/main/groovy/io/micronaut/build/MicronautBuildCommonPlugin.groovy | Report enforced platform + Micronaut version mismatch validations via Problems API. |
| micronaut-gradle-plugins/src/main/groovy/io/micronaut/build/MicronautModulePlugin.groovy | Report unsupported test framework validation via Problems API. |
| micronaut-gradle-plugins/src/main/groovy/io/micronaut/build/pom/PomChecker.groovy | Report invalid coordinates + POM verification failures via Problems API. |
| micronaut-gradle-plugins/src/main/groovy/io/micronaut/build/MavenCentralPublishTask.java | Sanitize/bound Maven Central diagnostics and report failures via Problems API; add deployment id extraction/encoding helpers. |
| micronaut-gradle-plugins/src/main/groovy/io/micronaut/build/docs/ValidateAsciidocOutputTask.java | Report generated Asciidoc output validation failures via Problems API. |
| micronaut-gradle-plugins/src/test/groovy/io/micronaut/build/problems/MicronautBuildProblemsTest.groovy | Unit tests for sanitization and truncation behavior. |
| micronaut-gradle-plugins/src/test/groovy/io/micronaut/build/MavenCentralPublishTaskTest.groovy | Unit tests for deployment id extraction + URL encoding + credential-like response rejection. |
| micronaut-gradle-plugins/src/functionalTest/groovy/io/micronaut/build/ProblemsApiFunctionalTest.groovy | Functional tests asserting Gradle Problems report contains expected IDs/groups. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
micronaut-build > validationgroup and covered validation IDs.Tests
./gradlew --rerun-tasks :micronaut-gradle-plugins:functionalTest --tests 'io.micronaut.build.ProblemsApiFunctionalTest' :micronaut-gradle-plugins:test --tests 'io.micronaut.build.MavenCentralPublishTaskTest' --tests 'io.micronaut.build.problems.MicronautBuildProblemsTest'git diff --check origin/8.0.x...HEADPaperclip Handoff
type: enhancement.5.0.0-M3and5.0.0 Release.5.0.1 Release,5.1.0 Release, and6.0.0 Release; QA selected both the matching milestone and GA release boards for the default8.0.xline.✨ This message was AI-generated using gpt-5