Skip to content

Update package model - #6311

Merged
jgonz120 merged 3 commits into
dev-feature-PackageDomainModelfrom
dev-jgonz120-UpdatePackageModel
Mar 12, 2025
Merged

jgonz120 merged 3 commits into
dev-feature-PackageDomainModelfrom
dev-jgonz120-UpdatePackageModel

Conversation

@jgonz120

Copy link
Copy Markdown
Contributor

Bug

Fixes:

Description

Added additional fields to base package model

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.

@jgonz120
jgonz120 requested a review from a team as a code owner March 11, 2025 20:07
@jgonz120
jgonz120 requested a review from Copilot March 11, 2025 20:07
@jgonz120
jgonz120 changed the base branch from dev to dev-feature-PackageDomainModel March 11, 2025 20:08

Copilot AI left a comment

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.

Pull Request Overview

This PR updates the package model by adding additional fields and capabilities related to embedded resources and vulnerabilities, along with new tests to validate the changes.

  • Introduces tests for EmbeddedResourcesCapability and VulnerableCapability.
  • Implements a new VulnerableCapability class for ordering and exposing package vulnerabilities.
  • Exposes GetEmbeddedFileAsync as a public static helper in the NuGetPackageFileService.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/Models/Package/EmbeddedResourcesCapabilityTests.cs New tests validating EmbeddedResourcesCapability behavior.
src/NuGet.Clients/NuGet.PackageManagement.UI/Models/Package/VulnerableCapability.cs New capability implementation for handling package vulnerabilities.
test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/Models/Package/VulnerableCapabilityTests.cs Tests ensuring proper vulnerability ordering and error handling.
src/NuGet.Clients/NuGet.PackageManagement.UI/Models/Package/IEmbeddedResources.cs New interface added for embedded resource operations.
test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/Models/Package/PackageModelTests.cs Tests verifying the PackageModel functionality.
src/NuGet.Clients/NuGet.PackageManagement.UI/Models/Package/EmbeddedResourcesCapability.cs Implementation for fetching embedded package resources.
src/NuGet.Clients/NuGet.PackageManagement.UI/Models/Package/IVulnerable.cs Interface for exposing vulnerability details.
src/NuGet.Clients/NuGet.PackageManagement.UI/Models/Package/PackageModel.cs Updates to the base package model with additional fields.
test/NuGet.Clients.Tests/NuGet.PackageManagement.UI.Test/Models/Package/TestPackageModel.cs Test implementation for PackageModel.
src/NuGet.Clients/NuGet.PackageManagement.VisualStudio/Services/NuGetPackageFileService.cs Modified GetEmbeddedFileAsync visibility and static modifier.

@jgonz120
jgonz120 requested a review from Copilot March 11, 2025 21:17

Copilot AI left a comment

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@jgonz120
jgonz120 requested a review from Copilot March 11, 2025 21:30

Copilot AI left a comment

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.

Pull Request Overview

This PR updates the base package model by adding additional fields that support enhanced package metadata.

  • Added new parameters and properties: Owners, OwnersList, packageDependencyGroups, and Summary.
  • Introduced logic to derive OwnersList from Owners and vice versa, and to process package dependency groups.
Comments suppressed due to low confidence (1)

src/NuGet.Clients/NuGet.PackageManagement.UI/Models/Package/PackageModel.cs:39

  • Consider handling the case where both Owners and OwnersList are provided but contain conflicting data. Explicitly validating or prioritizing one over the other could prevent unexpected behavior.
if (Owners != null && OwnersList == null)

@jgonz120
jgonz120 merged commit bd2d0e1 into dev-feature-PackageDomainModel Mar 12, 2025
@jgonz120
jgonz120 deleted the dev-jgonz120-UpdatePackageModel branch March 12, 2025 17:20
jebriede pushed a commit that referenced this pull request Mar 24, 2025
* Add new fields

* added summary

* only use ownerlist
jebriede pushed a commit that referenced this pull request Apr 16, 2025
* Add new fields

* added summary

* only use ownerlist
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.

3 participants