← Back to issue list

Charmcraft init migrated to InitService

View original Github issue

Metadata

Project
charmcraft
Number
#2547
Type
issue
State
open
Author
mr-cal
Labels
Status: Triaged Type: Refactor
Created
Updated
Closed
—

Current evaluation

Core migration landed in #2873, but init still exposes --author, --force, and --project-dir; required warning/help cleanup and testcraft coverage remain incomplete or unverified.

Suggested action: keep open

Reason: Commit 3eb45f3a and #2873 added the core migration: InitCommand now extends craft-application's command, CharmcraftInitService extends InitService, and workload files are renamed. However, the current command still advertises and consumes --author and --force and still lists --project-dir in help, contrary to the stated compatibility behavior; the requested testcraft coverage was not verified.

Evaluated by: mr-cal-bot

Impact: 46 Quick Win: 17 Complexity: 57 Confidence: 93 Actionability: 88

Issue body

### Check existing issues - [x] I've verified that this request isn't described by any existing issues. ### Request Replace the current [`init` command](https://github.com/canonical/charmcraft/blob/main/charmcraft/application/commands/init.py) in Charmcraft with the [craft-application `init` command](https://github.com/canonical/craft-application/blob/main/craft_application/commands/init.py), extending the craft-application command and the [InitService](https://github.com/canonical/craft-application/blob/main/craft_application/services/init.py) to make this possible. ### The problem it solves * All existing args must be accepted. However: * The `--author` argument (and the general GECOS info) is no longer used and may simply output a warning that it’s not used. * `--force` can similarly be replaced with a warning. (The craft-application behaviour of initing a project even if files exist in this directory as long as they’re not overwritten is acceptable as the default, so the behaviour of `--force` becomes the default behaviour) * The command must accept either the positional `project_dir` as in craft-application or `--project-dir` as in existing charmcraft, with a migration note for users. * `--project-dir` should be removed from the help and documentation * Extend the craft-application InitService to be able to rename template files, similar to how it’s implemented in [https://github.com/canonical/charmcraft/pull/2242](https://github.com/canonical/charmcraft/pull/2242) * This should include at least one `testcraft` spread test that uses this feature. * End-to-end tests in Charmcraft pass without changes Supersedes #2316

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 46
Quick Win: 17
Complexity: 57
Confidence: 93
Actionability: 88
keep open Core migration landed in #2873, but init still exposes --author, --force, and --project-dir; required warning/help cleanup and testcraft coverage remain incomplete or unverified.
stealth/space-bunny-alpha
Impact: 54
Quick Win: 14
Complexity: 73
Confidence: 94
Actionability: 95
keep open Triaged Charmcraft refactor to replace its init command with craft-application InitService, add template-file renaming, preserve CLI compatibility, and retain end-to-end coverage; still open.
stealth/space-bunny-alpha
Impact: 48
Quick Win: 13
Complexity: 68
Confidence: 92
Actionability: 86
keep open Triaged, maintainer-authored refactor to migrate Charmcraft init to craft-application’s InitService, with CLI compatibility, template renaming, and tests; still open.
qwen/qwen3.6-35b-a3b
Impact: 45
Quick Win: 16
Complexity: 55
Confidence: 80
Actionability: 80
keep open Refactor to migrate Charmcraft's init command to craft-application's InitService, extending InitService for template file renaming. Issue is triaged and open; migration not yet implemented.
qwen/qwen3.8-27b
Impact: 35
Quick Win: 12
Staleness: 60
Complexity: 65
Confidence: 80
Support Request: 0
keep open Refactor to replace charmcraft's custom init command with craft-application's init command and InitService, deprecating --author/--force and extending InitService with template file renaming. Triaged, tracked in Jira, not yet implemented.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 45
Confidence: 80
Support Request: 5
keep open Refactor to migrate Charmcraft's init command to craft-application's InitService. Triaged and clearly scoped, but inactive for 181 days with only automated Jira sync comments.
qwen3.6-35b-a3b-mtp-q6
Staleness: 55
Complexity: 40
Confidence: 85
Support Request: 0
keep open Refactor to replace Charmcraft's init command with craft-application's InitService. Triaged and labeled as a refactor, but has seen no maintainer discussion or progress in over 5 months.
qwen3.6-35b-a3b-mtp-q6
Staleness: 55
Complexity: 45
Confidence: 80
Support Request: 5
keep open Refactor to migrate Charmcraft's init command to craft-application's InitService, handling deprecated args and extending template renaming. Triaged but inactive for 164 days.

Update history

No update history recorded yet.

Related work

  • Related To: charmcraft#2316 (confidence 100%)

    The issue explicitly says it supersedes #2316, which was closed without a resolving PR or commit.

  • Likely Fixed By: charmcraft#2873 (confidence 88%)

    Commit 3eb45f3a introduced the current InitService-based implementation, including workload-file renaming, but appears to cover only the core migration.

Related issues

Issue Project State Summary Similarity
#2316 Charmcraft init migrated to InitService charmcraft closed Bounty closed after proposals stalled and no implementation was linked; @mr-cal announced its closure. PR #2873 later delivered the visible InitCommand/InitService migration.
75%