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
4d1f30b9
Commit
4d1f30b9
authored
Jan 04, 2021
by
Kyle Wiebers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'eliminate-tz-sensitivity-ci-analytics-charts' into 'master'"
This reverts merge request !50760
parent
78bbe251
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
45 deletions
+3
-45
changelogs/unreleased/eliminate-tz-sensitivity-ci-analytics-charts.yml
...released/eliminate-tz-sensitivity-ci-analytics-charts.yml
+0
-5
lib/gitlab/ci/charts.rb
lib/gitlab/ci/charts.rb
+3
-5
spec/lib/gitlab/ci/charts_spec.rb
spec/lib/gitlab/ci/charts_spec.rb
+0
-35
No files found.
changelogs/unreleased/eliminate-tz-sensitivity-ci-analytics-charts.yml
deleted
100644 → 0
View file @
78bbe251
---
title
:
Fix empty pipeline analytics charts when time_zone is non-UTC
merge_request
:
50760
author
:
type
:
fixed
lib/gitlab/ci/charts.rb
View file @
4d1f30b9
...
...
@@ -31,10 +31,9 @@ module Gitlab
current
=
@from
while
current
<=
@to
label
=
current
.
strftime
(
@format
)
@labels
<<
label
@total
<<
(
totals_count
[
label
]
||
0
)
@success
<<
(
success_count
[
label
]
||
0
)
@labels
<<
current
.
strftime
(
@format
)
@total
<<
(
totals_count
[
current
]
||
0
)
@success
<<
(
success_count
[
current
]
||
0
)
current
+=
interval_step
end
...
...
@@ -46,7 +45,6 @@ module Gitlab
query
.
group
(
"date_trunc('
#{
interval
}
',
#{
::
Ci
::
Pipeline
.
table_name
}
.created_at)"
)
.
count
(
:created_at
)
.
transform_keys
{
|
date
|
date
.
strftime
(
@format
)
}
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
spec/lib/gitlab/ci/charts_spec.rb
View file @
4d1f30b9
...
...
@@ -47,10 +47,6 @@ RSpec.describe Gitlab::Ci::Charts do
subject
{
chart
.
to
}
before
do
create
(
:ci_empty_pipeline
,
project:
project
,
duration:
120
)
end
it
'includes the whole current day'
do
is_expected
.
to
eq
(
Date
.
today
.
end_of_day
)
end
...
...
@@ -62,37 +58,6 @@ RSpec.describe Gitlab::Ci::Charts do
it
'uses %d %B as labels format'
do
expect
(
chart
.
labels
).
to
include
(
chart
.
from
.
strftime
(
'%d %B'
))
end
it
'returns count of pipelines run each day in the current week'
do
expect
(
chart
.
total
).
to
contain_exactly
(
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
)
end
end
context
'weekchart_non_utc'
do
today
=
Date
.
today
end_of_today
=
Time
.
use_zone
(
Time
.
find_zone
(
'Asia/Dubai'
))
{
today
.
end_of_day
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:chart
)
do
allow
(
Date
).
to
receive
(
:today
).
and_return
(
today
)
allow
(
today
).
to
receive
(
:end_of_day
).
and_return
(
end_of_today
)
Gitlab
::
Ci
::
Charts
::
WeekChart
.
new
(
project
)
end
subject
{
chart
.
total
}
before
do
create
(
:ci_empty_pipeline
,
project:
project
,
duration:
120
)
end
it
'uses a non-utc time zone for range times'
do
expect
(
chart
.
to
.
zone
).
to
eq
(
end_of_today
.
zone
)
expect
(
chart
.
from
.
zone
).
to
eq
(
end_of_today
.
zone
)
end
it
'returns count of pipelines run each day in the current week'
do
is_expected
.
to
contain_exactly
(
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
)
end
end
context
'pipeline_times'
do
...
...
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