Skip to content

feat: backfill repo dateCreated/lastModified via migration - #1681

Open
andypols wants to merge 3 commits into
finos:mainfrom
qube-rt:feat/1486-repo-date-fields-migration
Open

feat: backfill repo dateCreated/lastModified via migration#1681
andypols wants to merge 3 commits into
finos:mainfrom
qube-rt:feat/1486-repo-date-fields-migration

Conversation

@andypols

Copy link
Copy Markdown
Contributor

This PR adds the migration for #1656 adding repo dateCreated and lastModified using the migrations #1661

It reads repos through the sink, asks the backend to derive a creation time (Mongo derives it from the ObjectId; the file backend has no source and falls back to now), and writes back through the sink. Repos that already have a dateCreated are skipped, so the migration is safe to re-run.

The UI can now show the repos in order which is really useful when you want to what has been added recently.

Adds the populateRepoDates migration and registers it in the migration
registry. It reads repos through the sink, asks the backend to derive a
creation time (Mongo derives it from the ObjectId; the file backend has
no source and falls back to now), and writes back through the sink.
Repos that already have a dateCreated are skipped, so the migration is
safe to re-run.
@andypols
andypols requested a review from a team as a code owner August 20, 2026 10:38
@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit 591ce50
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/6a86df73d8115c0008deb497

andypols and others added 2 commits August 20, 2026 11:38
The db.test.ts mongo and file mocks omitted getRepos, updateRepo and
deriveCreatedAt, so runMigrations() failed once the populateRepoDates
migration was added to the registry.
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.62500% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.26%. Comparing base (39fc66a) to head (591ce50).

Files with missing lines Patch % Lines
src/db/migrations/populateRepoDates.ts 90.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1681   +/-   ##
=======================================
  Coverage   90.26%   90.26%           
=======================================
  Files          94       95    +1     
  Lines        9115     9146   +31     
  Branches     1705     1712    +7     
=======================================
+ Hits         8228     8256   +28     
- Misses        854      857    +3     
  Partials       33       33           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andypols andypols added this to the 2.2.0 milestone Aug 20, 2026

@jescalada jescalada 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.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants