Conversation
Co-authored-by: Evan Phoenix <evan@miren.dev>
phinze
left a comment
There was a problem hiding this comment.
Nice catch, and the CDT test case pins it down well. Non-blocking: upgrade_helpers.go has four more BuildDate.Format("... UTC") calls without a .UTC(). They're probably safe today because the inputs are already UTC, but tossing .UTC() on them would kill the whole class. Happy either way.
Co-authored-by: Evan Phoenix <evan@miren.dev>
|
Addressed Paul’s review: all four UTC-labeled build dates in — e + 🤖 |
There was a problem hiding this comment.
🍪 biscuit: ✅ ready to merge — auto-review, non-blocking
This is ready, and I'm approving it: it's a small, display-only change, and I didn't find anything in it that needs another reviewer.
What changed: commit 4096053 follows Paul's suggestion and adds .UTC() to the four remaining BuildDate.Format("... UTC") calls in cli/commands/upgrade_helpers.go, at lines 134, 142, 167 and 168. The search I ran came back truncated, but every build-date format ending in a literal UTC that it returned now converts to UTC before formatting.
The new test: TestPrintVersionComparisonBuildDatesUTC gives the two timestamps opposite offsets (CDT −5 and JST +9), so leaving .UTC() off either one fails the test. The expected values are right:
- 12:48 CDT on the 14th is 17:48 UTC.
- 04:10 JST on the 15th is 19:10 UTC on the 14th.
Stdout swap in the test: the test temporarily replaces os.Stdout. That's safe here because nothing in cli/commands calls t.Parallel(). The output is also small enough to fit in the pipe buffer, so closing the writer before reading can't hang.
No new tests for two lines: the two changed lines in CheckIfUpgradeNeeded don't have their own test. They're the same one-token change as the lines that are tested, so I wouldn't hold the merge for it.
🍪 full review note · reviewed at 4096053 · comment /biscuit review to run biscuit again.
Summary
Built:line inmiren version --server.Closes MIR-1848
Tests
hack/it ./cli/commands(929 tests passed)make lint(0 issues)