fix: correct Go time-format tokens for S3 object key date path#312
fix: correct Go time-format tokens for S3 object key date path#312ThiagoBauken wants to merge 2 commits into
Conversation
GenerateS3Key built the year/month/day segments of every S3 object key with
now.Format("2025"), now.Format("05") and now.Format("25"). None are valid Go
layout tokens (the reference time is "2006-01-02 15:04:05") and "05" is the
seconds field, so uploaded media was filed under nonsensical, non-chronological
paths — breaking date-based browsing and S3 lifecycle/retention rules.
Use the correct tokens "2006"/"01"/"02".
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request corrects the Go time formatting layout tokens in s3manager.go from incorrect values ("2025", "05", "25") to the correct reference layout tokens ("2006", "01", "02") to ensure proper chronological folder organization. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Add TestGenerateS3KeyDateFormat: the year/month/day path segments must equal
time.Now().Format("2006"/"01"/"02") and have widths 4/2/2. Verified red/green —
fails against the previous "2025"/"05"/"25" tokens (which yielded a 5-digit
"year" and a seconds-based "month") and passes with the corrected tokens.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Closing to consolidate my recent PRs into a smaller, focused set that's easier to review — I'll resubmit the changes grouped together. Sorry for the churn, and thanks! |
Problem
GenerateS3Keybuilds the date segments of every S3 object key with invalid Go time-format tokens:Go's reference time is
2006-01-02 15:04:05, so the only valid tokens are2006/01/02.05is the seconds field, and2025/25aren't recognized layouts — so media is stored under nonsensical, non-chronological folders (the "month" segment actually renders seconds). This breaks date-based browsing and any S3 lifecycle/retention rule keyed on the object path.Fix
Use the correct tokens
2006/01/02.Testing
go build ./...✅go vet ./...✅