Go to file
Yorick Peterse 0395c47193
Migrate events into a new format
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 "projects.id" 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 GitLab.com 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.
2017-08-10 17:45:44 +02:00
.github
.gitlab Added a template for database changes 2017-08-10 13:04:08 +02:00
app Migrate events into a new format 2017-08-10 17:45:44 +02:00
bin Don't require stackprof in Gemfile 2017-08-09 10:10:33 +02:00
builds
changelogs Migrate events into a new format 2017-08-10 17:45:44 +02:00
config alternative route for download archive 2017-08-10 08:49:11 +00:00
db Migrate events into a new format 2017-08-10 17:45:44 +02:00
doc Migrate events into a new format 2017-08-10 17:45:44 +02:00
docker
features Migrate events into a new format 2017-08-10 17:45:44 +02:00
fixtures/emojis Added emoji description title to award emoji buttons 2017-04-24 14:24:48 +01:00
generator_templates Add remove_concurrent_index to database helper 2017-04-06 09:53:57 +11:00
lib Migrate events into a new format 2017-08-10 17:45:44 +02:00
locale Synchronous Korean translation in zanata 2017-08-09 09:27:10 +08:00
log
public Remove public/ci/favicon.ico 2017-07-12 10:13:47 +09:00
qa Fix new project selectors in GitLab QA 2017-07-21 12:13:27 +02:00
rubocop ini 2017-08-01 14:16:10 +09:00
scripts Remove test gitaly when older than version file 2017-08-03 10:15:08 +00:00
shared
spec Migrate events into a new format 2017-08-10 17:45:44 +02:00
tmp Move Prometheus presentation logic to PrometheusText 2017-06-02 19:45:58 +02:00
vendor Merge branch '15664-remove-jquery-nicescroll' into 'master' 2017-08-07 19:35:45 +00:00
.babelrc Update droplab 2017-04-07 13:57:03 +00:00
.codeclimate.yml Exclude more path from codeclimate job 2017-06-14 19:26:35 +03:00
.csscomb.json
.eslintignore Started internationalising cycyle analytics 2017-04-15 16:07:31 +01:00
.eslintrc Correct eslintrc comma dangle 2017-08-04 13:14:54 +01:00
.flayignore Store MergeWorker JID on merge request, and clean up stuck merges 2017-08-07 15:23:37 -03:00
.foreman
.gitignore Support multiple Redis instances based on queue type 2017-07-11 03:35:47 +00:00
.gitlab-ci.yml Re-enable SqlInjection and CommandInjection 2017-08-08 10:50:54 -04:00
.haml-lint.yml Add custom linter for inline JavaScript to haml_lint (!9742) 2017-08-07 11:37:16 +02:00
.mailmap
.nvmrc Update .nvmrc to 7.5 2017-06-22 13:43:59 +01:00
.pkgr.yml
.rubocop.yml Enable the Layout/SpaceBeforeBlockBraces cop 2017-08-09 11:52:22 +02:00
.rubocop_todo.yml Enable the Layout/SpaceBeforeBlockBraces cop 2017-08-09 11:52:22 +02:00
.ruby-version
.scss-lint.yml Merge branch 'enable-scss-lint-declaration-order' into 'master' 2017-07-12 20:40:26 +00:00
CHANGELOG.md fix missing changelog entries for security release on 2017-01-23 2017-08-04 17:57:08 -05:00
CONTRIBUTING.md Remove outdated ~Frontend label in CONTRIBUTING.md 2017-07-25 19:00:49 +02:00
GITALY_SERVER_VERSION Migrate Repository#find_commits_by_message to Gitaly 2017-08-07 18:57:06 +02:00
GITLAB_PAGES_VERSION Upgrade GitLab Pages to v0.5.0 2017-07-04 12:40:48 +01:00
GITLAB_SHELL_VERSION Bump gitlab-shell version to 5.8.0 to fix Git for Windows 2.14 2017-08-07 08:04:45 -07:00
GITLAB_WORKHORSE_VERSION Migrate Workhorse SendBlob to Gitaly 2017-07-11 16:55:00 +02:00
Gemfile Don't require stackprof in Gemfile 2017-08-09 10:10:33 +02:00
Gemfile.lock Updating Gemfile.lock for rubocop-rspec dependecy. 2017-08-09 11:13:15 +02:00
LICENSE Update LICENSE to 2017 2017-02-08 22:58:40 +00:00
MAINTENANCE.md
PROCESS.md Translations can be picked without asking for exceptions 2017-08-09 10:27:03 +01:00
Procfile
README.md fix javascript test coverage badge in README.md 2017-07-14 15:25:29 +00:00
Rakefile
VERSION Update VERSION to 9.5.0-pre 2017-07-22 06:55:36 +01:00
config.ru set ENV['prometheus_multiproc_dir'] in config/boot.rb instead of config.ru 2017-06-15 23:41:47 +02:00
doc_styleguide.md
docker-compose.yml
package.json Merge branch 'master' into ide 2017-08-07 22:44:47 -05:00
yarn.lock Merge branch 'master' into ide 2017-08-07 22:44:47 -05:00

README.md

GitLab

Build status Overall test coverage Code Climate Core Infrastructure Initiative Best Practices Gitter

Test coverage

  • Ruby coverage Ruby
  • JavaScript coverage JavaScript

Canonical source

The canonical source of GitLab Community Edition is hosted on GitLab.com.

Open source software to collaborate on code

To see how GitLab looks please see the features page on our website.

  • Manage Git repositories with fine grained access controls that keep your code secure
  • Perform code reviews and enhance collaboration with merge requests
  • Complete continuous integration (CI) and CD pipelines to builds, test, and deploy your applications
  • Each project can also have an issue tracker, issue board, and a wiki
  • Used by more than 100,000 organizations, GitLab is the most popular solution to manage Git repositories on-premises
  • Completely free and open source (MIT Expat license)

Hiring

We're hiring developers, support people, and production engineers all the time, please see our jobs page.

Editions

There are two editions of GitLab:

  • GitLab Community Edition (CE) is available freely under the MIT Expat license.
  • GitLab Enterprise Edition (EE) includes extra features that are more useful for organizations with more than 100 users. To use EE and get official support please become a subscriber.

Website

On about.gitlab.com you can find more information about:

Requirements

Please see the requirements documentation for system requirements and more information about the supported operating systems.

Installation

The recommended way to install GitLab is with the Omnibus packages on our package server. Compared to an installation from source, this is faster and less error prone. Just select your operating system, download the respective package (Debian or RPM) and install it using the system's package manager.

There are various other options to install GitLab, please refer to the installation page on the GitLab website for more information.

You can access a new installation with the login root and password 5iveL!fe, after login you are required to set a unique password.

Contributing

GitLab is an open source project and we are very happy to accept community contributions. Please refer to CONTRIBUTING.md for details.

Install a development environment

To work on GitLab itself, we recommend setting up your development environment with the GitLab Development Kit. If you do not use the GitLab Development Kit you need to install and setup all the dependencies yourself, this is a lot of work and error prone. One small thing you also have to do when installing it yourself is to copy the example development unicorn configuration file:

cp config/unicorn.rb.example.development config/unicorn.rb

Instructions on how to start GitLab and how to run the tests can be found in the getting started section of the GitLab Development Kit.

Software stack

GitLab is a Ruby on Rails application that runs on the following software:

  • Ubuntu/Debian/CentOS/RHEL/OpenSUSE
  • Ruby (MRI) 2.3
  • Git 2.8.4+
  • Redis 2.8+
  • PostgreSQL (preferred) or MySQL

For more information please see the architecture documentation.

UX design

Please adhere to the UX Guide when creating designs and implementing code.

Third-party applications

There are a lot of third-party applications integrating with GitLab. These include GUI Git clients, mobile applications and API wrappers for various languages.

GitLab release cycle

For more information about the release process see the release documentation.

Upgrading

For upgrading information please see our update page.

Documentation

All documentation can be found on docs.gitlab.com/ce/.

Getting help

Please see Getting help for GitLab on our website for the many options to get help.

Is it any good?

Yes

Is it awesome?

Thanks for asking this question Joshua. These people seem to like it.