Skip to content

Conversation

@samtrion
Copy link
Member

@samtrion samtrion commented Dec 14, 2025

Summary by CodeRabbit

  • New Features

    • Added --content-path command option to specify custom content directory paths.
    • Improved error message visibility in command help output.
  • Tests

    • Updated test coverage for content-path argument handling.
    • Enhanced error capture and reporting in command help verification.

✏️ Tip: You can customize this high-level summary in your review settings.

@samtrion samtrion self-assigned this Dec 14, 2025
@samtrion samtrion added state:ready for merge Indicates that a pull request has been reviewed and approved, and is ready to be merged into the mai type:chore Indicates some housework that needs to be done. labels Dec 14, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 14, 2025

Walkthrough

The pull request adds ContentPath option support to the build command and updates integration tests to capture error output alongside standard output. Snapshot files are updated to reflect the new error field and the new content-path option in help text.

Changes

Cohort / File(s) Summary
Build command option registration
src/NetEvolve.ForgingBlazor/Commands/CommandBuild.cs
Added CommandOptions.ContentPath to the build command's registered options via Add() call in constructor
Build command integration test
tests/NetEvolve.ForgingBlazor.Tests.Integration/Commands/CommandBuildTests.cs
Updated test helper invocations to conditionally append --content-path and _setup/content arguments based on initial args presence
Help command integration test
tests/NetEvolve.ForgingBlazor.Tests.Integration/Commands/CommandHelpTests.cs
Added error output capturing via secondary StringWriter, wired to Application.InvocationConfiguration.Error, and included error in verification composite object
Test configuration utilities
tests/NetEvolve.ForgingBlazor.Tests.Integration/Predefined.cs
Replaced qualified Verifier.DerivePathInfo() call with unqualified variant; added VerifierSettings.SortJsonObjects() and VerifierSettings.SortPropertiesAlphabetically() configuration calls
Help snapshot updates (all .NET versions)
tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet{9_0,10_0}/Help_Theory_Expected.CommandHelpTests_*.verified.txt
Added empty or populated error: field in serialized output; some snapshots (*_3cb5690aa64d0539.verified.txt) also added --content-path option documentation to Options section

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

The changes follow consistent patterns: a single option registration, straightforward test helper updates with conditional logic, and numerous homogeneous snapshot file updates (predominantly adding the same error field). However, note:

  • Review all _snapshots/ files to verify the error field placement and content-path additions are correct across different framework versions
  • Verify that the content-path argument value (_setup/content) matches the intended directory structure
  • Confirm the error output capture in CommandHelpTests.cs doesn't interfere with existing test assertions

Poem

🐰 A path for content, now declared with care,
Error streams captured, floating through the air,
Snapshots refreshed in their digital square,
Build commands blooming with options so fair! 🎉

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test: Extended Command Help and Command Build tests' accurately summarizes the main changes, which focus on expanding test coverage for command help and build functionality.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Dec 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.05%. Comparing base (3bf4cd2) to head (e4941ea).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #31      +/-   ##
==========================================
+ Coverage   82.75%   85.05%   +2.29%     
==========================================
  Files           4        4              
  Lines          87       87              
  Branches        2        2              
==========================================
+ Hits           72       74       +2     
+ Misses         15       13       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/NetEvolve.ForgingBlazor.Tests.Integration/Predefined.cs (1)

12-20: Add using static VerifyTests.Verifier; or qualify the call as Verifier.DerivePathInfo(...).

The unqualified DerivePathInfo(...) call on line 12 will not resolve without a static import. The current file has only using VerifyTests;, which does not bring DerivePathInfo into scope. Either add using static VerifyTests.Verifier; at the top of the file, or qualify the call as Verifier.DerivePathInfo(...). For module-level configuration, VerifierSettings.DerivePathInfo(...) is also a valid global alternative.

🧹 Nitpick comments (1)
tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet10_0/Help_Theory_Expected.CommandHelpTests_cf823c7fea89c954.verified.txt (1)

5-5: Empty error field inclusion is consistent; watch for snapshot brittleness
If error: , varies across frameworks/line-endings, consider normalizing empty error to ""/null in the test data before verification.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3bf4cd2 and e4941ea.

📒 Files selected for processing (16)
  • src/NetEvolve.ForgingBlazor/Commands/CommandBuild.cs (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/Commands/CommandBuildTests.cs (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/Commands/CommandHelpTests.cs (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/Predefined.cs (2 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet10_0/Help_Theory_Expected.CommandHelpTests_25a03f3b48369ce7.verified.txt (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet10_0/Help_Theory_Expected.CommandHelpTests_3cb5690aa64d0539.verified.txt (2 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet10_0/Help_Theory_Expected.CommandHelpTests_7482efceccfc847a.verified.txt (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet10_0/Help_Theory_Expected.CommandHelpTests_a46afb280312df84.verified.txt (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet10_0/Help_Theory_Expected.CommandHelpTests_cf823c7fea89c954.verified.txt (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet10_0/Help_Theory_Expected.CommandHelpTests_d2a59b5932a503ab.verified.txt (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet9_0/Help_Theory_Expected.CommandHelpTests_25a03f3b48369ce7.verified.txt (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet9_0/Help_Theory_Expected.CommandHelpTests_3cb5690aa64d0539.verified.txt (2 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet9_0/Help_Theory_Expected.CommandHelpTests_7482efceccfc847a.verified.txt (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet9_0/Help_Theory_Expected.CommandHelpTests_a46afb280312df84.verified.txt (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet9_0/Help_Theory_Expected.CommandHelpTests_cf823c7fea89c954.verified.txt (1 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet9_0/Help_Theory_Expected.CommandHelpTests_d2a59b5932a503ab.verified.txt (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
src/NetEvolve.ForgingBlazor/Commands/CommandBuild.cs (1)
src/NetEvolve.ForgingBlazor.Extensibility/Commands/CommandOptions.cs (1)
  • CommandOptions (13-173)
tests/NetEvolve.ForgingBlazor.Tests.Integration/Commands/CommandHelpTests.cs (1)
src/NetEvolve.ForgingBlazor/Application.cs (2)
  • Application (16-89)
  • Application (52-56)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build & Tests / Run Tests (ubuntu-latest) / Testing .NET solution
  • GitHub Check: Build & Tests / Run Tests (windows-latest) / Testing .NET solution
🔇 Additional comments (10)
tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet10_0/Help_Theory_Expected.CommandHelpTests_a46afb280312df84.verified.txt (1)

3-6: Snapshot correctly asserts stderr for missing command scenario
Capturing and verifying the error text here is valuable to prevent regressions in CLI diagnostics.

tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet10_0/Help_Theory_Expected.CommandHelpTests_7482efceccfc847a.verified.txt (1)

6-6: Consistent snapshot shape update (error captured for help output)
No concerns with adding error alongside args and output.

tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet9_0/Help_Theory_Expected.CommandHelpTests_7482efceccfc847a.verified.txt (1)

6-6: DotNet9_0 snapshot aligned with DotNet10_0 (error field added)
Keeps cross-target verification consistent.

tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet9_0/Help_Theory_Expected.CommandHelpTests_25a03f3b48369ce7.verified.txt (1)

6-6: Snapshot update looks correct (empty stderr captured)

tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet9_0/Help_Theory_Expected.CommandHelpTests_cf823c7fea89c954.verified.txt (1)

5-5: Global help snapshot now includes stderr channel (empty)

tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet10_0/Help_Theory_Expected.CommandHelpTests_d2a59b5932a503ab.verified.txt (1)

6-6: Consistent error field addition for example --help snapshot

tests/NetEvolve.ForgingBlazor.Tests.Integration/_snapshots/DotNet10_0/Help_Theory_Expected.CommandHelpTests_25a03f3b48369ce7.verified.txt (1)

6-6: DotNet10_0 create --help snapshot updated to include stderr (empty)

tests/NetEvolve.ForgingBlazor.Tests.Integration/Predefined.cs (1)

21-25: Global sorting settings: confirm this is intended for all snapshots.
SortJsonObjects() + SortPropertiesAlphabetically() can reduce churn, but they also change baseline snapshot semantics globally (including for any tests that relied on insertion order).

tests/NetEvolve.ForgingBlazor.Tests.Integration/Commands/CommandBuildTests.cs (1)

11-21: Verify default-args branch is still exercising the intended output-path behavior.
In the else branch you no longer pass an output path arg value (while the other branch effectively does by appending directory.Path). This may be totally fine if Helper.VerifyStaticContent(directory.Path, args) controls output path out-of-band—just worth confirming to avoid a silent behavior change in coverage.

src/NetEvolve.ForgingBlazor/Commands/CommandBuild.cs (1)

32-45: Option registration looks correct (--content-path shows up in help and parse results).

build,
--help
],
error: ,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Same note as DotNet10 snapshot: error: , suggests the verified value isn’t a clean string.
Consider snapshotting the error text (error.ToString()) to avoid formatter artifacts.

Comment on lines 11 to 20
if (args is not null && args.Length != 0)
{
args = [.. args, directory.Path];
args = [.. args, directory.Path, "--content-path", "_setup/content"];
}
else
{
args = ["build"];
args = ["build", "--content-path", "_setup/Content"];
}

await Helper.VerifyStaticContent(directory.Path, args).ConfigureAwait(false);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix _setup/content vs _setup/Content casing (will fail on case-sensitive filesystems).
Line 13 uses _setup/content, Line 17 uses _setup/Content. Pick one canonical casing that matches the repo folder.

-            args = ["build", "--content-path", "_setup/Content"];
+            args = ["build", "--content-path", "_setup/content"];
🤖 Prompt for AI Agents
In tests/NetEvolve.ForgingBlazor.Tests.Integration/Commands/CommandBuildTests.cs
around lines 11–20 there is inconsistent casing for the content path
(_setup/content vs _setup/Content) which will break on case-sensitive
filesystems; pick the canonical folder casing used in the repository (e.g.,
"_setup/Content") and update both occurrences to that exact casing so both
branches pass the same path to VerifyStaticContent.

@samtrion samtrion merged commit 2795969 into main Dec 14, 2025
11 checks passed
@samtrion samtrion deleted the test/extended-help-and-build-tests branch December 14, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:ready for merge Indicates that a pull request has been reviewed and approved, and is ready to be merged into the mai type:chore Indicates some housework that needs to be done.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants