build providers: tweak environment clean detection and logging
Metadata
Current evaluation
Merged #3216 in commit a00e3f52d, improving build-environment clean detection/logging and consolidating clean_project() into one call.
Resolution: closed resolved
Reason: PR #3216 was merged as commit a00e3f52d. It clarified unknown-state logging, reworded other cleaning messages, and extracted _check_environment_needs_cleaning() to centralize the cleanup decision.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Requires #3215
This error is often incorrect:
f"Build environment was created with unknown snapcraft version {built_by!r}, cleaning."
Update to more accurately describe that we simply don't know its state:
"Build environment is in unknown state, cleaning first."
For consistency, also reword the following by specifying "first":
(2) f"Project base changed from {provider_base!r} to {build_base!r}, cleaning build instance."
-> f"Project base changed from {provider_base!r} to {build_base!r}, cleaning first."
(3) f"Build environment was created with newer snapcraft version {built_by!r}, cleaning."
-> f"Build environment was created with newer snapcraft version {built_by!r}, cleaning first."
Pull these checks into new function '_check_environment_needs_cleaning()',
so there is only one call to clean_project().
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged #3216 in commit a00e3f52d, improving build-environment clean detection/logging and consolidating clean_project() into one call. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in #3216 via a00e3f52d, refining build-environment cleanup detection and messages while consolidating checks into one clean_project() call. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #3216 in a00e3f52d, clarifying environment cleanup logs and consolidating checks into _check_environment_needs_cleaning() with one clean_project() call. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #3216 in commit a00e3f52d, refining build-environment cleanup detection and logging while consolidating clean_project() calls. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3216 (commit a00e3f52d) clarified build-environment cleaning detection and logging, and consolidated clean_project() calls. Required #3215. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #3216 (commit a00e3f52d), clarifying build-environment cleanup logs and consolidating cleaning checks into _check_environment_needs_cleaning() with one clean_project() call. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Updated build environment cleaning detection and logging messages for accuracy and consistency. Refactored checks into a single _check_environment_needs_cleaning() function to consolidate clean_project() calls. Approved and merged by maintainer cjp256. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Updated build environment cleaning detection and logging for accuracy and consistency. Refactored checks into _check_environment_needs_cleaning() to consolidate clean_project() calls. |
Update history
No update history recorded yet.
Related work
-
Related To:
canonical/snapcraft#3215
(confidence 100%)
Required prerequisite PR implementing PEP 440-compliant SnapCraft version comparison.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3434 build providers: clean environment if project directory is changed | snapcraft | merged | Merged PR #3434 as commit 805327b65, adding project-directory tracking and cleaning build environments after relocation or project-name reuse. | |
| #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. | |
| #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. | |
| #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. |