[ARVADOS] updated: 00d95f0f330799a816214f3f329f8d8cf7e2a447
Git user
git at public.curoverse.com
Fri Feb 24 13:54:53 EST 2017
Summary of changes:
services/api/test/unit/log_test.rb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
discards c7df9c8c14d78ba99d30eb90f1d49ebc04735224 (commit)
via 00d95f0f330799a816214f3f329f8d8cf7e2a447 (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (c7df9c8c14d78ba99d30eb90f1d49ebc04735224)
\
N -- N -- N (00d95f0f330799a816214f3f329f8d8cf7e2a447)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 00d95f0f330799a816214f3f329f8d8cf7e2a447
Author: Tom Clegg <tom at curoverse.com>
Date: Fri Feb 24 13:45:12 2017 -0500
6347: Use RFC3339Nano to render timestamps loaded from serialized fields.
Psych (YAML) serializes timestamps as ISO8601-with-space-separators,
and safe_load deserializes them to Time even with
whitelist_classes=[].
Psych.dump(Time.now.utc)
=> "--- 2017-02-22 21:33:22.845133778 Z\n...\n"
Psych.safe_load('2017-02-22 21:33:22.845133778 Z').class
=> Time
Psych.safe_load('2017-02-31 21:33:22.845133778 Z').class
=> String
Before:
Psych.safe_load('2017-02-22 21:33:22.845133778 Z').as_json
=> "2017-02-22T21:33:22Z"
After:
Psych.safe_load('2017-02-22 21:33:22.845133778 Z').as_json
=> "2017-02-22T21:33:22.845133778Z"
diff --git a/services/api/config/initializers/time_format.rb b/services/api/config/initializers/time_format.rb
index d476781..ee7c91f 100644
--- a/services/api/config/initializers/time_format.rb
+++ b/services/api/config/initializers/time_format.rb
@@ -3,3 +3,9 @@ class ActiveSupport::TimeWithZone
strftime "%Y-%m-%dT%H:%M:%S.%NZ"
end
end
+
+class Time
+ def as_json *args
+ strftime "%Y-%m-%dT%H:%M:%S.%NZ"
+ end
+end
diff --git a/services/api/test/unit/log_test.rb b/services/api/test/unit/log_test.rb
index 92976e0..a1a19ca 100644
--- a/services/api/test/unit/log_test.rb
+++ b/services/api/test/unit/log_test.rb
@@ -51,6 +51,10 @@ class LogTest < ActiveSupport::TestCase
'old_etag', 'old_attributes')
assert_properties(new_props_test, event_type, props,
'new_etag', 'new_attributes')
+ ['old_attributes', 'new_attributes'].each do |logattr|
+ next if !props[logattr]
+ assert_match /"created_at":"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{9}Z"/, Oj.dump(props, mode: :compat)
+ end
yield props if block_given?
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list