Skip to content

feat(toolkit): restore legacy parity APIs#13

Merged
PaulStSmith merged 5 commits into
masterfrom
legacy-toolkit-parity-tests
May 17, 2026
Merged

feat(toolkit): restore legacy parity APIs#13
PaulStSmith merged 5 commits into
masterfrom
legacy-toolkit-parity-tests

Conversation

@PaulStSmith

Copy link
Copy Markdown
Member

Summary

  • Restore legacy-compatible Toolkit APIs for assembly metadata, configuration docs/options, DBAccess factory/interface shims, logging context/masking, and report timestamps
  • Preserve INI documentation cleanup behavior for default-valued keys
  • Add migration notes documenting modern syntax differences and the intentional DBAccess2 exclusion
  • Add unit tests for the new compatibility surface and edge cases
  • Include existing Update-FromMaster.ps1 hardening for configurable base branch, remote, and push behavior

Tests

  • dotnet test .\Toolkit.Modern.Tests\ByteForge.Toolkit.Modern.Tests.csproj --configuration Debug --no-restore
  • net9.0: 986 passed
  • net48: 986 passed

● Preserve documentation blocks only when their associated INI keys are saved.
● Add regression coverage for documented default-valued keys.
● Add legacy-compatible assembly, configuration, database, logging, and timestamp helpers.
● Document migration differences and keep DBAccess2 intentionally excluded.
● Add tests for factory shims, logging context, secret masking, and timestamp formatting.
● Cover provider attribute validation and assembly metadata constructors.
● Allow configurable base branches, remotes, and optional push behavior.
● Harden cleanup when git operations or stash restoration cannot safely continue.
Copilot AI review requested due to automatic review settings May 17, 2026 15:03

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.

Pull request overview

Restores a broad set of legacy-parity Toolkit APIs (assembly metadata attributes, configuration documentation/schema/options, DBAccess factory + IDatabaseAccess shim with cancellation-token overloads, logging context/masking, report timestamp formatting), preserves INI documentation cleanup when keys carry default values, adds migration notes, expands unit tests, and hardens Update-FromMaster.ps1 with configurable base branch/remote/push behavior.

Changes:

  • New legacy-compat surface across Configuration, Data/Database, Logging, Utilities, and Attributes, including IDatabaseAccess implemented by DBAccess and a new DBAccess.Compatibility.cs async-token overload partial
  • INI save path now tracks ;;;-doc-blocks so default-valued keys' attached docs are dropped together, plus new ConfigDocumentationCatalog/IniDocumentationReader and option provider attribute/providers
  • Update-FromMaster.ps1 supports -BaseBranch, -RemoteName, -NoPush, robust base-branch detection, improved cleanup/stash restoration logic, and Windows-only guard

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Update-FromMaster.ps1 Adds parameters, Windows guard, base-branch resolution, stash/cleanup hardening
Toolkit.Modern/Utilities/ReportTimestampFormatter.cs New timestamp formatter with timezone label mapping
Toolkit.Modern/Logging/Models/LogRoutingContext.cs New per-scope logger routing snapshot
Toolkit.Modern/Logging/Models/AsyncLoggerOptions.cs New base options class for async logging
Toolkit.Modern/Logging/LogSecretMasker.cs New regex-based secret masker
Toolkit.Modern/Logging/LogContext.cs New AsyncLocal-based page identifier + routing context
Toolkit.Modern/Data/Database/IDatabaseAccess.cs New shared DB access interface
Toolkit.Modern/Data/Database/DBAccess.Core.cs Implements IDatabaseAccess
Toolkit.Modern/Data/Database/DBAccess.Compatibility.cs New cancellation-token async overloads
Toolkit.Modern/Data/Database/DatabaseAccessFactory.cs New legacy factory shim returning IDatabaseAccess
Toolkit.Modern/Configuration/Providers/* New encoding/culture options providers
Toolkit.Modern/Configuration/Models/ConfigSectionSchema.cs New config schema/options DTOs
Toolkit.Modern/Configuration/Models/ConfigDocumentationCatalog.cs New documentation catalog types
Toolkit.Modern/Configuration/Interfaces/IConfigOptionsProvider.cs New options-provider interface
Toolkit.Modern/Configuration/Helpers/IniDocumentationReader.cs New INI doc/validation reader
Toolkit.Modern/Configuration/Configuration.cs Preserves/drops attached doc blocks during save
Toolkit.Modern/Configuration/Attributes/ConfigOptionsProviderAttribute.cs New provider attribute
Toolkit.Modern/Attributes/AssemblyDeveloperAttribute.cs New legacy-style assembly metadata attributes
Toolkit.Modern.Tests/Unit/** New unit tests covering the added surface
MIGRATION-legacy-toolkit.md New migration guide

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Toolkit.Modern/Logging/LogContext.cs
Comment thread Toolkit.Modern/Data/Database/DatabaseAccessFactory.cs
Comment thread Toolkit.Modern/Logging/Models/LogRoutingContext.cs
Comment thread Update-FromMaster.ps1 Outdated
● Clarify log context clearing and database factory error behavior.
● Deduplicate routed loggers and use plain branch switching in the update script.
@PaulStSmith PaulStSmith force-pushed the legacy-toolkit-parity-tests branch from 897877e to 28e19a0 Compare May 17, 2026 15:53
@PaulStSmith PaulStSmith changed the base branch from develop to master May 17, 2026 15:53
@PaulStSmith PaulStSmith merged commit 7941a68 into master May 17, 2026
2 of 4 checks passed
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