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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
28a9bbce
Commit
28a9bbce
authored
Nov 01, 2018
by
Chris Baumbauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove comments from migration script and add usage data
parent
0a62588b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
22 deletions
+4
-22
db/migrate/20180912111628_add_knative_application.rb
db/migrate/20180912111628_add_knative_application.rb
+0
-22
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+1
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+3
-0
No files found.
db/migrate/20180912111628_add_knative_application.rb
View file @
28a9bbce
# frozen_string_literal: true
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
AddKnativeApplication
<
ActiveRecord
::
Migration
class
AddKnativeApplication
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
DOWNTIME
=
false
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires downtime.
# DOWNTIME_REASON = ''
# When using the methods "add_concurrent_index", "remove_concurrent_index" or
# "add_column_with_default" you must disable the use of transactions
# as these methods can not run in an existing transaction.
# When using "add_concurrent_index" or "remove_concurrent_index" methods make sure
# that either of them is the _only_ method called in the migration,
# any other changes should go in a separate migration.
# This ensures that upon failure _only_ the index creation or removing fails
# and can be retried or reverted easily.
#
# To disable transactions uncomment the following line and remove these
# comments:
# disable_ddl_transaction!
def
change
def
change
create_table
"clusters_applications_knative"
do
|
t
|
create_table
"clusters_applications_knative"
do
|
t
|
t
.
references
:cluster
,
null:
false
,
unique:
true
,
foreign_key:
{
on_delete: :cascade
}
t
.
references
:cluster
,
null:
false
,
unique:
true
,
foreign_key:
{
on_delete: :cascade
}
...
...
lib/gitlab/usage_data.rb
View file @
28a9bbce
...
@@ -62,6 +62,7 @@ module Gitlab
...
@@ -62,6 +62,7 @@ module Gitlab
clusters_applications_ingress:
count
(
::
Clusters
::
Applications
::
Ingress
.
installed
),
clusters_applications_ingress:
count
(
::
Clusters
::
Applications
::
Ingress
.
installed
),
clusters_applications_prometheus:
count
(
::
Clusters
::
Applications
::
Prometheus
.
installed
),
clusters_applications_prometheus:
count
(
::
Clusters
::
Applications
::
Prometheus
.
installed
),
clusters_applications_runner:
count
(
::
Clusters
::
Applications
::
Runner
.
installed
),
clusters_applications_runner:
count
(
::
Clusters
::
Applications
::
Runner
.
installed
),
clusters_applications_knative:
count
(
::
Clusters
::
Applications
::
Knative
.
installed
),
in_review_folder:
count
(
::
Environment
.
in_review_folder
),
in_review_folder:
count
(
::
Environment
.
in_review_folder
),
groups:
count
(
Group
),
groups:
count
(
Group
),
issues:
count
(
Issue
),
issues:
count
(
Issue
),
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
28a9bbce
...
@@ -20,6 +20,7 @@ describe Gitlab::UsageData do
...
@@ -20,6 +20,7 @@ describe Gitlab::UsageData do
create
(
:clusters_applications_ingress
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_ingress
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_prometheus
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_prometheus
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_runner
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_runner
,
:installed
,
cluster:
gcp_cluster
)
create
(
:clusters_applications_knative
,
:installed
,
cluster:
gcp_cluster
)
end
end
subject
{
described_class
.
data
}
subject
{
described_class
.
data
}
...
@@ -81,6 +82,7 @@ describe Gitlab::UsageData do
...
@@ -81,6 +82,7 @@ describe Gitlab::UsageData do
clusters_applications_ingress
clusters_applications_ingress
clusters_applications_prometheus
clusters_applications_prometheus
clusters_applications_runner
clusters_applications_runner
clusters_applications_knative
in_review_folder
in_review_folder
groups
groups
issues
issues
...
@@ -126,6 +128,7 @@ describe Gitlab::UsageData do
...
@@ -126,6 +128,7 @@ describe Gitlab::UsageData do
expect
(
count_data
[
:clusters_applications_ingress
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_ingress
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_prometheus
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_prometheus
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_runner
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_runner
]).
to
eq
(
1
)
expect
(
count_data
[
:clusters_applications_knative
]).
to
eq
(
1
)
end
end
it
'works when queries time out'
do
it
'works when queries time out'
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