Sha256: eff02b3b3629d644600933c78992be3eb53c2d465eacca4a7c1c072578654bbd

Contents?: true

Size: 700 Bytes

Versions: 7

Compression:

Stored size: 700 Bytes

Contents

# frozen_string_literal: true

TYPE_LABEL_MISSING_MESSAGE = "Please add a [merge request type](https://about.gitlab.com/handbook/engineering/metrics/#work-type-classification) to this merge request."

require_relative "../../../gitlab/dangerfiles/type_label_guesser"

if respond_to?(:changelog) && !helper.has_scoped_label_with_scope?("type")
  type_label_guesser = Gitlab::Dangerfiles::TypeLabelGuesser.new
  helper.labels_to_add.concat(type_label_guesser.labels_from_changelog_categories(changelog.categories))
end

return if helper.has_scoped_label_with_scope?("type")

if ENV["DANGER_ERROR_WHEN_TYPE_LABEL_IS_MISSING"]
  fail TYPE_LABEL_MISSING_MESSAGE
else
  warn TYPE_LABEL_MISSING_MESSAGE
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gitlab-dangerfiles-3.4.3 lib/danger/rules/type_label/Dangerfile
gitlab-dangerfiles-3.4.2 lib/danger/rules/type_label/Dangerfile
gitlab-dangerfiles-3.4.1 lib/danger/rules/type_label/Dangerfile
gitlab-dangerfiles-3.4.0 lib/danger/rules/type_label/Dangerfile
gitlab-dangerfiles-3.3.0 lib/danger/rules/type_label/Dangerfile
gitlab-dangerfiles-3.2.0 lib/danger/rules/type_label/Dangerfile
gitlab-dangerfiles-3.1.0 lib/danger/rules/type_label/Dangerfile