jdaugherty opened a new pull request, #16689:
URL: https://github.com/apache/grails-core/pull/16689

   ## Description
   
   Codecov has never seen the `cli` tier of grails-bootstrap, grails-core, 
grails-openapi, grails-scaffolding and grails-web-url-mappings: the `src/cli` 
companion source set that the `grails-plugin-cli` plugin adds, production code 
with its own `testCli` phase. `GrailsJacocoPlugin` collected every module's 
exec files, `testCli.exec` included, but fed the aggregate report only the main 
source set's classes and sources. With nothing to match the cli exec data 
against, the whole tier was absent from the report, and so from Codecov.
   
   The plugin now adds the cli source set's classes and sources whenever a 
module has one, through live file collections, so a directory the source set 
gains after the aggregate task is realized (an eager build script, an IDE sync) 
is still reported. `GrailsJacocoPluginSpec` covers the cli source set being 
reported next to main and the late-added directory.
   
   Cherry-picked from #16631 (9.0.x), where @borinquenkid found and fixed it 
while chasing patch coverage for the new `grails-datamapping-core` cli tier: 
Codecov's report for that branch grew by about 100 files once the cli tiers 
appeared. The gap is the same on every branch from 8.0.x up, where the plugin 
and its spec are byte-identical, so the fix lands here and merges up; the same 
two commits on the 9.0.x PR merge cleanly with it. 7.0.x has neither 
`GrailsJacocoPlugin` nor a cli source set and needs nothing.
   
   Verified locally on this branch with `../gradlew :build-logic:test --tests 
org.apache.grails.buildsrc.GrailsJacocoPluginSpec` from `build-logic`: 7 specs 
pass.
   
   ## Contributor Checklist
   
   ### Issue and Scope
   
   - [ ] This PR is linked to an existing issue. No issue exists; the 
background is above.
   - [x] This PR addresses the **complete scope** of the change.
   - [x] This PR contains a **single, focused change**.
   - [x] This PR targets the **correct branch**: 8.0.x is the oldest branch 
with the plugin and a cli source set.
   
   ### Code Quality
   
   - [x] I have **added or updated tests** that cover the changes introduced in 
this PR.
   - [ ] I have verified that all existing tests pass by running `./gradlew 
build --rerun-tasks`. Only the build-logic spec was run locally; CI runs the 
rest.
   - [x] My code follows the project's **code style** guidelines.
   - [x] This PR does **not** include mass reformatting, style-only changes, or 
large-scale refactoring.
   
   ### Licensing and Attribution
   
   - [x] All contributed code is provided under the Apache License 2.0; no new 
source files.
   - [x] I have the necessary rights to submit this contribution.
   
   ### Documentation
   
   - [x] No user-facing change: build logic only, nothing to document.
   - [x] The PR description clearly explains **what** was changed and **why**.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to