← 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

Partially resolved: PR #301 stops duplicate greetings for repeated trace modes, but current code still prints the initial trace greeting before CLI --verbosity=quiet is parsed.

Suggested action: keep open

Reason: Commit 6fa01e1 and PR #301 added an unchanged-mode guard, and release 2.10.1 confirms this resolved Scenario 2. However, Emitter.init() prints the greeting while initializing trace mode, and Dispatcher.pre_parse_args() later switches to quiet without removing that output, leaving Scenario 1 present in the current implementation.

Evaluated by: mr-cal-bot

Impact: 30 Quick Win: 14 Complexity: 42 Confidence: 96 Actionability: 82

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
stealth/space-bunny-alpha
Impact: 30
Quick Win: 14
Complexity: 42
Confidence: 96
Actionability: 82
keep open Partially resolved: PR #301 stops duplicate greetings for repeated trace modes, but current code still prints the initial trace greeting before CLI --verbosity=quiet is parsed.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 8
Complexity: 60
Confidence: 70
Actionability: 50
keep open craft-cli greeting displayed incorrectly when emit.init() and pre_parse_args() use different verbosity levels; partially fixed by #301 for duplicate greetings but quiet mode issue remains
qwen/qwen3.8-27b
Impact: 40
Quick Win: 24
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.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: craft-cli#301 (confidence 99%)

    Commit 6fa01e1 prevents repeated greetings when the mode is unchanged, resolving the duplicate-greeting scenario but not the initial trace-to-quiet case.

Related issues

No related issues found above the similarity threshold.