Appearance
ADR-2527: Enforce Dependency Alignment with MSBuild Properties and pnpm Catalogs
- Status: Accepted
- Date: 2026-11-21
- Authors: @fderuiter
- Deciders: @fderuiter
- Relates to: ADR-2233, ADR-2327, ADR-2508, ADR-2524, ADR-2525, ADR-2534
1. Context & Problem Statement
Ungrouped dependency update rules in .github/dependabot.yml and repeated version literals across Directory.Packages.props, apps/apphost/src/Cadence.AppHost.csproj, .config/dotnet-tools.json, docker/Dockerfile.dotnet, and five workspace package.json manifests allowed single-package bumps to introduce cross-manifest and transitive version skew while GitHub Actions runners remain paused until 2027 (ADR-2525, PRD-SYS-001):
- .NET, Aspire, IdentityModel, and CLI tool skew:
Directory.Packages.propsrepeated.NET 10(10.0.14vs10.0.15),IdentityModel(8.22.0vs8.23.0, plus transitive8.19.2), andAspire(13.6.5packages vs13.5.4Aspire.AppHost.SdkinCadence.AppHost.csproj) literals. Meanwhile,AWSSDK.S3 4.1.2transitively pulledSystem.IO.Hashing 11.0.0intonet10.0projects, and.config/dotnet-tools.jsonpinneddotnet-efto11.0.0(rollForward: false) whiledocker/Dockerfile.dotnetinstalled10.0.11. - Frontend workspace skew: Shared cohorts (
@typescript-eslint,vitest,@playwright,vue,vite,typescript,pinia) were duplicated acrosspackage.json,packages/ui/package.json,packages/usdm-schemas/package.json,apps/web/package.json, andapps/subject-portal/package.json, leaving@typescript-eslint/eslint-pluginat^8.72.2alongside@typescript-eslint/parser^8.73.0. - Statistical container drift & fail-open manifest validation: Unguarded Dependabot Docker updates drifted
docker/sce/python/Dockerfileanddocker/sce/r/Dockerfileaway from the qualifiedpython:3.14-slimandr-base:4.4.2GxP statistical execution baselines in ADR-2327 anddocs/openapi/interop_openapi.json. In addition,DependencyValidatorService.ValidateDependenciescaught JSON parse exceptions and returned0(failing open) and checked onlyapps/web/package.json.
2. Decision Drivers & Constraints
- Single source of truth per cohort: Lockstep
.NET,Aspire,IdentityModel,Microsoft.Extensions.AI,OpenTelemetry,MassTransit,FluentValidation, and sharednpmcohorts must define each version once with zero duplicate literals across.NETandpnpmmanifests. - Compile-time transitive enforcement: Because
.githooks/pre-commitskipsdotnet buildwhen no C# files are staged and GitHub Actions is paused,dotnet build Cadence.slnitself must reject.NET 11+framework assemblies or splitIdentityModel/Aspiregraphs onnet10.0without disabling Roslyn analyzers,CentralPackageTransitivePinningEnabled, orTreatWarningsAsErrors. - Native AOT & test isolation (
K-XS-1, ADR-2496, ADR-2534):packages/cliandpackages/tooling_coremust remain 100% Native AOT clean (zeroIL2xxx/IL3xxxwarnings), preserveFloorNativeAotPacksinDirectory.Build.targets, fail closed on malformed JSON manifests, and still passQualityGateRegistryTestsagainst isolated temporary directories without manifests. - GxP statistical baseline preservation: Platform migrations to
.NET 11,Python 3.15, orR 4.6remain out of scope; statistical execution containers stay pinned by tag and@sha256digest topython:3.14-slimandr-base:4.4.2.
3. Options Considered
Option 1: MSBuild cohort properties + Directory.Build.targets compile-time skew gate + pnpm-workspace.yaml catalog: + Dependabot groups/ignores + fail-closed DependencyValidatorService (selected)
- Overview: Centralize lockstep NuGet and SDK versions in
Directory.Build.propsconsumed byDirectory.Packages.props,Cadence.AppHost.csproj, andDirectory.Build.targets; enforceValidateDependencyAlignmentbeforeCoreCompileacross allnet10.0projects; move all multi-manifestnpmpackages intopnpm-workspace.yamlcatalog:; aligndotnet-ef(10.0.15) and SCE Dockerfiles (python:3.14-slim,r-base:4.4.2); configure Dependabotgroupsand runtimeignorerules; makeDependencyValidatorServicefail closed on malformed JSON; and lock everything withContainerImagePinTests. - Pros:
- ✅ Eliminates duplicate version literals across
.NETandpnpmmanifests at the package-manager layer (CentralPackageTransitivePinningEnabled+pnpmcatalog:). - ✅ Catches transitive major-version skew (
CADDEP001) and splitIdentityModel/Aspireclosures (CADDEP002,CADDEP003) deterministically duringdotnet build. - ✅ Fails closed on malformed
package.jsonand.config/dotnet-tools.jsonfiles while keepingCadence.CliNative AOT clean.
- ✅ Eliminates duplicate version literals across
- Cons:
- ❌ Dependabot has partial support for MSBuild property indirection and
pnpm-workspace.yamlcatalogs, requiring documented manual cohort bump steps when reviewing grouped PRs.
- ❌ Dependabot has partial support for MSBuild property indirection and
Option 2: Custom CLI script scanning Directory.Packages.props and package.json literals without MSBuild targets or pnpm catalogs
- Overview: Keep literal versions in every manifest and add a regex-based CLI linter to compare strings across files.
- Pros:
- ✅ Dependabot can edit raw string literals directly in individual manifests.
- Cons:
- ❌ Does not inspect resolved NuGet transitive graphs (
project.assets.json/PackageDefinitions/ReferencePath), missing indirect skew such asAWSSDK.Core 4.1.x -> System.IO.Hashing 11.0.0or transitiveIdentityModel 8.19.2. - ❌ Leaves contributors manually editing five
package.jsonfiles and dozens of<PackageVersion>lines on every routine upgrade.
- ❌ Does not inspect resolved NuGet transitive graphs (
Option 3: Rely solely on .github/dependabot.yml groups without MSBuild or pnpm structural enforcement
- Overview: Add
groupsandignorerules to.github/dependabot.ymlwhile leaving manifests unchanged. - Pros:
- ✅ Minimal diff in
.github/dependabot.yml.
- ✅ Minimal diff in
- Cons:
- ❌ Leaves existing version drift unresolved and provides zero compile-time or unit-test protection against manual edits or transitive package upgrades while GitHub Actions is paused.
4. Decision Outcome
- Chosen Option: Option 1.
- MSBuild cohort properties (
Directory.Build.props,Directory.Packages.props,Cadence.AppHost.csproj): DefineDotNetServicingVersion(10.0.15),AspireHostingVersion(13.6.5),IdentityModelVersion(8.23.0),DotNetAiVersion(10.11.0),OpenTelemetryVersion(1.19.1),OpenTelemetryInstrumentationVersion(1.19.0),MassTransitVersion(8.5.12), andFluentValidationVersion(12.2.0) inDirectory.Build.props. Reference those properties acrossDirectory.Packages.props(including transitiveMicrosoft.IdentityModel.Protocols.OpenIdConnectunderCentralPackageTransitivePinningEnabled=trueandAWSSDK.S3on the4.0.xline),Cadence.AppHost.csproj(<Sdk Name="Aspire.AppHost.Sdk" Version="$(AspireHostingVersion)" />), andCadence.Cli.csproj/FloorNativeAotPacks. - Compile-time skew target (
Directory.Build.targets):ValidateDependencyAlignmentruns afterResolvePackageAssetsandResolveAssemblyReferencesbeforeCoreCompileonnet10.0, failing compilation withCADDEP001on.NET 11+System.*/Microsoft.*framework packages or assemblies,CADDEP002on split or misalignedIdentityModelversions, andCADDEP003on split or misalignedAspireSDK/package versions. - Central
pnpmcatalog (pnpm-workspace.yaml): Move all 19 shared frontend packages (including@typescript-eslint/*unified on^8.73.0,vitest,@vitest/coverage-v8,@playwright/test,@axe-core/playwright,vue,vue-router,pinia,vite,@vitejs/plugin-vue,typescript) intocatalog:inpnpm-workspace.yaml, reference"catalog:"across all five workspacepackage.jsonmanifests, and refreshpnpm-lock.yaml. - CLI tool, SCE Dockerfiles, and Dependabot alignment: Pin
dotnet-efto10.0.15in.config/dotnet-tools.json(rollForward: false) anddocker/Dockerfile.dotnet; restorepython:3.14-slim@sha256:9aaa474097d094040649f2162a627c0049b408f52138d980916788d80f04802fandr-base:4.4.2@sha256:fe9b29520eeb5292d814b0958783c0ddfcdab37402967a3e67307604354f98d7indocker/sce/{python,r}/Dockerfile; and add lockstepgroupsand runtimeignorerules acrossnuget,npm, anddockerin.github/dependabot.yml. - Fail-closed
DependencyValidatorService& xUnit sentinels:DependencyValidatorService.ValidateDependenciesvalidates JSON syntax and schema across root/workspacepackage.jsonfiles and.config/dotnet-tools.json(returning1on malformed JSON or forbidden client-side crypto packagesnode-forge,elliptic,jose, and0when an isolated test fixture has no manifests).ContainerImagePinTestsverifies CLI tools, statistical Dockerfiles, MSBuild properties and skew targets,pnpmcatalog usage, Dependabot rules, andDependencyValidatorService.
5. Consequences & Trade-offs
- Positive Impact: Lockstep
.NET,Aspire,IdentityModel, andpnpmcohorts have a single version definition per cohort; transitive.NET 11+orIdentityModelskew fails immediately duringdotnet build Cadence.sln; statistical execution containers match ADR-2327 andinterop_openapi.json; andcadence check dependenciesno longer masks broken JSON manifests. - Negative Impact / Technical Debt: When Dependabot cannot update an MSBuild property in
Directory.Build.propsor acatalog:version inpnpm-workspace.yamlautomatically, maintainers update the central property or catalog entry once and refresh lockfiles/pins together. - Mitigation Strategy:
AGENTS.mdanddocs/CI.mddocument the exact manual cohort update steps and local MSBuild,pnpm, and xUnit verification commands, andContainerImagePinTestsfails immediately if.config/dotnet-tools.json,docker/Dockerfile.dotnet,Directory.Build.props,pnpm-workspace.yaml, or.github/dependabot.ymldrift out of sync.
6. Implementation & Verification
- Affected Repositories / Services:
Directory.Build.props,Directory.Packages.props,Directory.Build.targets,apps/apphost,packages/cli,packages/tooling_core,pnpm-workspace.yaml, workspacepackage.jsonmanifests,pnpm-lock.yaml,.config/dotnet-tools.json,docker/Dockerfile.dotnet,docker/sce/python/Dockerfile,docker/sce/r/Dockerfile,.github/dependabot.yml,tests/Cadence.UnitTests,AGENTS.md,docs/CI.md,docs/cli.md. - Verification Plan:
dotnet restore Cadence.sln && dotnet build Cadence.slnverifies zero warnings/errors onHEAD, andContainerImagePinTests.DirectoryBuildTargets_FailsCompilationOnDotNet11OrSplitIdentityModelOrAspireSkewverifies compile-time failure (CADDEP001,CADDEP002,CADDEP003) on skewed resolutions.pnpm install --frozen-lockfile,pnpm build, andpnpm -r testverify unified catalog resolution across all workspace packages.pnpm cadence check dependencies,cli-docs,adrs,doc-index,yaml, anddotnet test tests/Cadence.UnitTests/Cadence.UnitTests.csproj --filter FullyQualifiedName~ContainerImagePinTestsverify fail-closed manifest parsing, CLI documentation sync, and sentinel coverage.