build providers: destroy on create failures
Metadata
Current evaluation
Merged. Resolves a bug where build providers and VMs remained running after launch failures. Adds cleanup logic and tests across seven files, approved by a reviewer and passing CI checks.
Suggested action: —
No scores available.
Issue body
When launch fails within the context manager, there is not logic that
ensures the build provider is actually destroyed so the VM does not
stay running.
LP: #1792242
- [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [ ] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [ ] Have you successfully run `./runtests.sh static`?
- [ ] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Resolves a bug where build providers and VMs remained running after launch failures. Adds cleanup logic and tests across seven files, approved by a reviewer and passing CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged changes implement cleanup logic to destroy build provider VMs after creation failures, resolving LP #1792242. Comprehensive tests ensure proper resource teardown, achieving 93.33% diff coverage. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix that ensures build provider VMs are destroyed upon launch failures within the context manager. The update adds necessary cleanup logic and tests to prevent orphaned instances, resolving LP #1792242. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2474 build providers: remove dead code | snapcraft | merged | Merged removal of dead code for legacy cleanbuild support in build providers. Approved by one reviewer, passed CI, and modified three files (+54/-165 lines). | |
| #2940 build providers: remove use of cloud-init | snapcraft | merged | Merged changes removing cloud-init from build providers. Refactored to use _run and _push_file methods, isolating initial setup. Approved by reviewer, passed CI, and updated six files. | |
| #2282 build providers: cleaner start and launch messaging | snapcraft | merged | Merged changes that clean up start and launch messaging for build providers. Approved by one reviewer, passed CI checks, and modified eight files to address Launchpad issue #1793101. | |
| #2508 Build provider errors | snapcraft | merged | Merged after approval and passing CI checks. Resolved build provider errors across two files (+353/-85 lines). Codecov reported 90.62% diff coverage. | |
| #5537 docs: update build provider procedures | snapcraft | merged | Merged documentation update to build provider procedures, resolving issue #5519. Approved by two reviewers and passed most CI checks despite minor integration test failures. Changes span four files with 100 lines added and 98 removed. | |
| #3434 build providers: clean environment if project directory is changed | snapcraft | merged | Merged into master. Fixes environment cleanup when project directories are relocated or reused. The build provider now tracks the directory path, verifies compatibility, and automatically cleans the environment on mismatch. Approved and passed CI. | |
| #3284 build providers: rename clean() -> clean_parts() to clarify scope | snapcraft | merged | Merged into master. Renames build provider clean() to clean_parts() to clarify scope, as cleanup extends beyond parts. Approved by one reviewer with 100% diff coverage and zero unresolved comments. | |
| #2252 build providers: shell in provider if debug is used | snapcraft | merged | Merged changes enabling shell access in build providers during debug sessions. Approved by a reviewer, passed CI, and updated five files with 112 additions and 21 deletions. | |
| #2249 build providers: provide support to shell in | snapcraft | merged | Merged. Adds shell access support to build providers, resolving LP #1782775. Approved by reviewer, passed CI checks, and implemented across 8 files. | |
| #2275 build providers: use the provider if exported | snapcraft | merged | Merged an update to build provider logic that enables using a provider if it is exported. Approved by a reviewer, passed CI checks, and integrated into the codebase. |