charmcraft: perform LXD checks before use (CRAFT-420)
Metadata
Current evaluation
Merged to charmcraft, adding pre-use LXD readiness and permission validation to the provider module. Consolidates existing checks, updates mocks, and improves import structure. Approved by two reviewers and passed CI.
Suggested action: —
No scores available.
Issue body
Invoke ensure_lxd_is_ready() interface before using LXD
provider. This consolidates a couple of existing checks
done elsewhere as well as a new one for ensuring the user
has the necessary permissions to use LXD.
Minor simplification of imports used in providers module
to improve and update mocks accordingly.
Example error:
```
$ /snap/bin/charmcraft pack
LXD requires additional permissions.
Please ensure that the user is in the 'lxd' group.
(full execution logs in '/home/test1/snap/charmcraft/common/charmcraft-log-0xgcist7')
```
Signed-off-by: Chris Patterson <chris.patterson@canonical.com>
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged to charmcraft, adding pre-use LXD readiness and permission validation to the provider module. Consolidates existing checks, updates mocks, and improves import structure. Approved by two reviewers and passed CI. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged implementation adding pre-use LXD readiness and permission validation to charmcraft. Consolidates existing checks, verifies user group membership, and updates mocks to prevent runtime errors. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Adds pre-use LXD readiness and permission checks to charmcraft, consolidating existing validations and verifying group membership. Updates provider imports and mocks. Resolves CRAFT-420. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #412 clean: introduce clean command (CRAFT-62) | charmcraft | merged | Merged. Introduces a clean command to remove LXD containers built by Charmcraft and adds a caplog filter fixture for testing. Approved by two reviewers, the update modifies five files with 116 additions and 4 deletions. | |
| #925 providers: set lxd project to 'charmcraft' | charmcraft | merged | Merged a fix setting the LXD project to 'charmcraft' instead of 'default', resolving a regression from the craft-providers migration. Approved by one reviewer, the change updates two files with a +10/-4 diff. | |
| #2436 ci: check charms generated by `charmcraft init` | charmcraft | merged | Merged a dedicated CI spread test validating linting and unit tests for charms generated by charmcraft init across kubernetes and machine profiles. Approved by two reviewers, passes CI checks, and adds 25 lines of test configuration. | |
| #3660 providers: integrate craft-providers support | snapcraft | merged | Integrated craft-providers support to run lifecycle commands in LXD or Multipass build providers. Merged with 1338 additions and 41 deletions across 22 files, adapting Charmcraft's implementation after reviewer approval. | |
| #504 providers: improve error handling (CRAFT-472) | charmcraft | merged | Improved error handling for provider-generated exceptions by adding try/except blocks for LXD and Multipass, chaining exceptions, and adding test coverage. Merged after approval and passing CI checks. | |
| #380 Charmcraft imported improvements | starbase | merged | Merged minor import improvements for Charmcraft across two files. Approved by two reviewers and passed all CI checks before integration. | |
| #9 providers: add build provider support (CRAFT-28) | rockcraft | merged | Merged integration of rockcraft with craft-providers to run build providers on LXD instances. The change ports Charmcraft glue code, hardwires execution to LXD, and defers user messages and log retrieval to follow-up PRs. Approved and passed CI. |