diagnose: improve result reporting and output - #2425
Open
mjcheetham wants to merge 6 commits into
Open
Conversation
Allow the creation of the diagnose command without the standard diagnostics. This will enable us to add tests in the future that exercise the diagnostic infrastructure without always adding the standard diagnostics. The main application adds them when it creates the command. Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
mjcheetham
force-pushed
the
diagnose-v2
branch
from
August 28, 2026 15:53
307f98d to
7725618
Compare
Diagnostics currently collapse each run into a Boolean and an unstructured string log. That makes warnings indistinguishable from useful progress and forces tests to assert against presentation text. Introduce typed reports and derive success, warning, error, and skipped outcomes from them. Migrate the built-in diagnostics and teach the command to present warnings without turning them into failures. The reporter also retains associated exceptions and additional files for the consolidated log. Cover command exit behavior and networking reports at the typed reporter boundary. Assisted-by: GPT-5.6 Sol Fast (Internal only) Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
The command now retains outcome, report, exception, and file data for each diagnostic. Keeping presentation and file copying inside the execution loop would make the summary depend on mutable counters and scatter the logging rules. Return a result from each run and aggregate those results before copying files or printing the summary. Isolating header, exception, and presentation logic keeps the command flow linear and gives later options one place to decide how outcomes affect the exit status. Assisted-by: GPT-5.6 Sol Fast (Internal only) Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Add a new --strict flag to the diagnose command to return a non-zero result when warnings are emitted. Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Use the default AnsiConsole from Spectre.Console to spruce up our diagnostic terminal output. Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
mjcheetham
force-pushed
the
diagnose-v2
branch
from
August 28, 2026 16:11
7725618 to
63406bf
Compare
dscho
approved these changes
Sep 1, 2026
dscho
left a comment
Contributor
There was a problem hiding this comment.
In particular the "sprucing up" of the output should make those among us happy who insist on Quarter-by-Quarter Incremental Delivery, i.e. those who demand that every initiative/epic must come with a user-visible improvement 😉
Comment on lines
+108
to
+114
| ConsoleEx.WriteColor("[SKIP]", ConsoleColor.Gray); | ||
| ConsoleEx.WriteColor("[SKIP]", ConsoleColor.DarkGray); |
Contributor
There was a problem hiding this comment.
Not sure that this fits the bill of "diagnose: report structured outcomes" ;-) But it does not really matter, I think, it's not like this introduces a regression.
| _context = context; | ||
|
|
||
| var output = new Option<string>(new[] { "--output", "-o" }, "Output directory for diagnostic logs."); | ||
| var output = new Option<string>(["--output", "-o"], "Output directory for diagnostic logs."); |
Contributor
There was a problem hiding this comment.
In general, I dislike those drive-by changes by AI, they increase the cognitive load for reviewers in unnecessary ways. But in this instance, it's a net readability improvement, so I don't mind as much.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update
git-credential-manager diagnoseto report structured diagnostic outcomes instead of collapsing each diagnostic into a true/false result and an unstructured log.Distinguish successful, warning, error, and skipped diagnostic outcomes.
Use Spectre.Console to show live diagnostic status, colour-coded results, and a consolidated summary with generated log file paths.
Add
--strictso automated checks can treat warnings as a non-zero exit, while preserving the default behaviour of failing only on errors.Collect exceptions and additional files through the diagnostic reporter so presentation, logging, and file copying are handled consistently.
Allow diagnostics to be registered explicitly, making the command infrastructure easier to test independently of the standard diagnostics.
Add coverage for command exit behaviour and structured networking reports.
This ultimately forms a better base for expanding our diagnostic tests.
Example Terminal Output