← 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

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.

Suggested action: keep open

Reason: The issue is properly triaged (Status: Triaged, Type: Refactor labels), filed by a maintainer, and synced to internal Jira tickets CHARMCRAFT-677/678, so it has clear ownership. I confirmed the work is still pending: charmcraft/application/commands/init.py still uses the old custom implementation with --author, --force, and --project-dir, and no InitService references exist in the codebase. Inactivity (~7 months, bot comments only) does not make it obsolete since the target behavior is still unimplemented.

Impact: 35 Quick Win: 12.25 Staleness: 60 Complexity: 65 Confidence: 80 Support Request: 0

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
qwen/qwen3.8-27b
Impact: 35
Quick Win: 12.25
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 55
Confidence: 85
Support Request: 5
keep open Migrate Charmcraft's init command to craft-application's InitService, deprecating unused arguments and supporting template renaming. Currently triaged but inactive for 145 days, awaiting assignment and implementation.

Update history

No update history recorded yet.

Related work

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

    This issue explicitly supersedes #2316, which was closed without implementation; it is the predecessor of the same migration task.

  • Related To: charmcraft#2242 (confidence 85%)

    PR #2242 (merged as 040cce32) is cited in the issue as the reference implementation for the template file renaming feature that InitService must gain.

Related issues

Issue Project State Summary Similarity
#2316 Charmcraft init migrated to InitService charmcraft closed The bounty to migrate Charmcraft's init command to craft-application's InitService was closed without implementation. Multiple contributors submitted proposals, but maintainers declined to proceed, leaving the task abandoned.
85%
#1153 Move the init command to craft-application charmcraft closed Closed without implementation. The migration of the init command to craft-application was abandoned or superseded, with no comments or merge details recorded.
71%