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
e83a8187
Commit
e83a8187
authored
Sep 06, 2017
by
Maxim Rydkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adds changelog
fix CI fix CI
parent
5b296f81
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
changelogs/unreleased/5836-move-lib-ci-into-gitlab-namespace.yml
...ogs/unreleased/5836-move-lib-ci-into-gitlab-namespace.yml
+5
-0
lib/gitlab/ci/charts.rb
lib/gitlab/ci/charts.rb
+4
-4
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
+1
-1
No files found.
changelogs/unreleased/5836-move-lib-ci-into-gitlab-namespace.yml
0 → 100644
View file @
e83a8187
---
title
:
Move `lib/ci` to `lib/gitlab/ci`
merge_request
:
14078
author
:
Maxim Rydkin
type
:
other
lib/gitlab/ci/charts.rb
View file @
e83a8187
...
@@ -4,7 +4,7 @@ module Gitlab
...
@@ -4,7 +4,7 @@ module Gitlab
module
DailyInterval
module
DailyInterval
def
grouped_count
(
query
)
def
grouped_count
(
query
)
query
query
.
group
(
"DATE(
#{
Ci
::
Pipeline
.
table_name
}
.created_at)"
)
.
group
(
"DATE(
#{
::
Ci
::
Pipeline
.
table_name
}
.created_at)"
)
.
count
(
:created_at
)
.
count
(
:created_at
)
.
transform_keys
{
|
date
|
date
.
strftime
(
@format
)
}
.
transform_keys
{
|
date
|
date
.
strftime
(
@format
)
}
end
end
...
@@ -18,12 +18,12 @@ module Gitlab
...
@@ -18,12 +18,12 @@ module Gitlab
def
grouped_count
(
query
)
def
grouped_count
(
query
)
if
Gitlab
::
Database
.
postgresql?
if
Gitlab
::
Database
.
postgresql?
query
query
.
group
(
"to_char(
#{
Ci
::
Pipeline
.
table_name
}
.created_at, '01 Month YYYY')"
)
.
group
(
"to_char(
#{
::
Ci
::
Pipeline
.
table_name
}
.created_at, '01 Month YYYY')"
)
.
count
(
:created_at
)
.
count
(
:created_at
)
.
transform_keys
(
&
:squish
)
.
transform_keys
(
&
:squish
)
else
else
query
query
.
group
(
"DATE_FORMAT(
#{
Ci
::
Pipeline
.
table_name
}
.created_at, '01 %M %Y')"
)
.
group
(
"DATE_FORMAT(
#{
::
Ci
::
Pipeline
.
table_name
}
.created_at, '01 %M %Y')"
)
.
count
(
:created_at
)
.
count
(
:created_at
)
end
end
end
end
...
@@ -48,7 +48,7 @@ module Gitlab
...
@@ -48,7 +48,7 @@ module Gitlab
def
collect
def
collect
query
=
project
.
pipelines
query
=
project
.
pipelines
.
where
(
"? >
#{
Ci
::
Pipeline
.
table_name
}
.created_at AND
#{
Ci
::
Pipeline
.
table_name
}
.created_at > ?"
,
@to
,
@from
)
# rubocop:disable GitlabSecurity/SqlInjection
.
where
(
"? >
#{
::
Ci
::
Pipeline
.
table_name
}
.created_at AND
#{
::
Ci
::
Pipeline
.
table_name
}
.created_at > ?"
,
@to
,
@from
)
# rubocop:disable GitlabSecurity/SqlInjection
totals_count
=
grouped_count
(
query
)
totals_count
=
grouped_count
(
query
)
success_count
=
grouped_count
(
query
.
success
)
success_count
=
grouped_count
(
query
.
success
)
...
...
spec/lib/gitlab/import_export/project_tree_saver_spec.rb
View file @
e83a8187
...
@@ -119,7 +119,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
...
@@ -119,7 +119,7 @@ describe Gitlab::ImportExport::ProjectTreeSaver do
it
'has no when YML attributes but only the DB column'
do
it
'has no when YML attributes but only the DB column'
do
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:ci_yaml_file
).
and_return
(
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
)))
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:ci_yaml_file
).
and_return
(
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
)))
expect_any_instance_of
(
Ci
::
GitlabCi
YamlProcessor
).
not_to
receive
(
:build_attributes
)
expect_any_instance_of
(
Gitlab
::
Ci
::
YamlProcessor
).
not_to
receive
(
:build_attributes
)
saved_project_json
saved_project_json
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