You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change fixes a workspace cleanup gap in source-code retention handling for coverage reports.
When painted source files are generated, the plugin creates a temporary directory in the agent workspace named after the recordCoverage id (for example: my-coverage-report), writes per-file zipped painted sources into that directory, then zips the directory into coverage-sources.zip for transfer to the controller. The transfer zip is cleaned up, but the temporary id-named directory was not deleted, so it remained in the agent workspace after each build.
In AgentCoveragePainter.invoke(...), the code zips outputFolder into coverage-sources.zip, but cleanup only removed the JVM temp folder used during rendering. The outputFolder itself (workspace/id) was never deleted.
What Changed
Added cleanup of the agent workspace temporary output folder after zipping is complete.
Kept existing behavior for creating per-file zipped painted sources and packaging them into coverage-sources.zip.
Did not change coverage parsing, metrics calculations, source rendering content, or retention semantics.
Why I Think This Solution Is Safe
The id-named workspace folder is a transport/staging artifact used only before packaging.
Deleting it after successful packaging does not affect the extracted artifacts stored in the build folder on the controller.
The change is scoped to artifact lifecycle cleanup only.
Behavior Before vs After
Before: workspace/id temporary folder remained after builds.
After: workspace/id temporary folder is deleted after packaging, so no temporary painted-source folder remains in the agent workspace root.
Impact
Prevents accumulation and visibility of temporary .zip artifacts in id-named workspace folders.
Reduces workspace clutter and avoids unexpected untracked artifacts in environments that validate workspace cleanliness.
Testing Done
I did not run this code or write unit tests. I do not have a Java environment set up to compile this project. I am hoping one of the maintainers can pull this branch, write or run a basic test, and ensure that testing requirements for this project are met.
Submitter checklist
Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
Ensure that the pull request title represents the desired changelog entry
Please describe what you did
Link to relevant issues in GitHub or Jira
Link to relevant pull requests, esp. upstream and downstream changes
Ensure you have provided tests that demonstrate the feature works or the issue is fixed
Disclaimer
This PR is provided in good faith as a starting point to resolve GitHub Issue #752. The submitter expects maintainers to verify that this is the correct fix and that the changes behave according to project expectations.
uhafner
changed the title
Coverage plugin: delete temporary output folder after zipping painted sources
Delete temporary output folder after zipping painted sources
May 11, 2026
uhafner
linked an issue
May 11, 2026
that may be
closed
by this pull request
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
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.
This change fixes a workspace cleanup gap in source-code retention handling for coverage reports.
When painted source files are generated, the plugin creates a temporary directory in the agent workspace named after the recordCoverage id (for example: my-coverage-report), writes per-file zipped painted sources into that directory, then zips the directory into coverage-sources.zip for transfer to the controller. The transfer zip is cleaned up, but the temporary id-named directory was not deleted, so it remained in the agent workspace after each build.
Open Issue
This PR addresses GitHub Issue #752: coverage-sources.zip is left behind in agent workspace after each build
Root Cause
In AgentCoveragePainter.invoke(...), the code zips outputFolder into coverage-sources.zip, but cleanup only removed the JVM temp folder used during rendering. The outputFolder itself (workspace/id) was never deleted.
What Changed
Why I Think This Solution Is Safe
Behavior Before vs After
Before: workspace/id temporary folder remained after builds.
After: workspace/id temporary folder is deleted after packaging, so no temporary painted-source folder remains in the agent workspace root.
Impact
Testing Done
I did not run this code or write unit tests. I do not have a Java environment set up to compile this project. I am hoping one of the maintainers can pull this branch, write or run a basic test, and ensure that testing requirements for this project are met.
Submitter checklist
Disclaimer
This PR is provided in good faith as a starting point to resolve GitHub Issue #752. The submitter expects maintainers to verify that this is the correct fix and that the changes behave according to project expectations.