← Back to issue list

Greeting doesn't output as expected

View original Github issue

Metadata

Project
craft-cli
Number
#128
Type
issue
State
open
Author
mr-cal
Labels
Created
Updated
Closed

Current evaluation

craft-cli Emitter logs the greeting when set_mode() is called a second time with a different verbosity (e.g. snapcraft env var vs --verbosity flag), causing greeting in quiet mode or duplicated greeting. Reported by a maintainer in 2022, no labels, no comments, no fix found in current code.

Suggested action: needs triage

Reason: The issue has no labels, no comments, and no maintainer acknowledgement despite being filed by a maintainer (mr-cal) referencing snapcraft PR #3958, so it has never been triaged. The underlying code path still exists: craft_cli/messages.py set_mode() still emits the greeting and 'Logging execution to' lines to stderr whenever the mode changes to VERBOSE/DEBUG/TRACE, and dispatcher.py pre_parse_args() still calls emit.set_mode() after the app has already called emit.init(), so the double-set_mode scenario described is still reproducible in current code. It is a real (if cosmetic) bug, not a support request, but it is old (last activity 539 days ago) and low-severity, so it needs a maintainer to decide whether to fix or close.

Impact: 40 Quick Win: 24.0 Staleness: 75 Complexity: 40 Confidence: 70 Support Request: 5

Issue body

Uncovered with https://github.com/snapcore/snapcraft/pull/3958 Snapcraft makes the two calls on startup: ``` emit.init( mode=get_verbosity(), # verbosity comes from environmental variable ) ... dispatcher.pre_parse_args(sys.argv[1:]) ``` These two calls both call `craft_cli.set_mode()`. If the verbosity levels don't match between these two calls, then craft-cli may not log as expected. See scenarios below. ## Scenario 1 Greeting logged when in `quiet`. ### input `SNAPCRAFT_VERBOSITY_LEVEL=trace snapcraft --verbosity=quiet` ### output ``` 2022-10-26 11:26:15.135 Starting Snapcraft 7.2.1.post5+git529c27a2 2022-10-26 11:26:15.135 Logging execution to '/home/developer/.cache/snapcraft/log/snapcraft-20221026-112615.134692.log' ``` ## Scenario 2 Greeting logged twice. ## input `SNAPCRAFT_VERBOSITY_LEVEL=trace snapcraft --verbosity=trace` ### output ``` 2022-10-26 11:25:57.052 Starting Snapcraft 7.2.1.post5+git529c27a2 2022-10-26 11:25:57.052 Logging execution to '/home/developer/.cache/snapcraft/log/snapcraft-20221026-112557.051720.log' 2022-10-26 11:25:57.052 Starting Snapcraft 7.2.1.post5+git529c27a2 2022-10-26 11:25:57.052 Logging execution to '/home/developer/.cache/snapcraft/log/snapcraft-20221026-112557.051720.log' ... (logs continue in trace-level) ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 40
Quick Win: 24.0
Staleness: 75
Complexity: 40
Confidence: 70
Support Request: 5
needs triage craft-cli Emitter logs the greeting when set_mode() is called a second time with a different verbosity (e.g. snapcraft env var vs --verbosity flag), causing greeting in quiet mode or duplicated greeting. Reported by a maintainer in 2022, no labels, no comments, no fix found in current code.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 45
Confidence: 75
Support Request: 5
needs triage Bug where mismatched verbosity levels between craft_cli.set_mode() calls cause duplicate or unexpected greeting logs. Unlabelled, no maintainer response, inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 40
Confidence: 60
Support Request: 5
needs triage Unexpected greeting logs when craft_cli.set_mode() is called twice with mismatched verbosity. Issue is unlabelled, has zero comments, and has been inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 80
Complexity: 20
Confidence: 75
Support Request: 10
needs triage Mismatched verbosity levels between emit.init() and dispatcher.pre_parse_args() cause craft-cli to log greetings incorrectly when quiet or duplicate them when trace. Open, unassigned, awaiting triage.

Update history

No update history recorded yet.

Related work

  • Related To: snapcore/snapcraft#3958 (confidence 80%)

    The issue body states the bug was uncovered with snapcraft PR #3958, which introduced the second set_mode() call via pre_parse_args.

Related issues

No related issues found above the similarity threshold.