← Back to issue list

create_build_plan: refactor

View original Github issue

Metadata

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

Current evaluation

Merged PR #837 (commit 974a1bc1, merge bec5c7c4, CRAFT-1272): moved create_build_plan to new charmcraft/providers/providers.py, made it return named tuples, and added direct unit tests.

Resolution: closed resolved

Reason: The PR was approved by facundobatusta and merged into main via commit bec5c7c4 (merge of #837 from branch mr-cal/refactor-plan), carrying the refactor commit 974a1bc1 that relocated create_build_plan and added unit tests.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Overview - `create_build_plan` is now in a common location so other commands can access it - `create_build_plan` returns a list of named tuples - Added a comprehensive set of unit tests. Previously, this function was only being tested indirectly. ### Rationale for the new file `charmcraft/providers/providers.py` As the new `craft-providers` interface is built out, the directory `charmcraft/providers/` will be split into 2 places: 1. `charmcraft/providers.py` for charmcraft-specific code 2. The `craft-providers` library The code in the `charmcraft/providers/` directory will be split piece-by-piece, in a series of small PRs. Once all the code is finally split, the file `charmcraft/providers/providers.py` will be moved to `charmcraft/providers.py`. Then, the directory will be removed. Finally, all references to the intermediate file`charmcraft/providers/providers.py` will be replaced with `charmcraft/providers.py`. (CRAFT-1272)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #837 (commit 974a1bc1, merge bec5c7c4, CRAFT-1272): moved create_build_plan to new charmcraft/providers/providers.py, made it return named tuples, and added direct unit tests.
stealth/space-bunny-alpha — closed resolved Merged canonical/charmcraft#837 (CRAFT-1272), moving create_build_plan to shared provider code, returning named tuples, and adding direct unit tests ahead of the craft-providers split.
stealth/space-bunny-alpha — closed resolved Merged PR #837 moved create_build_plan to shared code, returned named tuples, and added direct unit tests as part of the craft-providers split.
qwen/qwen3.6-35b-a3b — — Merged refactoring of create_build_plan to a shared location, returning named tuples and adding unit tests. Placed in charmcraft/providers/providers.py for splitting into the craft-providers library. Approved and merged.
qwen3.6-35b-a3b-mtp-q6 — — Merged refactoring of create_build_plan to a shared location, returning named tuples and adding unit tests. Added a temporary providers.py file as a stepping stone for future separation from craft-providers.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#843 (confidence 30%)

    Follow-up commits on charmcraft/providers/providers.py (e.g. 981a0bd9, bb1081ee, 5e5acb7c) continue the described craft-providers split that this PR's intermediate file anticipates.

Related issues

Issue Project State Summary Similarity
#81 feat: multi-base support for charm build plans craft-platforms merged Merged PR #81 as commit 519b705, adding multi-base charm build-plan support and fixing #73, with stricter shorthand validation and CraftPlatformsError.
75%
#1894 refactor: use craft-platforms for build plans charmcraft merged Merged PR #1894 (commit f1755e8f, +25/-33) replaced Charmcraft's custom build-plan generation for `platforms` charms with craft-platforms, routing exhaustive build plans through craft-application's BuildPlanService.
74%
#4 feat: add charmcraft build plans craft-platforms merged Merged charmcraft build-plan support and supporting build-plan utilities in canonical/craft-platforms#4 via commit efa325b.
74%