<commit_before># frozen_string_literal: true

require 'set'

class Feature
  class Gitaly
    # Server feature flags should use '_' to separate words.
    SERVER_FEATURE_FLAGS =
      %w[
        get_commit_signatures
        cache_invalidator
        inforef_uploadpack_cache
        get_all_lfs_pointers_go
      ].freeze

    DEFAULT_ON_FLAGS = Set.new([]).freeze

    class << self
      def enabled?(feature_flag)
        return false unless Feature::FlipperFeature.table_exists?

        default_on = DEFAULT_ON_FLAGS.include?(feature_flag)
        Feature.enabled?("gitaly_#{feature_flag}", default_enabled: default_on)
      rescue ActiveRecord::NoDatabaseError
        false
      end

      def server_feature_flags
        SERVER_FEATURE_FLAGS.map do |f|
          ["gitaly-feature-#{f.tr('_', '-')}", enabled?(f).to_s]
        end.to_h
      end
    end
  end
end
<commit_msg>Add latest changes from gitlab-org/gitlab@master<commit_after># frozen_string_literal: true

require 'set'

class Feature
  class Gitaly
    # Server feature flags should use '_' to separate words.
    SERVER_FEATURE_FLAGS =
      %w[
        cache_invalidator
        inforef_uploadpack_cache
        get_all_lfs_pointers_go
      ].freeze

    DEFAULT_ON_FLAGS = Set.new([]).freeze

    class << self
      def enabled?(feature_flag)
        return false unless Feature::FlipperFeature.table_exists?

        default_on = DEFAULT_ON_FLAGS.include?(feature_flag)
        Feature.enabled?("gitaly_#{feature_flag}", default_enabled: default_on)
      rescue ActiveRecord::NoDatabaseError
        false
      end

      def server_feature_flags
        SERVER_FEATURE_FLAGS.map do |f|
          ["gitaly-feature-#{f.tr('_', '-')}", enabled?(f).to_s]
        end.to_h
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.08815272318921955, 'fraction_numerical': 0.0, 'mean_word_length': 2.759493670886076, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5247668', 'n_tokens_mistral': 555, 'n_tokens_neox': 562, 'n_words': 113}