fix(936): repoint stale analyzer paths and stop the CI package cache from masking them - #937
Merged
Merged
Conversation
…from masking them Dependabot PR #921 bumped Meziantou.Analyzer to 3.0.290 and MSTest.Analyzers to 4.4.1 in every packages.config but left the <Analyzer Include> paths on 3.0.235 and 4.4.0. A clean restore creates only the new folders, so main failed to compile with CS0006 in 17 projects. CI stayed green because the packages/ cache in _build-analyzers.yml, _build-nullable.yml and _mstest-coverage.yml fell back through restore-keys to an older cache that still held the superseded folders. The fallback is removed so a cache miss restores exactly what the manifests declare. Verified on a fresh worktree with an empty packages/ folder: rebuild with TreatWarningsAsErrors and the analyzer rebuild both exit 0; actionlint and CSharpier check exit 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks
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.
Suggested title
fix(936): repoint stale analyzer paths and stop the CI package cache from masking them
Summary
mainfails to compile after a clean package restore (CS0006 in 17 projects). This PR fixes it.<Analyzer Include>path now points at the versions declared inpackages.config: Meziantou.Analyzer 3.0.290 (was 3.0.235) and MSTest.Analyzers 4.4.1 (was 4.4.0).restore-keysfallback is removed from thepackages/cache in_build-analyzers.yml,_build-nullable.ymland_mstest-coverage.yml. That fallback is why CI stayed green while clean builds failed.Why
packages.configbut left the analyzer paths in the project files on the old version folders.packages/cache through the prefix fallback. That older cache still contained the superseded folders, so every required check passed against package folders a clean checkout does not have.What Changed
Project files
.csprojfiles:Meziantou.Analyzer.3.0.235\becomes3.0.290\, andMSTest.Analyzers.4.4.0\becomes4.4.1\.<Analyzer Include>path lines change: 34 lines in total.CI
restore-keysis removed from the threepackages/cache steps, and the comment that described the fallback as safe is replaced with the reason it is not._format-check.ymlcaches only the dotnet tools directory, so it is unchanged.Docs
Architecture / How It Fits Together
nuget restorematerializespackages/{id}.{version}/from eachpackages.config. Analyzer DLLs reach the compiler through<Analyzer Include>paths in each project file. Those paths must name the same version folder that restore creates.Verification
Completed, on a fresh detached worktree at
mainwith an emptypackages/folder:msbuild /t:Rebuildfailed with CS0006 for both analyzer packages.msbuild TaskMaster.sln /t:Rebuild /m /p:Configuration=Debug "/p:Platform=Any CPU" /p:TreatWarningsAsErrors=trueexits 0.msbuild TaskMaster.sln /t:Rebuild /m /p:Configuration=Debug "/p:Platform=Any CPU" /p:EnableNETAnalyzers=true /p:EnforceCodeStyleInBuild=trueexits 0.actionlinton the three workflows exits 0.dotnet tool run csharpier check .exits 0...\packages\<dir>\reference against the clean restore finds no missing folder other than theExists()-guardedaltcover.8.6.45import, which Bug: package-manifest-consistency-residuals #929 tracks.Not verified in this PR
mstest-coveragecheck runs it on this PR.Recommended
packages/folder, runmsbuild TaskMaster.sln /t:Restore /p:RestorePackagesConfig=true, then the rebuild above.Backward Compatibility / Migration Notes
Risks and Mitigations
Slower CI on a cache miss. A
packages.configchange now restores from scratch.The existing exact-key cache still holds superseded folders.
packages.configchange produces a new key.Rollback: revert this commit.
Review Guide
.csprojdiffs. They are the same mechanical two-string substitution across 17 files.Follow-ups
<Analyzer Include>paths. The manifest-consistency work in Bug: package-manifest-consistency-residuals #929 is the natural home for a verifier that checks them.GitHub Auto-close
🤖 Generated with Claude Code