← Back to issue list

Provide a way for apps to warn users about deprecated features.

View original Github issue

Metadata

Project
craft-cli
Number
#266
Type
issue
State
open
Author
lengau
Labels
—
Created
Updated
Closed
—

Current evaluation

Maintainer-filed request for an Emitter deprecation-warning API (docs link, version-to-error, once-per-run, silencing). Emitter.warning() (#358) covers only basic warnings; the dedicated mechanism is unimplemented. Tracked as CRAFT-3174.

Suggested action: keep open

Reason: The issue is authored by maintainer lengau (implicitly triaged and legitimized) and linked to internal ticket CRAFT-3174, and remains a valid, clearly-scoped API request. PR #358 added a generic Emitter.warning() (messages.py:579) that lacks every specific element requested here — docs link, version-to-error mapping, once-per-run dedup, and silencing — while dispatcher.py:536 still uses the emit.progress(permanent=True) workaround the issue explicitly calls out. Confidence is held at 70 because the existence of warning() creates ambiguity about whether the maintainer considers the core need satisfied, and the dedup/silencing design is unspecified.

Evaluated by: mr-cal-bot

Impact: 30 Quick Win: 10 Complexity: 50 Confidence: 70 Actionability: 68

Issue body

### What needs to get done Similar to `CraftError` but this would be a way to alert users that something is deprecated and will be removed in a future release of the app. Ideally, it would be something equivalent to `warnings.warn()`, perhaps a `warning()` method on the `Emitter`, that gets: 1. A warning message for the user (that will be emitted permanently to stderr) 2. A link to documentation about the change. 3. (Optionally) a version in which the warning will become an error. This particular warning should only be emitted once per application run, and the app should be able to disable these warnings. (e.g. if an app is going to run in managed mode, the outer version can silence its own warnings.) ### Why it needs to get done Currently applications either implement this themselves or just use `emit.progress` with `permanent=True`, but this would help the app have a consistent way to do it.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 30
Quick Win: 10
Complexity: 50
Confidence: 70
Actionability: 68
keep open Maintainer-filed request for an Emitter deprecation-warning API (docs link, version-to-error, once-per-run, silencing). Emitter.warning() (#358) covers only basic warnings; the dedicated mechanism is unimplemented. Tracked as CRAFT-3174.
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 11
Complexity: 40
Confidence: 70
Actionability: 60
keep open Feature request for a dedicated deprecation warning system with docs links, version-to-error mapping, once-per-run deduplication, and silencing capability.
qwen/qwen3.8-27b
Impact: 35
Quick Win: 23
Staleness: 75
Complexity: 35
Confidence: 72
Support Request: 0
close stale Feature request for a deprecation-warning API on the Emitter (message, docs link, optional error version, once-per-run, disableable). Core warning() method was added in PR #358; extra features remain unimplemented. Inactive ~1.5 years.
qwen/qwen3.6-35b-a3b
Staleness: 65
Complexity: 40
Confidence: 85
Support Request: 10
needs triage Feature request to add a standardized deprecation warning mechanism for apps, similar to Python's warnings.warn(). Currently unlabelled and awaiting triage.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 45
Confidence: 75
Support Request: 10
needs triage Feature request to add a deprecation warning mechanism to the Emitter, similar to warnings.warn(), for consistent app-level deprecation handling. Unassessed and inactive for over a year.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-cli#358 (confidence 82%)

    Commit 4736b39 'feat(emitter): add warning method' shipped in 3.2.0; provides a generic stderr warning with a prefix but none of the deprecation-specific features requested here.

  • Related To: canonical/craft-cli#361 (confidence 55%)

    Referenced in dispatcher.py:246-247 as the issue for removing default_command/allow_default_command; its deprecation notice is implemented via the emit.progress(permanent=True) workaround this issue asks to replace.

Related issues

No related issues found above the similarity threshold.