Closed
Bug 1509308
Opened 6 years ago
Closed 5 years ago
Date for cf_last_resolved in history results should be UTC
Categories
(bugzilla.mozilla.org :: API, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: marco, Assigned: kohei)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
See for example in https://bugzilla.mozilla.org/rest/bug/1508617/history and https://bugzilla.mozilla.org/rest/bug/1162860/history. While the `when` field is in UTC, the `removed` or `added` can be in different timezones (in the examples, GMT the first, US/Pacific the second). Would it be possible to always have UTC dates?
Reporter | ||
Comment 1•6 years ago
|
||
In the 'bug' endpoint, cf_last_resolved is always UTC.
Assignee | ||
Comment 2•6 years ago
|
||
Assignee: nobody → kohei.yoshino
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•6 years ago
|
||
Nah, my PR just fixes the format, not the timezone issue :( The older PST/PDT timestamps logged before the UTC migration (Bug 232193) have to be converted with a script.
Reporter | ||
Comment 4•6 years ago
|
||
(In reply to Kohei Yoshino [:kohei] (Bugzilla UX) (FxSiteCompat) from comment #3) > Nah, my PR just fixes the format, not the timezone issue :( The older > PST/PDT timestamps logged before the UTC migration (Bug 232193) have to be > converted with a script. Unfortunately it looks like the timestamps in the history are not always PST/PDT, but they can also be in other timezones (maybe it's the timezone the user had set at the time?).
Assignee | ||
Comment 5•6 years ago
|
||
Then it’s harder to fix. Dig into the audit_log table to check the user’s timezone setting whenever each timestamp is logged, then convert it to UTC accordingly.
Assignee | ||
Updated•6 years ago
|
Attachment #9027033 -
Attachment is obsolete: true
Assignee | ||
Comment 6•6 years ago
|
||
I just checked the audit_log table in my local VM database but user preference changes were not logged. Then it’s impossible to solve the issue, eh?
Assignee: kohei.yoshino → nobody
Status: ASSIGNED → NEW
Assignee | ||
Comment 7•6 years ago
|
||
Comment on attachment 9027033 [details] [review] GitHub Pull Request It turns out that the `bug_when` and `added` columns in the `bugs_activity` table share the same timestamp [1], but the latter wasn’t converted during the UTC migration because it’s not a datetime column. So we can just copy `bug_when` to `added`, and copy the last `added` timestamp to `removed`. Added a conversion script to my PR. [1] https://github.com/mozilla-bteam/bmo/blob/master/extensions/LastResolved/Extension.pm#L86-L87
Attachment #9027033 -
Attachment is obsolete: false
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → kohei.yoshino
Status: NEW → ASSIGNED
Comment 8•6 years ago
|
||
Merged to master. Leaving open as reminder to run the fixup script after deployment.
Assignee | ||
Comment 9•5 years ago
|
||
So who can run the script? It’s located at extensions/LastResolved/bin/bug-1509308.pl. Should be tested on stage first.
Flags: needinfo?(dylan)
Assignee | ||
Comment 11•5 years ago
|
||
Ah okay! Both https://bugzilla.mozilla.org/rest/bug/1508617/history and https://bugzilla.mozilla.org/rest/bug/1162860/history in comment 0 look good now. Closing then.
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•