providers: refactor clean_project_environments
Metadata
Current evaluation
Merged PR #3929 as commit 19343788, removing get_instance_name() from clean_project_environments() and renaming is_provider_available() to is_provider_installed().
Resolution: closed resolved
Reason: PR #3929 was merged into main as commit 19343788. It completed the CRAFT-1396 provider-interface refactor and updated affected code and tests.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [X] Have you successfully run `make lint`?
- [X] Have you successfully run `pytest tests/unit`?
-----
Two changes to the `craft-providers()` interface:
1. Move the snapcraft-specific call `get_instance_name()` out of `clean_project_environments()`
2. Rename `is_provider_available()` to `is_provider_installed()`
These changes match what was done for [rockcraft](https://github.com/canonical/rockcraft/blob/5d7ed67646a10e5b35319c12d664df7b1e1a14b9/rockcraft/providers/_provider.py#L33).
(CRAFT-1396)
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3929 as commit 19343788, removing get_instance_name() from clean_project_environments() and renaming is_provider_available() to is_provider_installed(). | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3929 (commit 19343788), removing get_instance_name() from clean_project_environments() and renaming is_provider_available() to is_provider_installed(). | |
| qwen/qwen3.6-35b-a3b | — | — | Merged a refactor to the craft-providers interface, removing get_instance_name() from clean_project_environments() and renaming is_provider_available() to is_provider_installed(). Aligns with rockcraft, passed CI, and increased coverage by 0.13%. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged refactoring of clean_project_environments to extract get_instance_name() and rename is_provider_available() to is_provider_installed(), aligning with rockcraft. Successfully merged into main with 100% diff coverage and a 0.13% overall increase. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #410 providers: introduce clean_project_environments() (CRAFT-314) | charmcraft | merged | Merged #410 via 91207ad4, adding clean_project_environments() in 4aa71880 to remove all project environments and support the upcoming clean command. | |
| #95 providers: add `create_environment` method | rockcraft | merged | Merged PR #95 as commit 00b557bf, adding Provider.create_environment() for project-environment cleanup. |