Uh oh!
There was an error while loading. Please reload this page.
fix: make plugin hashes reproducible so the fork-PR verify gate can pass - #674
Merged
Merged
Conversation
The `Verify Plugin Hashes (fork PRs)` step in build_dotnet.yml regenerates PluginHashGenerator.Generated.cs and runs `git diff --exit-code` on it. That gate could never pass, for two independent reasons. First, the generator embedded `DateTime.UtcNow` in the file, so every regeneration produced a diff even when no hash had changed. Second, the SDK queries git and feeds the commit sha into every assembly by two routes: appended to InformationalVersion, and into the SourceLink map in the portable PDB, whose checksum is embedded in the DLL. So the hashes you commit describe the parent commit's binaries and go stale the instant they land - committing them changes HEAD, which changes the binaries again. Only first-party assemblies moved; the NuGet-supplied DLLs alongside them never did. That made the gate unwinnable rather than merely awkward: PR #673 burned two attempts re-pasting hashes, and every push produced a different set again. On Development the same churn was absorbed by the sibling auto-commit step, which is why `chore: update plugin hashes [skip ci]` landed after nearly every merge. It also meant the committed table always described a different build than the one it shipped in, so Release plugin verification never matched its own binaries. Drop the timestamp, stop the SDK's source-control queries, and regenerate. Verified: two clean Release builds at different commits now produce identical plugin hashes, and `git diff --exit-code` on the generated file is clean.
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
The
Verify Plugin Hashes (fork PRs)step in build_dotnet.yml regenerates PluginHashGenerator.Generated.cs and runsgit diff --exit-codeon it. That gate could never pass, for two independent reasons.First, the generator embedded
DateTime.UtcNowin the file, so every regeneration produced a diff even when no hash had changed.Second, the SDK queries git and feeds the commit sha into every assembly by two routes: appended to InformationalVersion, and into the SourceLink map in the portable PDB, whose checksum is embedded in the DLL. So the hashes you commit describe the parent commit's binaries and go stale the instant they land - committing them changes HEAD, which changes the binaries again. Only first-party assemblies moved; the NuGet-supplied DLLs alongside them never did.
That made the gate unwinnable rather than merely awkward: PR #673 burned two attempts re-pasting hashes, and every push produced a different set again.
On Development the same churn was absorbed by the sibling auto-commit step, which is why
chore: update plugin hashes [skip ci]landed after nearly every merge. It also meant the committed table always described a different build than the one it shipped in, so Release plugin verification never matched its own binaries.Drop the timestamp, stop the SDK's source-control queries, and regenerate. Verified: two clean Release builds at different commits now produce identical plugin hashes, and
git diff --exit-codeon the generated file is clean.