Skip to content

[Data model improvements] Deprecation capability - #6312

Merged
martinrrm merged 4 commits into
dev-feature-PackageDomainModelfrom
dev-martinrrm-deprecation-capability
Mar 19, 2025
Merged

martinrrm merged 4 commits into
dev-feature-PackageDomainModelfrom
dev-martinrrm-deprecation-capability

Conversation

@martinrrm

Copy link
Copy Markdown
Contributor

Bug

Fixes:

Description

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@martinrrm
martinrrm requested a review from a team as a code owner March 11, 2025 20:57
@martinrrm
martinrrm changed the base branch from dev to dev-feature-PackageDomainModel March 11, 2025 20:57
@jgonz120
jgonz120 requested review from jgonz120 and removed request for jgonz120 March 13, 2025 20:36
@martinrrm
martinrrm requested review from jebriede and jgonz120 March 17, 2025 18:11

foreach (var reason in DeprecationMetadata.Reasons)
{
if (string.Equals(reason, "CriticalBugs", StringComparison.OrdinalIgnoreCase))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like these are defined in a central location, could we make that public and reference them here?

private static class PackageDeprecationReason
{
public const string CriticalBugs = nameof(CriticalBugs);
public const string Legacy = nameof(Legacy);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe add it to the new model you created?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this to the model I created, but it is on Protocol project, is that a concern? I had to rename the enum too so naming is not a problem.

If I make it public it adds this to the file using static NuGet.PackageManagement.UI.DetailControlModel; which looks weird


#nullable enable

namespace NuGet.Protocol.Model

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intended to be in Protocol? If so, can you share more about what changes you'll be making to Protocol?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a similar enum for vulnerabilities, PackageVulnerabilitySeverity, I believe this is a good place to have this enum since it's really similar but at the cost of creating new public APIs.

I don't plan any changes to the protocol in this effort, do you believe this shouldn't be here? Should I move this to the UI projects?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My general thoughts are putting model code into the UI projects makes sense. If it's needed later in Protocol, it will need to be brought over, anyway.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's unusual to have a type defined in a class but never used in it.

I agree with @donnie-msft, we should move this to the UI project.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw, the policies are not enabled on the feature branches, but we should still follow that.

This should've been addressed before the PR was merged.

@martinrrm
martinrrm requested a review from jgonz120 March 18, 2025 22:48
@martinrrm
martinrrm merged commit 63056c7 into dev-feature-PackageDomainModel Mar 19, 2025
@martinrrm
martinrrm deleted the dev-martinrrm-deprecation-capability branch March 19, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants