Skip to content

Manage Packages Centrally#226

Merged
elzik merged 7 commits intomainfrom
centralise-package-management
Jan 7, 2026
Merged

Manage Packages Centrally#226
elzik merged 7 commits intomainfrom
centralise-package-management

Conversation

@elzik
Copy link
Owner

@elzik elzik commented Jan 3, 2026

Summary by CodeRabbit

  • Chores
    • Centralized package version management added: a single manifest now governs dependency versions across the solution.
    • Projects and tests updated to rely on the centralized manifest instead of per-project version pins.
    • Solution and build configuration updated to ensure the central manifest and package config are included during restores.
    • Build and Docker workflows adjusted to use the repository root as the build context.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 3, 2026

Walkthrough

Adds a centralized NuGet version manifest (Directory.Packages.props), removes per-project Version attributes from PackageReferences across many projects, updates the solution to include the manifest and new projects, and adjusts Docker build context and Dockerfile to copy nuget.config and Directory.Packages.props.

Changes

Cohort / File(s) Summary
Central Package Version Management
Directory.Packages.props
New file enabling ManagePackageVersionsCentrally with an ItemGroup of PackageVersion entries mapping many packages to explicit versions.
API Project
src/Elzik.Breef.Api/Elzik.Breef.Api.csproj
Removed explicit Version attributes from PackageReference entries so versions resolve centrally.
Application Project
src/Elzik.Breef.Application/Elzik.Breef.Application.csproj
Removed explicit Version attribute from SonarAnalyzer.CSharp PackageReference.
Domain & Infrastructure
src/Elzik.Breef.Domain/Elzik.Breef.Domain.csproj, src/Elzik.Breef.Infrastructure/Elzik.Breef.Infrastructure.csproj
Removed explicit Version attributes from multiple PackageReference entries; preserved PrivateAssets/IncludeAssets.
Test Projects
tests/.../*.csproj
tests/Elzik.Breef.Api.Tests.Functional/Elzik.Breef.Api.Tests.Functional.csproj, tests/Elzik.Breef.Api.Tests.Integration/Elzik.Breef.Api.Tests.Integration.csproj, tests/Elzik.Breef.Infrastructure.Tests.Integration/Elzik.Breef.Infrastructure.Tests.Integration.csproj, tests/Elzik.Breef.Infrastructure.Tests.Unit/Elzik.Breef.Infrastructure.Tests.Unit.csproj
Removed Version attributes from many test project PackageReference entries; retained PrivateAssets/IncludeAssets and test groupings.
Solution & Build Scripts
Elzik.Breef.sln, build/api/build-docker.ps1
Solution header bumped to VS 18; added Directory.Packages.props & nuget.config to Solution Items; new Build and Api projects and configuration mappings; build-docker.ps1 now uses repo root as Docker build context.
Dockerfile
src/Elzik.Breef.Api/Dockerfile
Updated to copy nuget.config and Directory.Packages.props, uses /repo build context and updated csproj/restore paths; build/publish pipeline preserved.

Sequence Diagram(s)

(No sequence diagram generated — changes are declarative and do not introduce multi-component control flow requiring visualization.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Update Dependencies #155: Modifies NuGet package version declarations in csproj files; strongly related to centralizing/removing per-project Version attributes.

Poem

🐇 I hopped through props and gathered each seed,
A single file now guides every feed.
I trimmed the csprojs of their versioned rows,
Copying configs where the restore now goes.
✨🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Manage Packages Centrally' clearly and concisely describes the main change: implementing centralized NuGet package version management through Directory.Packages.props and removing explicit versions from all project files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0fe75e4 and c1133f6.

📒 Files selected for processing (1)
  • Directory.Packages.props
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-01-03T13:47:17.466Z
Learnt from: elzik
Repo: elzik/breef PR: 226
File: Directory.Packages.props:1-45
Timestamp: 2026-01-03T13:47:17.466Z
Learning: In the elzik/breef repository, the alpha version of Microsoft.SemanticKernel.Connectors.Ollama (1.51.0-alpha) is intentionally used and documented in the README.md with a note that it's in preview and warnings will be logged.

Applied to files:

  • Directory.Packages.props
📚 Learning: 2026-01-03T13:47:19.042Z
Learnt from: elzik
Repo: elzik/breef PR: 226
File: Directory.Packages.props:25-25
Timestamp: 2026-01-03T13:47:19.042Z
Learning: The breef project intentionally uses preview/alpha NuGet packages (e.g., Microsoft.SemanticKernel.Connectors.Ollama) with documented awareness in the README and warning logs to inform users of the preview status. During reviews, check that any preview/alpha package references are documented, and that appropriate warnings or notes exist (in README, changelog, or release notes). Apply this guideline to all package reference declarations within .props files across the repository.

Applied to files:

  • Directory.Packages.props
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (csharp)
  • GitHub Check: build-ubuntu
  • GitHub Check: build-ubuntu
🔇 Additional comments (2)
Directory.Packages.props (2)

1-4: LGTM! CPM configuration is correctly set up.

The centralized package management configuration is properly implemented with ManagePackageVersionsCentrally set to true, enabling version management across all projects in the solution.


7-44: No issues found. All package versions verified as legitimate releases on NuGet:

  • Microsoft.NET.Test.Sdk 18.0.1: Exists and is the current stable release; no security advisories detected.
  • Microsoft.Extensions.Configuration, Microsoft.AspNetCore.Mvc.Testing, and related Microsoft.Extensions. packages at 10.0.1/10.1.0*: These are correct stable releases for .NET 10 (released December 2025).
  • Refit 9.0.2 and other packages: All versions exist and are current; no security concerns identified.

The version numbers align appropriately with the .NET 10 target.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 18bde07 and 701a2da.

📒 Files selected for processing (9)
  • Directory.Packages.props
  • src/Elzik.Breef.Api/Elzik.Breef.Api.csproj
  • src/Elzik.Breef.Application/Elzik.Breef.Application.csproj
  • src/Elzik.Breef.Domain/Elzik.Breef.Domain.csproj
  • src/Elzik.Breef.Infrastructure/Elzik.Breef.Infrastructure.csproj
  • tests/Elzik.Breef.Api.Tests.Functional/Elzik.Breef.Api.Tests.Functional.csproj
  • tests/Elzik.Breef.Api.Tests.Integration/Elzik.Breef.Api.Tests.Integration.csproj
  • tests/Elzik.Breef.Infrastructure.Tests.Integration/Elzik.Breef.Infrastructure.Tests.Integration.csproj
  • tests/Elzik.Breef.Infrastructure.Tests.Unit/Elzik.Breef.Infrastructure.Tests.Unit.csproj
🧰 Additional context used
🪛 GitHub Actions: Continuous Delivery
src/Elzik.Breef.Api/Elzik.Breef.Api.csproj

[error] 1-1: NU1015: The following PackageReference item(s) do not have a version specified: AspNetCore.Authentication.ApiKey, Microsoft.SemanticKernel, Microsoft.VisualStudio.Azure.Containers.Tools.Targets, Refit, Refit.HttpClientFactory, Serilog, Serilog.Enrichers.AspNetCore, Serilog.Extensions.Hosting, Serilog.Settings.Configuration, Serilog.Sinks.Console, Serilog.Sinks.File, SonarAnalyzer.CSharp

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (8)
src/Elzik.Breef.Api/Elzik.Breef.Api.csproj (1)

12-26: Package references correctly updated for CPM, pending build fix.

The removal of explicit Version attributes is correct for Central Package Management. However, the pipeline failure (NU1015) indicates that Directory.Packages.props is not being discovered by MSBuild.

Once the file discovery issue identified in Directory.Packages.props is resolved, these package references will correctly resolve to the centralized versions.

src/Elzik.Breef.Application/Elzik.Breef.Application.csproj (1)

10-13: LGTM! Package reference correctly updated for CPM.

The SonarAnalyzer.CSharp package reference correctly omits the Version attribute while preserving the PrivateAssets and IncludeAssets settings. This will resolve to version 10.17.0.131074 from Directory.Packages.props once the file discovery issue is fixed.

src/Elzik.Breef.Domain/Elzik.Breef.Domain.csproj (1)

10-15: LGTM! Package references correctly migrated to CPM.

All three package references (HtmlAgilityPack, Microsoft.SemanticKernel.Abstractions, and SonarAnalyzer.CSharp) correctly omit version attributes while preserving other settings. They will resolve to centralized versions once the file discovery issue is fixed.

tests/Elzik.Breef.Infrastructure.Tests.Integration/Elzik.Breef.Infrastructure.Tests.Integration.csproj (1)

13-46: LGTM! Test project package references correctly migrated.

All package references have been correctly updated for Central Package Management. The changes preserve important attributes like PrivateAssets and IncludeAssets while removing version specifications that will now be managed centrally.

All referenced packages have corresponding entries in Directory.Packages.props.

tests/Elzik.Breef.Api.Tests.Functional/Elzik.Breef.Api.Tests.Functional.csproj (1)

12-36: Verify that all referenced packages have versions defined in Directory.Packages.props.

Ensure that the following packages used in the functional test project are declared with versions in Directory.Packages.props: Microsoft.AspNetCore.Mvc.Testing, Microsoft.PowerShell.SDK, Microsoft.SemanticKernel, Testcontainers, and Xunit.SkippableFact.

tests/Elzik.Breef.Api.Tests.Integration/Elzik.Breef.Api.Tests.Integration.csproj (1)

13-32: Centralized package management is properly configured.

All 11 packages are declared in Directory.Packages.props with explicit versions, and ManagePackageVersionsCentrally is correctly enabled. The removal of explicit Version attributes from this file is appropriate.

tests/Elzik.Breef.Infrastructure.Tests.Unit/Elzik.Breef.Infrastructure.Tests.Unit.csproj (1)

13-39: Unit test package versions confirmed in Directory.Packages.props.

All three unit test specific packages are correctly defined with versions:

  • Microsoft.Extensions.Diagnostics.Testing (10.1.0)
  • NSubstitute (5.3.0)
  • NSubstitute.Analyzers.CSharp (1.0.17)

The removal of Version attributes from the .csproj is correct and aligns with the centralized package version management configuration.

src/Elzik.Breef.Infrastructure/Elzik.Breef.Infrastructure.csproj (1)

10-26: Infrastructure package versions are properly centralized.

All infrastructure dependencies referenced in the project file have versions defined in Directory.Packages.props: Microsoft.Extensions.Configuration, Microsoft.Extensions.Configuration.Binder, Microsoft.SemanticKernel.Connectors.AzureOpenAI, Microsoft.SemanticKernel.Connectors.Ollama, Microsoft.SemanticKernel.Connectors.OpenAI, Refit, Refit.HttpClientFactory, Serilog.Extensions.Hosting, and the remaining dependencies. The centralized version management approach is correctly implemented.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 701a2da and 3aee290.

📒 Files selected for processing (2)
  • Elzik.Breef.sln
  • src/Elzik.Breef.Api/Dockerfile
🧰 Additional context used
🪛 GitHub Actions: Continuous Delivery
src/Elzik.Breef.Api/Dockerfile

[error] 14-14: Build failed: failed to solve: failed to compute cache key: failed to calculate checksum ... "/Directory.Packages.props": not found. Command/Step: COPY ["Directory.Packages.props", "./"]

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (2)
Elzik.Breef.sln (2)

3-4: LGTM - Standard Visual Studio version update.

The Visual Studio version has been updated from 17 to 18, which is a standard automatic change when the solution is opened in a newer version of Visual Studio. This has no impact on the centralized package management functionality.


10-10: LGTM - Correct integration of centralized package management.

Adding Directory.Packages.props to the Solution Items ensures the centralized package version manifest is visible in Visual Studio and properly recognized during NuGet restore operations. This change correctly supports the PR's objective of centralizing package management.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
Elzik.Breef.sln (1)

3-4: Visual Studio version metadata appears unusual.

Line 4 contains an unexpected format: 18.1.11312.151 d18.0 with a space and suffix. This metadata is typically auto-generated by Visual Studio and doesn't affect builds, but the format looks potentially malformed compared to standard version strings.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e2c263 and 5779d49.

📒 Files selected for processing (3)
  • Elzik.Breef.sln
  • build/api/build-docker.ps1
  • src/Elzik.Breef.Api/Dockerfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Elzik.Breef.Api/Dockerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-ubuntu
  • GitHub Check: build-ubuntu
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (4)
Elzik.Breef.sln (3)

10-10: LGTM! Essential addition for centralized package management.

Adding Directory.Packages.props to Solution Items correctly exposes the centralized NuGet version manifest in Visual Studio, supporting the PR's objective of managing packages centrally.


48-59: LGTM! Improved solution organization.

The new Build/Api folder structure effectively organizes build scripts, making them easily accessible within Visual Studio. This improves maintainability and discoverability of build-related files.


109-110: LGTM! Correct folder nesting configuration.

The NestedProjects entries correctly establish the hierarchy: Solution Items > Build > Api. The GUIDs match the folder definitions, ensuring proper solution structure in Visual Studio.

build/api/build-docker.ps1 (1)

13-13: Dockerfile correctly updated for repository root build context.

The Dockerfile at src/Elzik.Breef.Api/Dockerfile properly handles the build context change:

  • Line 14 copies Directory.Packages.props from the repository root
  • Line 15 copies the project file with correct path (src/Elzik.Breef.Api/Elzik.Breef.Api.csproj)
  • Subsequent COPY operations use correct paths for the repo root context

The change is approved.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI Agents
In @src/Elzik.Breef.Api/Dockerfile:
- Line 32: The Dockerfile's ENTRYPOINT line is malformed (it currently contains
the corrupted token placeholder `dot ${({token}}}`); update the ENTRYPOINT to
call the .NET runtime correctly by replacing the bad token with `dotnet` so the
ENTRYPOINT becomes a proper exec-array invoking the app (i.e., use ENTRYPOINT
["dotnet", "Elzik.Breef.Api.dll"]) to ensure the container can start.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5779d49 and 1fe02c0.

📒 Files selected for processing (2)
  • Elzik.Breef.sln
  • src/Elzik.Breef.Api/Dockerfile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-ubuntu
  • GitHub Check: build-ubuntu
  • GitHub Check: Analyze (csharp)
🔇 Additional comments (6)
src/Elzik.Breef.Api/Dockerfile (2)

13-17: LGTM!

The build context changes correctly align with building from the repository root. Copying nuget.config and Directory.Packages.props before restore ensures centralized package management works in the Docker build.


19-19: LGTM!

WORKDIR correctly updated to /repo/src/Elzik.Breef.Api to match the new build context.

Elzik.Breef.sln (4)

3-4: LGTM!

Visual Studio version update to 18 is a standard IDE upgrade.


10-11: LGTM!

Adding Directory.Packages.props and nuget.config to Solution Items improves visibility and supports the centralized package management initiative.


49-60: LGTM!

Good organization of build scripts under a dedicated Build solution folder with the Api subfolder. This keeps build automation artifacts visible and accessible within the IDE.


110-111: LGTM!

Nesting structure is correctly configured: Api folder nested under Build, and Build nested under Solution Items.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 7, 2026

@elzik elzik merged commit cfdc3cd into main Jan 7, 2026
14 checks passed
@elzik elzik deleted the centralise-package-management branch January 7, 2026 19:58
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