Skip to content

feat(cleanup): add full cleanup target to remove intermediate and out…#385

Merged
samtrion merged 2 commits intomainfrom
feature/fullcleanup
Apr 20, 2026
Merged

feat(cleanup): add full cleanup target to remove intermediate and out…#385
samtrion merged 2 commits intomainfrom
feature/fullcleanup

Conversation

@samtrion
Copy link
Copy Markdown
Contributor

@samtrion samtrion commented Apr 20, 2026

…put directories

Summary by CodeRabbit

  • Chores
    • Enhanced build process with improved cleanup functionality that removes intermediate and output directories during clean operations.

@samtrion samtrion self-assigned this Apr 20, 2026
@samtrion samtrion requested a review from a team as a code owner April 20, 2026 05:42
@samtrion samtrion added the state:ready for merge Indicates that a pull request has been reviewed and approved, and is ready to be merged into the mai label Apr 20, 2026
@samtrion samtrion removed the request for review from a team April 20, 2026 05:42
@samtrion samtrion added the type:feature Indicates a new feature or enhancement to be added. label Apr 20, 2026
@samtrion samtrion requested a review from Hnogared April 20, 2026 05:42
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 20, 2026

Warning

Rate limit exceeded

@samtrion has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 41 minutes and 39 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 41 minutes and 39 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e266639d-8867-4884-be30-a4eb0ee7216c

📥 Commits

Reviewing files that changed from the base of the PR and between 993617d and 264cc14.

📒 Files selected for processing (1)
  • src/NetEvolve.Defaults/buildMultiTargeting/NetEvolve.Defaults.targets

Walkthrough

A new MSBuild target file SupportFullCleanUp.targets is created and imported into NetEvolve.Defaults.targets. The target executes after the standard Clean target, removing both the intermediate and output directories during cleanup operations.

Changes

Cohort / File(s) Summary
MSBuild cleanup target implementation
src/NetEvolve.Defaults/buildMultiTargeting/NetEvolve.Defaults.targets, src/NetEvolve.Defaults/buildMultiTargeting/SupportFullCleanUp.targets
Added new FullCleanUp target that executes after Clean, removing intermediate and output directories. Target is imported into the main targets file.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A fluffy hop through build cleanup deep,
Where targets rest and directories sleep,
We sweep away the old, keep the new,
MSBuild targets—one, two, three through!
Clean builds bloom when dust is gone. 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a full cleanup target to remove intermediate and output directories, which is exactly what the pull request implements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/NetEvolve.Defaults/buildMultiTargeting/SupportFullCleanUp.targets (1)

2-3: Reconsider automatic full cleanup on standard Clean invocation.

AfterTargets="Clean" automatically triggers full cleanup when any user invokes dotnet clean. While this repository's own workflows don't use clean, this is a distributed package consumed by many downstream projects. Some consumers may have workflows or development practices that combine clean with subsequent builds, and the automatic removal of BaseIntermediateOutputPath (including project.assets.json) could break build/test --no-restore patterns in those projects. Additionally, consumers who customize BaseOutputPath could lose shared artifact roots unexpectedly.

Consider making FullCleanUp an explicit opt-in target (requiring explicit /t:FullCleanUp invocation) rather than a side effect of standard clean:

Proposed fix
-  <Target Name="FullCleanUp" AfterTargets="Clean">
+  <Target Name="FullCleanUp">
     <RemoveDir Directories="$(BaseIntermediateOutputPath);$(BaseOutputPath)" />
   </Target>

Alternatively, gate the behavior behind an opt-in property like <EnableFullCleanUp>false</EnableFullCleanUp>.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/NetEvolve.Defaults/buildMultiTargeting/SupportFullCleanUp.targets` around
lines 2 - 3, The FullCleanUp target is currently bound to run automatically via
AfterTargets="Clean" and removes $(BaseIntermediateOutputPath) and
$(BaseOutputPath) via RemoveDir; change this to an opt-in action by either
removing the AfterTargets="Clean" attribute so FullCleanUp only runs when
explicitly invoked (/t:FullCleanUp) or add a gate property such as
EnableFullCleanUp and wrap the AfterTargets or the RemoveDir call in a Condition
that checks "'$(EnableFullCleanUp)' == 'true'"; update the target definition
(Target Name="FullCleanUp") and the RemoveDir invocation accordingly so
downstream consumers aren’t surprised by automatic deletion of
BaseIntermediateOutputPath or custom BaseOutputPath.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/NetEvolve.Defaults/buildMultiTargeting/NetEvolve.Defaults.targets`:
- Line 12: The import of SupportFullCleanUp.targets is unconditional and
forcibly alters Clean for all consumers; add a property-based opt-out so
consumers can disable it. Modify the Import of SupportFullCleanUp.targets to
include a Condition that allows opt-out (for example,
Condition="'$(EnableNetEvolveSupportFullCleanUp)' != 'false'" or an inverse
opt-out like Condition="'$(DisableNetEvolveSupportFullCleanUp)' != 'true'"), and
document that consumers can set that MSBuild property to opt out of the
destructive Clean behavior introduced by SupportFullCleanUp.targets (referencing
the Import line and the Clean target affected).

---

Nitpick comments:
In `@src/NetEvolve.Defaults/buildMultiTargeting/SupportFullCleanUp.targets`:
- Around line 2-3: The FullCleanUp target is currently bound to run
automatically via AfterTargets="Clean" and removes $(BaseIntermediateOutputPath)
and $(BaseOutputPath) via RemoveDir; change this to an opt-in action by either
removing the AfterTargets="Clean" attribute so FullCleanUp only runs when
explicitly invoked (/t:FullCleanUp) or add a gate property such as
EnableFullCleanUp and wrap the AfterTargets or the RemoveDir call in a Condition
that checks "'$(EnableFullCleanUp)' == 'true'"; update the target definition
(Target Name="FullCleanUp") and the RemoveDir invocation accordingly so
downstream consumers aren’t surprised by automatic deletion of
BaseIntermediateOutputPath or custom BaseOutputPath.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8cf96c5c-2f2e-4b4d-9e4d-420af4f64883

📥 Commits

Reviewing files that changed from the base of the PR and between 1424454 and 993617d.

📒 Files selected for processing (2)
  • src/NetEvolve.Defaults/buildMultiTargeting/NetEvolve.Defaults.targets
  • src/NetEvolve.Defaults/buildMultiTargeting/SupportFullCleanUp.targets

Comment thread src/NetEvolve.Defaults/buildMultiTargeting/NetEvolve.Defaults.targets Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Martin Stühmer <me@samtrion.net>
@samtrion samtrion merged commit cd25385 into main Apr 20, 2026
12 checks passed
@samtrion samtrion deleted the feature/fullcleanup branch April 20, 2026 06:34
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (1424454) to head (264cc14).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #385   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:ready for merge Indicates that a pull request has been reviewed and approved, and is ready to be merged into the mai type:feature Indicates a new feature or enhancement to be added.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant