Sha256: 1de89ebdccd8e7e6655fdfd3d7f56fb1d4da62ff4c2b3a0abe152a26c6efc08b

Contents?: true

Size: 735 Bytes

Versions: 64

Compression:

Stored size: 735 Bytes

Contents

require_relative 'base_conditions_filter'

module Gitlab
  module Triage
    module Filters
      class NoAdditionalLabelsConditionsFilter < BaseConditionsFilter
        def self.filter_parameters
          []
        end

        def validate_condition(condition)
          raise ArgumentError, 'condition must be an array containing the only label values allowed' unless condition.is_a?(Array)
        end

        def initialize_variables(expected_labels)
          @attribute = :labels
          @expected_labels = expected_labels
        end

        def resource_value
          @resource[@attribute]
        end

        def calculate
          (resource_value - @expected_labels).empty?
        end
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 2 rubygems

Version Path
gitlab-triage-1.19.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.18.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.17.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.16.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.15.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.14.3 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.14.2 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.14.1 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.14.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.13.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.12.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.11.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.10.1 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.10.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.9.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.8.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.7.1 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.7.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.6.1 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb
gitlab-triage-1.6.0 lib/gitlab/triage/filters/no_additional_labels_conditions_filter.rb