← Back to issue list

Dynamically import charmcraft init template

View original Github issue

Metadata

Project
charmcraft
Number
#762
Type
issue
State
closed
Author
PietroPasotti
Labels
—
Created
Updated
Closed

Current evaluation

Closed in favor of broader charmcraft init profile work, notably #568; live template-repository fetching was left for future discussion. Profile support later landed through PRs #854, #859 and #868.

Resolution: closed superseded

Reason: On 2022-09-06, maintainer facundobatista closed the request because the team already had several init-profile efforts underway, while leaving remote template repositories for further discussion. Subsequent PRs implemented local init profiles, including machine and Kubernetes variants, rather than the dynamic import proposed here.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Right now there are a few places where a starter can bootstrap their new charm project. The first (most documented) way is charmcraft init; the second would be to clone from a template repo such as https://github.com/canonical/template-operator (a personal favourte, there may be more) My proposal is to make charmcraft init fetch the code from a public template repository. The default should be https://github.com/canonical/template-operator (main branch) equivalent: ``` charmcraft init charmcraft init --branch=main ``` Then we could pass a flag to target a specific branch where we could host for example a machine charm template ``` charmcraft init --branch=machine ``` or a 'minimal' charm template for those among us who don't wish to spend the first 30m on a new project deleting stuff we don't need or use such as (for example) actions.yaml, removing the links to the config from the headers, removing all the httpbin stuff, removing _stored, etc... Related: #568

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed superseded Closed in favor of broader charmcraft init profile work, notably #568; live template-repository fetching was left for future discussion. Profile support later landed through PRs #854, #859 and #868.
stealth/space-bunny-alpha — closed superseded Closed by facundobatista (Sep 2022) in favour of broader charmcraft init-profile work (e.g. #568). Live-fetched template repos were dropped; profiles ship as vendored templates in charmcraft (init.py parent_template_dir).
stealth/space-bunny-alpha — closed superseded Closed in favor of broader charmcraft init-profile work, including #568. Live or vendored template repositories were left for further discussion.
qwen3.6-35b-a3b-mtp-q6 — — Closed as superseded by broader init profiles work. Dynamic template fetching was deferred to avoid internet dependency. Template customization will instead rely on vendored profiles and init-time substitutions.
qwen/qwen3.6-35b-a3b — — Closed as superseded. Remote template fetching was rejected due to offline dependency concerns. Maintainers implemented init profiles using bundled templates with substitution options instead, deferring this request to broader profile work.
qwen3.6-35b-a3b-mtp-q6 — — Closed as superseded by other open issues tracking charmcraft init profiles. The dynamic template repository proposal was deferred in favor of vendoring templates directly into charmcraft to avoid internet dependency and streamline profile management.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/charmcraft#868 (confidence 97%)

    Added a machine init profile, covering the principal profile use case discussed in the issue.

  • Related To: canonical/charmcraft#854 (confidence 96%)

    Added the profile option to the charmcraft init command.

  • Related To: canonical/charmcraft#859 (confidence 96%)

    Added a Kubernetes init profile.

  • Superseded By: canonical/charmcraft#568 (confidence 92%)

    The linked machine-template profile request became part of the broader init-profile direction that replaced this proposal.

Related issues

Issue Project State Summary Similarity
#568 Add a `charmcraft init` template for machine charms charmcraft closed The machine-charm init-template request was closed without a linked fix after the March 2022 discussion; later profile work is not tied to its closure.
77%
#854 Created the profile option for the init command (CRAFT-1317). charmcraft merged Merged PR #854 as commit 21b83fb0, adding an optional charmcraft init profile that defaults to simple and updating its scaffold template for CRAFT-1317.
74%
#91 First pass at 'charmcraft init' charmcraft merged Merged PR #91 delivered the first non-interactive charmcraft init scaffolding implementation; README improvements, extra options, and prompts were deferred (commit 0ebd9f87).
74%
#2365 Add test configuration templates for charmcraft charmcraft closed Test init profiles delivered by merged PR #2401 (commit a7334d49), adding test-machine and test-kubernetes templates for `charmcraft init`; shipped in Charmcraft 4.0.
71%
#238 `charmcraft init` creates broken charm charmcraft closed Superseded by charmcraft#247, a planned overhaul of init templates and generated tests; #247 later closed without implementing its proposed guard against building incomplete templates.
71%
#828 Automatically update template operator based on latest charmcraft init charmcraft closed Declined and closed. Maintainer facundobatista rejected the request to auto-sync template-operator with `charmcraft init`, saying the templates are intentionally independent and init profiles may replace the need.
71%
#1128 `charmcraft init`: issues with --profile docs, default profile, and default charm.py links charmcraft closed PR #1158 (commit 5b50d9e6) documented init profiles and replaced the outdated charm.py link; the default Kubernetes profile was left unchanged.
70%