1. 04 May, 2018 5 commits
  2. 03 May, 2018 1 commit
  3. 02 May, 2018 4 commits
  4. 01 May, 2018 4 commits
  5. 30 Apr, 2018 12 commits
  6. 29 Apr, 2018 1 commit
    • blackst0ne's avatar
      [Rails5] Fix Arel::UpdateManager · 2be35b7fc4ea
      blackst0ne authored
      In Arel 7.0.0 (Arel 7.1.4 is used in Rails 5.0) the `engine` parameter
      of `Arel::UpdateManager#initializer` was removed.
      
      This commit makes the gitlab database helpers work both in rails 4 and
      rails 5.
      Fixes errors like this one:
      
      ```
      1) Gitlab::Database::MigrationHelpers#update_column_in_batches when running outside of a transaction updates all the rows in a table
          Failure/Error:
            update_arel = Arel::UpdateManager.new(ActiveRecord::Base)
              .table(table)
              .set([[table[column], value]])
              .where(table[:id].gteq(start_id))
      
          ArgumentError:
            wrong number of arguments (given 1, expected 0)
          # ./lib/gitlab/database/migration_helpers.rb:317:in `new'
          # ./lib/gitlab/database/migration_helpers.rb:317:in `block in update_column_in_batches'
          # ./lib/gitlab/database/migration_helpers.rb:307:in `loop'
          # ./lib/gitlab/database/migration_helpers.rb:307:in `update_column_in_batches'
          # ./spec/lib/gitlab/database/migration_helpers_spec.rb:367:in `block (4 levels) in <top (required)>'
      ```
      2be35b7fc4ea
  7. 28 Apr, 2018 1 commit
    • blackst0ne's avatar
      [Rails5] Fix TZInfo::InvalidTimezoneIdentifier exception · acf6276281a2
      blackst0ne authored
      In Rails 4.2.10 the `ActiveSupport::TimeZone.find_tzinfo(timezone_name)`
      method calls `TZInfo::TimezoneProxy.new(timezone_name)` which returns
      `timezone_name` if it is invalid.
      
      But in Rails 5.0 the `ActiveSupport::TimeZone.find_tzinfo(timezone_name)`
      method now calls the `TZInfo::Timezone.new(timezone_name)` method which
      throws the `TZInfo::InvalidTimezoneIdentifier: Invalid identifier`
      exception if `timezone_name` is invalid.
      
      This commit adds the rescue block to return timezone name if the
      exception is raised.
      
      Also this change fixes the error:
      
      ```
        1) Ci::PipelineSchedule validations does not allow invalid cron patters
           Failure/Error: ActiveSupport::TimeZone.find_tzinfo(timezone).name
      
           TZInfo::InvalidTimezoneIdentifier:
             Invalid identifier
           # ./lib/gitlab/ci/cron_parser.rb:28:in `timezone_name'
           # ./lib/gitlab/ci/cron_parser.rb:9:in `initialize'
           # ./app/validators/cron_validator.rb:6:in `new'
           # ./app/validators/cron_validator.rb:6:in `validate_each'
           # ./spec/models/ci/pipeline_schedule_spec.rb:26:in `block (3 levels) in <top (required)>'
      ```
      acf6276281a2
  8. 27 Apr, 2018 2 commits
  9. 26 Apr, 2018 2 commits
  10. 25 Apr, 2018 5 commits
  11. 24 Apr, 2018 3 commits