cli: introduce --provider
Metadata
Current evaluation
Merged into master. Adds a --provider CLI flag for host, lxd, and multipass, replacing legacy flags. Refactors option handling, cleans up configuration, and increases coverage. Approved and passed CI.
Suggested action: —
No scores available.
Issue body
Valid options include `host`, `lxd`, and `multipass`. This approach
is more extendable than the --use-<provider> flags for future providers.
- Split _BUILD_OPTIONS into _BUILD_OPTIONS and _PROVIDER_OPTIONS
- Split add_build_options into add_build_options and add_provider_options
- Convert `clean` command to use `add_provider_options` so it doesn't
duplicate provider flags (--use-lxd, --destructive-mode, etc.).
- Minor cleanup for BuilderEnvironmentConfig:
-- drop is_multipass, no-one uses it
-- document lxd as valid provider
-- rename force_provider to build_provider
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
- [ ] 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/)?
- [ ] 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 into master. Adds a --provider CLI flag for host, lxd, and multipass, replacing legacy flags. Refactors option handling, cleans up configuration, and increases coverage. Approved and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into master. Introduces a --provider CLI flag for host, lxd, and multipass. Refactors build and provider option handling, updates the clean command, and cleans up BuilderEnvironmentConfig. Merged with improved test coverage. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged the --provider CLI flag to consolidate host, lxd, and multipass options. Refactored provider handling, updated the clean command, and improved coverage. Successfully merged after rebasing and passing checks. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2977 cli: merge build options into provider options | snapcraft | merged | Merged consolidation of build options into provider options in the CLI to simplify handling, as they are provider-specific. Approved by one reviewer, passed CI checks, and modified three files. | |
| #484 providers: refactor to better support multiple providers (CRAFT-362) | charmcraft | merged | Merged following two approvals and passing CI. Refactored the providers module into a package introducing a common Provider interface and LXDProvider subclass to accommodate future providers like Multipass. No behavioral changes. Minor naming adjustments applied during review. | |
| #2786 cli: add support for 'http-proxy' and 'https-proxy' parameters | snapcraft | merged | Merged after review and conflict resolution. Adds CLI parameters for http_proxy and https_proxy to configure build environment variables. Refactored to a unified option set with provider-specific support for lxd, multipass, host, and managed-host. |