<commit_before>class ProjectAutoDevops < ActiveRecord::Base
  belongs_to :project

  enum deploy_strategy: {
    manual: 1,
    continuous: 2
  }

  scope :enabled, -> { where(enabled: true) }
  scope :disabled, -> { where(enabled: false) }

  validates :domain, allow_blank: true, hostname: { allow_numeric_hostname: true }

  def instance_domain
    Gitlab::CurrentSettings.auto_devops_domain
  end

  def has_domain?
    domain.present? || instance_domain.present?
  end

  def predefined_variables
    Gitlab::Ci::Variables::Collection.new.tap do |variables|
      if has_domain?
        variables.append(key: 'AUTO_DEVOPS_DOMAIN',
                         value: domain.presence || instance_domain)
      end

      if continuous?
        variables.append(key: 'STAGING_ENABLED', value: 1)
        variables.append(key: 'INCREMENTAL_ROLLOUT_ENABLED', value: 1)
      end
    end
  end
end<commit_msg>Make deploy_strategy zero based<commit_after>class ProjectAutoDevops < ActiveRecord::Base
  belongs_to :project

  enum deploy_strategy: {
    manual: 0,
    continuous: 1
  }

  scope :enabled, -> { where(enabled: true) }
  scope :disabled, -> { where(enabled: false) }

  validates :domain, allow_blank: true, hostname: { allow_numeric_hostname: true }

  def instance_domain
    Gitlab::CurrentSettings.auto_devops_domain
  end

  def has_domain?
    domain.present? || instance_domain.present?
  end

  def predefined_variables
    Gitlab::Ci::Variables::Collection.new.tap do |variables|
      if has_domain?
        variables.append(key: 'AUTO_DEVOPS_DOMAIN',
                         value: domain.presence || instance_domain)
      end

      if continuous?
        variables.append(key: 'STAGING_ENABLED', value: 1)
        variables.append(key: 'INCREMENTAL_ROLLOUT_ENABLED', value: 1)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0962800875273523, 'fraction_numerical': 0.00437636761487965, 'mean_word_length': 3.2534883720930234, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6064372', 'n_tokens_mistral': 583, 'n_tokens_neox': 564, 'n_words': 126}