From f69066a2367d934a8ccb19e8981a69e917b0f598 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 14 Feb 2019 09:07:19 +0000 Subject: [PATCH 01/10] Merge branch '57579-gitlab-project-import-fails-sidekiq-undefined-method-import_jid' into 'master' Resolve "Gitlab Project import fails: sidekiq undefined method import_jid" Closes #57579 See merge request gitlab-org/gitlab-ce!25239 (cherry picked from commit c06ebe511700f25a61b4dfaa518fbed7667c6876) 401a3bca Fix import_jid error on project import --- ...mport-fails-sidekiq-undefined-method-import_jid.yml | 5 +++++ lib/gitlab/import_export/shared.rb | 2 +- spec/lib/gitlab/import_export/shared_spec.rb | 10 ++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/57579-gitlab-project-import-fails-sidekiq-undefined-method-import_jid.yml diff --git a/changelogs/unreleased/57579-gitlab-project-import-fails-sidekiq-undefined-method-import_jid.yml b/changelogs/unreleased/57579-gitlab-project-import-fails-sidekiq-undefined-method-import_jid.yml new file mode 100644 index 00000000000..f7d6a6c4863 --- /dev/null +++ b/changelogs/unreleased/57579-gitlab-project-import-fails-sidekiq-undefined-method-import_jid.yml @@ -0,0 +1,5 @@ +--- +title: Fix import_jid error on project import +merge_request: 25239 +author: +type: fixed diff --git a/lib/gitlab/import_export/shared.rb b/lib/gitlab/import_export/shared.rb index 947caaaefee..725c1101d70 100644 --- a/lib/gitlab/import_export/shared.rb +++ b/lib/gitlab/import_export/shared.rb @@ -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 } diff --git a/spec/lib/gitlab/import_export/shared_spec.rb b/spec/lib/gitlab/import_export/shared_spec.rb index f2d750c6595..2c288cff6ef 100644 --- a/spec/lib/gitlab/import_export/shared_spec.rb +++ b/spec/lib/gitlab/import_export/shared_spec.rb @@ -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)) -- GitLab From b4186403ebf12e2e646e8c62b26192487241cf24 Mon Sep 17 00:00:00 2001 From: Mark Lapierre Date: Tue, 19 Feb 2019 20:30:32 +0000 Subject: [PATCH 02/10] Merge branch 'qa-team-tasks-92-test-failure-retries' into 'master' Retry failing tests Closes gitlab-org/quality/team-tasks#92 See merge request gitlab-org/gitlab-ce!25391 (cherry picked from commit b570f53d17f5bc0e72fef9a122b7fe5645db0ea9) d54cb37d Retry failed tests with rspec-retry --- qa/Gemfile | 1 + qa/Gemfile.lock | 3 +++ qa/spec/spec_helper.rb | 12 +++++++++ qa/spec/spec_helper_spec.rb | 51 +++++++++++++++++++++++++++++++++++++ 4 files changed, 67 insertions(+) diff --git a/qa/Gemfile b/qa/Gemfile index 873eac1013f..f29006617ed 100644 --- a/qa/Gemfile +++ b/qa/Gemfile @@ -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' diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock index 9f84bdc3828..c3d9f558c23 100644 --- a/qa/Gemfile.lock +++ b/qa/Gemfile.lock @@ -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 diff --git a/qa/spec/spec_helper.rb b/qa/spec/spec_helper.rb index cddaa6fc6e0..021fe5fce5e 100644 --- a/qa/spec/spec_helper.rb +++ b/qa/spec/spec_helper.rb @@ -1,4 +1,5 @@ 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. diff --git a/qa/spec/spec_helper_spec.rb b/qa/spec/spec_helper_spec.rb index 2427999e110..27ec1ec80fe 100644 --- a/qa/spec/spec_helper_spec.rb +++ b/qa/spec/spec_helper_spec.rb @@ -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 -- GitLab From a1624833e8c98ed86137551f3534ba64300e44fc Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Thu, 21 Feb 2019 11:11:14 +0000 Subject: [PATCH 03/10] Merge branch 'docs-review-mr-diffs-admin' into 'master' Docs review: MR diffs external storage Closes #57335 See merge request gitlab-org/gitlab-ce!25433 (cherry picked from commit 56b82db63a91695a1dec1b7cbf39636bb01ad3df) 1387983b Docs review: wording, styles, missing links 01680510 Copy edit - add missing preposition --- doc/administration/index.md | 2 +- doc/administration/merge_request_diffs.md | 33 +++++++++-------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/doc/administration/index.md b/doc/administration/index.md index 12fec2753bf..683c4921f37 100644 --- a/doc/administration/index.md +++ b/doc/administration/index.md @@ -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 diff --git a/doc/administration/merge_request_diffs.md b/doc/administration/merge_request_diffs.md index 94620c3d3a0..c34a9519ace 100644 --- a/doc/administration/merge_request_diffs.md +++ b/doc/administration/merge_request_diffs.md @@ -1,7 +1,6 @@ -# 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:** @@ -29,17 +26,15 @@ 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` + `/var/opt/gitlab/gitlab-rails/shared/external-diffs`._ To change the path, + 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. -- GitLab From d94c6510d56de1abfefe4477d5cc88a06ff034d3 Mon Sep 17 00:00:00 2001 From: Annabel Dunstone Gray Date: Thu, 21 Feb 2019 21:56:17 +0000 Subject: [PATCH 04/10] Merge branch 'ps-remove-mr-widget-section-padding' into 'master' Remove padding for mr-widget-section See merge request gitlab-org/gitlab-ce!25475 (cherry picked from commit a6d52ff83ff86f88f59f6a231fc4a348640729f7) 7bd65593 Remove padding for mr-widget-section --- .../javascripts/vue_merge_request_widget/mr_widget_options.vue | 2 +- app/assets/stylesheets/pages/merge_requests.scss | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue index abbbe19c5ef..57c4dfbe3b7 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue +++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.vue @@ -315,7 +315,7 @@ export default { :endpoint="mr.testResultsPath" /> -
+