Skip to content

Fix stale command reporting 0 days for all dependencies#88

Merged
andrew merged 1 commit intomainfrom
fix/stale-days-calculation
Feb 6, 2026
Merged

Fix stale command reporting 0 days for all dependencies#88
andrew merged 1 commit intomainfrom
fix/stale-days-calculation

Conversation

@andrew
Copy link
Copy Markdown
Contributor

@andrew andrew commented Feb 6, 2026

Go's time.Time.String() produces timestamps like 2026-02-05 14:16:48 +0000 +0000 which SQLite's julianday() can't parse, returning NULL. The CAST to INTEGER then produces 0 for every entry.

Two changes: format committed_at as UTC when storing (2006-01-02 15:04:05), and wrap the julianday() calls in substr(..., 1, 19) so existing databases with the old format still work.

Reproduced and verified on pypi/warehouse at the commit from the issue report.

Fixes #83

Go's time.Time.String() produces timestamps like '2026-02-05 14:16:48
+0000 +0000' which SQLite's julianday() cannot parse, returning NULL.
The CAST to INTEGER then gives 0.

Fix the storage to format committed_at as UTC and wrap julianday()
calls in substr(..., 1, 19) so existing databases with the old format
still work.

Fixes #83
@andrew andrew merged commit 3afdea6 into main Feb 6, 2026
4 checks passed
@andrew andrew deleted the fix/stale-days-calculation branch February 8, 2026 10:35
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.

bug: git pkgs stale reports 0 days across the board

1 participant