......@@ -315,7 +315,7 @@ export default {
:endpoint="mr.testResultsPath"
/>
<div class="mr-widget-section p-0">
<div class="mr-widget-section">
<component :is="componentName" :mr="mr" :service="service" />
<section v-if="shouldRenderCollaborationStatus" class="mr-info-list mr-links">
......
......
......@@ -82,7 +82,6 @@
}
.mr-widget-body,
.mr-widget-section,
.mr-widget-content,
.mr-widget-footer {
padding: $gl-padding;
......
......
......@@ -1830,7 +1830,7 @@ class Project < ActiveRecord::Base
# Set repository as writable again
def set_repository_writable!
with_lock do
update_column(repository_read_only, false)
update_column(:repository_read_only, false)
end
end
......
......
......@@ -54,6 +54,7 @@ class GroupPolicy < BasePolicy
rule { has_projects }.policy do
enable :read_group
enable :read_list
enable :read_label
end
......
......
---
title: Fix import_jid error on project import
merge_request: 25239
author:
type: fixed
---
title: Fix error when viewing group issue boards when user doesn't have explicit group
permissions
merge_request: 25524
author:
type: fixed
---
title: Fix method to mark a project repository as writable
merge_request: 25546
author:
type: fixed
---
title: Properly handle multiple X-Forwarded-For addresses in runner IP
merge_request: 25511
author:
type: fixed
......@@ -48,7 +48,7 @@ Learn how to install, configure, update, and maintain your GitLab instance.
- [Third party offers](../user/admin_area/settings/third_party_offers.md)
- [Compliance](compliance.md): A collection of features from across the application that you may configure to help ensure that your GitLab instance and DevOps workflow meet compliance standards.
- [Diff limits](../user/admin_area/diff_limits.md): Configure the diff rendering size limits of branch comparison pages.
- [Merge request diffs](merge_request_diffs.md): Configure the diffs shown on merge requests
- [Merge request diffs storage](merge_request_diffs.md): Configure merge requests diffs external storage.
- [Broadcast Messages](../user/admin_area/broadcast_messages.md): Send messages to GitLab users through the UI.
#### Customizing GitLab's appearance
......
......
# Merge request diffs administration
# Merge request diffs storage **[CORE ONLY]**
> **Notes:**
> - External merge request diffs introduced in GitLab 11.8
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/52568) in GitLab 11.8.
Merge request diffs are size-limited copies of diffs associated with merge
requests. When viewing a merge request, diffs are sourced from these copies
......@@ -16,9 +15,7 @@ large, in which case, switching to external storage is recommended.
Merge request diffs can be stored on disk, or in object storage. In general, it
is better to store the diffs in the database than on disk.
To enable external storage of merge request diffs:
---
To enable external storage of merge request diffs, follow the instructions below.
**In Omnibus installations:**
......@@ -30,16 +27,14 @@ To enable external storage of merge request diffs:
1. _The external diffs will be stored in in
`/var/opt/gitlab/gitlab-rails/shared/external-diffs`._ To change the path,
for example to `/mnt/storage/external-diffs`, edit `/etc/gitlab/gitlab.rb`
for example, to `/mnt/storage/external-diffs`, edit `/etc/gitlab/gitlab.rb`
and add the following line:
```ruby
gitlab_rails['external_diffs_storage_path'] = "/mnt/storage/external-diffs"
```
1. Save the file and [reconfigure GitLab][] for the changes to take effect.
---
1. Save the file and [reconfigure GitLab](restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
**In installations from source:**
......@@ -52,7 +47,7 @@ To enable external storage of merge request diffs:
```
1. _The external diffs will be stored in
`/home/git/gitlab/shared/external-diffs`._ To change the path, for example
`/home/git/gitlab/shared/external-diffs`._ To change the path, for example,
to `/mnt/storage/external-diffs`, edit `/home/git/gitlab/config/gitlab.yml`
and add or amend the following lines:
......@@ -62,18 +57,18 @@ To enable external storage of merge request diffs:
storage_path: /mnt/storage/external-diffs
```
1. Save the file and [restart GitLab][] for the changes to take effect.
1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source) for the changes to take effect.
### Using object storage
Instead of storing the external diffs on disk, we recommended you use an object
Instead of storing the external diffs on disk, we recommended the use of an object
store like AWS S3 instead. This configuration relies on valid AWS credentials to
be configured already.
### Object Storage Settings
For source installations, these settings are nested under `external_diffs:` and
then `object_store:`. On omnibus installs, they are prefixed by
then `object_store:`. On Omnibus installations, they are prefixed by
`external_diffs_object_store_`.
| Setting | Description | Default |
......@@ -118,7 +113,7 @@ The connection settings match those provided by [Fog](https://github.com/fog), a
}
```
NOTE: if you are using AWS IAM profiles, be sure to omit the
Note that, if you are using AWS IAM profiles, be sure to omit the
AWS access key and secret access key/value pairs. For example:
```ruby
......@@ -129,9 +124,7 @@ The connection settings match those provided by [Fog](https://github.com/fog), a
}
```
1. Save the file and [reconfigure GitLab][] for the changes to take effect.
---
1. Save the file and [reconfigure GitLab](restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
**In installations from source:**
......@@ -151,4 +144,4 @@ The connection settings match those provided by [Fog](https://github.com/fog), a
region: eu-central-1
```
1. Save the file and [restart GitLab][] for the changes to take effect.
1. Save the file and [restart GitLab](restart_gitlab.md#installations-from-source) for the changes to take effect.
......@@ -33,7 +33,7 @@ Please consider using a virtual machine to run GitLab.
## Ruby versions
GitLab requires Ruby (MRI) 2.3. Support for Ruby versions below 2.3 (2.1, 2.2) will stop with GitLab 8.13.
GitLab requires Ruby (MRI) 2.5. Support for Ruby versions below 2.5 (2.3, 2.4) will stop with GitLab 11.6.
You will have to use the standard MRI implementation of Ruby.
We love [JRuby](https://www.jruby.org/) and [Rubinius](https://rubinius.com) but GitLab
......
......
......@@ -26,7 +26,7 @@ module API
end
def get_runner_ip
{ ip_address: request.env["HTTP_X_FORWARDED_FOR"] || request.ip }
{ ip_address: env["action_dispatch.remote_ip"].to_s || request.ip }
end
def current_runner
......
......
......@@ -61,7 +61,7 @@ module Gitlab
def log_base_data
{
importer: 'Import/Export',
import_jid: @project&.import_state&.import_jid,
import_jid: @project&.import_state&.jid,
project_id: @project&.id,
project_path: @project&.full_path
}
......
......
......@@ -8,3 +8,4 @@ gem 'rspec', '~> 3.7'
gem 'selenium-webdriver', '~> 3.12'
gem 'airborne', '~> 0.2.13'
gem 'nokogiri', '~> 1.10.1'
gem 'rspec-retry', '~> 0.6.1'
......@@ -76,6 +76,8 @@ GEM
rspec-mocks (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-retry (0.6.1)
rspec-core (> 3.3)
rspec-support (3.7.0)
rubyzip (1.2.2)
selenium-webdriver (3.141.0)
......@@ -101,6 +103,7 @@ DEPENDENCIES
pry-byebug (~> 3.5.1)
rake (~> 12.3.0)
rspec (~> 3.7)
rspec-retry (~> 0.6.1)
selenium-webdriver (~> 3.12)
BUNDLED WITH
......
......
# frozen_string_literal: true
module QA
context 'Create' do
# https://gitlab.com/gitlab-org/quality/staging/issues/40
context 'Create', :quarantine do
describe 'Push mirror a repository over HTTP' do
it 'configures and syncs a (push) mirrored repository' do
Runtime::Browser.visit(:gitlab, Page::Main::Login)
......
......
require_relative '../qa'
require 'rspec/retry'
Dir[::File.join(__dir__, 'support', '**', '*.rb')].each { |f| require f }
......@@ -43,6 +44,17 @@ RSpec.configure do |config|
config.profile_examples = 10
config.order = :random
Kernel.srand config.seed
# show retry status in spec process
config.verbose_retry = true
# show exception that triggers a retry if verbose_retry is set to true
config.display_try_failure_messages = true
config.around do |example|
retry_times = example.metadata.keys.include?(:quarantine) ? 1 : 3
example.run_with_retry retry: retry_times
end
end
# Skip tests in quarantine unless we explicitly focus on them.
......
......
......@@ -28,6 +28,22 @@ describe 'rspec config tests' do
end
end
let(:group_2) do
RSpec.describe do
before(:all) do
@expectations = [1, 2, 3]
end
example 'not in quarantine' do
expect(@expectations.shift).to be(3)
end
example 'in quarantine', :quarantine do
expect(@expectations.shift).to be(3)
end
end
end
context 'with no tags focussed' do
before do
group.run
......@@ -301,4 +317,39 @@ describe 'rspec config tests' do
end
end
end
context 'rspec retry' do
context 'in an untagged context' do
before do
group_2.run
end
it 'should run example :retry times' do
examples = group_2.descendant_filtered_examples
ex = examples.find { |e| e.description == 'not in quarantine' }
expect(ex.execution_result.status).to eq(:passed)
end
end
context 'with :quarantine focussed' do
before do
RSpec.configure do |config|
config.inclusion_filter = :quarantine
end
group_2.run
end
after do
RSpec.configure do |config|
config.inclusion_filter.clear
end
end
it 'should run example once only' do
examples = group_2.descendant_filtered_examples
ex = examples.find { |e| e.description == 'in quarantine' }
expect(ex.execution_result.status).to eq(:failed)
end
end
end
end
......@@ -14,6 +14,16 @@ describe Gitlab::ImportExport::Shared do
expect(subject.errors).to eq(['Error importing into [FILTERED] Permission denied @ unlink_internal - [FILTERED]'])
end
it 'updates the import JID' do
import_state = create(:import_state, project: project, jid: 'jid-test')
expect_next_instance_of(Gitlab::Import::Logger) do |logger|
expect(logger).to receive(:error).with(hash_including(import_jid: import_state.jid))
end
subject.error(error)
end
it 'calls the error logger with the full message' do
expect(subject).to receive(:log_error).with(hash_including(message: error.message))
......
......
......@@ -2487,6 +2487,16 @@ describe Project do
end
end
describe '#set_repository_writable!' do
it 'sets repository_read_only to false' do
project = create(:project, :read_only)
expect { project.set_repository_writable! }
.to change(project, :repository_read_only)
.from(true).to(false)
end
end
describe '#pushes_since_gc' do
let(:project) { create(:project) }
......
......