The ENVIRONMENT.md test also checks each row's default against the code #291

Merged
claude merged 1 commit from feature/24-env-default-check into develop 2026-11-05 06:24:35 -05:00
Owner

EnvironmentVariableDocumentationTests now also compares each ENVIRONMENT.md row's Default cell with the default in the code, so a changed default can no longer leave a wrong row unnoticed.

  • CheckDefaults reads each default from a new instance of its options class, following nested classes through the parent's instance. It compares that value with the cell's first backticked token: booleans case-insensitive, TimeSpans in 00:00:30 form, enums by name, numbers in the invariant culture. An empty or null default must be documented as *(empty …) or *(none …). File defaults are compared relative to the install directory, so the data/… rows need no exception.
  • Coverage: 328 of 333 mapped variables are compared. Five are on an allow-list, each with its reason in code:
    • the minimum password length, the unique e-mail rule and the lockout time, which startup sets before it reads the configuration;
    • the hostname and the pipeline worker count, which depend on the host.
  • A new self-test reports a document with a wrong default. It was red before the comparison existed.
  • The real document already matched the code, so no row needed fixing. The ENVIRONMENT.md paragraph about what the test checks now describes the comparison.

Tests: the whole Ninlil.Web.Tests project passes 2069. The verifier passed the change. It re-ran the red check and a mutation of a real row (port 80 → 81), which both tests caught.

Closes #24

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

`EnvironmentVariableDocumentationTests` now also compares each ENVIRONMENT.md row's Default cell with the default in the code, so a changed default can no longer leave a wrong row unnoticed. - `CheckDefaults` reads each default from a new instance of its options class, following nested classes through the parent's instance. It compares that value with the cell's first backticked token: booleans case-insensitive, TimeSpans in `00:00:30` form, enums by name, numbers in the invariant culture. An empty or null default must be documented as `*(empty …)` or `*(none …)`. File defaults are compared relative to the install directory, so the `data/…` rows need no exception. - Coverage: 328 of 333 mapped variables are compared. Five are on an allow-list, each with its reason in code: - the minimum password length, the unique e-mail rule and the lockout time, which startup sets before it reads the configuration; - the hostname and the pipeline worker count, which depend on the host. - A new self-test reports a document with a wrong default. It was red before the comparison existed. - The real document already matched the code, so no row needed fixing. The ENVIRONMENT.md paragraph about what the test checks now describes the comparison. Tests: the whole `Ninlil.Web.Tests` project passes 2069. The verifier passed the change. It re-ran the red check and a mutation of a real row (port 80 → 81), which both tests caught. Closes #24 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The ENVIRONMENT.md test now fails when a row's default differs from the default in the code
All checks were successful
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in 1m51s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in 1m55s
Build / Build Binary (linux-arm64) (pull_request) Successful in 22s
Build / Build Binary (macos-amd64) (pull_request) Successful in 22s
Build / Build Binary (linux-amd64) (pull_request) Successful in 23s
Build / Build Binary (windows-amd64) (pull_request) Successful in 2m52s
Build / Build Binary (macos-arm64) (pull_request) Successful in 17m5s
Build / Smoke Test the Windows Binary (pull_request) Successful in 19s
Build / Build and Push Image (pull_request) Successful in 28s
Build / Build Arch Linux Packages (pull_request) Successful in -1m52s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in 26s
Build / Publish Release (pull_request) Successful in 9s
Build / Pipeline (pull_request) Successful in 0s
Build / Test .NET (push) Successful in 30m22s
Build / Stage Draft Release (push) Successful in 10s
Build / Pack and Push NuGet Packages (common) (push) Successful in 35s
Build / Pack and Push NuGet Packages (dns-core) (push) Successful in -1m9s
Build / Pack and Push NuGet Packages (dhcp) (push) Successful in 1m39s
Build / Pack and Push NuGet Packages (dns-server) (push) Successful in 3m31s
Build / Build Binary (linux-amd64) (push) Successful in 1m1s
Build / Build Binary (macos-arm64) (push) Successful in -36s
Build / Build Binary (windows-amd64) (push) Successful in -45s
Build / Build Binary (linux-arm64) (push) Successful in 6m45s
Build / Build Binary (macos-amd64) (push) Successful in 5m54s
Build / Build and Push Image (push) Successful in 12s
Build / Smoke Test the Windows Binary (push) Successful in 16s
Build / Build Arch Linux Packages (push) Successful in 26s
Build / Build and Test Deb and RPM Packages (push) Successful in 3m0s
Build / Publish Release (push) Successful in -2m36s
Build / Pipeline (push) Successful in 0s
c1a36234a5
Closes #24

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit 9a550fd5dd into develop 2026-11-05 06:24:35 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!291
No description provided.