-
Notifications
You must be signed in to change notification settings - Fork 494
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
[Dependencies]: Removes direct reference for Newtonfoft package and add a target build. #4839
[Dependencies]: Removes direct reference for Newtonfoft package and add a target build. #4839
Conversation
… for consumer apps.
Really appreciate the time you took to write the overview (and the fact that it's also very well written!) |
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.
Slight nit in the overview - you should probably check "Breaking Change" instead of non-breaking bug fix.
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.
Agree about putting the condition directly on the whole .
Also, have we verified that this works properly transitively? Specifically, if a library like the Aspire integration package references the Cosmos package, but disables the check to pass the buck on to the consumer, does the consumer correctly get the error?
Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj
Show resolved
Hide resolved
That's a great point. The .targets file needs to be included/imported from the |
…eive the same build failure.
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.
LGTM. Thanks!
… package.config and package reference.
Pull Request Template
Description
The intent of this change is to ensure that the
Newtonsoft.Json
dependency, which is currently used within the SDK, does not propagate to downstream consumers as Package dependency. The SDK referencesNewtonsoft.Json
for its internal functionality, but this package should not be exposed to users of the SDK. This measure also avoids the risk of consumers relying on a specific version ofNewtonsoft.Json
that might have vulnerabilities or other limitations.Type of change
Newtonsoft.Json
package reference as private asset.Microsoft.Azure.Cosmos.targets
to ensure the Newtonsoft.Json dependency is not passed to consumer apps and there is a build failure when the consumer app do not have Newtonsoft package installed.Testing the change on a consumer console app with updated dotnet SDK package without installing newtonsoft package in consumer app:
Once the Newtonsoft nuget package is included the build succeeds:
Testing the change on a consumer console app with updated dotnet SDK package when consumer app installs any other version of newtonsoft package on their end:
Testing the change on a consumer console app with updated dotnet SDK package when consumer app uses packages.config:
Testing the change on a consumer console app with updated dotnet SDK package and Newtonsoft available as transitive dependency:
Testing the change on a consumer console app with updated dotnet SDK package and build failure and allowing consumer app the option to opt out this build failure due to missing newtonsoft:
Testing the change on a consumer console app by installing updated Microsoft.Azure.Cosmos.Encryption which has dependency on updated Microsoft.Azure.Cosmos package. The build failure happens if Newtonsoft is missing:
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #4674