Skip to content

Fix sync detection: flag version props changes that affect Bazel NuGet deps#65

Merged
agocke merged 1 commit into
bazelfrom
fix/detect-version-props-bazel-deps
Mar 14, 2026
Merged

Fix sync detection: flag version props changes that affect Bazel NuGet deps#65
agocke merged 1 commit into
bazelfrom
fix/detect-version-props-bazel-deps

Conversation

@agocke
Copy link
Copy Markdown
Owner

@agocke agocke commented Mar 14, 2026

Problem

The sync detection script treats eng/Version.Details.props as "version bump, informational" and never flags it as build-changes. This is wrong — NuGet package versions are embedded in MODULE.bazel and paket/paket.main.bzl, so version bumps can cause stale Bazel refs.

PR #64 demonstrates this: classified as ✅ clean despite bumping versions for packages like Microsoft.DotNet.Arcade.Sdk that are pinned in the Bazel build.

Fix

  • Remove the blanket is_version_only exemption for version props files
  • Cross-reference changed package names (extracted from MSBuild property names) against packages declared in paket/paket.main.bzl
  • If any changed package is used by Bazel, flag as build-changes; otherwise mark as (version bump, no Bazel NuGet deps affected)
  • Increase diff snippet limit from head -10 to head -20 to reduce misleading truncation

Testing

Ran against the PR #64 diff (sync/release-10.0-066be76ee5d):

Before: ✅ clean (exit 0)
After: ⚠️ build-changes (exit 1), identifying 9 affected packages:
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.GenFacades, Microsoft.DotNet.XUnitConsoleRunner, Microsoft.DotNet.Cecil, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.XUnitAssert, Microsoft.DotNet.XUnitExtensions, Microsoft.CodeAnalysis.Analyzers, Microsoft.CodeAnalysis.CSharp

The detection script previously treated eng/Version.Details.props and
eng/Versions.props as 'version bump, informational' and never flagged
them as build-relevant. This is wrong because Bazel's paket/paket.main.bzl
and MODULE.bazel embed NuGet package versions that must stay in sync with
the MSBuild version props.

Changes:
- Remove blanket is_version_only exemption for version props files
- Cross-reference changed package names against paket/paket.main.bzl to
  detect when version bumps affect packages used by the Bazel build
- Increase diff snippet from head -10 to head -20 to reduce misleading
  truncation in PR body reports

Tested against PR #64 (sync/release-10.0-066be76ee5d): now correctly
classifies as build-changes and identifies 9 affected Bazel NuGet deps
including Microsoft.DotNet.Arcade.Sdk, GenFacades, and XUnitConsoleRunner.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@agocke agocke enabled auto-merge (squash) March 14, 2026 01:26
@agocke agocke merged commit 03359e9 into bazel Mar 14, 2026
4 checks passed
@agocke agocke deleted the fix/detect-version-props-bazel-deps branch March 14, 2026 01:29
agocke pushed a commit that referenced this pull request Apr 23, 2026
* Keep instance fields on types with explicit or sequential layout

* Check for static flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant