<commit_before>class BuildPart < ActiveRecord::Base
  belongs_to :build_instance, :class_name => "Build", :foreign_key => "build_id", :inverse_of => :build_parts    # using build_instance because AR defines #build for associations, and it wins
  has_many :build_attempts, :dependent => :destroy, :inverse_of => :build_part
  has_one :project, :through => :build_instance
  has_one :last_attempt, :class_name => "BuildAttempt", :order => "id DESC"
  has_one :last_completed_attempt, :class_name => "BuildAttempt", :conditions => ['state in (?)', BuildAttempt::COMPLETED_BUILD_STATES], :order => 'id DESC'
  validates_presence_of :kind, :paths

  serialize :paths, Array
  serialize :options, Hash

  def create_and_enqueue_new_build_attempt!
    build_attempt = build_attempts.create!(:state => :runnable)
    build_instance.running!

    # TODO: this is a hack, please fix the following and restore this code to it's former glory.
    # We need to do 2 things before enabling this:
    # 1) update the ssh key on ec2 builders
    # 2) get more space on the ec2 builders
    if build_instance.repository.use_spec_and_ci_queues
      BuildAttemptJob.enqueue_on("#{build_instance.queue}-#{self.kind}", job_args(build_attempt))
    else
      # TODO: hopefully this is only temporary while we work to make these tests less flaky
      # franklin should only be in this list until we get chromedriver installed on EC2
      # cogs/cogs-hbase should be in this list until we get hbase installed on EC2
      if (kind == "maven" && (paths.include?("franklin") ||
                              paths.include?("cogs/cogs-hbase") ||
                              paths.include?("sake/rpc") ||
                              paths.include?("clustering/zookeeper") ||
                              paths.include?("bletchley") ||
                              paths.include?("searle")))<commit_msg>add matador to os-x build exception list<commit_after>class BuildPart < ActiveRecord::Base
  belongs_to :build_instance, :class_name => "Build", :foreign_key => "build_id", :inverse_of => :build_parts    # using build_instance because AR defines #build for associations, and it wins
  has_many :build_attempts, :dependent => :destroy, :inverse_of => :build_part
  has_one :project, :through => :build_instance
  has_one :last_attempt, :class_name => "BuildAttempt", :order => "id DESC"
  has_one :last_completed_attempt, :class_name => "BuildAttempt", :conditions => ['state in (?)', BuildAttempt::COMPLETED_BUILD_STATES], :order => 'id DESC'
  validates_presence_of :kind, :paths

  serialize :paths, Array
  serialize :options, Hash

  def create_and_enqueue_new_build_attempt!
    build_attempt = build_attempts.create!(:state => :runnable)
    build_instance.running!

    # TODO: this is a hack, please fix the following and restore this code to it's former glory.
    # We need to do 2 things before enabling this:
    # 1) update the ssh key on ec2 builders
    # 2) get more space on the ec2 builders
    if build_instance.repository.use_spec_and_ci_queues
      BuildAttemptJob.enqueue_on("#{build_instance.queue}-#{self.kind}", job_args(build_attempt))
    else
      # TODO: hopefully this is only temporary while we work to make these tests less flaky
      # franklin should only be in this list until we get chromedriver installed on EC2
      # cogs/cogs-hbase should be in this list until we get hbase installed on EC2
      # matador is on this list because it fails on ec2 because of a database null field not being null
      if (kind == "maven" && (paths.include?("franklin") ||
                              paths.include?("cogs/cogs-hbase") ||
                              paths.include?("matador") ||
                              paths.include?("sake/rpc") ||
                              paths.include?("clustering/zookeeper") ||
                              paths.include?("bletchley") ||
                              paths.include?("searle")))
{'fraction_non_alphanumeric': 0.10308236483072258, 'fraction_numerical': 0.0037897928246589186, 'mean_word_length': 3.1025906735751296, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '6852945', 'n_tokens_mistral': 1182, 'n_tokens_neox': 1127, 'n_words': 351}