mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-05-08 20:58:16 -05:00
[PR #226] [MERGED] feat: add importedAt-based repository sorting #1094
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/226
Author: @arunavo4
Created: 3/15/2026
Status: ✅ Merged
Merged: 3/15/2026
Merged by: @arunavo4
Base:
main← Head:codex/issue-225-imported-sort📝 Commits (2)
62b4196repositories: add importedAt sortingc3ecc64repositories: use tanstack table for repo list📊 Changes
20 files changed (+2370 additions, -40 deletions)
View changed files
📝
bun.lock(+5 -0)➕
drizzle/0009_nervous_tyger_tiger.sql(+24 -0)➕
drizzle/meta/0009_snapshot.json(+2022 -0)📝
drizzle/meta/_journal.json(+7 -0)📝
package.json(+1 -0)📝
src/components/repositories/Repository.tsx(+59 -0)📝
src/components/repositories/RepositoryTable.tsx(+127 -39)📝
src/hooks/useFilterParams.ts(+1 -0)📝
src/lib/db/schema.ts(+5 -0)📝
src/lib/github.ts(+3 -0)📝
src/lib/repo-utils.test.ts(+1 -0)📝
src/lib/repo-utils.ts(+1 -0)➕
src/lib/repository-sorting.test.ts(+68 -0)➕
src/lib/repository-sorting.ts(+40 -0)📝
src/pages/api/github/repositories.ts(+1 -1)📝
src/pages/api/sync/index.ts(+1 -0)📝
src/pages/api/sync/organization.ts(+1 -0)📝
src/pages/api/sync/repository.ts(+1 -0)📝
src/types/Repository.ts(+1 -0)📝
src/types/filter.ts(+1 -0)📄 Description
Summary
repositories.imported_atwith migration and backfill strategycreated_atduring repository ingestionimported_at DESCRationale
created_atcurrently reflects GitHub repository creation time, which does not represent when a repository was imported into this app. This PR introduces a dedicated import timestamp and uses it to support "recently imported first" sorting.Migration Notes
imported_atcolumn torepositorieswith defaultunixepoch()imported_atfrom earliest matchingmirror_jobs.timestamp(byrepository_idwhen available), falling back torepositories.created_atidx_repositories_user_imported_at(user_id,imported_at)Testing
bun test src/lib/repository-sorting.test.tsbun test src/lib/repo-utils.test.tsbun test src/lib/gitea-starred-repos.test.tsbun run buildbun run init-dbbun run manage-db checkCloses #225
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.