An error occurred fetching the project authors.
  1. 10 Jul, 2019 1 commit
  2. 28 Jun, 2019 1 commit
  3. 19 Jun, 2019 2 commits
    • pjaspers's avatar
      Use correct arg name · 6f5daf49
      pjaspers authored
      So funny story, true story. I tried to run the test locally, but
      didn't make it past setting up Gitaly.
      
      Here's what I tried:
      
      First attempt:
      
      `git clone gitlab-ce`
      `cd gitlab-ce && bundle install`
      `be rspec`
      
      This didn't work because I was missing the config/database.yml, I
      didn't see a `script/bootstrap` so I looked in the readme which
      redirected me to a webpage which redirected me to the
      gitlab-development-kit.
      
      Second attempt:
      
      `gem install gitlab-development-kit`
      cd gitlab-development-kit
      gdk init
      gdk isntall
      
      This broke somwhere along the way because it couldn't install Gitaly
      because my go version was too low. But it did clone the gitlab repo
      again and this time it did have a config/database.yml.
      
      So I tried to cd into it and `be rspec
      spec/lib/gitlab/database/migration_helpers_spec.rb` which complained
      about the database not being configured so I:
      
      - Changed the socket to localhost (in the config/database.yml)
      - `createdb <dev_db>` `createdb test_db`
      - `be rake db:test:prepare`
      
      Great success, it was doing things! But then failed when it came at
      the Gitaly step.
      
      Since I only want to change these three lines, at the point I gave up
      and entrusted the pipeline to do its thing.
      
      What I would have liked:
      
      - A 'It's a Rails system, I know this' readme/docs (It's in there
        somewhere just couldn't find it)
      - A way to run tests without having to use Gitaly
      - Not having too install all the things for a small fix (I get why'd
        you want this, but to me it's overkill)
      6f5daf49
    • pjaspers's avatar
      Fix syntax coloring on emacs · 31438ddd
      pjaspers authored
      The rather cryptic:
      
            "fk_#{Digest::SHA256.hexdigest("#{table}_#{column}_fk").first(10)}"
      
      Was too much for emacs too handle*, since it was coming from the Rails
      codebase I took their way of doing the same thing and applied it here.
      
      I think it's easier to read and it also makes emacs render the
      migration helpers pretty again.
      
      * not true, emacs can handle anything, leave emacs alone!
      31438ddd
  4. 17 Jun, 2019 1 commit
  5. 07 May, 2019 1 commit
  6. 06 Apr, 2019 1 commit
  7. 14 Feb, 2019 1 commit
  8. 12 Feb, 2019 1 commit
  9. 11 Feb, 2019 1 commit
    • Felipe Artur's avatar
      Migrate issuable states to integer patch 1 · e9b84f50
      Felipe Artur authored
      Patch 1 that migrates issues/merge requests states from integer to string.
      On this commit we are only adding the state_id column and syncing it with a backgroud migration.
      
      On Patch 2 the code to use the new integer column will be deployed and the old column will be
      removed.
      e9b84f50
  10. 16 Dec, 2018 1 commit
  11. 07 Dec, 2018 1 commit
  12. 07 Nov, 2018 1 commit
    • gfyoung's avatar
      Enable even more frozen string in lib/gitlab · 7e6f6e16
      gfyoung authored
      Enables frozens string for the following:
      
      * lib/gitlab/conflict/**/*.rb
      * lib/gitlab/cross_project_access/**/*.rb
      * lib/gitlab/cycle_analytics/**/*.rb
      * lib/gitlab/data_builder/**/*.rb
      * lib/gitlab/database/**/*.rb
      * lib/gitlab/dependency_linker/**/*.rb
      * lib/gitlab/diff/**/*.rb
      * lib/gitlab/downtime_check/**/*.rb
      * lib/gitlab/email/**/*.rb
      * lib/gitlab/etag_caching/**/*.rb
      
      Partially addresses gitlab-org/gitlab-ce#47424.
      7e6f6e16
  13. 01 Nov, 2018 1 commit
  14. 21 Sep, 2018 1 commit
  15. 13 Sep, 2018 1 commit
  16. 11 Aug, 2018 1 commit
    • Gabriel Mazetto's avatar
      disable_statement_timeout doesn't require any argument anymore · f21e655b
      Gabriel Mazetto authored
      it will decide the method for disable statement_timeout upon
      per transaction or per session, based on how it's called.
      
      When calling with a block, block will be executed and it will use
      session based statement_timeout, otherwise will default to existing
      behavior.
      f21e655b
  17. 10 Aug, 2018 1 commit
    • Gabriel Mazetto's avatar
      MigrationHelper `disable_statement_timeout` accepts `transaction: false` · 09e7c75d
      Gabriel Mazetto authored
      By default statement_timeout will only be enabled during transaction
      lifetime, therefore not leaking outside of it.
      
      With `transaction: false` it will set for entire session, but requires
      a block to passed. It yields control and cleans up session after block
      finishes, also preventing leaking outside of it.
      09e7c75d
  18. 06 Aug, 2018 1 commit
    • Yorick Peterse's avatar
      Respond to DB health in background migrations · 91b752dc
      Yorick Peterse authored
      This changes the BackgroundMigration worker so it checks for the health
      of the DB before performing a background migration. This in turn allows
      us to reduce the minimum interval, without having to worry about blowing
      things up if we schedule too many migrations.
      
      In this setup, the BackgroundMigration worker will reschedule jobs as
      long as the database is considered to be in an unhealthy state. Once the
      database has recovered, the migration can be performed.
      
      To determine if the database is in a healthy state, we look at the
      replication lag of any replication slots defined on the primary. If the
      lag is deemed to great (100 MB by default) for too many slots, the
      migration is rescheduled for a later point in time.
      
      The health checking code is hidden behind a feature flag, allowing us to
      disable it if necessary.
      91b752dc
  19. 26 Jun, 2018 1 commit
  20. 29 Apr, 2018 1 commit
    • blackst0ne's avatar
      [Rails5] Fix Arel::UpdateManager · 54124fc6
      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)>'
      ```
      54124fc6
  21. 05 Apr, 2018 1 commit
  22. 28 Mar, 2018 1 commit
  23. 20 Mar, 2018 2 commits
  24. 14 Mar, 2018 1 commit
    • Andreas Brandl's avatar
      Fix concurrency issue with migration for user_interacted_projects table. · 5f35ea14
      Andreas Brandl authored
      The concurrency issue originates from inserts on
      `user_interacted_projects` from the app while running the post-deploy
      migration.
      
      This change comes with a strategy to lock the table while removing
      duplicates and creating the unique index (and similar for FK
      constraints).
      
      Also, we'll have a non-unique index until the post-deploy migration is
      finished to speed up queries during that time.
      
      Closes #44205.
      5f35ea14
  25. 18 Jan, 2018 1 commit
    • Yorick Peterse's avatar
      Reduce UPDATEs for background column type changes · 0054d383
      Yorick Peterse authored
      Prior to this commit we would essentially update all rows in a table,
      even those where the source column (e.g. `issues.closed_at`) was NULL.
      This in turn could lead to statement timeouts when using the default
      batch size of 10 000 rows per job.
      
      To work around this we don't schedule jobs for rows where the source
      value is NULL. We also don't update rows where the source column is NULL
      (as an extra precaution) or the target column already has a non-NULL
      value. Using this approach it should be possible to update 10 000 rows
      in the "issues" table in about 7.5 - 8 seconds.
      
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/42158
      0054d383
  26. 11 Jan, 2018 1 commit
  27. 05 Jan, 2018 1 commit
    • Yorick Peterse's avatar
      Run background migrations with a minimum interval · 7f30bb9c
      Yorick Peterse authored
      This adds a minimum interval to BackgroundMigrationWorker, ensuring
      background migrations of the same class only run once every 5 minutes.
      This prevents a thundering herd problem where scheduled migrations all
      run at once due to their delays having been expired (e.g. as the result
      of a queue being paused for a long time).
      
      If a job was recently executed it's rescheduled with a delay that equals
      the remaining time of the job's lease. This means that if the lease
      expires in two minutes we only need to wait two minutes, instead of
      five.
      
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/41624
      7f30bb9c
  28. 03 Jan, 2018 1 commit
    • Yorick Peterse's avatar
      Use a background migration for issues.closed_at · 78d22fb2
      Yorick Peterse authored
      In a previous attempt (rolled back in
      https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16021) we tried
      to migrate `issues.closed_at` from timestamp to timestamptz using a
      regular migration. This has a bad impact on GitLab.com and as such was
      rolled back.
      
      This commit re-implements the original migrations using generic
      background migrations, allowing us to still migrate the data in a single
      release but without a negative impact on availability.
      
      To ensure the database schema is up to date the background migrations
      are performed inline in development and test environments. We also make
      sure to not migrate that that doesn't need migrating in the first place
      or has already been migrated.
      78d22fb2
  29. 05 Dec, 2017 1 commit
  30. 17 Nov, 2017 1 commit
  31. 14 Sep, 2017 2 commits
  32. 29 Aug, 2017 1 commit
    • Yorick Peterse's avatar
      Improve migrations using triggers · 5eab624d
      Yorick Peterse authored
      This adds a bunch of checks to migrations that may create or drop
      triggers. Dropping triggers/functions is done using "IF EXISTS" so we
      don't throw an error if the object in question has already been dropped.
      We now also raise a custom error (message) when the user does not have
      TRIGGER privileges. This should prevent the schema from entering an
      inconsistent state while also providing the user with enough information
      on how to solve the problem.
      
      The recommendation of using SUPERUSER permissions is a bit extreme but
      we require this anyway (Omnibus also configures users with this
      permission).
      
      Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36633
      5eab624d
  33. 23 Aug, 2017 1 commit
  34. 22 Aug, 2017 1 commit
  35. 20 Aug, 2017 1 commit
    • Stan Hu's avatar
      Fix Error 500s when attempting to destroy a protected tag · 718ecd4e
      Stan Hu authored
      Due to a missing `on_delete: :cascade`, users would hit the error that
      looked like:
      
      ```
      PG::ForeignKeyViolation: ERROR: update or delete on table "protected_tags"
      violates foreign key constraint "fk_rails_f7dfda8c51" on table
      "protected_tag_create_access_levels" DETAIL: Key (id)=(1385) is still
      referenced from table "protected_tag_create_access_levels". : DELETE FROM
      "protected_tags" WHERE "protected_tags"."id" = 1385
      ```
      
      Closes #36013
      718ecd4e
  36. 18 Jul, 2017 1 commit
  37. 07 Jul, 2017 1 commit