Skip to content

Conversation

@gimlichael
Copy link
Member

@gimlichael gimlichael commented Dec 18, 2025

This pull request refactors the benchmark console runner implementation to simplify the codebase and improve maintainability. The main change is the removal of the BenchmarkWorker class, consolidating its logic into the new BenchmarkProgram class, which now directly inherits from MinimalConsoleProgram<BenchmarkProgram>. Associated tests and benchmarks have been updated to reflect these structural changes. Package dependencies and minor code details have also been updated.

Refactor: Benchmark runner consolidation

  • Removed the BenchmarkWorker class and moved all benchmark execution logic into BenchmarkProgram, which now inherits from MinimalConsoleProgram<BenchmarkProgram> instead of ConsoleProgram<BenchmarkWorker>. This includes service configuration and benchmark execution routines. (src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs [1] src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs [2] [3]
  • Updated unit tests to reflect the new inheritance and generic type parameter for BenchmarkProgram. (test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs [1] [2]
  • Removed the BenchmarkWorkerBenchmark performance benchmark since BenchmarkWorker no longer exists. (tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.csL1-L92)

Dependency and code improvements

Summary by CodeRabbit

  • Chores

    • Bumped two package versions and added an assembly-level code-analysis suppression.
    • Updated package release notes and changelog entries for 1.2.0.
  • Refactor

    • Consolidated benchmark execution into a single async-friendly runner and streamlined lifecycle/activation.
  • Tests

    • Removed legacy benchmark tests, benchmarks and related reports.
  • Style

    • Improved path-matching logic for build artifact discovery.

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

@gimlichael gimlichael self-assigned this Dec 18, 2025
Copilot AI review requested due to automatic review settings December 18, 2025 22:31
@coderabbitai
Copy link

coderabbitai bot commented Dec 18, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Benchmark execution was consolidated: BenchmarkWorker was removed and its logic moved into a reworked BenchmarkProgram (now inheriting MinimalConsoleProgram), adding build-awareness, async RunAsync flow, report-based filtering helpers, and service wiring. Package versions and tests/benchmarks were updated or removed; a suppression file and a minor string Contains change were added.

Changes

Cohort / File(s) Change Summary
Package Management
Directory.Packages.props
Version bumps: Codebelt.Bootstrapper.Console (5.0.1 → 5.0.2), Codebelt.Extensions.Xunit.App (11.0.2 → 11.0.3).
Program Consolidation
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
Replaced ConsoleProgram<BenchmarkWorker> with MinimalConsoleProgram<BenchmarkProgram>. Added static build metadata (BuildConfiguration, IsDebugBuild), builder-based host construction, new async RunAsync flow, service wiring for BenchmarkContext and BenchmarkWorkspace, and helpers for report-based filtering and benchmark execution; added BenchmarkDotNet-related usings and public Run overloads.
Worker Removal
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs
File deleted — removed BenchmarkWorker class, its DI/service configuration, and its RunAsync benchmark execution and filtering logic.
Workspace & Code Quality
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs,
src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
BenchmarkWorkspace: replaced IndexOf(... ) >= 0 with Contains(..., StringComparison.OrdinalIgnoreCase) for path filtering. Added GlobalSuppressions.cs with assembly-level SuppressMessage for CA1859 targeting BenchmarkWorkspace.LoadAssemblies.
Tests — Updated
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
Updated expectations to reflect new base type MinimalConsoleProgram\1and generic argumentBenchmarkProgram`.
Tests & Benchmarks — Removed
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkWorkerTest.cs,
tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs,
reports/tuning/.../BenchmarkWorkerBenchmark-report-github.md
Deleted comprehensive BenchmarkWorker unit tests, the BenchmarkDotNet benchmark suite for BenchmarkWorker, and associated generated report markdown.
Packaging / Release Notes
.nuget/.../PackageReleaseNotes.txt, CHANGELOG.md
Added/updated 1.2.0 release notes describing removal of BenchmarkWorker, merging functionality into BenchmarkProgram, TFM availability, dependency upgrades, and related public API notes (new Workspace helpers and options referenced).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant CLI as CLI (Console)
  participant Program as BenchmarkProgram
  participant Builder as Host Builder / DI
  participant Workspace as BenchmarkWorkspace
  participant FS as FileSystem/Reports
  participant Runner as BenchmarkDotNet Runner

  CLI->>Program: Start(args)
  Program->>Builder: Build host (register BenchmarkContext, BenchmarkWorkspace)
  Builder-->>Program: IServiceProvider
  Program->>Workspace: LoadAssemblies(configuration, buildSegment, ...)
  Workspace-->>Program: assemblies[]
  alt Skip based on reports option
    Program->>FS: Read existing reports (results/tuning paths)
    FS-->>Program: report metadata
    Program->>Program: ApplyReportFilters(assemblies, reports)
  end
  Program->>Runner: Execute benchmarks for filtered assemblies (async)
  Runner-->>Program: results/artifacts
  Program->>Workspace: PostProcessArtifacts(results)
  Program-->>CLI: Exit(status)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Inspect BenchmarkProgram.cs thoroughly: async flow, lifetime management, and parity with removed worker logic.
  • Verify service registrations and lifetimes for BenchmarkContext and BenchmarkWorkspace.
  • Confirm report-filtering helpers and matching logic (edge cases and string comparisons).
  • Review removed tests/benchmarks to decide which behaviors need re-covered by new tests.

Possibly related PRs

  • V1.1.0/worker flexibility #2 — Modifies the same BenchmarkDotNet components (BenchmarkProgram, BenchmarkWorker, BenchmarkWorkspace and tests); appears directly related to the consolidation and filtering changes.

Poem

🐰 I hopped from Worker to Program bright,
Moved benchmarks into a single light—
I sniffed the reports, I filtered the run,
Runners hum softly, artifacts done—
A byte-sized rabbit, carrot for fun. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'V1.2.0/service update' is vague and generic, using non-descriptive terms that don't convey the primary change (consolidating BenchmarkWorker into BenchmarkProgram). Consider a more descriptive title like 'Consolidate BenchmarkWorker into BenchmarkProgram' or 'Refactor benchmark console runner to use MinimalConsoleProgram' that clearly communicates the main architectural change.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch v1.2.0/service-update

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the benchmark console runner by consolidating the BenchmarkWorker class into BenchmarkProgram, which now directly inherits from MinimalConsoleProgram<BenchmarkProgram> instead of ConsoleProgram<BenchmarkWorker>. The refactoring simplifies the codebase by reducing the number of classes and moving the benchmark execution logic directly into the program class.

Key changes:

  • Removed the BenchmarkWorker class and moved its functionality into BenchmarkProgram with improved method organization
  • Updated inheritance from ConsoleProgram<BenchmarkWorker> to MinimalConsoleProgram<BenchmarkProgram>
  • Enhanced code maintainability by extracting helper methods for better separation of concerns

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs Deleted benchmark file for the removed BenchmarkWorker class
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkWorkerTest.cs Deleted test file for the removed BenchmarkWorker class
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs Updated assertions to reflect new inheritance structure and generic type parameter
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs Deleted worker class; functionality moved to BenchmarkProgram
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs Added RunAsync method and helper methods; changed inheritance to MinimalConsoleProgram<BenchmarkProgram>
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs Modernized string comparison using Contains instead of IndexOf
src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs Added code analysis suppression for abstraction usage in public API
Directory.Packages.props Updated package versions to latest releases

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: 0

🧹 Nitpick comments (1)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (1)

165-175: Type matching by simple name could cause false positives.

FindMatchingBenchmarkType matches benchmark types solely by class name (e.g., FooBenchmark), ignoring namespaces. If two assemblies contain benchmarks with the same class name in different namespaces, only one would be matched—potentially skipping the wrong benchmark or missing one entirely.

Consider matching by full type name when the report filename contains namespace information:

🔎 Suggested improvement for more precise matching
 private static Type FindMatchingBenchmarkType(string reportPath, List<Type> benchmarkTypes)
 {
     var filename = Path.GetFileNameWithoutExtension(reportPath);
     var potentialTypeFullName = filename.Split('-').FirstOrDefault();
     if (string.IsNullOrWhiteSpace(potentialTypeFullName)) { return null; }

-    var potentialTypeName = potentialTypeFullName.Split('.').LastOrDefault();
-    if (string.IsNullOrWhiteSpace(potentialTypeName)) { return null; }
-
-    return benchmarkTypes.FirstOrDefault(t => t.Name.Equals(potentialTypeName, StringComparison.OrdinalIgnoreCase));
+    // Try full name match first, fall back to simple name
+    return benchmarkTypes.FirstOrDefault(t => t.FullName?.Equals(potentialTypeFullName, StringComparison.OrdinalIgnoreCase) == true)
+        ?? benchmarkTypes.FirstOrDefault(t => t.Name.Equals(potentialTypeFullName.Split('.').LastOrDefault(), StringComparison.OrdinalIgnoreCase));
 }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6ba0635 and fcfa063.

📒 Files selected for processing (8)
  • Directory.Packages.props (1 hunks)
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (2 hunks)
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs (0 hunks)
  • src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs (1 hunks)
  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs (1 hunks)
  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs (2 hunks)
  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkWorkerTest.cs (0 hunks)
  • tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs (0 hunks)
💤 Files with no reviewable changes (3)
  • tuning/Codebelt.Extensions.BenchmarkDotNet.Console.Benchmarks/BenchmarkWorkerBenchmark.cs
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkWorker.cs
  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkWorkerTest.cs
🧰 Additional context used
📓 Path-based instructions (2)
**/*Test.cs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*Test.cs: Always inherit from the Test base class for all unit test classes in Codebelt.Extensions.BenchmarkDotNet
Do NOT add using Xunit.Abstractions in test files; use Codebelt.Extensions.Xunit Test base class and using Xunit; instead
Use [Fact] for standard unit tests and [Theory] with [InlineData] or other data sources for parameterized tests
Use descriptive test method names that state the expected behavior (e.g., ShouldReturnTrue_WhenConditionIsMet)
End test class names with Test (e.g., DateSpanTest)
Use Assert methods from xUnit for all assertions in unit tests
Test class namespaces MUST match the System Under Test (SUT) namespace exactly; do NOT append .Tests, .Benchmarks, or similar suffixes to the namespace

Files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
**/*.cs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Add XML doc comments to public and protected classes and methods in C# code where appropriate

Files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
🧠 Learnings (19)
📓 Common learnings
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*.csproj : Modify the associated .csproj file for benchmarks to override the root namespace so the compiled namespace matches the production assembly; example: `<RootNamespace>Codebelt.Extensions.BenchmarkDotNet.Bar</RootNamespace>`
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[Benchmark]` on methods representing measured operations; consider `Baseline = true` and `Description` to improve report clarity
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Benchmark class namespaces must match the production assembly namespace; do NOT append `.Benchmarks` to the namespace
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: For shared helpers for benchmarking, prefer small utility classes inside the `tuning` projects rather than cross-cutting changes to production code
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]` to group related benchmarks
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Keep benchmark configuration minimal and explicit; prefer in-class attributes over large shared configs unless re-used widely
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : When comparing benchmark implementations, mark one method with `Baseline = true` and use similar names so reports are easy to read
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Test.cs : Always inherit from the `Test` base class for all unit test classes in Codebelt.Extensions.BenchmarkDotNet

Applied to files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • Directory.Packages.props
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Benchmark class namespaces must match the production assembly namespace; do NOT append `.Benchmarks` to the namespace

Applied to files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*.csproj : Modify the associated .csproj file for benchmarks to override the root namespace so the compiled namespace matches the production assembly; example: `<RootNamespace>Codebelt.Extensions.BenchmarkDotNet.Bar</RootNamespace>`

Applied to files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • Directory.Packages.props
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[Benchmark]` on methods representing measured operations; consider `Baseline = true` and `Description` to improve report clarity

Applied to files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Test.cs : Do NOT add `using Xunit.Abstractions` in test files; use `Codebelt.Extensions.Xunit` Test base class and `using Xunit;` instead

Applied to files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • Directory.Packages.props
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Benchmark class names must end with `Benchmark` (e.g., `SampleOperationBenchmark`)

Applied to files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : When comparing benchmark implementations, mark one method with `Baseline = true` and use similar names so reports are easy to read

Applied to files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]` to group related benchmarks

Applied to files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Test.cs : Use `Assert` methods from xUnit for all assertions in unit tests

Applied to files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*.csproj : Modify the associated .csproj file to override the root namespace so the compiled namespace matches the SUT; example: `<RootNamespace>Codebelt.Extensions.BenchmarkDotNet.Foo</RootNamespace>`

Applied to files:

  • test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • Directory.Packages.props
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Keep benchmark projects isolated (e.g., `tuning/*.csproj`) so they don't affect package builds or production artifacts

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs
  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • Directory.Packages.props
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Place micro- and component-benchmarks under the `tuning/` folder or in projects named `*.Benchmarks`

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[GlobalSetup]` for one-time initialization in benchmarks that is not part of measured work

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[MemoryDiagnoser]` attribute to capture memory allocations in benchmarks

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Use the same documentation style as found throughout the Codebelt.Extensions.BenchmarkDotNet codebase for XML documentation

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
  • Directory.Packages.props
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Do not use `InternalsVisibleTo` to access internal types or members from test projects; prefer indirect testing via public APIs

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Keep tests focused and isolated; do not rely on external systems except for xUnit itself and Codebelt.Extensions.Xunit

Applied to files:

  • Directory.Packages.props
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Benchmarks are primarily for local and tuning runs; be cautious about running heavy BenchmarkDotNet workloads in CI

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
🧬 Code graph analysis (1)
test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs (1)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (2)
  • BenchmarkProgram (23-193)
  • BenchmarkProgram (25-30)
⏰ 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). (11)
  • GitHub Check: call-test (windows-2025, Release) / 🧪 Test
  • GitHub Check: call-test (windows-11-arm, Release) / 🧪 Test
  • GitHub Check: call-test (ubuntu-24.04, Release) / 🧪 Test
  • GitHub Check: call-test (windows-11-arm, Debug) / 🧪 Test
  • GitHub Check: call-test (windows-2025, Debug) / 🧪 Test
  • GitHub Check: call-test (ubuntu-24.04-arm, Release) / 🧪 Test
  • GitHub Check: call-pack (Release) / 📦 Pack
  • GitHub Check: call-test (ubuntu-24.04, Debug) / 🧪 Test
  • GitHub Check: call-test (ubuntu-24.04-arm, Debug) / 🧪 Test
  • GitHub Check: CodeQL analysis (csharp)
  • GitHub Check: Agent
🔇 Additional comments (10)
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs (1)

122-124: LGTM - cleaner string matching.

The switch from IndexOf(...) >= 0 to Contains(...) is more idiomatic and readable while maintaining identical behavior.

test/Codebelt.Extensions.BenchmarkDotNet.Console.Tests/BenchmarkProgramTest.cs (2)

242-254: Test correctly updated to reflect new inheritance.

The assertion now verifies BenchmarkProgram inherits from MinimalConsoleProgram<T> instead of the removed ConsoleProgram<T>, matching the production code changes.


256-269: Generic type parameter assertion correctly updated.

The test now verifies that BenchmarkProgram uses itself as the generic type argument (CRTP pattern), consistent with the refactored MinimalConsoleProgram<BenchmarkProgram> inheritance.

src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (5)

1-4: New imports appropriately added for BenchmarkDotNet integration.

The added using directives support the new RunAsync implementation with BenchmarkRunner, BenchmarkSwitcher, SimpleFilter, and async/IO operations.

Also applies to: 10-15


25-42: Static initialization is well-designed.

The static constructor safely handles the case where GetEntryAssembly() returns null by falling back to GetExecutingAssembly(). Both properties are correctly initialized once and exposed as read-only.


95-106: Service configuration and host building pattern looks correct.

The builder pattern properly configures:

  • ConsoleLifetimeOptions to suppress status messages in Release builds
  • BenchmarkContext as singleton with command-line args
  • Custom workspace implementation via AddBenchmarkWorkspace<TWorkspace>

118-137: Solid async entry point with proper cleanup.

The try/finally pattern ensures PostProcessArtifacts() runs regardless of benchmark outcome. Note that cancellationToken is unused—BenchmarkDotNet's synchronous API doesn't support cancellation, so this is acceptable.


177-192: Benchmark execution logic is clean and correct.

The conditional approach appropriately uses:

  • BenchmarkRunner.Run for automated full runs (no args)
  • BenchmarkSwitcher for interactive/selective runs (with args)
src/Codebelt.Extensions.BenchmarkDotNet/GlobalSuppressions.cs (1)

8-8: Verify suppression target—LoadAssemblies is private.

The suppression targets BenchmarkWorkspace.LoadAssemblies, but this method is declared as private static (line 108). CA1859 applies to public API return types, so this private method shouldn't trigger the rule. The public method LoadBenchmarkAssemblies() already returns the concrete type Assembly[] (line 86), not an enumerable. The suppression appears unnecessary or incorrectly targeted.

Directory.Packages.props (1)

8-9: Package version bumps are appropriate.

Both are patch-level updates. The Codebelt.Bootstrapper.Console 5.0.2 update aligns with the new MinimalConsoleProgram<T> base class used in BenchmarkProgram.

gimlichael and others added 2 commits December 18, 2025 23:36
…am.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…am.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 17.74194% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.95%. Comparing base (6ba0635) to head (f33fd35).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...nsions.BenchmarkDotNet.Console/BenchmarkProgram.cs 16.39% 51 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #3      +/-   ##
==========================================
- Coverage   73.92%   66.95%   -6.97%     
==========================================
  Files           7        6       -1     
  Lines         349      345       -4     
  Branches       41       42       +1     
==========================================
- Hits          258      231      -27     
- Misses         91      114      +23     

☔ 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: 0

🧹 Nitpick comments (1)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (1)

125-125: Consider braces for single-line if statement.

While functionally correct, adding braces improves consistency and reduces the risk of future errors when the conditional body is expanded.

🔎 Proposed refactor
-if (options.SkipBenchmarksWithReports) { ConfigureBenchmarkDotNetFiltersForExistingReports(options, assemblies); }
+if (options.SkipBenchmarksWithReports)
+{
+    ConfigureBenchmarkDotNetFiltersForExistingReports(options, assemblies);
+}
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fcfa063 and e430b1a.

📒 Files selected for processing (1)
  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.cs

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Add XML doc comments to public and protected classes and methods in C# code where appropriate

Files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
🧠 Learnings (15)
📓 Common learnings
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*.csproj : Modify the associated .csproj file for benchmarks to override the root namespace so the compiled namespace matches the production assembly; example: `<RootNamespace>Codebelt.Extensions.BenchmarkDotNet.Bar</RootNamespace>`
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[Benchmark]` on methods representing measured operations; consider `Baseline = true` and `Description` to improve report clarity
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: For shared helpers for benchmarking, prefer small utility classes inside the `tuning` projects rather than cross-cutting changes to production code
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : When comparing benchmark implementations, mark one method with `Baseline = true` and use similar names so reports are easy to read
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Benchmark class namespaces must match the production assembly namespace; do NOT append `.Benchmarks` to the namespace
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Keep benchmark projects isolated (e.g., `tuning/*.csproj`) so they don't affect package builds or production artifacts
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]` to group related benchmarks
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Benchmarks are primarily for local and tuning runs; be cautious about running heavy BenchmarkDotNet workloads in CI
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Keep benchmark configuration minimal and explicit; prefer in-class attributes over large shared configs unless re-used widely
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Keep benchmarks focused: each `Benchmark` method should measure a single logical operation
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[Benchmark]` on methods representing measured operations; consider `Baseline = true` and `Description` to improve report clarity

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*.csproj : Modify the associated .csproj file for benchmarks to override the root namespace so the compiled namespace matches the production assembly; example: `<RootNamespace>Codebelt.Extensions.BenchmarkDotNet.Bar</RootNamespace>`

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Test.cs : Always inherit from the `Test` base class for all unit test classes in Codebelt.Extensions.BenchmarkDotNet

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Benchmark class namespaces must match the production assembly namespace; do NOT append `.Benchmarks` to the namespace

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : When comparing benchmark implementations, mark one method with `Baseline = true` and use similar names so reports are easy to read

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[GlobalSetup]` for one-time initialization in benchmarks that is not part of measured work

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]` to group related benchmarks

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*.csproj : Modify the associated .csproj file to override the root namespace so the compiled namespace matches the SUT; example: `<RootNamespace>Codebelt.Extensions.BenchmarkDotNet.Foo</RootNamespace>`

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Keep benchmark projects isolated (e.g., `tuning/*.csproj`) so they don't affect package builds or production artifacts

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Benchmarks are primarily for local and tuning runs; be cautious about running heavy BenchmarkDotNet workloads in CI

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Use the same documentation style as found throughout the Codebelt.Extensions.BenchmarkDotNet codebase for XML documentation

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Benchmark class names must end with `Benchmark` (e.g., `SampleOperationBenchmark`)

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Keep tests focused and isolated; do not rely on external systems except for xUnit itself and Codebelt.Extensions.Xunit

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[MemoryDiagnoser]` attribute to capture memory allocations in benchmarks

Applied to files:

  • src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs
🧬 Code graph analysis (1)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (4)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkContext.cs (2)
  • BenchmarkContext (6-22)
  • BenchmarkContext (12-15)
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptions.cs (2)
  • BenchmarkWorkspaceOptions (64-321)
  • BenchmarkWorkspaceOptions (98-106)
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspaceOptionsExtensions.cs (1)
  • BenchmarkWorkspaceOptions (65-76)
src/Codebelt.Extensions.BenchmarkDotNet/BenchmarkWorkspace.cs (5)
  • PostProcessArtifacts (103-106)
  • Assembly (86-95)
  • BenchmarkWorkspace (17-225)
  • BenchmarkWorkspace (62-71)
  • GetReportsTuningPath (46-50)
⏰ 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). (3)
  • GitHub Check: call-test (windows-2025, Debug) / 🧪 Test
  • GitHub Check: call-test (windows-11-arm, Debug) / 🧪 Test
  • GitHub Check: call-test (windows-11-arm, Release) / 🧪 Test
🔇 Additional comments (8)
src/Codebelt.Extensions.BenchmarkDotNet.Console/BenchmarkProgram.cs (8)

1-16: LGTM: Using directives support the refactored execution flow.

The new using directives appropriately support the consolidated benchmark execution logic and filtering features.


25-42: LGTM: Build metadata initialization is clear and well-documented.

The static constructor correctly determines the build configuration, and the public properties are appropriately documented.


44-106: LGTM: Run method overloads provide flexible configuration options.

The overload pattern is well-designed, and the host builder configuration correctly integrates BenchmarkContext, BenchmarkWorkspace, and ConsoleLifetimeOptions based on build configuration.


108-137: LGTM: RunAsync orchestrates execution with proper cleanup.

The try-finally ensures artifact post-processing always occurs, and the overall flow correctly loads assemblies, applies optional filters, and executes benchmarks.


139-146: LGTM: Type discovery follows BenchmarkDotNet naming conventions.

The method correctly identifies potential benchmark types by name suffix, consistent with BenchmarkDotNet's discovery patterns.


177-192: LGTM: Benchmark execution correctly uses BenchmarkRunner or BenchmarkSwitcher based on arguments.

The method appropriately delegates to BenchmarkDotNet's execution APIs, running all benchmarks when no arguments are provided or using the switcher for selective execution with arguments.


19-23: No changes needed.

The seealso reference MinimalConsoleProgram{BenchmarkProgram} follows the correct C# XML documentation syntax for generic types. Braces are the standard approach for referencing generics in cref attributes. The backtick notation is only for compiler-generated metadata, not source code.

Likely an incorrect or invalid review comment.


148-175: The code uses established K&R style with single-line if statements containing braces on the same line (line 151: if (!Directory.Exists(tuningPath)) { return config; }), consistent with the codebase pattern at lines 125, 169, and 172. No refactoring is needed. The FindMatchingBenchmarkType method correctly applies BenchmarkDotNet's documented stable report filename format of <BenchmarkName>-<suffix>.<ext>, and appropriately returns null when parsing fails.

Likely an incorrect or invalid review comment.

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: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e430b1a and f33fd35.

📒 Files selected for processing (4)
  • .nuget/Codebelt.Extensions.BenchmarkDotNet.Console/PackageReleaseNotes.txt (1 hunks)
  • .nuget/Codebelt.Extensions.BenchmarkDotNet/PackageReleaseNotes.txt (1 hunks)
  • CHANGELOG.md (1 hunks)
  • reports/tuning/Codebelt.Extensions.BenchmarkDotNet.Console.BenchmarkWorkerBenchmark-report-github.md (0 hunks)
💤 Files with no reviewable changes (1)
  • reports/tuning/Codebelt.Extensions.BenchmarkDotNet.Console.BenchmarkWorkerBenchmark-report-github.md
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*.csproj : Modify the associated .csproj file for benchmarks to override the root namespace so the compiled namespace matches the production assembly; example: `<RootNamespace>Codebelt.Extensions.BenchmarkDotNet.Bar</RootNamespace>`
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[Benchmark]` on methods representing measured operations; consider `Baseline = true` and `Description` to improve report clarity
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: For shared helpers for benchmarking, prefer small utility classes inside the `tuning` projects rather than cross-cutting changes to production code
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : When comparing benchmark implementations, mark one method with `Baseline = true` and use similar names so reports are easy to read
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Benchmark class namespaces must match the production assembly namespace; do NOT append `.Benchmarks` to the namespace
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Keep benchmark projects isolated (e.g., `tuning/*.csproj`) so they don't affect package builds or production artifacts
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Benchmarks are primarily for local and tuning runs; be cautious about running heavy BenchmarkDotNet workloads in CI
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]` to group related benchmarks
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Keep benchmarks focused: each `Benchmark` method should measure a single logical operation
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Keep benchmark configuration minimal and explicit; prefer in-class attributes over large shared configs unless re-used widely
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Use the same documentation style as found throughout the Codebelt.Extensions.BenchmarkDotNet codebase for XML documentation

Applied to files:

  • .nuget/Codebelt.Extensions.BenchmarkDotNet/PackageReleaseNotes.txt
  • CHANGELOG.md
  • .nuget/Codebelt.Extensions.BenchmarkDotNet.Console/PackageReleaseNotes.txt
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*.csproj : Modify the associated .csproj file for benchmarks to override the root namespace so the compiled namespace matches the production assembly; example: `<RootNamespace>Codebelt.Extensions.BenchmarkDotNet.Bar</RootNamespace>`

Applied to files:

  • .nuget/Codebelt.Extensions.BenchmarkDotNet/PackageReleaseNotes.txt
  • CHANGELOG.md
  • .nuget/Codebelt.Extensions.BenchmarkDotNet.Console/PackageReleaseNotes.txt
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Use `[Benchmark]` on methods representing measured operations; consider `Baseline = true` and `Description` to improve report clarity

Applied to files:

  • CHANGELOG.md
  • .nuget/Codebelt.Extensions.BenchmarkDotNet.Console/PackageReleaseNotes.txt
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: If a benchmark exposes regressions or optimizations, add a short note in the benchmark file referencing the relevant issue or PR

Applied to files:

  • CHANGELOG.md
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : Benchmark class namespaces must match the production assembly namespace; do NOT append `.Benchmarks` to the namespace

Applied to files:

  • CHANGELOG.md
  • .nuget/Codebelt.Extensions.BenchmarkDotNet.Console/PackageReleaseNotes.txt
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Test.cs : Always inherit from the `Test` base class for all unit test classes in Codebelt.Extensions.BenchmarkDotNet

Applied to files:

  • .nuget/Codebelt.Extensions.BenchmarkDotNet.Console/PackageReleaseNotes.txt
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Benchmarks are primarily for local and tuning runs; be cautious about running heavy BenchmarkDotNet workloads in CI

Applied to files:

  • .nuget/Codebelt.Extensions.BenchmarkDotNet.Console/PackageReleaseNotes.txt
📚 Learning: 2025-12-14T19:07:05.899Z
Learnt from: CR
Repo: codebeltnet/benchmarkdotnet PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-14T19:07:05.899Z
Learning: Applies to **/*Benchmark.cs : When comparing benchmark implementations, mark one method with `Baseline = true` and use similar names so reports are easy to read

Applied to files:

  • .nuget/Codebelt.Extensions.BenchmarkDotNet.Console/PackageReleaseNotes.txt
⏰ 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). (6)
  • GitHub Check: call-test (windows-2025, Debug) / 🧪 Test
  • GitHub Check: call-test (windows-11-arm, Debug) / 🧪 Test
  • GitHub Check: call-test (ubuntu-24.04-arm, Release) / 🧪 Test
  • GitHub Check: call-test (ubuntu-24.04-arm, Debug) / 🧪 Test
  • GitHub Check: call-test (windows-2025, Release) / 🧪 Test
  • GitHub Check: call-test (windows-11-arm, Release) / 🧪 Test
🔇 Additional comments (4)
.nuget/Codebelt.Extensions.BenchmarkDotNet.Console/PackageReleaseNotes.txt (1)

1-9: Release notes clearly document the 1.2.0 changes.

The addition of version 1.2.0 accurately reflects the removal of BenchmarkWorker and consolidation into BenchmarkProgram. The "Breaking Changes" section is appropriately used, and the description clearly communicates what was removed and where the responsibility was transferred.

CHANGELOG.md (2)

7-13: CHANGELOG clearly documents 1.2.0 with transparent rationale.

The new 1.2.0 entry accurately captures the removal of BenchmarkWorker and explains the versioning decision. The note that this is technically a major release but labeled minor—because the external API remains unchanged and the library is new—is transparent and reasonable for the stated scope.


15-25: 1.1.0 section correctly documents prior enhancements.

The 1.1.0 "### Changed" section appropriately captures the extensions to BenchmarkWorkspace, BenchmarkWorkspaceOptions, BenchmarkProgram, and BenchmarkWorker that laid the groundwork for the consolidation in 1.2.0. The progression is logical and well-documented.

.nuget/Codebelt.Extensions.BenchmarkDotNet/PackageReleaseNotes.txt (1)

1-5: Release notes incomplete with duplicate content from v1.1.0.

The Version 1.2.0 notes contain an identical ALM entry to v1.1.0 ("Dependencies have been upgraded..."). Additionally, v1.2.0 lacks the "Bug Fixes" and "Improvements" sections present in v1.1.0, suggesting either minimal changes or incomplete documentation. Add a "Breaking Changes" section if applicable and clarify what functional changes, bug fixes, or improvements are included in this release beyond the dependency upgrades.

Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
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

Duplicate ALM entry between versions 1.2.0 and 1.1.0.

Both Version 1.2.0 (line 5) and Version 1.1.0 (line 11) contain identical wording: "Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)". Clarify whether:

  • This is a copy-paste error in 1.1.0's notes
  • Both versions genuinely have the same dependency change (and if so, whether 1.2.0's notes should be more specific)
  • The 1.1.0 notes need historical correction

Also applies to: 11-11

🤖 Prompt for AI Agents
In .nuget/Codebelt.Extensions.BenchmarkDotNet/PackageReleaseNotes.txt around
lines 5 and 11, there is a duplicate ALM entry ("Dependencies have been upgraded
to the latest compatible versions for all supported target frameworks (TFMs)")
present in both Version 1.2.0 (line 5) and Version 1.1.0 (line 11); determine
which version actually introduced that dependency change and then either remove
or rewrite the duplicate: if 1.2.0 is the correct entry, remove or replace the
1.1.0 sentence with a concise historical correction (e.g., accurate change text
or "no dependency updates"), or if 1.1.0 was correct, make 1.2.0 more specific
about what changed (package names/versions or scope) so the notes are not
identical; commit the updated PackageReleaseNotes.txt reflecting the chosen
clarification.

@sonarqubecloud
Copy link

@gimlichael gimlichael merged commit d25700f into main Dec 19, 2025
34 of 37 checks passed
@gimlichael gimlichael deleted the v1.2.0/service-update branch December 19, 2025 17:06
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.

2 participants