Skip to content

chore: bump dependencies (consolidates 7 dependabot PRs)#201

Merged
FrankRay78 merged 4 commits into
mainfrom
chore/dependency-bumps-2026-05
May 19, 2026
Merged

chore: bump dependencies (consolidates 7 dependabot PRs)#201
FrankRay78 merged 4 commits into
mainfrom
chore/dependency-bumps-2026-05

Conversation

@FrankRay78
Copy link
Copy Markdown
Owner

Summary

Consolidates the 7 open dependabot chore PRs into a single branch so they can be tested together and merged in one go.

Closes #78, #123, #144, #156, #172, #180, #181.

Bumps

Package From To PR
Spectre.Console 0.54.0 0.55.2 #181
Spectre.Console.Cli 1.0.0-alpha.0.11 1.0.0-alpha.0.16 #172
Spectre.Console.Cli.Testing 1.0.0-alpha.0.11 1.0.0-alpha.0.16 #172
Spectre.Console.Testing 0.54.0 0.55.2 #172
Microsoft.NET.Test.Sdk 17.14.x 18.5.1 #180
Verify / Verify.Xunit 30.x 31.12.5 #156
Roslynator.Analyzers 4.14.1 4.15.0 #144
BenchmarkDotNet 0.15.5 0.15.8 #123
xunit.runner.visualstudio 3.1.4 3.1.5 #78

Code change required by Spectre.Console 0.55

IAnsiConsole gained a new WriteAnsi(Action<AnsiWriter>) method (the new Spectre.Console.Ansi library). The two in-repo implementers needed implementations:

  • FileConsole.WriteAnsi — no-op (file output is plain text only, matches existing Clear no-op pattern)
  • CompositeAnsiConsole.WriteAnsi — forwards to inner consoles (matches existing Write / Clear pattern)

No other 0.55 / Verify 31 breaking changes affected this codebase.

Test plan

  • dotnet build — 7 projects, 0 errors, 0 warnings
  • dotnet test — 582 tests pass (incl. all Verify snapshot tests)
  • CI green on push
  • Smoke-run the CLI after merge to confirm Spectre rendering is unchanged in the terminal

🤖 Generated with Claude Code

FrankRay78 and others added 2 commits May 19, 2026 19:24
)

- Spectre.Console 0.54.0 -> 0.55.2 (#181)
- Spectre.Console.Cli/Cli.Testing 1.0.0-alpha.0.11 -> 0.16 (#172)
- Spectre.Console.Testing 0.54.0 -> 0.55.2 (#172)
- Microsoft.NET.Test.Sdk -> 18.5.1 (#180)
- Verify / Verify.Xunit -> 31.12.5 (#156)
- Roslynator.Analyzers 4.14.1 -> 4.15.0 (#144)
- BenchmarkDotNet 0.15.5 -> 0.15.8 (#123)
- xunit.runner.visualstudio 3.1.4 -> 3.1.5 (#78)

Implement new IAnsiConsole.WriteAnsi(Action<AnsiWriter>) member added in
Spectre.Console 0.55 on FileConsole (no-op, file output is plain text)
and CompositeAnsiConsole (forwards to inner consoles).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@FrankRay78
Copy link
Copy Markdown
Owner Author

@claude Please review this PR

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 19, 2026

Claude finished @FrankRay78's task in 1m 59s —— View job


PR Review

  • Gather context and understand request
  • Read changed files
  • Review dependency version bumps
  • Review code changes (WriteAnsi implementations)
  • Post final review

Summary

Solid dependency consolidation PR. The version bumps are mechanical and correct, and the WriteAnsi additions follow the existing Write/Clear patterns faithfully. Build passes clean, 582 tests pass. One genuine concern to address before merge.


WriteAnsi Implementations

FileConsole.WriteAnsi (src/NetPace.Console/FileConsole.cs:82) — correct no-op, consistent with Clear (also a no-op for file output). The doc comment explains the rationale clearly.

CompositeAnsiConsole.WriteAnsi (src/NetPace.Console/CompositeAnsiConsole.cs:70) — correctly fans out to all inner consoles, consistent with both Write and Clear.

One thing worth knowing: action is invoked once per inner console. Each inner console creates its own AnsiWriter, so this is fine — there's no shared state between calls. The implementation is correct.


Concern: TDD Gap on New Interface Members

The constitution is unambiguous — production code requires a failing test first. Both WriteAnsi implementations are production code with no tests.

CompositeAnsiConsole has no test class at all. FileConsole has one test (FileConsoleTests.cs), but WriteAnsi is untested.

For FileConsole.WriteAnsi (no-op), a minimal test would assert it does not throw:

[Fact]
public void WriteAnsi_DoesNotThrow_ForFileConsole()
{
    using var fileConsole = new FileConsole(_testFilePath, FileMode.Overwrite);
    fileConsole.WriteAnsi(_ => { });
    // No assertion needed — we're verifying no exception
}

For CompositeAnsiConsole.WriteAnsi, a test should verify that the action is forwarded to each inner console. Since there is no existing test infrastructure for CompositeAnsiConsole, this would require standing up a mock/test double (or a simple spy). The test would assert the action was invoked on each inner console.

The Clear no-op on CompositeAnsiConsole and FileConsole is also untested — this PR extends a pre-existing gap. That gap should be noted, but closing the full gap is probably out of scope here. At minimum, adding a WriteAnsi_DoesNotThrow test for FileConsole is a low-effort way to stay compliant for the new code introduced in this PR.

Fix this →


Other Observations

Spectre.Console.Cli still at alpha (1.0.0-alpha.0.16) — pre-existing condition, not introduced here. This is the Spectre.Console.Cli separate-package experiment the Spectre team is running. Low operational risk since it tracks the main Spectre.Console release, but worth keeping on the radar for a future GA dependency.

Microsoft.NET.Test.Sdk 17.x → 18.x — a major version jump. Low risk given all 582 tests pass, but worth a quick skim of the 18.x release notes to ensure no test runner behaviour changes could silently affect CI output interpretation.

.claude/settings.json — the three new rtk git allowlist entries (git status, log, diff) are benign read-only operations.


Verdict

Approve with the test gap noted. The dependency bumps are correct, the WriteAnsi implementations are idiomatic and consistent, and the codebase is in a healthy state post-bump. The TDD gap on WriteAnsi is the one thing to close — a straightforward fix that can go in before or immediately after merge.

- Add FileConsoleTests.WriteAnsi_DoesNotThrow (no-op contract).
- Add CompositeAnsiConsoleTests covering Write + WriteAnsi fan-out
  to all inner consoles via a SpyConsole.
- Remove Spectre.Console.Cli and Spectre.Console.Cli.Testing from
  NetPace.Console.Tests — neither is referenced in any .cs file
  (CLAUDE.md already notes Spectre.Console.Cli was replaced).

Closes the TDD gap flagged in the PR #201 review.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@FrankRay78
Copy link
Copy Markdown
Owner Author

@claude All good now?

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 19, 2026

Claude finished @FrankRay78's task in 48s —— View job


Re-review

  • Gather context
  • Read new/modified test files
  • Verify WriteAnsi coverage is complete
  • Post verdict

Yes, all good.

The concern from the previous review has been addressed in commit 2c7459f.

FileConsoleTests.csWriteAnsi_DoesNotThrow_ForFileConsole added (lines 44–51). Exactly the pattern suggested: instantiates a FileConsole, calls WriteAnsi, no assertion needed (no exception = pass).

CompositeAnsiConsoleTests.cs — New file with a SpyConsole test double and two tests:

  • WriteAnsi_ForwardsActionToEveryInnerConsole — confirms the action reaches each unique inner console; the assertion counts are correct given _consoles = [primary, secondary].
  • Write_ForwardsRenderableToEveryInnerConsole — bonus coverage for the Write fan-out (pre-existing behaviour, now tested).

Both follow the project's Given-When-Then structure and MethodName_Scenario_ExpectedResult naming convention.

The Spectre.Console.Cli / Spectre.Console.Cli.Testing package removals from the test csproj are a tidy bonus — they were pulled in by the bump PR but weren't used in the test project.

Verdict: ready to merge. The only outstanding item is CI going green on the push, which the PR description already has as a pending checkbox.

@FrankRay78
Copy link
Copy Markdown
Owner Author

@claude Please investigate the build job failure, which is due to a stream being disposed when written to, and the check this PR to see if I've fixed it already: #199

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 19, 2026

Claude finished @FrankRay78's task in 4m 40s —— View job


Build failure fixed

  • Gather context
  • Check CI status on this PR — failed
  • Investigate the stream-disposed build failure — root cause confirmed
  • Check PR Profile CLI Switch #199 to see if the fix is already in place — fix was NOT on this branch
  • Apply the fix from PR Profile CLI Switch #199 to this branch
  • 586 tests pass locally, pushed

Root cause

Spectre.Console's ProgressRefreshThread fires on a background thread and can call FileConsole.Write after the console is disposed at the end of a test. On Linux CI (where thread scheduling is more aggressive) this races reliably; on Windows it rarely does. The crash:

System.ObjectDisposedException: Cannot write to a closed TextWriter.
   at NetPace.Console.FileConsole.Write(IRenderable renderable) in FileConsole.cs:line 69
   at NetPace.Console.CompositeAnsiConsole.Write(IRenderable renderable)
   at Spectre.Console.ProgressContext.Refresh()
   at Spectre.Console.ProgressRefreshThread.Run()

Fix applied (commit 348aa9e)

Added a _writeLock + _disposed guard to FileConsole — identical to the fix in PR #199 (003-profile-cli-switch, commit 0936fb0):

  • Dispose() sets _disposed = true inside the lock before tearing down the writer
  • Write() checks _disposed inside the lock and silently returns if disposed
  • WriteAnsi() is a no-op so needs no guard (doesn't touch the stream)
  • Added Write_AfterDispose_DoesNotThrow test to pin the behaviour

Test count: 582 → 586 (3 existing new tests + 1 new pinning test). Build clean, 0 warnings.
| Branch

Spectre.Console's ProgressRefreshThread fires on a background thread and
can call Write after FileConsole has been disposed at the end of a test,
crashing the test host on Linux CI with ObjectDisposedException.

Add a _writeLock + _disposed guard so background writes after disposal are
silently ignored. Also adds Write_AfterDispose_DoesNotThrow test to pin
the behaviour.

Co-authored-by: Frank Ray <FrankRay78@users.noreply.github.com>
@FrankRay78 FrankRay78 merged commit 8212126 into main May 19, 2026
3 checks passed
@FrankRay78 FrankRay78 deleted the chore/dependency-bumps-2026-05 branch May 19, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant