Commit Graph

321 Commits

Author SHA1 Message Date
Kamil Trzciński e00e62c2c8 Merge branch 'backstage/gb/migrate-stages-statuses' into 'master'
Migrate CI/CD stages statuses

Closes #33453

See merge request !12584
2017-08-21 11:47:44 +00:00
Douwe Maan 91d3e6d901 Merge branch 'ee-2628-backport-to-ce' into 'master'
Backports EE mirror stuck handling feature…

See merge request !13627
2017-08-17 13:53:39 +00:00
Tiago Botelho f865b1b459 Backports EE mirror stuck handling feature (https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2628) to CE 2017-08-17 13:38:05 +01:00
Douwe Maan ba7251fefd Only create commit GPG signature when necessary 2017-08-16 18:57:50 +02:00
Grzegorz Bizon 32d0983a4e Merge branch 'master' into backstage/gb/migrate-stages-statuses
* master: (1000 commits)
  Fix username autocomplete group name with no avatar alignment
  Fix 'Projected tags' typo in protected_tags_spec.rb
  Many Repo Fixes
  Repo Editor Fixes
  Docs: New index for permissions
  link article from CI index
  link tech articles from the landing page
  new articles come first
  fix relative link
  fix date format
  Fixed changed files dropdown not being shown
  Update publication date
  Remove deprecated field from workhorse API responses
  Fix API responses when dealing with txt files
  Make sure MySQL would not use CURRENT_TIMESTAMP
  Add two more project templates
  Allow usage of any_projects? with an Array
  Copyedit Artifactory and GitLab article
  Rename Artifactory and GitLab article file
  Display GPG status loading spinner only when Ajax request is made
  ...
2017-08-16 13:18:03 +02:00
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
Rémy Coutable c946ee1282
Enable the Layout/SpaceBeforeBlockBraces cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-08-09 11:52:22 +02:00
Stan Hu fd40bce9cc Merge branch '31207-clean-locked-merge-requests' into 'master'
Resolve "Store MergeWorker JID on merge request, and clean up stuck merges"

Closes #31207

See merge request !13207
2017-08-08 01:47:48 +00:00
Sean McGivern c94990820a Merge branch '32844-issuables-performance' into 'master'
Issuables: Move some code from create services to Sidekiq workers

See merge request !13326
2017-08-07 21:21:29 +00:00
Oswaldo Ferreira 0640b3d1d8 Store MergeWorker JID on merge request, and clean up stuck merges 2017-08-07 15:23:37 -03:00
Jarka Kadlecova 9ef3c431e4 Move some after_create parts to worker to improve performance 2017-08-07 15:57:56 +02:00
Lin Jen-Shin bb5f79d43e Don't include EmailHelpers manually, pick with rspec
`:mailer` is needed to pick it easily, while
`type: :mailer` is needed for picking it automatically for
tests located in spec/mailers/*_spec.rb

It's a bit complicated in spec/services/notification_service_spec.rb
but we'll leave it alone for now.
2017-08-03 21:55:48 +08:00
Sean McGivern 27d34789c9 Merge branch '28472-ignore-auto-generated-mails' into 'master'
Don't send rejection mails for all auto-generated mails

Closes #28472

See merge request !13254
2017-08-03 12:41:16 +00:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Lin Jen-Shin f097e4dbcd Don't send rejection mails for all auto-generated mails
Also make it easier to have mailer helper
2017-08-03 00:40:10 +08:00
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Gabriel Mazetto 597e619080 Rename ensure_dir_exist -> ensure_storage_path_exist 2017-08-01 07:44:25 +02:00
Grzegorz Bizon cec2cc3ffa Add specs for stage update worker 2017-07-31 12:07:05 +02:00
Sean McGivern 15d00fc3d3 Merge branch 'gitaly-398-git-garbage-collect' into 'master'
Migrate GitGarbageCollectWorker to Gitaly

Closes gitaly#398

See merge request !12975
2017-07-31 07:57:23 +00:00
Kim "BKC" Carlbäcker 05f90b861f Migrate GitGarbageCollectWorker to Gitaly 2017-07-28 17:49:22 +02:00
Alexis Reigel 7f7e93a344 remove log statements from workers 2017-07-27 15:46:04 +02:00
Alexis Reigel e63b693f28 generate gpg signature on push 2017-07-27 15:43:37 +02:00
Alexis Reigel 9816856d05 perform signature update in sidekiq worker 2017-07-27 15:43:36 +02:00
Sean McGivern 5de3ec64da Merge branch '29289-project-destroy-clean-up-after-failure' into 'master'
Handle errors while a project is being deleted asynchronously.

Closes #29289

See merge request !11088
2017-07-26 12:49:54 +00:00
Tiago Botelho b5bdc55d23 Move exception handling to execute 2017-07-26 12:47:50 +01:00
Tiago Botelho 3491b19a4e Add specs for ProjectDestroyWorker 2017-07-20 09:59:56 +01:00
Lin Jen-Shin 65e722ee97 Merge remote-tracking branch 'upstream/master' into 30634-protected-pipeline
* upstream/master: (638 commits)
  Simplify background migrations stealing code
  Expire cached user IDs that can see the performance after 5 minutes
  Promote visibility level helpers from Group to Namespace
  Fix off-by-one error in background migration retries
  Recover from all exceptions when stealing bg migration
  Fix label creation from new list for subgroup projects
  move click handler to button. when on the icon it wasn't triggered in firefox
  Fix incorrect AWS ELB metrics.
  Fix wrong link to docs in docs styleguide
  Update issue-related docs
  Refactor groups docs
  Add subgroups limitations to Pages docs
  Update Google launcher details
  Split docs on IP whitelist for monitoring access
  Update health check docs
  Bump fog-core to 1.44.3 and fog providers' plugins to latest
  Introduce have_gitlab_http_status
  Remove Repository#search_files
  Update Pipeline's badge count in Merge Request and Commits view to match real-time content
  Fixes the user order being overriden in the autocomplete controller
  ...
2017-07-17 22:38:37 +08:00
Paul Charlton cb3b4a15e6 Support multiple Redis instances based on queue type 2017-07-11 03:35:47 +00:00
Grzegorz Bizon b7b3aef444 Merge remote-tracking branch 'origin/active-record-each-batch' into fix/gb/stage-id-reference-background-migration
* origin/active-record-each-batch: (59 commits)
  Added EachBatch for iterating tables in batches
  Extend MR tabs a bit to cover up the avatar holder and collapse icon on scroll
  Update VERSION to 9.4.0-pre.
  Add CHANGELOG
  Fix some N+1 queries in the GET /projects API
  Don't show auxiliary blob viewer for README when there is no wiki
  Improve & fix the performance bar UI and behavior
  Remove orphaned haml files
  Fixed CHANGELOG.md for 9.3.4 release
  Add table for merge request commits
  34727 Remove two columned layout from project member settings
  Just draw :legacy_builds
  Re-enable polling for environments
  Cleanup minor UX issues in the performance dashboard
  Upgrade GitLab Workhorse to v2.3.0
  Added test for the chart legend
  Use correct field for label name, fix default for unit to be blank
  Fix shorter route helpers in production environment
  Encode certificate-authority-data in base64
  Revert "Merge branch 'winh-mr-widget-no-pipeline' into 'master'"
  ...
2017-07-07 15:08:24 +02:00
Grzegorz Bizon 945cdf326e Make it possible to schedule bg migrations in bulk 2017-07-07 15:08:15 +02:00
Yorick Peterse c63e322158
Add many foreign keys to the projects table
This removes the need for relying on Rails' "dependent" option for data
removal, which is _incredibly_ slow (even when using :delete_all) when
deleting large amounts of data. This also ensures data consistency is
enforced on DB level and not on application level (something Rails is
really bad at).

This commit also includes various migrations to add foreign keys to
tables that eventually point to "projects" to ensure no rows get
orphaned upon removing a project.
2017-07-06 12:01:36 +02:00
Lin Jen-Shin c6bed06533 Merge remote-tracking branch 'upstream/master' into 30634-protected-pipeline
* upstream/master: (1168 commits)
  Job details won't scroll horizontally to show long lines
  Bring back branches badge to main project page
  Limit OpenGraph image size to 64x64
  Improve changelog
  Split up MergeRequestsController
  Add parent_id back to the tests
  Make changelog more descriptive
  Improve tests text
  Rename members_count to members_count_with_descendants and expose only to group admins
  Fix a bug where an invalid sort param value was passed to Gitaly
  Drop default ORDER scope when calling a find method on a Sortable model
  Add tests for project import state transition: [:started] => [:finished]
  Add CHANGELOG
  Perform housekeeping only when an import of a fresh project is completed
  Strip trailing whitespace in relative submodule URL
  Adjust projects spec on namespace fields
  Add "members_count" and "parent_id" data on namespaces API
  Removes redundant pending delete checks
  Fix gitaly ref encoding bugs
  Add ProjectWiki#ensure_repository
  ...
2017-06-29 21:14:47 +08:00
Alejandro Rodríguez e7470534e5 Use gl_repository exclusively as identifier on post-receive 2017-06-27 19:20:20 -04:00
Grzegorz Bizon 0430b76441 Enable Style/DotPosition Rubocop 👮 2017-06-21 13:48:12 +00:00
Michael Kozono af784cc6e2 Add “Project moved” error to Git-over-SSH 2017-06-16 14:14:19 -07:00
Robert Speicher a6ec5121f0 Correct RSpec/SingleLineHook cop offenses 2017-06-14 13:18:56 -05:00
Yorick Peterse d83ee2bbd1
Add the ability to perform background migrations
Background migrations can be used to perform long running data
migrations without these blocking a deployment procedure.

See MR https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11854 for
more information.
2017-06-12 13:24:04 +02:00
Robert Speicher c28ba5aa72 Merge branch 'port-post-receive-changes' into 'master'
Refactor PostReceive worker to limit merge conflicts

See merge request !11916
2017-06-08 22:39:28 +00:00
Lin Jen-Shin e86e1e515a Try to report why it's failing and fix tests 2017-06-06 21:19:07 +08:00
Douwe Maan 9464456597 Merge branch 'pull-mirror-overhaul-ce-backport' into 'master'
backports changed import logic from pull mirroring feature into CE

See merge request !11850
2017-06-05 23:40:53 +00:00
Douglas Barbosa Alexandre 3fd02428d4 Refactor PostReceive worker to limit merge conflicts 2017-06-05 20:37:52 -03:00
Tiago Botelho 810866ecb6 backports changed import logic from pull mirroring feature into CE 2017-06-05 23:09:10 +01:00
Taurie Davis, Simon Knox and Adam Niedzielski 26dde5f55f Add Conversational Development Index page to admin panel 2017-06-01 17:37:21 +02:00
Kamil Trzcinski 161af17c1b Introduce source to pipeline entity 2017-05-31 14:17:49 +02:00
Douwe Maan 67ea638921 Merge branch 'issue_19262' into 'master'
Prevent commits from upstream repositories to be re-processed by forks

Closes #19262

See merge request !11511
2017-05-25 18:59:35 +00:00
Felipe Artur 0054963544 Remove unecessary commit pattern check 2017-05-25 12:13:32 -03:00
Dmitriy Zaporozhets 1ed7b7629a Merge branch '17848-web-hook-logging' into 'master'
Implement Web Hooks calls logging

Closes #17848

See merge request !11027
2017-05-25 13:26:12 +00:00
Alexander Randa 330789c23c Implement web hooks logging
* implemented logging of project and system web hooks
* implemented UI for user area (project hooks)
* implemented UI for admin area (system hooks)
* implemented retry of logged webhook
* NOT imeplemented log remover
2017-05-25 10:07:52 +03:00
Felipe Artur e44016b90a Prevent commits from upstream repositories to be re-processed by forks 2017-05-22 17:43:27 -03:00
Z.J. van de Weg 336635f283 Test the ExpireJobCacheWorker and related changes
These were untested by the cherry picked commit.
2017-05-22 22:07:11 +02:00