Verified Commit 21d858d7 authored by Rémy Coutable's avatar Rémy Coutable 🔴
Browse files

Debug the 'z_add_labels' rule



Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent ace31758
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -9,7 +9,9 @@ def post_labels(labels)
                                  helper.mr_iid,
                                  add_labels: labels.join(","))
rescue Gitlab::Error::Forbidden
  warn("This Merge Request needs to be labelled with #{helper.labels_list(labels)}. Please request a reviewer or maintainer to add them.")
  warn("This merge request needs to be labelled with #{helper.labels_list(labels)}. Please request a reviewer or maintainer to add them.")
end

puts "helper.labels_to_add: #{helper.labels_to_add}"

post_labels(helper.labels_to_add) if helper.labels_to_add.any?
+3 −3
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ module Gitlab
        danger_plugin.import_plugin(File.expand_path("../danger/plugins/*.rb", __dir__))

        Dir.glob(File.expand_path("danger/plugins/*.rb", config.project_root)).sort.each do |path|
          puts "Importing plugin at #{path}" if dangerfile.verbose
          puts "Importing plugin at #{path}"
          danger_plugin.import_plugin(path)
        end
      end
@@ -87,10 +87,10 @@ module Gitlab
        return if helper_plugin.release_automation?

        rules = filtered_rules(only, except)
        puts "Running rules: #{rules}\n" if dangerfile.verbose
        puts "Running rules: #{rules}\n"

        rules.each do |rule, path|
          puts "Importing rule #{rule} at #{path}" if dangerfile.verbose
          puts "Importing rule #{rule} at #{path}"
          danger_plugin.import_dangerfile(path: path)
        end
      end