Commit Graph

6860 Commits

Author SHA1 Message Date
Kim Carlbäcker 8cbabe43be Update repository.rb 2018-05-04 11:27:08 +00:00
Kim Carlbäcker 3fe555a751 Add note about rebase/squash duplication in Gitaly 2018-05-04 10:45:20 +00:00
Fabio Busatto 1d74a0e93a Resolve "Reconcile project templates with Auto DevOps" 2018-05-04 09:48:53 +00:00
Douwe Maan 639cf5617f Merge branch 'zj-fork-opt-out' into 'master'
Forking repositories is handled by Gitaly by default

See merge request gitlab-org/gitlab-ce!18679
2018-05-03 08:12:04 +00:00
Robert Speicher 6b93fafb56 Merge branch 'zj-repo-checksum-opt-out' into 'master'
Compute repository checksum by default

Closes gitaly#1146

See merge request gitlab-org/gitlab-ce!18648
2018-05-02 18:45:29 +00:00
Tim Zallmann 77c473893d Optimize Emoji Sprite Handling 2018-05-02 18:23:17 +00:00
Zeger-Jan van de Weg 2bbfa4cc66
Forking repositories is handled by Gitaly by default
Initial Rails implementation was introduced in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16018, and
acceptance testing was done in
https://gitlab.com/gitlab-org/gitaly/issues/881

Part of https://gitlab.com/gitlab-org/gitaly/issues/817
2018-05-02 18:29:39 +02:00
Zeger-Jan van de Weg 12be728b17
Remove old GitLab Shell implementation
Moves the calls to Gitaly, no matter what the feature flag values are.
2018-05-02 11:54:43 +02:00
Alexis Reigel ( 🌴 may 2nd - may 9th 🌴 ) 9b33e3d36f Display and revoke active sessions 2018-05-02 08:08:16 +00:00
Rémy Coutable 415bf587f2 Merge branch 'blackst0ne-rails5-fix-arel-update-manager' into 'master'
[Rails5] Fix Arel::UpdateManager

See merge request gitlab-org/gitlab-ce!18641
2018-05-02 08:00:27 +00:00
Rémy Coutable 3f9bfb0ccc Merge branch 'blackst0ne-rails5-fix-tzinfo-invalid-timezone-identifier' into 'master'
[Rails5] Fix `TZInfo::InvalidTimezoneIdentifier` exception

See merge request gitlab-org/gitlab-ce!18640
2018-05-02 07:58:43 +00:00
Kamil Trzciński 8b0b4ecee2 Merge branch 'backstage/gb/migrate-pipeline-stages-index' into 'master'
Migrate pipeline stages indices

Closes #43009

See merge request gitlab-org/gitlab-ce!18420
2018-05-02 07:28:15 +00:00
Douwe Maan 202c100d5a Merge branch 'osw-use-cached-highlighted-content-for-discussions' into 'master'
Use persisted diff data instead fetching Git on discussions

Closes #44052

See merge request gitlab-org/gitlab-ce!18657
2018-05-01 15:11:21 +00:00
Kamil Trzciński 1134f540d2 Merge branch 'helm-add-alpine-mirrors' into 'master'
Add alpine mirrors while operating on k8s cluster

Closes gitlab-ee#4922

See merge request gitlab-org/gitlab-ce!18651
2018-05-01 13:08:59 +00:00
Jan Provaznik 7a76caa5a8 Merge request and commit discussions API 2018-05-01 12:39:44 +00:00
Grzegorz Bizon 0fd0b64be6 Use stages position column to track stage index 2018-05-01 14:30:44 +02:00
Grzegorz Bizon b337a086d5 Merge branch 'master' into backstage/gb/migrate-pipeline-stages-index
* master: (106 commits)
2018-05-01 14:24:39 +02:00
Douwe Maan 3fcb9c115d Merge branch 'zj-fix-index-rails' into 'master'
Use Ruby methods, not Rails' String#first

See merge request gitlab-org/gitlab-ce!18669
2018-05-01 10:16:18 +00:00
Zeger-Jan van de Weg 5e75d37705
Use Ruby methods, not Rails' String#first
Gitaly-Ruby is not a Rails application, which made the method not exist
after the vendor. This patch uses direct indexing, which has the same
properties that `#first` has.

Found while working on: https://gitlab.com/gitlab-org/gitaly/merge_requests/699
2018-05-01 10:49:58 +02:00
Oswaldo Ferreira be8a320bd8 Use persisted diff data instead fetching Git on discussions
Today, when fetching diffs of a note, we always go to Gitaly in order to diff between commits and return the diff of each discussion note. With this change we avoid doing that for notes on the "current version" of the MR.
2018-04-30 20:07:21 -03:00
Douwe Maan 9cf4e47341 Merge branch 'security-45689-fix-archive-cache-bug' into 'security-10-7'
Serve archive requests with the correct file in all cases (10.7)

See merge request gitlab/gitlabhq!2376
2018-04-30 15:00:14 -05:00
Douwe Maan e71351d4f4 Merge branch 'bvl-fix-openid-redirect' into 'master'
Skip `authenticate_user!` for Doorkeeper controllers

Closes #44639

See merge request gitlab-org/gitlab-ce!18599
2018-04-30 16:11:36 +00:00
Douwe Maan 5af7fd59e5 Merge branch 'rebase-in-progress-fast-timeout' into 'master'
Use fast timeouts for Gitaly FooInProgress RPC's

See merge request gitlab-org/gitlab-ce!18655
2018-04-30 15:40:11 +00:00
Alessio Caiazza ce5723c849
Add alpine mirrors while operating on k8s cluster 2018-04-30 15:12:26 +02:00
Jacob Vosmaer b37cea6e9c Use fast timeouts for Gitaly FooInProgress RPC's 2018-04-30 14:16:27 +02:00
Douwe Maan 660a902891 Merge branch 'zj-remove-repo-path-remote-repository' into 'master'
Remove legacy storage path call

See merge request gitlab-org/gitlab-ce!18598
2018-04-30 10:17:09 +00:00
Bob Van Landuyt 0f593b1c57 Define custom base controller for Doorkeeper
Since we only need the `can?` view helpers there, it's better to
include those in a separate controller.

If we inherit from `ApplicationController` we also need to deal with
authentication, that needs to be done in some, but not all doorkeeper controllers.
2018-04-30 11:40:51 +02:00
Zeger-Jan van de Weg 27d2f407fb
Compute repository checksum by default
Acceptance testing was done in:
https://gitlab.com/gitlab-org/gitaly/issues/1146. Errors were limited to
NotFound errors, as the repository really doesn't exists.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1146

Optimistically moved https://gitlab.com/gitlab-org/gitaly/issues/1105 to
opt out on the Gitaly migration board.
2018-04-30 09:16:00 +02:00
Zeger-Jan van de Weg 7d23a2bfdf
Remove legacy storage path call
Storage shards should only be used, the exact paths are the
responsibilty of Gitaly. This will create deprecation warning, and in
this instance the path is initialized, but never used so it could be
removed.
2018-04-30 09:02:23 +02:00
blackst0ne 54124fc608 [Rails5] Fix Arel::UpdateManager
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)>'
```
2018-04-29 12:54:58 +11:00
blackst0ne b26a3f91b8 [Rails5] Fix TZInfo::InvalidTimezoneIdentifier exception
In Rails 4.2.10 the `ActiveSupport::TimeZone.find_tzinfo(timezone_name)`
method calls `TZInfo::TimezoneProxy.new(timezone_name)` which returns
`timezone_name` if it is invalid.

But in Rails 5.0 the `ActiveSupport::TimeZone.find_tzinfo(timezone_name)`
method now calls the `TZInfo::Timezone.new(timezone_name)` method which
throws the `TZInfo::InvalidTimezoneIdentifier: Invalid identifier`
exception if `timezone_name` is invalid.

This commit adds the rescue block to return timezone name if the
exception is raised.

Also this change fixes the error:

```
  1) Ci::PipelineSchedule validations does not allow invalid cron patters
     Failure/Error: ActiveSupport::TimeZone.find_tzinfo(timezone).name

     TZInfo::InvalidTimezoneIdentifier:
       Invalid identifier
     # ./lib/gitlab/ci/cron_parser.rb:28:in `timezone_name'
     # ./lib/gitlab/ci/cron_parser.rb:9:in `initialize'
     # ./app/validators/cron_validator.rb:6:in `new'
     # ./app/validators/cron_validator.rb:6:in `validate_each'
     # ./spec/models/ci/pipeline_schedule_spec.rb:26:in `block (3 levels) in <top (required)>'
```
2018-04-29 10:10:36 +11:00
Nick Thomas 1b2a94c178 Merge branch 'zj-repository-exist-mandatory' into 'master'
Repository#exists? can only be queried with Gitaly

Closes gitaly#314

See merge request gitlab-org/gitlab-ce!18567
2018-04-27 12:05:24 +00:00
Jacob Vosmaer (GitLab) 7da1b4cbf1 Add gitlab-pages admin ping rake task 2018-04-27 11:01:54 +00:00
Kamil Trzciński 6b2eb865ca Merge branch 'performance/gb/improve-pipeline-creation-service' into 'master'
Improve pipeline creation service performance

Closes #37987

See merge request gitlab-org/gitlab-ce!18582
2018-04-26 08:35:19 +00:00
Douwe Maan 6587d3680e Merge branch 'zj-storage-path-deprecation' into 'master'
Legacy disk path refactor

Closes gitaly#1111

See merge request gitlab-org/gitlab-ce!18364
2018-04-25 13:55:21 +00:00
Grzegorz Bizon 37b9a441c1 Merge branch 'master' into 'backstage/gb/migrate-pipeline-stages-index'
# Conflicts:
#   db/schema.rb
2018-04-25 13:40:13 +00:00
Zeger-Jan van de Weg 5cd57cf250
Repository#exists? can only be queried with Gitaly
Has been in opt out for 5 months, and within GitLab been in production
for longer than that.

No code needs to be migrated as this is implemented in GoLang over at
Gitaly.

Closes https://gitlab.com/gitlab-org/gitaly/issues/314
2018-04-25 14:51:04 +02:00
Zeger-Jan van de Weg ec4423665c
Gitlab::Shell works on shard name, not path
Direct disk access is done through Gitaly now, so the legacy path was
deprecated. This path was used in Gitlab::Shell however. This required
the refactoring in this commit.

Added is the removal of direct path access on the project model, as that
lookup wasn't needed anymore is most cases.

Closes https://gitlab.com/gitlab-org/gitaly/issues/1111
2018-04-25 13:36:22 +02:00
Grzegorz Bizon e4d6984465 Do not save associated records for pipeline builds twice 2018-04-25 13:35:40 +02:00
Jan Provaznik 5bb421ecbb Cleanup after adding MR diff's commit_count (try 2)
* processes any pending records which are not migrated yet
* bumps import_export version because of new commits_count attribute
* removes commits_count fallback method
2018-04-25 10:53:37 +02:00
Douwe Maan 906fc00c33 Merge branch 'bvl-fix-maintainer-push-error' into 'master'
Fix errors on pushing/editing files on empty repositories

Closes #44618 and #42583

See merge request gitlab-org/gitlab-ce!18462
2018-04-24 14:49:38 +00:00
Grzegorz Bizon c9dc51111d Rename stage index column name to priority column 2018-04-24 15:48:10 +02:00
Grzegorz Bizon d7e8bfac48 Improve stages index migration code readability 2018-04-24 14:15:26 +02:00
Bob Van Landuyt 35a49922e6 Allow admins to push to empty repos 2018-04-24 14:06:59 +02:00
Kamil Trzciński f5524d554b Merge branch '10244-add-project-ci-cd-settings' into 'master'
Introduce new ProjectCiCdSettings model with group_runners_enabled

See merge request gitlab-org/gitlab-ce!18144
2018-04-24 11:05:20 +00:00
Douwe Maan 1e624f3401 Merge branch 'jej/refactor-omniauth-controller' into 'master'
Refactor OmniauthCallbacksController to remove duplication

Closes #26559

See merge request gitlab-org/gitlab-ce!16694
2018-04-24 10:18:10 +00:00
Grzegorz Bizon 657b24b7a5 Improve performance of stages index migration on PostgreSQL 2018-04-24 11:50:57 +02:00
Grzegorz Bizon 181d8f687d Make stages index background migration more idempotent 2018-04-24 11:07:37 +02:00
Grzegorz Bizon 02999234d4 Add background migration that migrates stages indices 2018-04-24 11:07:37 +02:00
Grzegorz Bizon f0d59b95f1 Validate presence of a stage index in the model 2018-04-24 11:07:37 +02:00