Sha256: 9d83d98e4c40c63739463c41ef93c63b0abbb03d134c9f53117581050da77ffc

Contents?: true

Size: 751 Bytes

Versions: 9

Compression:

Stored size: 751 Bytes

Contents

# frozen_string_literal: true

module Gitlab
  module Dangerfiles
    class TypeLabelGuesser
      CHANGELOG_CATEGORY_TO_TYPE_LABEL = {
        fixed: %w[type::bug],
        security: %w[type::bug bug::vulnerability],
        performance: %w[type::bug bug::performance],
        added: %w[type::feature feature::addition],
        deprecated: %w[type::maintenance maintenance::removal],
        removed: %w[type::maintenance maintenance::removal],
      }.freeze

      def labels_from_changelog_categories(categories)
        categories = categories.map(&:to_sym) & CHANGELOG_CATEGORY_TO_TYPE_LABEL.keys
        return [] unless categories.one?

        CHANGELOG_CATEGORY_TO_TYPE_LABEL.fetch(categories.first.to_sym, [])
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gitlab-dangerfiles-4.7.0 lib/gitlab/dangerfiles/type_label_guesser.rb
gitlab-dangerfiles-4.6.0 lib/gitlab/dangerfiles/type_label_guesser.rb
gitlab-dangerfiles-4.5.1 lib/gitlab/dangerfiles/type_label_guesser.rb
gitlab-dangerfiles-4.4.0 lib/gitlab/dangerfiles/type_label_guesser.rb
gitlab-dangerfiles-4.3.2 lib/gitlab/dangerfiles/type_label_guesser.rb
gitlab-dangerfiles-4.2.1 lib/gitlab/dangerfiles/type_label_guesser.rb
gitlab-dangerfiles-4.2.0 lib/gitlab/dangerfiles/type_label_guesser.rb
gitlab-dangerfiles-4.1.0 lib/gitlab/dangerfiles/type_label_guesser.rb
gitlab-dangerfiles-4.0.0 lib/gitlab/dangerfiles/type_label_guesser.rb