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
c85d6b0c
Commit
c85d6b0c
authored
Jul 04, 2019
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore fallback to deployment_platform_cluster
In 12.2 we will remove this fallback.
parent
25ba11a2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
4 deletions
+28
-4
app/models/deployment_metrics.rb
app/models/deployment_metrics.rb
+12
-1
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+4
-3
spec/models/deployment_metrics_spec.rb
spec/models/deployment_metrics_spec.rb
+12
-0
No files found.
app/models/deployment_metrics.rb
View file @
c85d6b0c
...
@@ -44,7 +44,18 @@ class DeploymentMetrics
...
@@ -44,7 +44,18 @@ class DeploymentMetrics
end
end
end
end
# TODO remove fallback case to deployment_platform_cluster.
# Otherwise we will continue to pay the performance penalty described in
# https://gitlab.com/gitlab-org/gitlab-ce/issues/63475
#
# Removal issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/64105
def
cluster_prometheus
def
cluster_prometheus
cluster
.
application_prometheus
if
cluster
&
.
application_prometheus_available?
cluster_with_fallback
=
cluster
||
deployment_platform_cluster
cluster_with_fallback
.
application_prometheus
if
cluster_with_fallback
&
.
application_prometheus_available?
end
def
deployment_platform_cluster
deployment
.
environment
.
deployment_platform
&
.
cluster
end
end
end
end
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
c85d6b0c
...
@@ -887,9 +887,10 @@ describe Projects::MergeRequestsController do
...
@@ -887,9 +887,10 @@ describe Projects::MergeRequestsController do
environment2
=
create
(
:environment
,
project:
forked
)
environment2
=
create
(
:environment
,
project:
forked
)
create
(
:deployment
,
:succeed
,
environment:
environment2
,
sha:
sha
,
ref:
'master'
,
deployable:
build
)
create
(
:deployment
,
:succeed
,
environment:
environment2
,
sha:
sha
,
ref:
'master'
,
deployable:
build
)
# TODO address the last 5 queries
# TODO address the last 11 queries
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/63952
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/63952 (5 queries)
leeway
=
5
# And https://gitlab.com/gitlab-org/gitlab-ce/issues/64105 (6 queries)
leeway
=
11
expect
{
get_ci_environments_status
}.
not_to
exceed_all_query_limit
(
control_count
+
leeway
)
expect
{
get_ci_environments_status
}.
not_to
exceed_all_query_limit
(
control_count
+
leeway
)
end
end
...
...
spec/models/deployment_metrics_spec.rb
View file @
c85d6b0c
...
@@ -49,6 +49,18 @@ describe DeploymentMetrics do
...
@@ -49,6 +49,18 @@ describe DeploymentMetrics do
it
{
is_expected
.
to
be_truthy
}
it
{
is_expected
.
to
be_truthy
}
end
end
context
'fallback deployment platform'
do
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_user
,
environment_scope:
'*'
,
projects:
[
deployment
.
project
])
}
let!
(
:prometheus
)
{
create
(
:clusters_applications_prometheus
,
:installed
,
cluster:
cluster
)
}
before
do
expect
(
deployment
.
project
).
to
receive
(
:deployment_platform
).
and_return
(
cluster
.
platform
)
expect
(
cluster
.
application_prometheus
).
to
receive
(
:can_query?
).
and_return
(
true
)
end
it
{
is_expected
.
to
be_truthy
}
end
end
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