Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
dcbf99d1
Commit
dcbf99d1
authored
Aug 17, 2020
by
Sean Arnold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move user facing code to use Time.current
parent
8a58f927
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
9 deletions
+9
-9
ee/lib/gitlab/analytics/cycle_analytics/request_params.rb
ee/lib/gitlab/analytics/cycle_analytics/request_params.rb
+1
-1
ee/lib/gitlab/analytics/cycle_analytics/summary/group/deployment_frequency.rb
...ics/cycle_analytics/summary/group/deployment_frequency.rb
+1
-1
lib/api/users.rb
lib/api/users.rb
+1
-1
lib/gitlab/incident_management/pager_duty/incident_issue_description.rb
...ident_management/pager_duty/incident_issue_description.rb
+1
-1
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+1
-1
lib/gitlab/utils/usage_data.rb
lib/gitlab/utils/usage_data.rb
+1
-1
spec/lib/gitlab/alerting/alert_spec.rb
spec/lib/gitlab/alerting/alert_spec.rb
+2
-2
spec/lib/gitlab/utils/usage_data_spec.rb
spec/lib/gitlab/utils/usage_data_spec.rb
+1
-1
No files found.
ee/lib/gitlab/analytics/cycle_analytics/request_params.rb
View file @
dcbf99d1
...
...
@@ -48,7 +48,7 @@ module Gitlab
def
initialize
(
params
=
{})
super
(
params
)
self
.
created_before
=
(
self
.
created_before
||
Time
.
now
).
at_end_of_day
self
.
created_before
=
(
self
.
created_before
||
Time
.
current
).
at_end_of_day
self
.
created_after
=
(
created_after
||
default_created_after
).
at_beginning_of_day
end
...
...
ee/lib/gitlab/analytics/cycle_analytics/summary/group/deployment_frequency.rb
View file @
dcbf99d1
...
...
@@ -21,7 +21,7 @@ module Gitlab
def
value
@value
||=
frequency
(
@deployments
,
options
[
:from
],
options
[
:to
]
||
Time
.
now
)
frequency
(
@deployments
,
options
[
:from
],
options
[
:to
]
||
Time
.
current
)
end
def
unit
...
...
lib/api/users.rb
View file @
dcbf99d1
...
...
@@ -218,7 +218,7 @@ module API
user_params
=
declared_params
(
include_missing:
false
)
user_params
[
:password_expires_at
]
=
Time
.
now
if
user_params
[
:password
].
present?
user_params
[
:password_expires_at
]
=
Time
.
current
if
user_params
[
:password
].
present?
result
=
::
Users
::
UpdateService
.
new
(
current_user
,
user_params
.
merge
(
user:
user
)).
execute
if
result
[
:status
]
==
:success
...
...
lib/gitlab/incident_management/pager_duty/incident_issue_description.rb
View file @
dcbf99d1
...
...
@@ -32,7 +32,7 @@ module Gitlab
end
def
incident_created_at
Time
.
parse
(
incident_payload
[
'created_at'
])
Time
.
zone
.
parse
(
incident_payload
[
'created_at'
])
rescue
Time
.
current
.
utc
# PagerDuty provides time in UTC
end
...
...
lib/gitlab/usage_data.rb
View file @
dcbf99d1
...
...
@@ -58,7 +58,7 @@ module Gitlab
end
def
recorded_at
Time
.
now
Time
.
current
end
# rubocop: disable Metrics/AbcSize
...
...
lib/gitlab/utils/usage_data.rb
View file @
dcbf99d1
...
...
@@ -93,7 +93,7 @@ module Gitlab
end
def
with_finished_at
(
key
,
&
block
)
yield
.
merge
(
key
=>
Time
.
now
)
yield
.
merge
(
key
=>
Time
.
current
)
end
private
...
...
spec/lib/gitlab/alerting/alert_spec.rb
View file @
dcbf99d1
...
...
@@ -191,7 +191,7 @@ RSpec.describe Gitlab::Alerting::Alert do
end
context
'with payload'
do
let
(
:time
)
{
Time
.
now
.
change
(
usec:
0
)
}
let
(
:time
)
{
Time
.
current
.
change
(
usec:
0
)
}
before
do
payload
[
'startsAt'
]
=
time
.
rfc3339
...
...
@@ -274,7 +274,7 @@ RSpec.describe Gitlab::Alerting::Alert do
before
do
payload
.
update
(
'annotations'
=>
{
'title'
=>
'some title'
},
'startsAt'
=>
Time
.
now
.
rfc3339
'startsAt'
=>
Time
.
current
.
rfc3339
)
end
...
...
spec/lib/gitlab/utils/usage_data_spec.rb
View file @
dcbf99d1
...
...
@@ -122,7 +122,7 @@ RSpec.describe Gitlab::Utils::UsageData do
freeze_time
do
result
=
described_class
.
with_finished_at
(
:current_time
)
{
{
a:
1
}
}
expect
(
result
).
to
eq
(
a:
1
,
current_time:
Time
.
now
)
expect
(
result
).
to
eq
(
a:
1
,
current_time:
Time
.
current
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment