[dotnet] only embed the git revision in SourceLink metadata when stamping - #18004
Conversation
PR Summary by QodoGate .NET SourceLink revisions on Bazel stamping
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Build caching can silently regress
|
🔗 Related Issues
Regressed from #17467, which has SourceLink metadata read the git revision from the workspace status file on every build; this prevented RBE from being able to cache test results, and results in every single RBE run executing all .NET tests regardless of changes (~120 RBE executor minutes)
💥 What does this PR do?
Prevents dotnet assemblies and tests from being rebuilt and rerun on every CI job. The SourceLink metadata now embeds the git revision only when stamping, so unstamped builds are cacheable again.
🔧 Implementation Notes
csharp_sourcelink_librarygains astampattribute that defaults to the--stampflag through aconfig_setting, the same pattern rules_pkg uses. Release builds already pass--stamp, so published packages keep the real commit; everything else gets the existingHEADfallback.🤖 AI assistance
🔄 Types of changes