Skip to content

V10.6.0/new features - #168

Merged
gimlichael merged 54 commits into
mainfrom
v10.6.0/new-features
Aug 7, 2026
Merged

V10.6.0/new features#168
gimlichael merged 54 commits into
mainfrom
v10.6.0/new-features

Conversation

@gimlichael

Copy link
Copy Markdown
Member

This pull request updates several API documentation code examples and summaries to improve clarity, accuracy, and real-world relevance. The main focus is on making example outputs more meaningful (e.g., displaying configuration values instead of type names), enhancing summary descriptions, and refining exception handling demonstrations.

Improvements to authentication and TagHelper examples:

  • Changed authentication handler examples (BasicAuthenticationHandler, DigestAuthenticationHandler, HmacAuthenticationHandler) to print relevant configuration values (like realm or scheme) instead of just type names, making the output more useful and realistic. [1] [2] [3] [4] [5] [6]
  • Refactored TagHelper examples (AppImageTagHelper, AppLinkTagHelper, AppScriptTagHelper, CdnImageTagHelper) to instantiate helpers with realistic property values and output constructed URLs, improving example clarity and practical application. [1] [2] [3] [4] [5]

Enhancements to exception handling examples:

  • Updated exception examples (BadRequestException, ConflictException, PayloadTooLargeException, TooManyRequestsException, PreconditionFailedException, UnauthorizedException) to print exception messages and relevant details instead of just type names, and improved the demonstration of error conditions and output for better instructional value. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Documentation summary improvements:

  • Expanded namespace summaries for Cuemon.Reflection and added a new summary for Cuemon.Extensions.FileProviders, clarifying their purposes and primary use cases. [1] [2]

Other minor refinements:

  • Adjusted the ServerTimingFilter example to print the presence of a predicate rather than the type name, making the output more relevant.

These changes collectively make the documentation more actionable and easier to follow for developers learning to use these APIs.

Introduces TargetFrameworkMoniker, a new static utility class in Cuemon.Reflection that parses and resolves short target framework monikers (such as net10.0, net9.0, netstandard2.0) from framework names, assemblies, paths, and the current application context. Includes comprehensive API documentation and unit test coverage.
Documents the new TargetFrameworkMoniker class introduction in the Cuemon.Core v10.6.0 package release, including availability across .NET 10, .NET 9, and .NET Standard 2.0.
Removes outdated analyzer suppression rules: CA1200 (cref tags with prefix) and IDE0330 (System.Threading.Lock). These exclusions are no longer needed as the codebase has moved past the constraints that originally required them.
Add portable, case-insensitive file provider implementation with support for .NET 10, .NET 9, and .NET Standard 2.0. Includes comprehensive unit tests and project scaffolding for the new extension library.
Add NuGet package README and release notes for the new Cuemon.Extensions.FileProviders.Physical library.
Update Codebelt.Extensions packages to v11.2.0 and add Microsoft.Extensions.FileProviders.Physical v9.0.18 and v10.0.10 for net9 and net10+netstandard2 target frameworks respectively.
Add performance benchmarks for the Awaiter class measuring fast-path direct await, immediate success, and retry failure scenarios using BenchmarkDotNet.
Added detailed guidance for fast feedback loop testing with affected projects only (avoiding full 40+ project suite). Clarified docker-compose setup requirement for full test suite since Cuemon.Data.SqlClient.Tests depends on SQL Server. Structured test commands by development vs. comprehensive validation workflows.
Include Cuemon.Extensions.FileProviders.Physical in the documentation generation pipeline.
Performance: Add IsEnabled guards to logging calls in ServerTimingFilter and ServerTimingMiddleware to avoid parameter allocation when log level is disabled. Code quality: Suppress unused return value warnings with discard operator in TargetFrameworkMoniker. TFM compatibility: Use newer WriteAsync/AppendLine overloads for net9.0+ while preserving netstandard2.0 compatibility. Pattern improvement: Enhance async pattern matching for line reading in DsvDataReader.
Convert XML documentation cref attributes from old-style T:Type[] format to cleaner, more readable patterns. For example: T:byte[] becomes 'byte array', T:IConvertible[] becomes 'IConvertible array', and T:System.Object becomes 'System.Object'. This improves readability and consistency of API documentation across 75 source files throughout the Cuemon package family.
Refined and improved code examples across 43 API type documentation pages to better demonstrate real-world usage patterns and output verification. Added complete documentation for the new Cuemon.Extensions.FileProviders namespace including the PortablePhysicalFileProvider type with practical examples showing case-insensitive file resolution, directory enumeration, and change notifications.
Updated XML documentation in four files to use correct cref syntax for the parameterless Disposable.Dispose() method. Changed from 'Disposable.Dispose' to 'Disposable.Dispose()' to match IntelliSense and documentation rendering requirements.
Enhanced the retry loop in Awaiter to properly handle cancellation tokens. Added explicit OperationCanceledException re-throw to ensure cancellation requests are propagated correctly. Task.Delay now accepts the CancellationToken parameter to honor cancellation during retry delays.
Reorganized benchmark structure to align with source code layout. Moved AwaiterBenchmark.cs from tuning/Cuemon.Kernel.Benchmarks/ root to tuning/Cuemon.Kernel.Benchmarks/Threading/ to mirror the production code namespace Cuemon.Threading.
Extended AsyncRunOptions with two new properties: TimeProvider for testable time measurement and MaximumAttempts to enforce explicit attempt limits during zero-delay retries. Implemented IValidatableParameterObject to validate the zero-delay safeguard constraint. These features enable more flexible retry scenarios while preventing accidental unbounded retry loops.
Updated Awaiter.RunUntilSuccessfulOrTimeoutAsync to leverage new AsyncRunOptions properties. Now uses TimeProvider for time measurement instead of Task.Delay, respects MaximumAttempts when configured, and passes CancellationToken to the user delegate to enable cooperative cancellation support.
Added unit tests covering TimeProvider integration, MaximumAttempts enforcement, zero-delay safeguard validation, and CancellationToken propagation in the Awaiter retry loop. Updated benchmarks to reflect new method signatures and validate performance characteristics of the enhanced implementation.
Updated DocFX examples to demonstrate new AsyncRunOptions properties (TimeProvider, MaximumAttempts) and updated Awaiter usage to show cancellation token integration. Examples now cover zero-delay retry configuration, TimeProvider usage, and cancellation scenarios.
Added Microsoft.Bcl.TimeProvider v10.0.10 dependency for netstandard2.0 target framework to support TimeProvider abstraction in AsyncRunOptions. Updated Cuemon.Kernel.csproj to reference the polyfill package for netstandard2.0 targets.
Updated Condition.IsValidRelativeUri to use implicit type inference (var) instead of explicit type declaration, improving code readability and maintainability.
Changed MaximumAttempts from nullable int? to non-nullable int with a default value of 0. This simplifies the API by using 0 to indicate unlimited attempts instead of null. Updated validation logic, Awaiter implementation, and test expectations accordingly. When Delay is zero, MaximumAttempts must be explicitly set to a positive value to prevent unbounded retry loops.
Removed TimeProvider property from AsyncRunOptions and simplified the implementation to use System.Diagnostics.Stopwatch for timeout measurement. This eliminates the netstandard2.0 dependency on Microsoft.Bcl.TimeProvider while maintaining equivalent retry and timeout behavior. Updated Awaiter implementation, tests, and documentation accordingly.
Replace Stopwatch.StartNew() with Stopwatch.GetTimestamp() for better performance characteristics. Add GetElapsedTime() helper with .NET 9+ conditional compilation to calculate elapsed time efficiently. Optimize DelayAsync to return Task.CompletedTask instead of async/await pattern to reduce allocations. Benchmark results show improved performance across .NET 9.0 and .NET 10.0 runtimes.
@gimlichael gimlichael self-assigned this Aug 5, 2026
@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown

Greptile Summary

This release adds a portable case-insensitive physical file provider, revises asynchronous retry behavior, updates framework and package configuration, and substantially refreshes API documentation and examples.

  • Adds PortablePhysicalFileProvider with tests and benchmarks for case-insensitive file and directory resolution.
  • Updates Awaiter retry timing, timeout handling, tests, and benchmarks.
  • Revises authentication, HTTP exception, TagHelper, reflection, and other API examples.
  • Updates package release notes, generated documentation, project configuration, and the changelog.

Confidence Score: 5/5

The PR appears safe to merge because no eligible new finding or known outstanding prior finding remains.

No blocking failure remains within the provided follow-up-review scope.

Important Files Changed

Filename Overview
src/Cuemon.Extensions.FileProviders.Physical/PortablePhysicalFileProvider.cs Introduces a public IFileProvider implementation that resolves path segments case-insensitively and caches successful physical-path resolutions.
test/Cuemon.Extensions.FileProviders.Physical.Tests/PortablePhysicalFileProviderTest.cs Adds broad coverage for file and directory lookup, path normalization, collisions, misses, watching, disposal, and concurrent access.
src/Cuemon.Kernel/Threading/Awaiter.cs Refines retry-delay normalization and ensures retries stop after a delay capped to the remaining timeout.
test/Cuemon.Kernel.Tests/Threading/AwaiterTest.cs Expands coverage of retry attempts, timeout boundaries, cancellation, delay capping, and exception aggregation.
Directory.Packages.props Updates centrally managed package versions used by the solution.
CHANGELOG.md Documents the release's new APIs, behavioral refinements, package updates, and documentation changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Caller requests file, directory, or watch] --> B[Normalize logical path]
    B --> C{Cached successful resolution?}
    C -->|Yes| D[Reuse physical path]
    C -->|No| E[Enumerate each path segment]
    E --> F{Single case-insensitive match?}
    F -->|Yes| G[Cache resolved physical path]
    F -->|Missing or ambiguous| H[Return not found or null change token]
    G --> I[Delegate to PhysicalFileProvider]
    D --> I
Loading

Reviews (4): Last reviewed commit: "🚨 add namespace mismatch suppressions" | Re-trigger Greptile

Task.Delay uses whole-millisecond resolution, and when retry delays are capped to remaining timeout windows they can become fractional milliseconds. The NormalizeDelay method now rounds these up to the next whole millisecond to prevent zero-delay busy loops when a capped delay would otherwise be truncated. This ensures retry delays remain positive even after timeout constraints.
Refactored Watch tests to establish a baseline PhysicalFileProvider and compare its behavior against PortablePhysicalFileProvider, ensuring consistent change notification semantics. Extracted AwaitChangeAsync into WaitForChangeAsync and AssertEquivalentChangeNotificationAsync for better composition of assertions. Also improved AssertEquivalentFileInfo to skip length assertion for non-existent files, and updated DistinctCaseEntriesUnsupportedReason to provide a sensible default message.
New benchmark project for measuring FileProviders.Physical performance across different file scenarios and workload sizes.
FileWatcher.UtcCreated now correctly initialized to UtcLastModified for consistency, and file-modified comparison now uses the tracked UtcLastModified instead of the instance creation time.
aicia-bot and others added 12 commits August 6, 2026 02:20
Benchmark suite measuring path resolution performance across cache hit/miss scenarios and file path complexity variations. Includes parameterized benchmarks for different directory depths, sibling counts, and path types. Performance data informs optimization decisions and baseline expectations for production deployments.
Updates DocFX namespace and type documentation to reflect the portable file provider implementation, caching strategy, and path resolution semantics. Clarifies cache entry sharing for equivalent logical paths and explains performance implications for cold lookups in wide directories.
Updates per-package release notes for all assemblies and adds README for the new Cuemon.Extensions.FileProviders.Physical package. Documents feature additions, API improvements, dependency updates, and breaking changes for each package component in the 10.6.0 release.
Release 10.6.0 focuses on portable file provider capabilities, async retry enhancements, and comprehensive dependency updates. Introduces PortablePhysicalFileProvider for cross-platform case-insensitive file resolution with intelligent caching. Refactors Awaiter with structured AsyncRunOptions configuration. Modernizes XML documentation and improves code quality patterns. Includes systematic dependency updates and critical bugfixes for FileWatcher and retry semantics.
Refactor FileDependency test to use TaskCompletionSource and ConcurrentQueue for more reliable async signal handling. Replaces CountdownEvent and List<DateTime> with modern async primitives, removes dependency on Cuemon.Extensions, and improves test directory lifecycle management with proper setup/teardown. Enhanced test readability and reliability with configurable timeout constants.
Minor improvements to threading test assertions and structure for consistency with updated FileDependencyTest patterns.
Streamline GlobalSetup initialization and improve benchmark measurement accuracy by reducing unnecessary allocations during setup phase.
Add new benchmark reports for cold directory/file lookups and collision scenarios. Remove outdated report for consolidated benchmark structure.
Remove outdated S2589 suppression for CyclicRedundancyCheck. Remove duplicate S107 suppression for DigestAuthorizationHeader constructor with 11 parameters. Remove S3776 suppression for AddEnumerableConverter that was addressed in recent refactoring. Clean up trailing whitespace in suppression file headers.
Replace traditional null check and assignment pattern with modern null-coalescing assignment operator (?=) for more concise and idiomatic C# code.
Apply file-scoped namespace syntax (namespace X;) consistently across all source and test projects. This modernizes the code structure to align with contemporary C# style conventions and improves overall readability by reducing nesting depth and visual indentation.
@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown

Too many files changed for review (1307 files, 500 file limit).

@gimlichael
gimlichael requested a lite review from Copilot August 6, 2026 23:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.50253% with 76 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.22%. Comparing base (fb5b172) to head (29c192f).

Files with missing lines Patch % Lines
...ntication/Digest/DigestAuthenticationMiddleware.cs 81.33% 13 Missing and 1 partial ⚠️
...Core.Mvc/Filters/Diagnostics/ServerTimingFilter.cs 84.84% 10 Missing ⚠️
...uthentication/Hmac/HmacAuthenticationMiddleware.cs 81.63% 9 Missing ⚠️
...hentication/Basic/BasicAuthenticationMiddleware.cs 84.37% 5 Missing ⚠️
src/Cuemon.AspNetCore/Diagnostics/ServerTiming.cs 75.00% 4 Missing ⚠️
...tCore.Authentication/AuthorizationHeaderBuilder.cs 89.65% 3 Missing ⚠️
...AspNetCore/Hosting/HostingEnvironmentMiddleware.cs 76.92% 3 Missing ⚠️
...spNetCore/Http/Headers/ApiKeySentinelMiddleware.cs 62.50% 3 Missing ⚠️
...etCore/Http/Headers/RequestIdentifierMiddleware.cs 78.57% 3 Missing ⚠️
...etCore/Http/Headers/UserAgentSentinelMiddleware.cs 62.50% 3 Missing ⚠️
... and 14 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
+ Coverage   94.21%   94.22%   +0.01%     
==========================================
  Files         602      604       +2     
  Lines       19283    19688     +405     
  Branches     2032     2104      +72     
==========================================
+ Hits        18167    18552     +385     
- Misses       1052     1072      +20     
  Partials       64       64              

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src/Cuemon.Xml/Extensions/StreamDecoratorExtensions.cs Fixed
gimlichael and others added 8 commits August 7, 2026 17:28
…eam handling

Add cancellation token support to async stream copy operations in authentication and caching middleware. Use XmlReader.Create() to properly manage stream resources and enable proper cleanup when XML documents are loaded from streams.
External test runners like JetBrains may host tests in a different target framework than the assembly was compiled for. Instead of failing the test, skip it when the runtime-reported TFM does not match the expected compile-time TFM. This prevents false negatives when running under non-built-in test runners.
Verify that XML encoding detection properly rejects Document Type Definitions (DTDs) to prevent XXE and entity expansion attacks. DTD entities should not be expanded when detecting encoding information.
Document bug fixes for async stream copy operations that now properly propagate cancellation tokens in authentication and caching middleware, and improvements to XML encoding detection resource cleanup.
Update CHANGELOG.md to clarify async stream copy operation improvements and add Security section documenting DTD rejection in XML encoding detection to prevent XXE and entity expansion attacks.
Comment thread src/Cuemon.Xml/Extensions/StreamDecoratorExtensions.cs Dismissed
@gimlichael
gimlichael merged commit a4ff6ac into main Aug 7, 2026
323 checks passed
@gimlichael
gimlichael deleted the v10.6.0/new-features branch August 7, 2026 17:48
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.

4 participants