Context
In #3370, the Sdk package README was updated to link to the analyzer rules index using a blob/main/ URL. As @jviau pointed out, this link can drift over time — a shipped SDK version may reference analyzer rules that were added after that version was released (or vice versa).
Proposal
Rewrite blob/main/ URLs in the README to blob/<tag-or-sha>/ at pack time so the link is a permalink matching the exact release. Two approaches discussed:
- MSBuild target before
GenerateNuspec — rewrite URLs in a temp copy of the README. There is existing URL rewriting in RepositoryInfo.targets for SourceLink that could serve as a pattern.
sed replacement in the CI pipeline — simpler, but only works in CI, not dotnet pack locally.
Option 1 would be preferred since it works in both CI and local pack.
Related
Context
In #3370, the Sdk package README was updated to link to the analyzer rules index using a
blob/main/URL. As @jviau pointed out, this link can drift over time — a shipped SDK version may reference analyzer rules that were added after that version was released (or vice versa).Proposal
Rewrite
blob/main/URLs in the README toblob/<tag-or-sha>/at pack time so the link is a permalink matching the exact release. Two approaches discussed:GenerateNuspec— rewrite URLs in a temp copy of the README. There is existing URL rewriting inRepositoryInfo.targetsfor SourceLink that could serve as a pattern.sedreplacement in the CI pipeline — simpler, but only works in CI, notdotnet packlocally.Option 1 would be preferred since it works in both CI and local pack.
Related