-
Notifications
You must be signed in to change notification settings - Fork 126
Manage dependencies with Central Package Management #2004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manage dependencies with Central Package Management #2004
Conversation
…ould not define the version on the PackageReference items but on the PackageVersion items: Microsoft.Data.SqlClient;Microsoft.Extensions.Logging.
…ve corresponding PackageVersion.
…versions are not allowed.
pjanotti
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @xiang17 - I had just a few minutes to look at it, I will finish it later today. Meanwhile, a few questions.
# Conflicts: # src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj # test/IntegrationTests/IntegrationTests.csproj
…to read/understand
… dependencies which are not latest.
…me dependencies which are not latest.
….` and `"`. Sorting instead with running `:sort` on selection in vim.
| @@ -0,0 +1,47 @@ | |||
| <Project> | |||
| <Import Project="..\Directory.Packages.props" /> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it will be good idea to reference here src\Directory.Packages.props
but without the section related to CommonExcludedAssets.props.
(Mainly to have OpenTelemetry* defined only in one place),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that as well, but there are only four dependencies that are common:
# cat src/Directory.Packages.props test/Directory.Packages.props | sort | uniq -d | grep Version
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.4.0-rc.2" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc9.11" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Wcf" Version="1.0.0-rc.8" />
<PackageVersion Include="OpenTelemetry" Version="1.4.0-rc.2" />
I've put them into Directory.Packages.props file in the root folder.
src/OpenTelemetry.AutoInstrumentation.AdditionalDeps/Directory.Packages.props
Show resolved
Hide resolved
# Conflicts: # examples/demo/Service/Examples.Service.csproj # src/OpenTelemetry.AutoInstrumentation/OpenTelemetry.AutoInstrumentation.csproj # test/IntegrationTests/IntegrationTests.csproj
| <PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- Versions from OpenTelemetry.AutoInstrumentation.csproj --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is wrong after uniting itemgroups.
RassK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall seems great!
|
After seeing PRs like this #2054 I think that too much has been moved to Central Package Management. I think that the instrumented library version should be declared only in |
The purpose of the PR was to make it easier for upgrading versions, especially for shared dependencies used in multiple places. The opentelemetry-dotnet repo centralizes almost all versions because most of them are shared. However, the same might not apply to this repo seeing recent PRs. I took a look at the recent dependabot PRs. Most of them are either in The packages in Regarding |
Why
Fixes #1974: Centralize dependency package versions.
What
Use Central Package Management
https://devblogs.microsoft.com/nuget/introducing-central-package-management/
Note1: the top comment in the article above says it's already supported by GitHub’s Dependabot, but I haven't been able to verify that or found any article in any other source.
Note2: I left a TODO comment on whether it's better to consolidate all packages in one ItemGroup and sort them alphabetically. I'd appreciate the community's feedback!
Tests
CI
Checklist
- [ ]CHANGELOG.mdis updated.- [ ] Documentation is updated.- [ ] New features are covered by tests.