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
3c931406
Commit
3c931406
authored
Jul 02, 2020
by
David Kim
Committed by
Mayra Cabrera
Jul 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update usage ping data to track projects with overridden approval rules
parent
e7f4c967
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
0 deletions
+44
-0
changelogs/unreleased/222313-update-usage-ping-data-to-track-projects-with-can-override-approva.yml
...ping-data-to-track-projects-with-can-override-approva.yml
+5
-0
db/post_migrate/20200626060151_add_disable_overriding_approvers_per_merge_request_indices.rb
...disable_overriding_approvers_per_merge_request_indices.rb
+26
-0
db/structure.sql
db/structure.sql
+5
-0
ee/lib/ee/gitlab/usage_data.rb
ee/lib/ee/gitlab/usage_data.rb
+2
-0
ee/spec/lib/ee/gitlab/usage_data_spec.rb
ee/spec/lib/ee/gitlab/usage_data_spec.rb
+6
-0
No files found.
changelogs/unreleased/222313-update-usage-ping-data-to-track-projects-with-can-override-approva.yml
0 → 100644
View file @
3c931406
---
title
:
Add project count with overridden approval rules in merge request to usage ping
merge_request
:
35224
author
:
type
:
added
db/post_migrate/20200626060151_add_disable_overriding_approvers_per_merge_request_indices.rb
0 → 100644
View file @
3c931406
# frozen_string_literal: true
class
AddDisableOverridingApproversPerMergeRequestIndices
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
DISABLE_OVERRIDING_APPROVERS_TRUE_INDEX_NAME
=
"idx_projects_id_created_at_disable_overriding_approvers_true"
DISABLE_OVERRIDING_APPROVERS_FALSE_INDEX_NAME
=
"idx_projects_id_created_at_disable_overriding_approvers_false"
disable_ddl_transaction!
def
up
add_concurrent_index
:projects
,
[
:id
,
:created_at
],
where:
"disable_overriding_approvers_per_merge_request = TRUE"
,
name:
DISABLE_OVERRIDING_APPROVERS_TRUE_INDEX_NAME
add_concurrent_index
:projects
,
[
:id
,
:created_at
],
where:
"(disable_overriding_approvers_per_merge_request = FALSE) OR (disable_overriding_approvers_per_merge_request IS NULL)"
,
name:
DISABLE_OVERRIDING_APPROVERS_FALSE_INDEX_NAME
end
def
down
remove_concurrent_index_by_name
:projects
,
DISABLE_OVERRIDING_APPROVERS_TRUE_INDEX_NAME
remove_concurrent_index_by_name
:projects
,
DISABLE_OVERRIDING_APPROVERS_FALSE_INDEX_NAME
end
end
db/structure.sql
View file @
3c931406
...
@@ -18393,6 +18393,10 @@ CREATE UNIQUE INDEX idx_project_id_payload_key_self_managed_prometheus_alert_eve
...
@@ -18393,6 +18393,10 @@ CREATE UNIQUE INDEX idx_project_id_payload_key_self_managed_prometheus_alert_eve
CREATE
INDEX
idx_project_repository_check_partial
ON
public
.
projects
USING
btree
(
repository_storage
,
created_at
)
WHERE
(
last_repository_check_at
IS
NULL
);
CREATE
INDEX
idx_project_repository_check_partial
ON
public
.
projects
USING
btree
(
repository_storage
,
created_at
)
WHERE
(
last_repository_check_at
IS
NULL
);
CREATE
INDEX
idx_projects_id_created_at_disable_overriding_approvers_false
ON
public
.
projects
USING
btree
(
id
,
created_at
)
WHERE
((
disable_overriding_approvers_per_merge_request
=
false
)
OR
(
disable_overriding_approvers_per_merge_request
IS
NULL
));
CREATE
INDEX
idx_projects_id_created_at_disable_overriding_approvers_true
ON
public
.
projects
USING
btree
(
id
,
created_at
)
WHERE
(
disable_overriding_approvers_per_merge_request
=
true
);
CREATE
INDEX
idx_projects_on_repository_storage_last_repository_updated_at
ON
public
.
projects
USING
btree
(
id
,
repository_storage
,
last_repository_updated_at
);
CREATE
INDEX
idx_projects_on_repository_storage_last_repository_updated_at
ON
public
.
projects
USING
btree
(
id
,
repository_storage
,
last_repository_updated_at
);
CREATE
INDEX
idx_repository_states_on_last_repository_verification_ran_at
ON
public
.
project_repository_states
USING
btree
(
project_id
,
last_repository_verification_ran_at
)
WHERE
((
repository_verification_checksum
IS
NOT
NULL
)
AND
(
last_repository_verification_failure
IS
NULL
));
CREATE
INDEX
idx_repository_states_on_last_repository_verification_ran_at
ON
public
.
project_repository_states
USING
btree
(
project_id
,
last_repository_verification_ran_at
)
WHERE
((
repository_verification_checksum
IS
NOT
NULL
)
AND
(
last_repository_verification_failure
IS
NULL
));
...
@@ -23531,6 +23535,7 @@ COPY "schema_migrations" (version) FROM STDIN;
...
@@ -23531,6 +23535,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200625045442
20200625045442
20200625082258
20200625082258
20200625190458
20200625190458
20200626060151
20200626130220
20200626130220
\
.
\
.
ee/lib/ee/gitlab/usage_data.rb
View file @
3c931406
...
@@ -218,6 +218,8 @@ module EE
...
@@ -218,6 +218,8 @@ module EE
projects_enforcing_code_owner_approval:
distinct_count
(
::
Project
.
requiring_code_owner_approval
.
where
(
time_period
),
:creator_id
),
projects_enforcing_code_owner_approval:
distinct_count
(
::
Project
.
requiring_code_owner_approval
.
where
(
time_period
),
:creator_id
),
merge_requests_with_optional_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_optional
.
where
(
time_period
),
:merge_request_id
),
merge_requests_with_optional_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_optional
.
where
(
time_period
),
:merge_request_id
),
merge_requests_with_required_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_required
.
where
(
time_period
),
:merge_request_id
),
merge_requests_with_required_codeowners:
distinct_count
(
::
ApprovalMergeRequestRule
.
code_owner_approval_required
.
where
(
time_period
),
:merge_request_id
),
projects_with_disable_overriding_approvers_per_merge_request:
count
(
::
Project
.
where
(
time_period
.
merge
(
disable_overriding_approvers_per_merge_request:
true
))),
projects_without_disable_overriding_approvers_per_merge_request:
count
(
::
Project
.
where
(
time_period
.
merge
(
disable_overriding_approvers_per_merge_request:
[
false
,
nil
]))),
projects_imported_from_github:
distinct_count
(
::
Project
.
github_imported
.
where
(
time_period
),
:creator_id
),
projects_imported_from_github:
distinct_count
(
::
Project
.
github_imported
.
where
(
time_period
),
:creator_id
),
projects_with_repositories_enabled:
distinct_count
(
::
Project
.
with_repositories_enabled
.
where
(
time_period
),
projects_with_repositories_enabled:
distinct_count
(
::
Project
.
with_repositories_enabled
.
where
(
time_period
),
:creator_id
,
:creator_id
,
...
...
ee/spec/lib/ee/gitlab/usage_data_spec.rb
View file @
3c931406
...
@@ -331,6 +331,8 @@ RSpec.describe Gitlab::UsageData do
...
@@ -331,6 +331,8 @@ RSpec.describe Gitlab::UsageData do
create
(
:deploy_key
,
user:
user
)
create
(
:deploy_key
,
user:
user
)
create
(
:key
,
user:
user
)
create
(
:key
,
user:
user
)
create
(
:project
,
creator:
user
)
create
(
:project
,
creator:
user
)
create
(
:project
,
creator:
user
,
disable_overriding_approvers_per_merge_request:
true
)
create
(
:project
,
creator:
user
,
disable_overriding_approvers_per_merge_request:
false
)
create
(
:protected_branch
,
project:
project
)
create
(
:protected_branch
,
project:
project
)
create
(
:remote_mirror
,
project:
project
)
create
(
:remote_mirror
,
project:
project
)
create
(
:snippet
,
author:
user
)
create
(
:snippet
,
author:
user
)
...
@@ -348,6 +350,8 @@ RSpec.describe Gitlab::UsageData do
...
@@ -348,6 +350,8 @@ RSpec.describe Gitlab::UsageData do
projects_enforcing_code_owner_approval:
0
,
projects_enforcing_code_owner_approval:
0
,
merge_requests_with_optional_codeowners:
4
,
merge_requests_with_optional_codeowners:
4
,
merge_requests_with_required_codeowners:
8
,
merge_requests_with_required_codeowners:
8
,
projects_with_disable_overriding_approvers_per_merge_request:
2
,
projects_without_disable_overriding_approvers_per_merge_request:
16
,
projects_imported_from_github:
2
,
projects_imported_from_github:
2
,
projects_with_repositories_enabled:
12
,
projects_with_repositories_enabled:
12
,
protected_branches:
2
,
protected_branches:
2
,
...
@@ -362,6 +366,8 @@ RSpec.describe Gitlab::UsageData do
...
@@ -362,6 +366,8 @@ RSpec.describe Gitlab::UsageData do
projects_enforcing_code_owner_approval:
0
,
projects_enforcing_code_owner_approval:
0
,
merge_requests_with_optional_codeowners:
2
,
merge_requests_with_optional_codeowners:
2
,
merge_requests_with_required_codeowners:
4
,
merge_requests_with_required_codeowners:
4
,
projects_with_disable_overriding_approvers_per_merge_request:
1
,
projects_without_disable_overriding_approvers_per_merge_request:
8
,
projects_imported_from_github:
1
,
projects_imported_from_github:
1
,
projects_with_repositories_enabled:
6
,
projects_with_repositories_enabled:
6
,
protected_branches:
1
,
protected_branches:
1
,
...
...
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