-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
chore(deps): update dependency system.text.json to v8 - autoclosed #237
Conversation
9b68e34
to
14ff608
Compare
@clrudolphi @gasparnagy we try to keep our dependencies up to date automatically. If a major versions should not be upgraded to, it is usually best to write a test that will fail when the version if upgraded. Otherwise an unwanted upgrade might slip through in the future. |
IIRC we would prefer to target that older version in order to avoid version conflicts with Reqnroll. |
@mpkorstanje I understand the motivation, but this is not that easy. (Or at least I feel so.) Let me explain the situation and you can give a suggestion about how this should be handled. The cucumber messages currently contains two assets:
In .NET testing libraries (like Reqnroll) the dependencies are common problems, because typically users would like to test their own code with it that has it's own dependencies. As JSON serialization is a common concern, this has caused a lot of issues in the past: if the tool (Reqnroll, SpecFlow) specifies the dependency (e.g. System.Text.Json 8.0.4), the tool cannot be used to test the SUT that uses a lower dependency version (or it will implicitly upgrade the version used by the SUT, so at the end it will not test the product with its own dependencies, causing potential false test results). We had such issues in the past. So far we have used two strategies to avoid this problem:
The package So in short: actually the As I said, I don't really know what the best would be, but I see the following options, that would be suitable for Reqnroll (that is currently the only user of the messages lib, I think).
What do you think? |
I would like to suggest option 3 but that's the serialization classes are removed completely and made part of Reqnroll.
Chris
…________________________________
From: Gáspár Nagy ***@***.***>
Sent: Tuesday, July 16, 2024 12:11:59 PM
To: cucumber/messages ***@***.***>
Cc: Chris Rudolphi ***@***.***>; Mention ***@***.***>
Subject: Re: [cucumber/messages] chore(deps): update dependency system.text.json to v8 (PR #237)
@mpkorstanje<https://github.com/mpkorstanje> I understand the motivation, but this is not that easy. (Or at least I feel so.) Let me explain the situation and you can give a suggestion about how this should be handled.
The cucumber messages currently contains two assets:
* the message classes (that Reqnroll would like to use in general, for example for storing Gherkin AST)
* the message JSON serialization helper (that is essentially just a configuration of the System.Text.Json library) - this is going to be used only in special cases when someone will activate the cucumber messages logging
In .NET testing libraries (like Reqnroll) the dependencies are common problems, because typically users would like to test their own code with it that has it's own dependencies. As JSON serialization is a common concern, this has caused a lot of issues in the past: if the tool (Reqnroll, SpecFlow) specifies the dependency (e.g. System.Text.Json 8.0.4), the tool cannot be used to test the SUT that uses a lower dependency version (or it will implicitly upgrade the version used by the SUT, so at the end it will not test the product with its own dependencies, causing potential false test results). We had such issues in the past.
So far we have used two strategies to avoid this problem:
1. Try to avoid using dependencies that are potentially used by the SUT. E.g. we had our own JSON serializer for SpecFlow. (But I would like to get rid of that, because it is quite an overhead.)
2. Set the dependencies to the minimum required version. With NuGet packages it means: any System.Text.Json with version greater than 6.0.0 can be used. So it is not "we" that select the version, but the SUT. We just declare what we are compatible with. (SpecFlow/Reqnroll use this strategy quite extensively for test runner (NUnit/MsTest/xUnit) and other integrations.)
The package System.Text.Json is even more special, because nowadays it is part of the framework anyway, so you don't need to explicitly choose a version - it will use the one comes with your .NET version (e.g. with .NET 8). There are a few still commonly used .NET version (the .NET Framework v4.7, v4.8), that does not have this yet. These frameworks are in the compatibility target .NET Standard 2.0, that we (and most libraries) target. This is also visible in the version "usage" of the package, the v6.0.0 is used 3 times more than v8.
So in short: actually the System.Text.Json difference is only relevant for .NET Framework v4.7, v4.8, for any other, the framework built-in one will be used (if that is newer).
As I said, I don't really know what the best would be, but I see the following options, that would be suitable for Reqnroll (that is currently the only user of the messages lib, I think).
1. Keep the version at v6.0.0 and make a comment that we on-purpose delayed upgrading
2. Make a release with v6.0.0 (that Reqnroll can use) and only after upgrade to 8.0.0 (and hope that there will be no changes until the System.Text.Json versioning is better settled)
3. Separate the message classes and the JSON serialization to two separate packages (and Reqnroll will only use the classes and copy-paste the JSON serialization config as code)
4. We use a custom JSON serializer for the messages and not one from a dependency (which one? how?)
5. Reqnroll forks the project and makes its own package with its own required dependencies (that is quite a big work, so I would like to avoid this).
What do you think?
—
Reply to this email directly, view it on GitHub<#237 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAM7YMXPA6NOC6BUFT4MUSLZMT5X7AVCNFSM6AAAAABKYJVNSOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZQGYZTEMZRGY>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Then you effectively have the same problems as the Java implementation. So I'd got for a slight variation of your suggestions.
messages/java/src/main/java/io/cucumber/messages/MessageToNdjsonWriter.java Lines 44 to 48 in fdbb9fb
edit: Got sniped. What @clrudolphi said. 😄 |
39ebcba
to
dc3e80e
Compare
cf6e991
to
8233dcb
Compare
Submitted PR #241 to address this. Moved the System.Text.Json dependency in to the testing library. The deployable Nuget package can be built without that dependency. |
8233dcb
to
bc67620
Compare
This PR contains the following updates:
6.0.9
->8.0.4
Release Notes
dotnet/runtime (System.Text.Json)
v8.0.4
: .NET 8.0.4Release
v8.0.3
: .NET 8.0.3Release
v8.0.2
: .NET 8.0.2Release
v8.0.1
: .NET 8.0.1Release
v8.0.0
: .NET 8.0.0Release
What's Changed
dotnet/installer
by @radical in https://github.com/dotnet/runtime/pull/92795DevServer
by @radical in https://github.com/dotnet/runtime/pull/92906JsonObjectHandling.Populate
to types with parameterized constructors. by @github-actions in https://github.com/dotnet/runtime/pull/929472290250
by @dotnet-bot in https://github.com/dotnet/runtime/pull/934222291029
by @dotnet-bot in https://github.com/dotnet/runtime/pull/93496Full Changelog: dotnet/runtime@v8.0.0-rc.2.23479.6...v8.0.0
v7.0.4
: .NET 7.0.4Release
v7.0.3
: .NET 7.0.3Release
v7.0.2
: .NET 7.0.2Release
v7.0.1
: .NET 7.0.1Release
v7.0.0
: .NET 7.0.0Release
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.