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
d2292276
Commit
d2292276
authored
Dec 21, 2021
by
Alina Mihaila
Committed by
Pavel Shutsin
Dec 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add performance indicator changes to Danger
parent
cffd45fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
danger/datateam/Dangerfile
danger/datateam/Dangerfile
+16
-2
No files found.
danger/datateam/Dangerfile
View file @
d2292276
...
...
@@ -6,14 +6,28 @@ DATA_WAREHOUSE_LABELS = [
"Data Warehouse::Not Impacted"
].
freeze
FILE_PATH_REGEX
=
%r{((ee|jh)/)?config/metrics(/.+
\.
yml)}
.
freeze
PERFORMANCE_INDICATOR_REGEX
=
%r{gmau|smau|paid_gmau|umau}
.
freeze
CHANGED_SCHEMA_MESSAGE
=
<<~
MSG
Notification to the Data Team about changes to
the db/structure.sql fil
e, add label `Data Warehouse::Impact Check`.
Notification to the Data Team about changes to
files with possible impact on Data Warehous
e, add label `Data Warehouse::Impact Check`.
/label ~"Data Warehouse::Impact Check"
The following files require a review:
MSG
db_schema_updated
=
!
git
.
modified_files
.
grep
(
%r{
\A
db/structure
\.
sql}
).
empty?
metrics_definitions_files
=
git
.
modified_files
.
grep
(
FILE_PATH_REGEX
)
data_warehouse_impact_files
=
metrics_definitions_files
.
select
do
|
file
|
helper
.
changed_lines
(
file
).
grep
(
PERFORMANCE_INDICATOR_REGEX
).
any?
end
.
compact
data_warehouse_impact_files
<<
'db/structure.sql'
if
db_schema_updated
no_data_warehouse_labels
=
(
gitlab
.
mr_labels
&
DATA_WAREHOUSE_LABELS
).
empty?
markdown
(
CHANGED_SCHEMA_MESSAGE
)
if
db_schema_updated
&&
no_data_warehouse_labels
markdown
(
CHANGED_SCHEMA_MESSAGE
+
helper
.
markdown_list
(
data_warehouse_impact_files
))
if
data_warehouse_impact_files
.
any?
&&
no_data_warehouse_labels
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