librariesio / libraries.io

:books: The Open Source Discovery Service
https://libraries.io
GNU Affero General Public License v3.0
1.1k stars 206 forks source link

Add rake task to backfill nuget published_at dates #3400

Closed tiegz closed 3 weeks ago

tiegz commented 3 weeks ago

(followup to https://github.com/librariesio/libraries.io/pull/3398 )

this adds a one_off:backfill_nuget_published_at rake task that will...

1) pull a list of all NuGet Version records where published_at: '1900-01-01 00:00:00', which means "unlisted" on NuGet (or "Deprecated" in Libraries terms) 2) iterate over release events in NuGet's Catalog API endpoint 3) if one of the releases from the API is in the list from step (1), and the API date is not 1900, then consider the API date as the original "published" date, update the Version record to that date (and mark it as status: "Deprecated")

Screenshot 2024-06-07 at 12 01 49 PM