Read about our upcoming Code of Conduct on this issue

  1. 22 Mar, 2018 1 commit
  2. 07 Mar, 2018 1 commit
  3. 05 Mar, 2018 1 commit
  4. 07 Feb, 2018 1 commit
  5. 10 Jan, 2018 1 commit
    • Jan Provaznik's avatar
      Denormalize commits count for merge request diffs · fc52079e6da2
      Jan Provaznik authored
      For each MR diff an extra 'SELECT COUNT()' is executed
      to get number of commits for the diff. Overall time to get counts for
      all MR diffs may be quite expensive. To speed up loading of MR info,
      information about number of commits is stored in a MR diff's extra column.
      Closes #38068
  6. 08 Jan, 2018 1 commit
  7. 05 Jan, 2018 1 commit
  8. 24 Dec, 2017 1 commit
  9. 28 Nov, 2017 1 commit
    • Sean McGivern's avatar
      Remove serialised diff and commit columns · 701b9ccc8a4b
      Sean McGivern authored
      The st_commits and st_diffs columns on merge_request_diffs historically held the
      YAML-serialised data for a merge request diff, in a variety of formats.
      Since 9.5, these have been migrated in the background to two new tables:
      merge_request_diff_commits and merge_request_diff_files. That has the advantage
      that we can actually query the data (for instance, to find out how many commits
      we've stored), and that it can't be in a variety of formats, but must match the
      new schema.
      This is the final step of that journey, where we drop those columns and remove
      all references to them. This is a breaking change to the importer, because we
      can no longer import diffs created in the old format, and we cannot guarantee
      the export will be in the new format unless it was generated after this commit.
  10. 06 Nov, 2017 1 commit
  11. 02 Nov, 2017 1 commit
  12. 01 Nov, 2017 1 commit
  13. 31 Oct, 2017 1 commit
  14. 13 Oct, 2017 1 commit
  15. 05 Oct, 2017 1 commit
  16. 04 Oct, 2017 1 commit
  17. 02 Oct, 2017 1 commit
  18. 20 Sep, 2017 1 commit
  19. 14 Sep, 2017 1 commit
  20. 06 Sep, 2017 3 commits
  21. 05 Sep, 2017 1 commit
  22. 04 Sep, 2017 2 commits
  23. 03 Sep, 2017 2 commits
  24. 10 Aug, 2017 1 commit
    • Yorick Peterse's avatar
      Migrate events into a new format · 20d17d1129f6
      Yorick Peterse authored
      This commit migrates events data in such a way that push events are
      stored much more efficiently. This is done by creating a shadow table
      called "events_for_migration", and a table called "push_event_payloads"
      which is used for storing push data of push events. The background
      migration in this commit will copy events from the "events" table into
      the "events_for_migration" table, push events in will also have a row
      created in "push_event_payloads".
      This approach allows us to reclaim space in the next release by simply
      swapping the "events" and "events_for_migration" tables, then dropping
      the old events (now "events_for_migration") table.
      The new table structure is also optimised for storage space, and does
      not include the unused "title" column nor the "data" column (since this
      data is moved to "push_event_payloads").
      == Newly Created Events
      Newly created events are inserted into both "events" and
      "events_for_migration", both using the exact same primary key value. The
      table "push_event_payloads" in turn has a foreign key to the _shadow_
      table. This removes the need for recreating and validating the foreign
      key after swapping the tables. Since the shadow table also has a foreign
      key to "" we also don't have to worry about orphaned rows.
      This approach however does require some additional storage as we're
      duplicating a portion of the events data for at least 1 release. The
      exact amount is hard to estimate, but for this is expected to
      be between 10 and 20 GB at most. The background migration in this commit
      deliberately does _not_ update the "events" table as doing so would put
      a lot of pressure on PostgreSQL's auto vacuuming system.
      == Supporting Both Old And New Events
      Application code has also been adjusted to support push events using
      both the old and new data formats. This is done by creating a PushEvent
      class which extends the regular Event class. Using Rails' Single Table
      Inheritance system we can ensure the right class is used for the right
      data, which in this case is based on the value of `events.action`. To
      support displaying old and new data at the same time the PushEvent class
      re-defines a few methods of the Event class, falling back to their
      original implementations for push events in the old format.
      Once all existing events have been migrated the various push event
      related methods can be removed from the Event model, and the calls to
      `super` can be removed from the methods in the PushEvent model.
      The UI and event atom feed have also been slightly changed to better
      handle this new setup, fortunately only a few changes were necessary to
      make this work.
      == API Changes
      The API only displays push data of events in the new format. Supporting
      both formats in the API is a bit more difficult compared to the UI.
      Since the old push data was not really well documented (apart from one
      example that used an incorrect "action" nmae) I decided that supporting
      both was not worth the effort, especially since events will be migrated
      in a few days _and_ new events are created in the correct format.
  25. 07 Aug, 2017 1 commit
  26. 26 Jul, 2017 1 commit
    • Sean McGivern's avatar
      Fix saving diffs that are not valid UTF-8 · c7b396c73939
      Sean McGivern authored
      Previously, we used Psych, which would:
      1. Check if a string was encoded as binary, and not ASCII-compatible.
      2. Add the !binary tag in that case.
      3. Convert to base64.
      We need to do the same thing, using a new column in place of the tag.
  27. 24 Jul, 2017 1 commit
  28. 20 Jul, 2017 1 commit
    • Timothy Andrew's avatar
      Handle errors while a project is being deleted asynchronously. · f136c01d1d1e
      Timothy Andrew authored
      1. Rescue all errors that `Projects::DestroyService` might throw, to prevent the
         worker from leaving things in an inconsistent state
      2. Unmark the project as `pending_delete`
      3. Add a `delete_error` text column to `projects`, and save the error message in
         there, to be shown to the project masters/owners.
  29. 11 Jul, 2017 1 commit
  30. 07 Jul, 2017 1 commit
  31. 06 Jul, 2017 1 commit
    • Sean McGivern's avatar
      Add table for merge request commits · b5835ae8e372
      Sean McGivern authored
      This is an ID-less table with just three columns: an association to the merge
      request diff the commit belongs to, the relative order of the commit within the
      merge request diff, and the commit SHA itself.
      Previously we stored much more information about the commits, so that we could
      display them even when they were deleted from the repo. Since 8.0, we ensure
      that those commits are kept around for as long as the target repo itself is, so
      we don't need to duplicate that data in the database.
  32. 05 Jul, 2017 1 commit
  33. 28 Jun, 2017 1 commit
  34. 16 Jun, 2017 1 commit
    • Sean McGivern's avatar
      Add table for files in merge request diffs · 5e72ebc31d73
      Sean McGivern authored
      This adds an ID-less table containing one row per file, per merge request
      diff. It has a column for each attribute on Gitlab::Git::Diff that is serialised
      currently, with the advantage that we can easily query the attributes of this
      new table.
      It does not migrate existing data, so we have fallback code when the legacy
      st_diffs column is present instead. For a merge request diff to be valid, it
      should have at most one of:
      * Rows in this new table, with the correct merge_request_diff_id.
      * A non-NULL st_diffs column.
      It may have neither, if the diff is empty.
  35. 05 Jun, 2017 2 commits