Commit Graph

324 Commits

Author SHA1 Message Date
Maxim Rydkin e83a818751
adds changelog
fix CI

fix CI
2017-09-12 22:32:02 +03:00
Kamil Trzcinski 12ddc28f84 Merge remote-tracking branch 'origin/master' into zj/gitlab-ce-zj-auto-devops-table 2017-09-07 18:03:20 +02:00
Sean McGivern 4ae8e20c9c Merge branch 'events-migration-cleanup' into 'master'
Finish migration to the new events setup

Closes #37241

See merge request !13932
2017-09-07 15:33:54 +00:00
Yorick Peterse 235b105c91
Finish migration to the new events setup
This finishes the procedure for migrating events from the old format
into the new format. Code no longer uses the old setup and the database
tables used during the migration process are swapped, with the old table
being dropped.

While the database migration can be reversed this will 1) take a lot of
time as data has to be coped around 2) won't restore data in the
"events.data" column as we have no way of restoring this.

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/37241
2017-09-06 16:40:31 +02:00
Zeger-Jan van de Weg 8189347b49
Merge branch 'master' into zj-auto-devops-table 2017-09-06 15:16:38 +02:00
Douwe Maan 9985296521 Merge branch 'AshleyDumaine/gitlab-ce-36994-toggle-for-automatically-collapsing-outdated-diff-comments' into 'master'
Add setting to collapse outdated diff comments on push

Closes #36994

See merge request !14053
2017-09-06 11:57:16 +00:00
Douwe Maan c1af169f1a Merge branch 'fix/import-export-performance' into 'master'
Improve Import/Export memory use and performance

Closes #35389 and #26556

See merge request !13957
2017-09-06 11:55:28 +00:00
Sean McGivern b40941db14 Fix note resolution specs 2017-09-06 10:10:16 +01:00
Ashley Dumaine ef4b3a39bc Add functionality to collapse outdated diff comments regardless of discussion resolution 2017-09-06 10:07:46 +01:00
Rubén Dávila 66cfb901c0 Optimize SQL queries used in Groups::GroupMembersController#create
The following optimizations were performed:

- Add new association to GroupMember and ProjectMember

  This new association will allow us to check if a user is a member of a
  Project or Group through a single query instead of two.

- Optimize retrieving of Members when adding multiple Users
2017-09-05 15:54:07 -05:00
James Lopez 104f221b60 fix specs 2017-09-05 21:06:27 +02:00
James Lopez 1d57ae8f84 fix typo 2017-09-05 17:47:45 +02:00
James Lopez d8d05e5f28 refactor code a little 2017-09-05 17:47:45 +02:00
James Lopez 4119206f76 fix export performance of CI builds 2017-09-05 17:47:45 +02:00
Shinya Maeda 68f6c61cf6 - Allow runner API to pass failure_reason
- Fix spec
2017-09-05 14:30:28 +09:00
Zeger-Jan van de Weg bcd70c4c46
Incorporate review 2017-09-04 15:44:46 +02:00
Zeger-Jan van de Weg 78dad4cf32
Fix tests 2017-09-04 09:27:09 +02:00
Shinya Maeda f3d3cecf5a Fix schema. Add safe_model_attributes for pipelines 2017-09-03 23:49:10 +09:00
Shinya Maeda 1925bfd2a5 Fix spec 2017-09-03 23:49:10 +09:00
Zeger-Jan van de Weg 770bcf71bb
Form for setting project auto devops settings 2017-08-31 22:25:26 +02:00
James Lopez 49495fe63d fix spec 2017-08-28 15:24:24 +02:00
Jacob Vosmaer bc97931e2d Fix Hook.new call sites in tests 2017-08-23 10:45:20 +02:00
James Lopez e163c83b48 fix static analysis 2017-08-22 09:42:24 +02:00
James Lopez ac53067b64 fix specs 2017-08-22 08:59:01 +02:00
James Lopez fb9bd552c9 Fix fork MRs importing issue 2017-08-21 16:39:28 +02:00
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
Felipe Artur 91035871d3 Fix project import to group when there are project milestones 2017-08-17 10:40:19 +00:00
Grzegorz Bizon 1066d8ba77 Use usual method to retrieve CI/CD stage statuses 2017-08-16 13:30:49 +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
Sean McGivern e80a893ff0 Merge branch 'split-events-into-push-events' into 'master'
Use a separate table for storing push events

See merge request !12463
2017-08-11 14:40:03 +00:00
James Edwards-Jones 334915d508 Merge branch 'import-symlinks-9-3' into 'security-9-3'
Fix file disclosure via hidden symlinks using the project import (9.3)

See merge request !2164
2017-08-10 20:42:01 +01: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
Oswaldo Ferreira 0640b3d1d8 Store MergeWorker JID on merge request, and clean up stuck merges 2017-08-07 15:23:37 -03:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Gabriel Mazetto abb878326c Rename many path_with_namespace -> full_path 2017-08-01 07:26:58 +02:00
Grzegorz Bizon 8f1274ae03 Merge commit '9a3b283402b8cc1c86802c526f19a459ce09c2e3' into backstage/gb/migrate-stages-statuses
* commit '9a3b283402b8cc1c86802c526f19a459ce09c2e3': (270 commits)
  Add a note about EFS and GitLab log files
  Projects logo are not centered vertically on projects page
  Fix spec/features/projects/branches_spec
  Fixup POST /v3/:id/hooks and PUT /v3/:id/hooks/:hook_id
  Fix a spec that was assuming to be on the wrong page
  Add copy about search terms to ux guide
  Update documentation of user creation by replacing the 'confirm' param with 'skip_confirmation'
  Fix replying to commit comments on MRs from forks
  Fix 500 error when rendering avatar for deleted project creator
  Load and process at most 100 commits when pushing into default branch
  Ensure Gitlab::Application.routes.default_url_options are set correctly in Capybara + :js specs
  Add log messages to clarify log messages about API CSRF token verification failure
  Update gitlab_flow.md, Teatro seems to be completely dead, see also https://forum.gitlab.com/t/gitlab-flow-documentation-teatro/7774
  Fix diff commenting results just after changing view
  Update CHANGELOG.md for 9.4.2
  none is not a CSS Value for sizes ;-)
  Merge issuable "reopened" state into "opened"
  Make access level more compatible with EE
  Add link to JIRA article in docs
  Expand pipeline_trigger_service_spec by godfat request
  ...
2017-07-31 10:50:10 +02:00
Shinya Maeda 56418e85ac init 2017-07-28 18:13:29 +09:00
Rémy Coutable ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Sean McGivern 2e483ca9e3 Merge branch 'rc/fix-tests-factories' into 'master'
Fix the :project factory by not copying the test repo twice

See merge request !13123
2017-07-27 08:55:53 +00:00
Rémy Coutable 05e152fa7f
Fix the :project factory by not copying the test repo twice
Also, fixing some calls to the :project factory with the :test_repo
trait since this trait is already included in the :project factory.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 09:58:06 +02:00
Sean McGivern 396b8f91ec Fix saving diffs that are not valid UTF-8
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.
2017-07-26 15:34:57 +01:00
Grzegorz Bizon c14bd53d74 Fix import/export for CI/CD stage commit statuses 2017-07-24 14:13:29 +02:00
Grzegorz Bizon d3814ad698 Adds some specs for stage optimistic locking 2017-07-24 11:22:01 +02:00
Timothy Andrew 72a85ae9ac Handle errors while a project is being deleted asynchronously.
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.
2017-07-20 09:56:52 +01:00
Grzegorz Bizon 6e9924a224 Add a new stage status column to safe attributes 2017-07-11 11:56:15 +02:00
Kamil Trzciński a77158ff31 Merge branch 'feature/intermediate/32568-adding-variables-to-pipelines-schedules' into 'master'
Add variables to pipelines schedules

Closes #32568

See merge request !12372
2017-07-07 15:17:02 +00:00
Felipe Artur b5f596c3ff Native group milestones 2017-07-07 15:08:49 +00:00
Shinya Maeda 08fba1327f merge from master 2017-07-07 16:12:13 +09:00