Repository navigation
fix: restore appsettings.Development.json — a test loads it non-optionally - #592
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #591.
mainis currently broken by it — three integration tests fail, and PR #588's CI surfaced it because PR runs test the branch merged intomain.What broke
tests/Cluckwork.Api.IntegrationTests/ProductionLogFormatTests.cs:318:Non-optional. #591 untracked
src/Cluckwork.Api/appsettings.Development.json(preserving its content asappsettings.Development.example.json), so the file is absent from a clean checkout and the threeenvironment: "Development"cases throw:Failing:
Non_production_configurations_bind_a_template_renderer(Development),Development_keeps_the_human_template_and_no_formatter,Exactly_one_console_sink_is_configured(Development). 1418 passed, 3 failed.Why the revert rather than a fix-forward
Making the test's load optional, or repointing it at the
.example.json, would keep CI green while deleting the guarantee. Those tests exist for #404: they assert the shipped Development config binds a template renderer and exactly one console sink — a formatter left beside a template is silently bound instead of it, which is the defect #404 records. If the file is not in the repo, there is no shipped Development config to assert about, and #404's Development-side guarantee becomes unverifiable.So the file is load-bearing as a tracked artifact, not merely as content. #591 was wrong.
How I got it wrong
I claimed "nothing referenced the tracked file" after grepping
Cluckwork.Api.csproj,Dockerfile,.github/,deploy/,tools/, and*.md+docs/. I never greppedtests/. A directory-filtered enumeration reported complete — the exact failure mode AGENTS.md #394 describes for contract changes ("list the references repo-wide, with no file-type filter"), applied to a file removal instead of a rename.Verified after reverting:
dotnet test --filter ProductionLogFormatTests→ 15 passed, 0 failed.The original concern still stands, and needs the other fix
#591 existed because a local Postgres connection string had been edited into that tracked file, one
git commit -afrom being committed to a GitGuardian-scanned repo. Untracking was the wrong remedy. The right one is the one AGENTS.md already prescribes, andUserSecretsIdis already configured for it:There is now hard evidence for why that is the only option: the file cannot be untracked without breaking a guard.