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
3ed12ee6
Commit
3ed12ee6
authored
May 15, 2020
by
allison.browne
Committed by
Ash McKenzie
May 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change oids to primary_keys
parent
dcc3b50c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
10 deletions
+9
-10
app/workers/clusters/applications/check_prometheus_health_worker.rb
...s/clusters/applications/check_prometheus_health_worker.rb
+1
-1
db/structure.sql
db/structure.sql
+1
-2
lib/gitlab/monitor/demo_projects.rb
lib/gitlab/monitor/demo_projects.rb
+1
-1
spec/lib/gitlab/monitor/demo_projects_spec.rb
spec/lib/gitlab/monitor/demo_projects_spec.rb
+5
-5
spec/workers/clusters/applications/check_prometheus_health_worker_spec.rb
...sters/applications/check_prometheus_health_worker_spec.rb
+1
-1
No files found.
app/workers/clusters/applications/check_prometheus_health_worker.rb
View file @
3ed12ee6
...
...
@@ -16,7 +16,7 @@ module Clusters
idempotent!
def
perform
demo_project_ids
=
Gitlab
::
Monitor
::
DemoProjects
.
oid
s
demo_project_ids
=
Gitlab
::
Monitor
::
DemoProjects
.
primary_key
s
clusters
=
Clusters
::
Cluster
.
with_application_prometheus
.
with_project_alert_service_data
(
demo_project_ids
)
...
...
db/structure.sql
View file @
3ed12ee6
...
...
@@ -5283,8 +5283,7 @@ CREATE TABLE public.project_settings (
created_at
timestamp
with
time
zone
NOT
NULL
,
updated_at
timestamp
with
time
zone
NOT
NULL
,
push_rule_id
bigint
,
show_default_award_emojis
boolean
DEFAULT
true
,
CONSTRAINT
check_bde223416c
CHECK
((
show_default_award_emojis
IS
NOT
NULL
))
show_default_award_emojis
boolean
DEFAULT
true
NOT
NULL
);
CREATE
TABLE
public
.
project_statistics
(
...
...
lib/gitlab/monitor/demo_projects.rb
View file @
3ed12ee6
...
...
@@ -6,7 +6,7 @@ module Gitlab
DOT_COM_IDS
=
[
14986497
,
12507547
].
freeze
STAGING_IDS
=
[
4422333
].
freeze
def
self
.
oid
s
def
self
.
primary_key
s
if
::
Gitlab
.
com?
DOT_COM_IDS
elsif
::
Gitlab
.
staging?
...
...
spec/lib/gitlab/monitor/demo_projects_spec.rb
View file @
3ed12ee6
...
...
@@ -3,22 +3,22 @@
require
'spec_helper'
describe
Gitlab
::
Monitor
::
DemoProjects
do
describe
'#
oid
s'
do
subject
{
described_class
.
oid
s
}
describe
'#
primary_key
s'
do
subject
{
described_class
.
primary_key
s
}
it
'fetches
oid
s when in test env'
do
it
'fetches
primary_key
s when in test env'
do
project
=
create
(
:project
)
expect
(
subject
).
to
eq
([
project
.
id
])
end
it
'fetches
oid
s when on gitlab.com'
do
it
'fetches
primary_key
s when on gitlab.com'
do
expect
(
Gitlab
).
to
receive
(
:'com?'
).
and_return
(
true
)
expect
(
subject
).
to
eq
(
Gitlab
::
Monitor
::
DemoProjects
::
DOT_COM_IDS
)
end
it
'fetches
oid
s when on staging'
do
it
'fetches
primary_key
s when on staging'
do
expect
(
Gitlab
).
to
receive
(
:staging?
).
and_return
(
true
)
expect
(
subject
).
to
eq
(
Gitlab
::
Monitor
::
DemoProjects
::
STAGING_IDS
)
...
...
spec/workers/clusters/applications/check_prometheus_health_worker_spec.rb
View file @
3ed12ee6
...
...
@@ -7,7 +7,7 @@ describe Clusters::Applications::CheckPrometheusHealthWorker, '#perform' do
it
'triggers health service'
do
cluster
=
create
(
:cluster
)
allow
(
Gitlab
::
Monitor
::
DemoProjects
).
to
receive
(
:
oid
s
)
allow
(
Gitlab
::
Monitor
::
DemoProjects
).
to
receive
(
:
primary_key
s
)
allow
(
Clusters
::
Cluster
).
to
receive
(
:with_application_prometheus
).
and_return
(
double
(
with_project_alert_service_data:
[
cluster
]))
service_instance
=
instance_double
(
Clusters
::
Applications
::
PrometheusHealthCheckService
)
...
...
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