Skip to content

Commit

Permalink
Add latest changes from gitlab-org/gitlab@master
Browse files Browse the repository at this point in the history
  • Loading branch information
GitLab Bot committed Apr 6, 2020
1 parent eaea945 commit ba174c9
Show file tree
Hide file tree
Showing 79 changed files with 861 additions and 676 deletions.
1 change: 1 addition & 0 deletions .gitlab/ci/rules.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@
.frontend:rules:qa-frontend-node:
rules:
- <<: *if-master-refs
changes: *frontend-dependency-patterns
when: on_success
- <<: *if-merge-request
changes: *frontend-dependency-patterns
Expand Down
7 changes: 0 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,9 @@ Gitlab/DuplicateSpecLocation:
- ee/spec/lib/gitlab/gl_repository_spec.rb
- ee/spec/models/namespace_spec.rb
- ee/spec/services/merge_requests/refresh_service_spec.rb
- ee/spec/services/merge_requests/update_service_spec.rb
- ee/spec/helpers/ee/auth_helper_spec.rb
- ee/spec/models/ee/namespace_spec.rb
- ee/spec/services/ee/merge_requests/refresh_service_spec.rb
- ee/spec/services/ee/merge_requests/update_service_spec.rb

Cop/InjectEnterpriseEditionModule:
Enabled: true
Expand Down Expand Up @@ -388,11 +386,6 @@ Performance/ChainArrayAllocation:
# https://gitlab.com/gitlab-org/gitlab/-/issues/212541
RSpec/RepeatedExample:
Exclude:
- 'spec/features/issues/filtered_search/filter_issues_spec.rb'
- 'spec/features/merge_request/user_posts_diff_notes_spec.rb'
- 'spec/features/projects/files/template_type_dropdown_spec.rb'
- 'spec/finders/environments_finder_spec.rb'
- 'spec/helpers/users_helper_spec.rb'
- 'spec/lib/gitlab/import_export/project/relation_factory_spec.rb'
- 'spec/services/notification_service_spec.rb'
- 'spec/services/web_hook_service_spec.rb'
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ gem 'peek', '~> 1.1'
gem 'snowplow-tracker', '~> 0.6.1'

# Memory benchmarks
gem 'gitlab-derailed_benchmarks', require: false
gem 'derailed_benchmarks', require: false

# Metrics
group :metrics do
Expand Down
28 changes: 17 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ GEM
declarative-option (0.1.0)
default_value_for (3.3.0)
activerecord (>= 3.2.0, < 6.1)
derailed_benchmarks (1.7.0)
benchmark-ips (~> 2)
get_process_mem (~> 0)
heapy (~> 0)
memory_profiler (~> 0)
mini_histogram (~> 0)
rack (>= 1)
rake (> 10, < 14)
ruby-statistics (>= 2.1)
thor (>= 0.19, < 2)
unicode_plot (>= 0.0.4, < 1.0.0)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
device_detector (1.0.0)
Expand Down Expand Up @@ -259,6 +270,7 @@ GEM
launchy (~> 2.1)
mail (~> 2.7)
encryptor (3.0.0)
enumerable-statistics (2.0.1)
equalizer (0.0.11)
erubi (1.9.0)
escape_utils (1.2.1)
Expand Down Expand Up @@ -290,7 +302,7 @@ GEM
fast_blank (1.0.0)
fast_gettext (1.6.0)
ffaker (2.10.0)
ffi (1.11.3)
ffi (1.12.2)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
rake
Expand Down Expand Up @@ -371,15 +383,6 @@ GEM
github-markup (1.7.0)
gitlab-chronic (0.10.5)
numerizer (~> 0.2)
gitlab-derailed_benchmarks (1.6.1)
benchmark-ips (~> 2)
get_process_mem (~> 0)
heapy (~> 0)
memory_profiler (~> 0)
rack (>= 1)
rake (> 10, < 14)
ruby-statistics (>= 2.1)
thor (>= 0.19, < 2)
gitlab-labkit (0.12.0)
actionpack (>= 5.0.0, < 6.1.0)
activesupport (>= 5.0.0, < 6.1.0)
Expand Down Expand Up @@ -632,6 +635,7 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331)
mimemagic (0.3.3)
mini_histogram (0.1.3)
mini_magick (4.9.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
Expand Down Expand Up @@ -1084,6 +1088,8 @@ GEM
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.6.0)
unicode_plot (0.0.4)
enumerable-statistics (>= 2.0.1)
unicode_utils (1.4.0)
unicorn (5.4.1)
kgio (~> 2.6)
Expand Down Expand Up @@ -1189,6 +1195,7 @@ DEPENDENCIES
database_cleaner (~> 1.7.0)
deckar01-task_list (= 2.3.1)
default_value_for (~> 3.3.0)
derailed_benchmarks
device_detector
devise (~> 4.6)
devise-two-factor (~> 3.1.0)
Expand Down Expand Up @@ -1231,7 +1238,6 @@ DEPENDENCIES
gitaly (~> 12.9.0.pre.rc4)
github-markup (~> 1.7.0)
gitlab-chronic (~> 0.10.5)
gitlab-derailed_benchmarks
gitlab-labkit (= 0.12.0)
gitlab-license (~> 1.0)
gitlab-mail_room (~> 0.0.3)
Expand Down
23 changes: 23 additions & 0 deletions app/models/concerns/import_state/sidekiq_job_tracker.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

module ImportState
module SidekiqJobTracker
extend ActiveSupport::Concern

included do
# Refreshes the expiration time of the associated import job ID.
#
# This method can be used by asynchronous importers to refresh the status,
# preventing the StuckImportJobsWorker from marking the import as failed.
def refresh_jid_expiration
return unless jid

Gitlab::SidekiqStatus.set(jid, StuckImportJobsWorker::IMPORT_JOBS_EXPIRATION)
end

def self.jid_by(project_id:, status:)
select(:jid).with_status(status).find_by(project_id: project_id)
end
end
end
end
11 changes: 1 addition & 10 deletions app/models/jira_import_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class JiraImportState < ApplicationRecord
include AfterCommitQueue
include ImportState::SidekiqJobTracker

self.table_name = 'jira_imports'

Expand Down Expand Up @@ -66,14 +67,4 @@ def owner_class_attribute_default
def in_progress?
scheduled? || started?
end

def refresh_jid_expiration
return unless jid

Gitlab::SidekiqStatus.set(jid, StuckImportJobsWorker::IMPORT_JOBS_EXPIRATION)
end

def self.jid_by(project_id:, status:)
select(:jid).with_status(status).find_by(project_id: project_id)
end
end
2 changes: 1 addition & 1 deletion app/models/merge_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ def predefined_variables
variables.append(key: 'CI_MERGE_REQUEST_PROJECT_URL', value: project.web_url)
variables.append(key: 'CI_MERGE_REQUEST_TARGET_BRANCH_NAME', value: target_branch.to_s)
variables.append(key: 'CI_MERGE_REQUEST_TITLE', value: title)
variables.append(key: 'CI_MERGE_REQUEST_ASSIGNEES', value: assignee_username_list) if assignees.any?
variables.append(key: 'CI_MERGE_REQUEST_ASSIGNEES', value: assignee_username_list) if assignees.present?
variables.append(key: 'CI_MERGE_REQUEST_MILESTONE', value: milestone.title) if milestone
variables.append(key: 'CI_MERGE_REQUEST_LABELS', value: label_names.join(',')) if labels.present?
variables.concat(source_project_variables)
Expand Down
15 changes: 1 addition & 14 deletions app/models/project_import_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class ProjectImportState < ApplicationRecord
include AfterCommitQueue
include ImportState::SidekiqJobTracker

self.table_name = "project_mirror_data"

Expand Down Expand Up @@ -88,20 +89,6 @@ def started?
# import? does SQL work so only run it if it looks like there's an import running
status == 'started' && project.import?
end

# Refreshes the expiration time of the associated import job ID.
#
# This method can be used by asynchronous importers to refresh the status,
# preventing the StuckImportJobsWorker from marking the import as failed.
def refresh_jid_expiration
return unless jid

Gitlab::SidekiqStatus.set(jid, StuckImportJobsWorker::IMPORT_JOBS_EXPIRATION)
end

def self.jid_by(project_id:, status:)
select(:jid).with_status(status).find_by(project_id: project_id)
end
end

ProjectImportState.prepend_if_ee('EE::ProjectImportState')
4 changes: 0 additions & 4 deletions app/policies/snippet_policy.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ def move_repository(from_name, to_name)
return true
end

gitlab_shell.mv_repository(project.repository_storage, from_name, to_name)
gitlab_shell.mv_repository(project.repository_storage, from_name, to_name).tap do |moved|
if moved
logger.info("Repository moved from '#{from_name}' to '#{to_name}' (PROJECT_ID=#{project.id})")
else
logger.error("Repository cannot be moved from '#{from_name}' to '#{to_name}' (PROJECT_ID=#{project.id})")
end
end
end

def move_repositories
Expand Down
6 changes: 6 additions & 0 deletions app/services/projects/hashed_storage/rollback_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ module HashedStorage
class RollbackService < BaseService
attr_reader :logger, :old_disk_path

def initialize(project, old_disk_path, logger: nil)
@project = project
@old_disk_path = old_disk_path
@logger = logger || Gitlab::AppLogger
end

def execute
# Rollback attachments from Hashed Storage to Legacy
if project.hashed_storage?(:attachments)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Resolve an N+1 in merge request CI variables
merge_request: 28688
author:
type: performance
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Fix storage rollback regression caused by previous refactor
merge_request: 28496
author:
type: fixed
5 changes: 5 additions & 0 deletions changelogs/unreleased/environment-finder-spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Fix duplicate spec in environment finder
merge_request: 28857
author: Rajendra Kadam
type: added
5 changes: 5 additions & 0 deletions changelogs/unreleased/filter-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Fix duplicate spec in filter issues
merge_request: 28860
author: Rajendra Kadam
type: added
5 changes: 5 additions & 0 deletions changelogs/unreleased/relation-factory-spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Fix duplicate spec in factory relation spec
merge_request: 28794
author: Rajendra Kadam
type: added
5 changes: 5 additions & 0 deletions changelogs/unreleased/user-helpers-spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Fix duplicate spec from user helper spec
merge_request: 28854
author: Rajendra Kadam
type: added

This file was deleted.

5 changes: 5 additions & 0 deletions changelogs/unreleased/webhook-service-spec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
title: Remove duplicate spec in web hook service spec
merge_request: 28669
author: Rajendra Kadam
type: fixed
2 changes: 1 addition & 1 deletion doc/administration/auth/ldap-ee.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The process will execute the following access checks:
NOTE: **Note:**
In Active Directory, a user is marked as disabled/blocked if the user
account control attribute (`userAccountControl:1.2.840.113556.1.4.803`)
has bit 2 set. See <https://ctogonewild.com/2009/09/03/bitmask-searches-in-ldap/>
has bit 2 set. See <https://ctovswild.com/2009/09/03/bitmask-searches-in-ldap/>
for more information.

The user will be set to `ldap_blocked` state in GitLab if the above conditions
Expand Down
4 changes: 2 additions & 2 deletions doc/administration/gitaly/praefect.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ application server, or a Gitaly node.

```ruby
# Name of storage hash must match storage name in git_data_dirs on GitLab
# server ('storage_1') and in git_data_dirs on Gitaly nodes ('gitaly-1')
# server ('praefect') and in git_data_dirs on Gitaly nodes ('gitaly-1')
praefect['virtual_storages'] = {
'storage_1' => {
'praefect' => {
'gitaly-1' => {
'address' => 'tcp://GITALY_HOST:8075',
'token' => 'PRAEFECT_INTERNAL_TOKEN',
Expand Down
16 changes: 2 additions & 14 deletions doc/administration/operations/extra_sidekiq_processes.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,20 +228,8 @@ When disabling `sidekiq_cluster`, you must copy your configuration for
`sidekiq_cluster` will be overridden by the options for `sidekiq` when
setting `sidekiq['cluster'] = true`.

When using this feature, replace the `sidekiq` service with the
`sidekiq-cluster`service for `gitlab-ctl` commands.

For example, instead of:

```shell
sudo gitlab-ctl restart sidekiq
```

Use:

```shell
sudo gitlab-ctl restart sidekiq-cluster
```
When using this feature, the service called `sidekiq` will now be
running `sidekiq-cluster`.

The [concurrency](#managing-concurrency) and other options configured
for Sidekiq will be respected.
Expand Down
2 changes: 1 addition & 1 deletion doc/administration/troubleshooting/log_parsing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ but if they are not available you can still quickly parse

## What is JQ?

As noted in its [manual](https://stedolan.github.io/jq/manual), jq is a command-line JSON processor. The following examples
As noted in its [manual](https://stedolan.github.io/jq/manual/), jq is a command-line JSON processor. The following examples
include use cases targeted for parsing GitLab log files.

## Parsing Logs
Expand Down
6 changes: 6 additions & 0 deletions doc/api/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ When the user is authenticated and `simple` is not set this returns something li
"merge_method": "merge",
"autoclose_referenced_issues": true,
"suggestion_commit_message": null,
"marked_for_deletion_at": "2020-04-03",
"marked_for_deletion_on": "2020-04-03",
"statistics": {
"commit_count": 37,
"storage_size": 1038090,
Expand Down Expand Up @@ -406,6 +408,8 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo
"merge_method": "merge",
"autoclose_referenced_issues": true,
"suggestion_commit_message": null,
"marked_for_deletion_at": "2020-04-03",
"marked_for_deletion_on": "2020-04-03",
"statistics": {
"commit_count": 37,
"storage_size": 1038090,
Expand Down Expand Up @@ -870,6 +874,8 @@ GET /projects/:id
"service_desk_address": null,
"autoclose_referenced_issues": true,
"suggestion_commit_message": null,
"marked_for_deletion_at": "2020-04-03",
"marked_for_deletion_on": "2020-04-03",
"statistics": {
"commit_count": 37,
"storage_size": 1038090,
Expand Down
Loading

0 comments on commit ba174c9

Please sign in to comment.