Skip to content
代码片段 群组 项目
提交 efc56511 编辑于 作者: Dennis van Rooijen's avatar Dennis van Rooijen 提交者: Albert Salim
浏览文件

Add data warehouse labels to MR upon schema change

上级 f1dd0d9f
No related branches found
No related tags found
无相关合并请求
# frozen_string_literal: true # frozen_string_literal: true
# rubocop:disable Style/SignalException # rubocop:disable Style/SignalException
DATA_WAREHOUSE_LABELS = [
"Data Warehouse::Impact Check",
"Data Warehouse::Impacted",
"Data Warehouse::Not Impacted"
].freeze
CHANGED_SCHEMA_MESSAGE = <<~MSG CHANGED_SCHEMA_MESSAGE = <<~MSG
Mentioning @gitlab-data/engineers to notify the team about changes to the db/structure.sql file. Notification to the Data Team about changes to the db/structure.sql file, add label `Data Warehouse::Impact Check`.
/label ~"Data Warehouse::Impact Check"
MSG MSG
db_schema_updated = !git.modified_files.grep(%r{\Adb/structure\.sql}).empty? db_schema_updated = !git.modified_files.grep(%r{\Adb/structure\.sql}).empty?
if db_schema_updated no_data_warehouse_labels = (gitlab.mr_labels & DATA_WAREHOUSE_LABELS).empty?
if db_schema_updated && no_data_warehouse_labels
markdown(CHANGED_SCHEMA_MESSAGE) markdown(CHANGED_SCHEMA_MESSAGE)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册