Skip to content

Enforce Canonical Application Name conventions, add config factories#29

Merged
ChrisSimmons merged 10 commits into
mainfrom
canonical-application-name-conventions
Jul 11, 2026
Merged

Enforce Canonical Application Name conventions, add config factories#29
ChrisSimmons merged 10 commits into
mainfrom
canonical-application-name-conventions

Conversation

@ChrisSimmons

@ChrisSimmons ChrisSimmons commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • CanonicalApplicationName now enforces the naming conventions from the Canonical Application Name / Name part normalization wiki pages on all four parts (previously only the long-form aggregate/component were checked for null/whitespace; the short forms weren't validated at all).
  • Added CanonicalApplicationName.FromConfiguration(IConfiguration), reading netchris:application:{aggregate,aggregateShort,component,componentShort} and failing fast with a message naming the missing key.
  • Renamed ApplicationMetadata's factory methods to take an explicit Assembly instead of relying on Assembly.GetEntryAssembly() (breaking change):
    • GetApplicationMetadataFromEntryAssemblyGetApplicationMetadata(assembly, ...)
    • Added an overload, GetApplicationMetadata(assembly, configuration, environmentName), composing CanonicalApplicationName.FromConfiguration with the assembly-based factory, to centralize logic previously duplicated in consumers (e.g. NetChris.AspNetCore.Server).
  • Added Microsoft.Extensions.Configuration.Abstractions to NetChris.Core.csproj.
  • Upgraded the test project to xunit.v3.
  • Documented CanonicalApplicationName and ApplicationMetadata, including the configuration keys, in Package-README.md.
  • Split the CLAUDE.md agent directive into AGENTS.md, with CLAUDE.md pointing to it.

Closes #28

Test plan

  • dotnet test — all 177 tests pass, including new CanonicalApplicationNameTests and updated/added ApplicationMetadataTests cases
  • dotnet build with TreatWarningsAsErrors on both projects — clean

🤖 Generated with Claude Code

ChrisSimmons and others added 10 commits July 11, 2026 15:26
Ensures future sessions explicitly load the .NET-specific agent
directives from the public MCP server rather than relying on passive
detection.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…28)

CanonicalApplicationName now validates all four parts against the
naming conventions in the reference wiki (long form: lower-case,
numbers, underscores, starting with a letter; short form: 1-4
lower-case letters/numbers), instead of only checking the long-form
values for null/whitespace.

Add CanonicalApplicationName.FromConfiguration and
ApplicationMetadata.GetApplicationMetadataFromEntryAssemblyAndConfiguration
factories that read the four well-known netchris:application:* keys,
centralizing logic that was previously duplicated in consumers like
NetChris.AspNetCore.Server.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ge-README

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…eaking change)

GetApplicationMetadataFromEntryAssembly -> GetApplicationMetadata(Assembly, ...)
GetApplicationMetadataFromEntryAssemblyAndConfiguration -> GetApplicationMetadataFromConfiguration(Assembly, IConfiguration, ...)

Callers now supply the assembly explicitly instead of relying on
Assembly.GetEntryAssembly(), which is unreliable for test hosts and
other non-standard entry points.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ationMetadata

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ChrisSimmons ChrisSimmons merged commit f1112d5 into main Jul 11, 2026
2 checks passed
@ChrisSimmons ChrisSimmons deleted the canonical-application-name-conventions branch July 11, 2026 23:20
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.

CanonicalApplicationName: enforce naming conventions and support creation from configuration

1 participant