← Back to issue list

fix: clean build provider when no parts are given

View original Github issue

Metadata

Project
craft-application
Number
#88
Type
pull request
State
merged
Author
tigarmo
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #88 (commit 2d2dd70e, merged into main as ed378fc) by maintainer tigarmo. Adds ProviderService.clean_instances(), converts AppCommand.run_managed to a method taking parsed args, and makes the clean command clean build instances when no parts are given. Fixes #56.

Resolution: closed resolved

Reason: The PR itself was merged into main as commit 2d2dd70e after approval by 2 reviewers. CraftApplicationCleanCommand._run now calls self._services.provider.clean_instances() when build-managed and no parts are specified, confirmed present in craft_application/commands/lifecycle.py and ProviderService.clean_instances() in craft_application/services/provider.py, closing issue #56.

Evaluated by: mr-cal-bot

No scores available.

Issue body

This pull request has 3 commits because I had to do some refactoring on `AppCommand` to get this "hybrid" command to work: - The first commit adds `ProviderService.clean_instances()`; - The second commit refactors `AppCommand.run_managed` from a property to a regular method that receives the parsed cli arguments; - The third commit hooks the first two by updating the `clean` command to call either `provider.clean_instances()` or `lifecycle.clean()` depending on the command line args. Fixes #56

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #88 (commit 2d2dd70e, merged into main as ed378fc) by maintainer tigarmo. Adds ProviderService.clean_instances(), converts AppCommand.run_managed to a method taking parsed args, and makes the clean command clean build instances when no parts are given. Fixes #56.
stealth/space-bunny-alpha — closed resolved PR #88 merged as commit 2d2dd70e: adds ProviderService.clean_instances() and refactors AppCommand.run_managed into a method so `clean` removes the build provider instances when no parts are given. Fixes #56.
stealth/space-bunny-alpha — closed resolved Merged PR #88 (commit 2d2dd70e, Oct 2023) by tigarmo: adds ProviderService.clean_instances(), refactors AppCommand.run_managed into a method taking parsed args, and makes `clean` call provider.clean_instances() or lifecycle.clean(). Closes issue #56.
stealth/space-bunny-alpha — closed resolved Merged PR #88 as commit 2d2dd70e, cleaning the build provider when no parts are supplied and refactoring AppCommand for the hybrid clean flow; fixes #56.
qwen/qwen3.6-35b-a3b — — Merged. Refactors AppCommand.run_managed and adds ProviderService.clean_instances() to clean the build provider when no parts are provided. Routes cleanup via CLI args. Fixes #56 and increases coverage by 0.03%.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-application#56 (confidence 98%)

    Issue "<appname> clean doesn't remove the build instance" is explicitly referenced as fixed by this PR; issue #56 is now closed.

Related issues

Issue Project State Summary Similarity
#3284 build providers: rename clean() -> clean_parts() to clarify scope snapcraft merged Merged into master as commit 81ade060c: build provider clean() renamed to clean_parts() (5 files, +9/-9) to distinguish parts cleanup from clean_project() and other build instance cleanup.
74%
#1779136 build provider support to clean parts snapcraft (launchpad) closed Build-provider support for cleaning selected parts was restored by merged canonical/snapcraft PR #2442 (commit 5546c3aab), without deleting the provider.
73%
#56 "<appname> clean" doesn't remove the build instance craft-application closed Fixed clean behavior: with no parts, craft-provider build instances are removed; part-specific cleans still run inside instances. Resolved by merged PR #88 (commit 2d2dd70e).
72%
#2474 build providers: remove dead code snapcraft merged Merged PR #2474 as commit 4308dd8d3, removing obsolete build-provider methods left over from legacy cleanbuild support.
70%