Skip to content

fix: set null publishedDate for yanked versions#4306

Merged
mbani01 merged 1 commit into
mainfrom
fix/nuget_published_date
Jul 3, 2026
Merged

fix: set null publishedDate for yanked versions#4306
mbani01 merged 1 commit into
mainfrom
fix/nuget_published_date

Conversation

@mbani01

@mbani01 mbani01 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

This pull request refactors how NuGet package published dates are parsed and handled, centralizing the logic for filtering out sentinel "unlisted" dates and improving code clarity. The main changes are:

Date Parsing Improvements:

  • Added a new parsePublishedDate function to handle NuGet's sentinel unlisted date (1900-01-01T00:00:00Z) and return null for absent or invalid dates.

Refactoring and Consistency:

  • Replaced all direct Date parsing and filtering logic for published dates in normalizeNuGetPackage with calls to the new parsePublishedDate function, ensuring consistent handling of unlisted or invalid dates throughout the code.
  • Updated the assignment of publishedAt in version objects to use parsePublishedDate, further centralizing date validation.

Note

Low Risk
Small refactor in NuGet normalization with clearer date filtering; behavior change is limited to published metadata for unlisted versions.

Overview
Centralizes NuGet published date handling in a new parsePublishedDate helper that returns null for missing values, invalid dates, and NuGet’s unlisted sentinel (1900-01-01T00:00:00Z).

normalizeNuGetPackage now uses that helper for firstReleaseAt / latestReleaseAt aggregation and for each version’s publishedAt, so yanked/unlisted versions no longer surface a bogus 1900 publish timestamp.

Reviewed by Cursor Bugbot for commit 6580bdd. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: Mouad BANI <mouad-mb@outlook.com>
@mbani01 mbani01 self-assigned this Jul 3, 2026
Copilot AI review requested due to automatic review settings July 3, 2026 14:50
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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 refactors NuGet package normalization to centralize how “published” dates are parsed, ensuring NuGet’s unlisted/yanked sentinel publish timestamps don’t leak into normalized metadata.

Changes:

  • Adds a parsePublishedDate helper that returns null for missing/invalid dates and NuGet’s sentinel “unlisted” date.
  • Replaces inline Date parsing/filtering in normalizeNuGetPackage with the helper for firstReleaseAt, latestReleaseAt, and per-version publishedAt.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread services/apps/packages_worker/src/nuget/normalize.ts
@mbani01 mbani01 merged commit 79aa52b into main Jul 3, 2026
19 checks passed
@mbani01 mbani01 deleted the fix/nuget_published_date branch July 3, 2026 15:00
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