[🚀 Feature]: Provide a Single Source of truth for .NET dependency versions
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- csharp
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu bằng cách đọc các định nghĩa dependency hiện có trong dotnet/paket.dependencies, các tệp dotnet/src/*/.csproj, DevToolsGenerator.csproj và Selenium.WebDriver.nuspec. Theo dõi các cơ chế paket2bazel và nuget_pack hiện có trước khi quyết định Directory.Packages.props sẽ tạo hoặc điền các nguồn khác như thế nào. Công việc được coi là hoàn tất khi các phiên bản dependency có một nguồn chân lý duy nhất, các input được tạo và input của IDE/build vẫn nhất quán, đồng thời Renovate có thể cập nhật các phiên bản dành cho người dùng và phát triển.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Rather than doing this piecemeal by PR (see #17563), this issue serves to explain the root problem, with recommended solution and discussion of alternatives.
Description
Note that this plan is worth doing on its own, but this approach aligns with Simon's rules_dotnet proposal to replace Paket entirely with NuGet. If that is implemented we just delete the pieces from this plan that would no longer apply, we wouldn't need to re-architect anything.
Problem
.NET package versions live in four places in this repo, everything is hard coded to explicit versions and updates must be made by hand (not currently possible to automate updates with Bazel or Renovate).
| File | Role |
|---|---|
dotnet/paket.dependencies |
What Bazel uses for build/test |
dotnet/src/*/.csproj <PackageReference Version=...> |
IDE-only, ignored by bazel |
third_party/dotnet/devtools/src/generator/DevToolsGenerator.csproj <PackageReference Version=...> |
IDE-only, ignored by bazel |
dotnet/src/webdriver/Selenium.WebDriver.nuspec <dependency version=...> |
Floor versions required for users in nupkg |
So our build process ignores the csproj, and doesn't have any contract to validate that what is in nuspec or csproj is what we're actually testing or building.
Renovate doesn't work with Paket, only csproj files, but since bazel ignores them we can't use Renovate to update things.
These versions have already drifted between sources. Three packages have already diverged between paket.dependencies and the devtools generator csproj: CommandLineParser (2.8.0 vs 2.9.1), Humanizer.Core (2.8.26 vs 2.14.1), Microsoft.Extensions.DependencyInjection (3.1.9 vs 3.1.32).
Also because how .NET dependency version management works, we want to test with the oldest supported user-facing versions and the latest dev-only versions
What this proposal would do
dotnet/Directory.Packages.propsCreate this file in NuGet's Central Package Management format (mainstream since 2021 with Renovate support) as the single source of truth for .NET versions and derive other sources from it.- csproj files remove versions and have the IDE get required versions from CPM natively (no additional support required from Selenium)
- The published nupkg's
<dependencies>block is rendered from CPM at build time by the existing nuspec template substitution mechanism innuget_pack(which already substitutes$packageid$and$version$, so this is just an additional parsing with existing approach). paket.dependenciesgets automatically generated based on CPM values. This is the heaviest lift, but we'll keep the file version controlled for visibility.paket.lockandpaket.nuget.bzlwill pin transitive versions based on what is inpaket.dependencies.renovate.jsonwill differentiate user-facing versions to only update the floor version for security issues, and allow the dev-dependencies to update patch or minor versions.
Potential concerns
- There are CPM features that wouldn't be recognized by Bazel
- Nothing in csproj is currently recognized by Bazel so this is no different from status quo.
- We can add additional checks if this is considered a blocker.
- Added obfuscation from build process
- We can add comments to each relevant file pointing at the source-of-truth explaining usage and restrictions
- paket.dependencies stays version-controlled and human-readable (not buried in a generator's stdout).
- The primary conversion code is a small, single-purpose script that extends the existing paket2bazel chain rather than introducing a parallel mechanism.
- Need to make sure we have the right behavior for transitive dependencies, and we may need to add some to CPM to pin them if needed.
Alternatives
- Make
paket.dependenciesthe single source of truth (see #17577)- Requires adding additional custom reference files and imports to each csproj file versus using the CPM standard
- Would need to be completely reverted if we convert rules_dotnet to use Nuget instead of Paket
- Updates must still be done by hand
- Remains disconnected from nuspec
- Update the nuspec template dynamically the same way we update
paket.dependencies.- Pro: we keep visibility
- Con: it's a different approach from what we currently do
Does this apply to specific language bindings?
C#/.NET
What part(s) of Selenium does this relate to?
Build (CI or Bazel)
- Ngôn ngữ chính
- Java
- Star
- 34.6k
- Fork
- 8.7k
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 107
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SeleniumHQ/selenium
-
C-py I-defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
SeleniumHQ/selenium#18438 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
SeleniumHQ/selenium#18323 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
B-build C-py I-enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
SeleniumHQ/selenium#18435 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[🐛 Bug]: Bindings change the user's options when Selenium Manager supplies a browserCó thể đã có người làm @Liz-Lian đã nhận 2 ngày trước. Đang mởC-dotnet C-java C-nodejs C-py C-rb I-defect
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
SeleniumHQ/selenium#18428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[🐛 Bug]: [rust] Selenium Manager can return a browser from the cache before it finishes copyingCó thể đã có người làm @Liz-Lian đã nhận 2 ngày trước. Đang mởC-rust I-defect
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
SeleniumHQ/selenium#18427 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của SeleniumHQ/selenium
Issue tương tự
-
area-integrations
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
? - Needs Triage bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NVIDIA/cudf-spark-jni#5598 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
oracle/graalvm-reachability-metadata#12264 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[source-facebook-pages] post stream never returns attachments.media_typeCó thể đã có người làm @v-k-data đã nhận hôm nay. Đang mởarea/connectors needs-triage type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] AppSync: GetIntrospectionSchema wraps the schema in JSON instead of returning the raw SDL bodyĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
floci-io/floci#10107 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày