Skip to content
代码片段 群组 项目
提交 116fd53f 编辑于 作者: Sarah German's avatar Sarah German 提交者: Jennifer Li
浏览文件

Check MR contents before adding Docs labels

上级 57e7d40b
No related branches found
No related tags found
无相关合并请求
...@@ -32,18 +32,16 @@ end ...@@ -32,18 +32,16 @@ end
SOLUTIONS_LABELS = %w[Solutions].freeze SOLUTIONS_LABELS = %w[Solutions].freeze
DEVELOPMENT_LABELS = ['docs::improvement', 'development guidelines'].freeze DEVELOPMENT_LABELS = ['docs::improvement', 'development guidelines'].freeze
def no_tw_review_label_message(labels) def add_labels(labels)
helper.labels_to_add.concat(%w[documentation type::maintenance maintenance::refactor] + labels) helper.labels_to_add.concat(%w[documentation type::maintenance maintenance::refactor] + labels)
'You do not need tech writer review.'
end end
SOLUTIONS_MESSAGE = <<~MSG.freeze SOLUTIONS_MESSAGE = <<~MSG
This MR contains docs in the /solutions directory and should be reviewed by a Solutions Architect approver. #{no_tw_review_label_message(SOLUTIONS_LABELS)} This MR contains docs in the /solutions directory and should be reviewed by a Solutions Architect approver. You do not need tech writer review.
MSG MSG
DEVELOPMENT_MESSAGE = <<~MSG.freeze DEVELOPMENT_MESSAGE = <<~MSG
This MR contains docs in the /development directory. Any Maintainer, other than the author, can merge. #{no_tw_review_label_message(DEVELOPMENT_LABELS)} This MR contains docs in the /development directory. Any Maintainer, other than the author, can merge. You do not need tech writer review.
MSG MSG
# For regular pages, prompt for a TW review # For regular pages, prompt for a TW review
...@@ -78,8 +76,15 @@ MSG ...@@ -78,8 +76,15 @@ MSG
# Output messages # Output messages
warn(DOCUMENTATION_UPDATE_MISSING) if docs_paths_to_review.empty? && feature_mr? warn(DOCUMENTATION_UPDATE_MISSING) if docs_paths_to_review.empty? && feature_mr?
message(SOLUTIONS_MESSAGE) if sections_with_no_tw_review["doc/solutions"].any? if sections_with_no_tw_review["doc/solutions"].any?
message(DEVELOPMENT_MESSAGE) if sections_with_no_tw_review["doc/development"].any? add_labels(SOLUTIONS_LABELS)
message(SOLUTIONS_MESSAGE)
end
if sections_with_no_tw_review["doc/development"].any?
add_labels(DEVELOPMENT_LABELS)
message(DEVELOPMENT_MESSAGE)
end
unless docs_paths_to_review.empty? unless docs_paths_to_review.empty?
message(DOCS_UPDATE_SHORT_MESSAGE) message(DOCS_UPDATE_SHORT_MESSAGE)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册