-
Notifications
You must be signed in to change notification settings - Fork 693
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
Remove NuGetOperationType #5394
Conversation
/// Uninstall package action. | ||
/// </summary> | ||
Uninstall = 2, | ||
public NuGetProjectActionType OperationType => (NuGetProjectActionType)base[nameof(OperationType)]; |
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.
If I am understanding correctly, OperationType
is emitted telemetry. If so, why not keep NuGetOperationType
and remove NuGetProjectActionType
. If the current change --- removing NuGetOperationType
--- makes more sense, why not update parameter names (operationType
-> actionType
)? This property can remain as-is for telemetry.
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.
NuGetProjectActionType is used more heavily overall. 80+ references vs 20ish of NuGetOperationType.
NuGetProjectActionType is also used more in public types. More notable in the NuGetProjectAction which itself is a type that's used a lot.
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'm not too concerned about NuGet.PackageManagement.
While sometimes similar but different APIs can be useful for strongly typed language type safety, it's not clear to me these two enums provide any API correctness benefits, so consolidating them is fine with me.
Bug
Fixes: NuGet/Home#12866
Regression? Last working version:
Description
While working conditional PR updating, I noticed myself doing a lot of duplicated work. See more details for motivation: https://github.com/NuGet/NuGet.Client/compare/dev-nkolev92-conditionalPackageReferenceUpdating?expand=1
For example, I had to do lots of conversions with NuGetProjectActionType and NuGetOperationType.
This is redundant, and makes our code more complicated.
I looked at the references and the only place where the NuGetOperationType is explicitly used is as an API is ActionTelemetryEvent, which is not used a lot.
Now this is a breaking change to a public API, which is why this refactoring is coming on its own instead as part of the PR that will follow, but the reasoning is that we should reducing duplication and unnecessary conversion. The likelihood of this API breaking anyone is super low.
Note - Note that NuGet.PackageManagement is not part of the .NET SDK. It is the broadest package we ship and is primarily used by component that package all of the NuGet functionality themselves, rather than as an extension of NuGet.
If people are ok with this change, and I'm looking at @zivkan primarily, I'll create a bug matching the reasoning in this description, and mark with
Type:BreakingChange
.PR Checklist
PR has a meaningful title
PR has a linked issue.
Described changes
Tests
Documentation