Skip to content
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

Refactored PackageService code for use by Search-by-TFM #9261

Merged
merged 4 commits into from
Sep 30, 2022

Conversation

advay26
Copy link
Contributor

@advay26 advay26 commented Sep 28, 2022

Addresses https://github.com/NuGet/Engineering/issues/4577

We need to reuse some asset framework logic from PackageService in NuGet.Jobs' Catalog2AzureSearch for Search-by-TFM, and moving this logic to NuGetGallery.Core would allow us to reuse this code with minimal changes.

This change:

  • Creates the AssetFrameworkHelper, which now holds the asset framework logic in its GetAssetFrameworks method
  • Redirects the previous GetSupportedFrameworks method in PackageService (NuGetGallery.Services) to this logic

All previous tests passed after this change.

@advay26 advay26 requested a review from a team as a code owner September 28, 2022 21:33
@@ -0,0 +1,113 @@
using System;
Copy link
Member

Choose a reason for hiding this comment

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

this needs the .NET Foundation header

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added this in now

joelverhagen
joelverhagen previously approved these changes Sep 29, 2022
dannyjdev
dannyjdev previously approved these changes Sep 29, 2022
drewgillies
drewgillies previously approved these changes Sep 29, 2022
Copy link
Contributor

@drewgillies drewgillies left a comment

Choose a reason for hiding this comment

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

My only thought is more of a discussion piece--the new class is named a service but doesn't really follow the DI service pattern that we generally use in gallery--it's a static type and not added to the DI container. So, possibly being pedantic, but I'd be more inclined to name this a "helper" rather than a "service" in this context.

@advay26 advay26 merged commit 55adfe0 into dev Sep 30, 2022
@advay26 advay26 deleted the advay26-sbtfm-nugetgallerycore branch September 30, 2022 18:41
@advay26 advay26 mentioned this pull request Oct 4, 2022
9 tasks
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.

None yet

4 participants