Title: [277901] trunk/Websites/perf.webkit.org
Revision
277901
Author
dewei_...@apple.com
Date
2021-05-21 17:13:39 -0700 (Fri, 21 May 2021)

Log Message

Fix a bug that incorrect timestamp is reported for Git repositories.
https://bugs.webkit.org/show_bug.cgi?id=225987

Reviewed by Ryosuke Niwa.

'datetime.fromtimestamp' will use the current timezone.
However, '/api/report-commits' will interprete it as a timestamp string from UTC.
In order to keep the consistency, we should always use 'datetime.utcfromtimestamp'.

* tools/sync-commits.py: Use 'datetime.utcfromtimestamp' instead of 'datetime.fromtimestamp'.
(GitRepository._revision_from_tokens):

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (277900 => 277901)


--- trunk/Websites/perf.webkit.org/ChangeLog	2021-05-22 00:11:37 UTC (rev 277900)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2021-05-22 00:13:39 UTC (rev 277901)
@@ -1,3 +1,17 @@
+2021-05-19  Dewei Zhu  <dewei_...@apple.com>
+
+        Fix a bug that incorrect timestamp is reported for Git repositories.
+        https://bugs.webkit.org/show_bug.cgi?id=225987
+
+        Reviewed by Ryosuke Niwa.
+
+        'datetime.fromtimestamp' will use the current timezone.
+        However, '/api/report-commits' will interprete it as a timestamp string from UTC.
+        In order to keep the consistency, we should always use 'datetime.utcfromtimestamp'.
+
+        * tools/sync-commits.py: Use 'datetime.utcfromtimestamp' instead of 'datetime.fromtimestamp'.
+        (GitRepository._revision_from_tokens):
+
 2021-05-20  Zhifei Fang  <zhifei_f...@apple.com>
 
         Need to use default git pull to remove the fake svn commit when syncing with SVN

Modified: trunk/Websites/perf.webkit.org/tools/sync-commits.py (277900 => 277901)


--- trunk/Websites/perf.webkit.org/tools/sync-commits.py	2021-05-22 00:11:37 UTC (rev 277900)
+++ trunk/Websites/perf.webkit.org/tools/sync-commits.py	2021-05-22 00:13:39 UTC (rev 277901)
@@ -274,7 +274,7 @@
             'revision': current_revision,
             'revisionIdentifier': revision_identifier,
             'previousCommit': previous_revision,
-            'time': datetime.fromtimestamp(commit_time).strftime(r'%Y-%m-%dT%H:%M:%S.%f'),
+            'time': datetime.utcfromtimestamp(commit_time).strftime(r'%Y-%m-%dT%H:%M:%S.%f'),
             'author': {'account': author_email, 'name': author_name},
             'message': message,
         }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to