-
Notifications
You must be signed in to change notification settings - Fork 643
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
Persist development dependency information in the DB #5666
Comments
I've picked this up again after #5656 was merged. I think I should be able to get the metadata into the DB for new packages, but I might need some assistance or at least some pointers on how to "fill in" the metadata for existing packages. I don't think both issues necessarily have to be solved at the same time, though. The work is at dev...khellang:developement-dependency-metadata |
Agreed. We are already in the inconsistent state so we are free to separate the "new package" case and "existing package" case. The "reflow" behavior should be able to fill this in if you put the metadata population in the right place (haven't looked at your branch). We should consider doing just a database fix-up though since reflow also produces a catalog entry which is unnecessary in this case. Consider an approach like this, which was used for repository URL info. |
Yes, your change will make reflow fill in the property. See in the NuGetGallery/src/NuGetGallery/Services/ReflowPackageService.cs Lines 71 to 76 in 0ca0368
You will need a migration and ensure the assoicated SQL generates a default value on the column of |
Oh, and I think there is a bit more metadata needed for the .csproj. This is produced by VS: <PackageReference Include="Nerdbank.GitVersioning" Version="3.0.6-beta">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference> |
Thanks for the pointers @joelverhagen! I think this would solve #2836 as well.
Ah, had it as nullable bool and just coalesced it to
This reflow-flow, is that triggered manually? Per package? 🤔 |
Yes, after we have completed the data fix, it makes no sense to have a null value for the bool. In the generic mental model for a NuGet package, it is either a dev dependency or it is not. No null state exists. Representing this state doesn't give us anything extra except for perhaps a marker that the package needs to be reflowed... but this can be determined in a different method such as comparing the bool determined by the .nuspec with the bool in the DB. For an example of what the migration should roughly look like: NuGetGallery/src/NuGetGallery/Migrations/201709111714021_AddPackageStatusKey.cs Lines 10 to 12 in 0ca0368
Of course we want a bool instead of an int but you get the idea.
I think the tool should be written to have a "discover" phase that finds all dev dependency packages (perhaps via the catalog) and a "update" phase which sets the The "discover" phase is a bit more interesting. The example I gave you above for the repository URL backfill checks all of the .nuspec to determine the Truth. You could go this route or you could consider a forward scan of the catalog. You can look for the Personally I would just copy and adapt the |
Agreed. I was just thinking if it makes sense to do it in a three-step process: add nullable bool column, backfill dev dependency data, then make the column non-nullable. But if we don't need the nullable-ness for not-yet-backfilled entries, it makes sense to just have |
Should
|
I would leave that one alone. It was used for package edit and has not been cleaned up yet.
Yes, I would add it here. Some auditing implementations just JSON serialize the package so it will automatically pick up more properties.
No, we are trying to leave the V1 and V2 protocols as-is from now on.
I wouldn't worry about this one. The search results do not use this value. |
* Add developmentDependency metadata to package * Add filldevdeps tool command * Change VerifyPackageRequest.DevelopmentDependency to bool * Tweaked install command display * Added unit tests for true/false/missing developmentDependency metadata * Updated GalleryTools readme Address #5666
This is deployed to PROD but I haven't run the backfill tool yet. This means new packages have show the proper thing in the I'll close this issue when I've completed running the backfill tool. |
Awesome! Let's hope the backfill command works as it should 😅 I guess the logical next question is; should we show this metadata anywhere else? It it interesting information? |
The tool worked great on our DEV and INT environments 👍. Perhaps we could plumb this to the VS UI. This would mean enhancing the package metadata endpoint and surfacing it in the client. Perhaps we should come up with some concrete ideas and make new issues. |
The backfill on PROD is complete. |
W00t! 🎉 Thanks for walking me through this 👌 |
This is useful for the
<PackageReference>
tab on the package details since the code snippet is has some additional properties when the package is a development dependency.See: #5656
To roll this out we would need to turn it on for existing packages then perform some kind of data fix for the existing development dependencies.
Note that this data is in the catalog leaves.
The text was updated successfully, but these errors were encountered: