Sha256: 74f283f5c44319d0d1b5fcf9306458fba9fa983998fd7936241c6058c7dac904

Contents?: true

Size: 750 Bytes

Versions: 1

Compression:

Stored size: 750 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

1 entries across 1 versions & 1 rubygems

Version Path
gitlab-dangerfiles-4.8.0 lib/gitlab/dangerfiles/type_label_guesser.rb