debian-mirror-gitlab/danger/datateam/Dangerfile

20 lines
595 B
Ruby
Raw Normal View History

2021-04-29 21:17:54 +05:30
# frozen_string_literal: true
2021-09-30 23:02:18 +05:30
DATA_WAREHOUSE_LABELS = [
"Data Warehouse::Impact Check",
"Data Warehouse::Impacted",
"Data Warehouse::Not Impacted"
].freeze
2021-04-29 21:17:54 +05:30
CHANGED_SCHEMA_MESSAGE = <<~MSG
2021-09-30 23:02:18 +05:30
Notification to the Data Team about changes to the db/structure.sql file, add label `Data Warehouse::Impact Check`.
/label ~"Data Warehouse::Impact Check"
2021-04-29 21:17:54 +05:30
MSG
db_schema_updated = !git.modified_files.grep(%r{\Adb/structure\.sql}).empty?
2021-09-30 23:02:18 +05:30
no_data_warehouse_labels = (gitlab.mr_labels & DATA_WAREHOUSE_LABELS).empty?
2021-04-29 21:17:54 +05:30
2021-09-30 23:02:18 +05:30
markdown(CHANGED_SCHEMA_MESSAGE) if db_schema_updated && no_data_warehouse_labels