← Back to issue list

providers: move `get_provider()` to providers.py

View original Github issue

Metadata

Project
snapcraft
Number
#3940
Type
pull request
State
merged
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #3940 by mr-cal moved get_provider() into snapcraft/providers.py (squash commit 2acdd89b6), a CRAFT-1409 refactor mirroring canonical/rockcraft#92, part of a series of provider/lifecycle function moves.

Resolution: closed resolved

Reason: The PR itself was merged into main as commit 2acdd89b6 ("providers: move `get_provider()` to providers.py (#3940)") with an approving review; it landed as part of the CRAFT-1409 refactoring series alongside #3926, #3927, #3930 and #3938.

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`? ----- Move `get_provider()` to `providers.py`. Similar to [this rockcraft PR](https://github.com/canonical/rockcraft/pull/92) (CRAFT-1409)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #3940 by mr-cal moved get_provider() into snapcraft/providers.py (squash commit 2acdd89b6), a CRAFT-1409 refactor mirroring canonical/rockcraft#92, part of a series of provider/lifecycle function moves.
stealth/space-bunny-alpha — closed resolved Merged PR #3940 (commit 2acdd89b6) relocating get_provider() into snapcraft/providers.py per CRAFT-1409, mirroring rockcraft#92; call sites in commands/lint.py and parts/lifecycle.py and unit tests updated.
stealth/space-bunny-alpha — closed resolved Merged snapcore/snapcraft#3940, moving get_provider() into providers.py to align with Rockcraft. The approved refactor changed 7 files and achieved 100% diff coverage.
qwen/qwen3.6-35b-a3b — — Merged the refactoring that moves get_provider() to providers.py. Aligned with rockcraft, the change passed code review and CI checks, modified 7 files, and was successfully integrated into main.
qwen3.6-35b-a3b-mtp-q6 — — Merged the refactoring that moves get_provider() to providers.py, aligning with rockcraft. The change passed all checks, achieved 100% diff coverage, and was integrated into main with a negligible 0.01% overall coverage decrease.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#3926 (confidence 92%)

    Same CRAFT-1409 series: moved get_instance_name() to providers.py, merged as 917d5e76a before this PR

  • Related To: snapcraft#3927 (confidence 92%)

    Same series: moved get_command_environment() to providers.py (c1246cbe3)

  • Related To: snapcraft#3930 (confidence 90%)

    Same refactor effort: moved mount logic to lifecycle.py (1c3a7eb92)

  • Related To: snapcraft#3938 (confidence 88%)

    Same series: moved confirm_with_user() call into providers.py (792d45f2f, the base branch commit)

  • Related To: canonical/rockcraft#92 (confidence 85%)

    Upstream rockcraft PR cited in the description as the model for this refactor

Related issues

Issue Project State Summary Similarity
#898 providers: move `get_provider()` to providers.py charmcraft merged Merged charmcraft#898, moving get_provider() into providers.py for CRAFT-1410 after prerequisite charmcraft#896 landed.
85%
#92 providers: refactor get_provider() rockcraft merged Merged PR #92 as commit 5bcc1c80, refactoring get_provider() and moving it from _get_provider.py to providers.py for CRAFT-1375.
82%
#3926 providers: move `get_instance_name()` to providers.py snapcraft merged Merged as commit c1246cbe3 (+82/-45, 6 files): moved the snapcraft-specific get_instance_name() out of craft-providers into snapcraft/providers/providers.py (CRAFT-1305 prep for the new craft-providers API).
81%
#3927 providers: move `get_command_environment()` to providers.py snapcraft merged Merged PR #3927 moved Snapcraft's get_command_environment() from the craft-providers interface to providers.py, resolving CRAFT-1352 in commit 917d5e76a.
76%
#71 providers: install rockcraft snap via craft-providers API rockcraft merged Merged as f31183b7, refactoring provider setup to install the Rockcraft snap through the craft-providers API without functional changes.
75%
#3943 providers: use new craft-providers interface snapcraft merged Merged into snapcraft main as commit 2980d145c: removed in-tree Provider/LXDProvider/MultipassProvider classes in favour of craft-providers, and moved snapcraft/providers/providers.py to snapcraft/providers.py (+65/-1173).
75%
#484 providers: refactor to better support multiple providers (CRAFT-362) charmcraft merged Merged PR #484 (commit 93982f90, merge 7a1f50fc) by cjp256 converted providers module into a package for CRAFT-362: added common Provider class, LXDProvider subclass and get_provider(); follow-ups moved get_provider() to providers.py and renamed _helpers to _logs.
74%
#120 providers: use new craft-providers interface rockcraft merged Merged as 3f887b70: replaced Rockcraft's local provider classes with craft-providers and moved providers.py.
73%
#3938 providers: move `confirm_with_user()` call to providers.py (#91) snapcraft merged Merged #3938 moved Snapcraft's confirm_with_user() prompt out of the craft-providers interface and into providers.py; landed as commit 792d45f2f.
73%
#91 providers: move `confirm_with_user()` call to providers.py rockcraft merged Merged PR #91 as b189a224, moving Rockcraft-specific confirm_with_user() into providers.py and renaming is_provider_available() to is_provider_installed().
73%