Skip to content

Feature/maintenance#361

Merged
davidkallesen merged 21 commits into
mainfrom
feature/maintenance
Apr 25, 2026
Merged

Feature/maintenance#361
davidkallesen merged 21 commits into
mainfrom
feature/maintenance

Conversation

@davidkallesen

Copy link
Copy Markdown
Collaborator

Summary

  • Bump analyzer packages and sync ATC coding rules to v1.0.1

Changes

✨ Features

  • Atc: add Enum.ToReadOnlyDictionary helper
  • Atc: add LogCategoryTypeExtensions with ToShortName helpers
  • Atc: add KillTreeAsync overloads on Process
  • Atc: add ProcessHelper.ExecuteAsync(ProcessStartInfo) overload
  • Atc.CodeDocumentation: emit code, example, exception XML doc tags
  • Atc.CodeAnalysis: expand SuppressMessageAttributeFactory coverage
  • Atc.XUnit: implement Type overload for exported-type checks
  • Atc.Rest: respect RequestAborted in ErrorHandlingExceptionFilter

🔒 Security

  • Atc.Rest.HealthChecks: make ExceptionMessage opt-in (info leak)
  • Atc.Rest: stop injecting Access-Control-Allow-Origin: * on static files
  • Atc.Rest.Extended: harden JWT signing-key fetch with timeout
  • Atc.Rest: replace ProblemDetails substring check with JsonDocument
  • Atc.Rest: sanitize exception filter and tighten regex timeout

🐛 Fixes

  • Atc: harden ProcessExtensions null guards and IsValidIssn catch
  • Atc: cache hot-path regexes (ASIN, ISSN, NumericAlphaComparer)
  • Atc.CodeDocumentation: cross-platform doc generator opt-in
  • Atc.OpenApi: throw ItemNotFoundException for missing schema Reference
  • Atc.DotNet: await ToListAsync that previously stringified Task

♻️ Refactoring

  • Atc.DotNet: forward no-logger BuildAndCollectErrors to logger overload

📝 Documentation

  • Atc.Rest: document setupAction as rate-limit/timeout hook point
  • Regenerate docs/CodeDoc/* from updated XML doc comments

📦 Dependencies

  • Bump analyzers and sync .editorconfig to ATC coding rules v1.0.1
  • Bump runtime packages and drop redundant SourceLink overrides

Breaking Changes

  • HealthCheck.ExceptionMessage is now opt-in (default: not populated)
  • Pass includeExceptionDetails: true to ToHealthCheck / CreateJson
  • SuppressMessageAttributeFactory no longer throws on unknown rule ids
  • It now returns a fallback attribute; update tests that asserted throw
  • Static files no longer set Access-Control-Allow-Origin: * by default
  • Apps that relied on the wildcard must configure CORS explicitly

…rides

- Bump Microsoft.OpenApi.Readers 1.6.28 -> 1.6.29
- Bump Microsoft.Extensions.Diagnostics.HealthChecks 10.0.5 -> 10.0.7
- Remove per-project Microsoft.SourceLink.GitHub overrides (now in Directory.Build.props)
…nfo leakage

- Add includeExceptionDetails parameter (default false) to ToHealthCheck
  and ToHealthChecks; raw exception text can carry connection strings,
  file paths or other internals
- Propagate the same opt-in through HealthCheckOptionsFactory.CreateJson
- Document the security tradeoff on HealthCheck.ExceptionMessage
- Add tests for default-off, opt-in, and connection-string non-leakage
…nd logger

- Stop injecting Access-Control-Allow-Origin: * on static files;
  the configured CORS policy already handles cross-origin headers
- Replace fragile substring check in IsFormatJsonAndProblemDetailsModel
  with JsonDocument-based property inspection (case-insensitive on names)
- Promote per-instance regex in ErrorHandlingExceptionFilterAttribute
  to static readonly and tighten its timeout to 250 ms
- Wrap StreamReader in RequestResponseLoggerMiddleware in a using block
  with leaveOpen so the swap-stream lifetime is explicit
- Add tests for substring false-positive, camelCase and JSON-array root
… logging

- Wrap the blocking GetIssuerSigningKeysAsync call in Task.Run with a
  30-second timeout so startup cannot hang or deadlock when the
  identity provider is unreachable
- Replace silent Debug.WriteLine on token-fetch failure with a
  structured ILogger.LogWarning (logger optional, DI-resolved)
- Add Microsoft.Extensions.Logging to GlobalUsings; drop unused
  System.Diagnostics import
…helper

- Replace null-forgiving Process.Start results in ProcessExtensions
  with explicit is-null guards; add class-level XML doc
- Cache ASIN, ISSN and digit regexes as static readonly Lazy<Regex>
  with Compiled and 250 ms timeouts
- Replace bare catch in IsValidIssn with explicit char-range validation
- Use TryGetValue in SimpleTypeHelper.GetBeautifyTypeName (single hash)
- Replace null! Tuple<int, string> values in NumericAlphaComparer with
  string.Empty
…ongDefinitions

- Replace NotImplementedException stub with a per-type validation
  call to AssemblyAnalyzerHelper
- Extract CollectMethodsWithWrongNamingForType helper so the assembly
  and single-type overloads share logic
- Add tests for happy path and null-argument validation; add
  FluentAssertions to test GlobalUsings
- Add runOnNonWindows parameter to MarkdownCodeDocGenerator.Run so the
  generator is callable on Linux and macOS when the XML doc files
  are reachable; default behavior remains Windows-only
- Cache CommentLookup access per type via GetTypeXmlDocumentComment
  and GetCommentsForType helpers
- Replace EventHandlerType! with a null-safe SafeBeautifyEventHandlerName
…Reference

- GetEnumSchema previously dereferenced schema.Reference.Id without
  a null check; now throws ItemNotFoundException with context and
  documents the new exception path
- Build error message previously stringified the Task<List<string>>
  returned by ToListAsync because it was never awaited; fix by
  awaiting the call so the file list is rendered correctly
- Reduce ParseBuildOutputHelper regex timeout from 2 minutes to 10s
- Add KillTreeAsync(CancellationToken) and KillTreeAsync(TimeSpan, CancellationToken)
  mirroring the existing sync KillTree, scheduled on the thread pool so callers
  do not block their own context
- Add class-level XML doc on the existing sync overloads
- Add tests covering null process, pre-cancelled token and an already-exited
  process round-trip
- Accept a fully configured ProcessStartInfo so callers can set custom
  environment variables, encoding, working directory etc; the overload forces
  RedirectStandardOutput/Error and disables UseShellExecute since the
  ProcessExecutionResult requires captured output
- Validates FileName is set (ArgumentException otherwise)
- Add validation tests for null and missing FileName, plus an integration
  test that runs a real shell echo on the current platform
… tags

- Replace the three TODO placeholders in CodeDocumentationTagsGenerator with
  real implementations for <code>, <example> and <exception cref="..."> tags
- Reuse the existing GenerateTag formatter for code and example so output
  spacing, indentation and dot-termination match the other tags
- Add tests covering all three new code paths
…overage

- Replace the single CA1062/CA1720 + SA1413 hard-coded switch with explicit
  lookup tables covering ~30 CA rules and ~14 SA rules drawn from current
  codebase usage
- Fall back to a generic Microsoft.Design / StyleCop.CSharp.MaintainabilityRules
  category for unknown rule ids instead of throwing NotImplementedException
  (analyzer matching only uses the rule id, so the fallback is functionally
  correct and removes a hostile API edge)
- Update existing tests for the new fallback semantics; add theory cases for
  the newly mapped rules
…er overload

- Replace the duplicated body in the no-logger overload with a single forward
  to the with-logger overload using NullLogger.Instance, removing copy-paste
  drift between the two public surfaces
- Add a remarks block recommending the with-logger overload for build progress
  visibility
…oint

- Expand the setupAction parameter doc to call out that this is the
  recommended position for app.UseRateLimiter() and app.UseRequestTimeouts()
- Add the setupAction step to the middleware-order list in <remarks>
- Provide a concrete example that wires both rate-limiting and request
  timeouts so consumers can copy/paste a working configuration
…ceptionFilter

- Track the exception in telemetry first, then short-circuit the response
  composition when the client has already disconnected (RequestAborted is
  signalled). This avoids JSON serialization on a closed connection and
  prevents noisy I/O failures from surfacing in logs
- Add tests for both the aborted and live request paths
…g int

- New EnumHelper.ConvertEnumToReadOnlyDictionary<T>() returns
  IReadOnlyDictionary<TEnum, int> keyed by typed enum value with each
  member's underlying int as the value, replacing hand-rolled rank /
  threshold dictionaries at call sites
- Reuses ShouldEnumValueBeSkipped so includeDefault, byFlagIncludeBase
  and byFlagIncludeCombined behave identically to ToDictionary
- Uses Convert.ToInt32 with InvariantCulture so non-int-backed enums
  (byte, short, long) work correctly — a small improvement over the
  existing (int)box cast in ToDictionary
- Add Enum<T>.ToReadOnlyDictionary wrapper next to ToDictionary
- Add EnumHelper tests for happy path, includeDefault=false, [Flags]
  base/combined matrix, and a byte-backed fixture; add Enum<T> theory
  test exercising the wrapper through DayOfWeek
@davidkallesen davidkallesen merged commit 3102a65 into main Apr 25, 2026
4 checks passed
@davidkallesen davidkallesen deleted the feature/maintenance branch April 25, 2026 21:28
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