From 34ebc10808b2ec8c2237a64717fe304b227f4f1b Mon Sep 17 00:00:00 2001
From: Dmitry Gruzd <dgruzd@gitlab.com>
Date: Tue, 21 Sep 2021 11:48:20 +0300
Subject: [PATCH] Update Rails to v6.1.4.1

This MR updates Rails from 6.1.3.2 to 6.1.4.1

Changes:
rails: https://my.diffend.io/gems/rails/6.1.3.2/6.1.4.1
actionpack: https://my.diffend.io/gems/actionpack/6.1.3.2/6.1.4.1
activerecord: https://my.diffend.io/gems/activerecord/6.1.3.2/6.1.4.1
activestorage: https://my.diffend.io/gems/activestorage/6.1.3.2/6.1.4.1

Release notes:
https://github.com/rails/rails/releases
---
 Gemfile                                       |   2 +-
 Gemfile.lock                                  | 122 +++++++++---------
 config/initializers/postgresql_cte.rb         |   2 +-
 .../security/report_summary_service.rb        |   2 +-
 .../audit_log_reports_controller_spec.rb      |   2 +-
 package.json                                  |   4 +-
 qa/Gemfile                                    |   2 +-
 qa/Gemfile.lock                               |   4 +-
 .../application_controller_spec.rb            |   4 +-
 .../designs/resized_image_controller_spec.rb  |   2 +-
 spec/controllers/search_controller_spec.rb    |   2 +-
 spec/factories/design_management/versions.rb  |   2 +-
 .../projects/badges/pipeline_badge_spec.rb    |   2 +-
 .../namespace/traversal_hierarchy_spec.rb     |   9 +-
 .../wiki_actions_shared_examples.rb           |   2 +-
 yarn.lock                                     |  18 +--
 16 files changed, 93 insertions(+), 88 deletions(-)

diff --git a/Gemfile b/Gemfile
index 83191f273f9fc..45dc4dfebed53 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,7 +2,7 @@
 
 source 'https://rubygems.org'
 
-gem 'rails', '~> 6.1.3.2'
+gem 'rails', '~> 6.1.4.1'
 
 gem 'bootsnap', '~> 1.4.6'
 
diff --git a/Gemfile.lock b/Gemfile.lock
index d9d01ee6bd3be..fc13e8d6ecccb 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -11,63 +11,63 @@ GEM
     RedCloth (4.3.2)
     acme-client (2.0.6)
       faraday (>= 0.17, < 2.0.0)
-    actioncable (6.1.3.2)
-      actionpack (= 6.1.3.2)
-      activesupport (= 6.1.3.2)
+    actioncable (6.1.4.1)
+      actionpack (= 6.1.4.1)
+      activesupport (= 6.1.4.1)
       nio4r (~> 2.0)
       websocket-driver (>= 0.6.1)
-    actionmailbox (6.1.3.2)
-      actionpack (= 6.1.3.2)
-      activejob (= 6.1.3.2)
-      activerecord (= 6.1.3.2)
-      activestorage (= 6.1.3.2)
-      activesupport (= 6.1.3.2)
+    actionmailbox (6.1.4.1)
+      actionpack (= 6.1.4.1)
+      activejob (= 6.1.4.1)
+      activerecord (= 6.1.4.1)
+      activestorage (= 6.1.4.1)
+      activesupport (= 6.1.4.1)
       mail (>= 2.7.1)
-    actionmailer (6.1.3.2)
-      actionpack (= 6.1.3.2)
-      actionview (= 6.1.3.2)
-      activejob (= 6.1.3.2)
-      activesupport (= 6.1.3.2)
+    actionmailer (6.1.4.1)
+      actionpack (= 6.1.4.1)
+      actionview (= 6.1.4.1)
+      activejob (= 6.1.4.1)
+      activesupport (= 6.1.4.1)
       mail (~> 2.5, >= 2.5.4)
       rails-dom-testing (~> 2.0)
-    actionpack (6.1.3.2)
-      actionview (= 6.1.3.2)
-      activesupport (= 6.1.3.2)
+    actionpack (6.1.4.1)
+      actionview (= 6.1.4.1)
+      activesupport (= 6.1.4.1)
       rack (~> 2.0, >= 2.0.9)
       rack-test (>= 0.6.3)
       rails-dom-testing (~> 2.0)
       rails-html-sanitizer (~> 1.0, >= 1.2.0)
-    actiontext (6.1.3.2)
-      actionpack (= 6.1.3.2)
-      activerecord (= 6.1.3.2)
-      activestorage (= 6.1.3.2)
-      activesupport (= 6.1.3.2)
+    actiontext (6.1.4.1)
+      actionpack (= 6.1.4.1)
+      activerecord (= 6.1.4.1)
+      activestorage (= 6.1.4.1)
+      activesupport (= 6.1.4.1)
       nokogiri (>= 1.8.5)
-    actionview (6.1.3.2)
-      activesupport (= 6.1.3.2)
+    actionview (6.1.4.1)
+      activesupport (= 6.1.4.1)
       builder (~> 3.1)
       erubi (~> 1.4)
       rails-dom-testing (~> 2.0)
       rails-html-sanitizer (~> 1.1, >= 1.2.0)
-    activejob (6.1.3.2)
-      activesupport (= 6.1.3.2)
+    activejob (6.1.4.1)
+      activesupport (= 6.1.4.1)
       globalid (>= 0.3.6)
-    activemodel (6.1.3.2)
-      activesupport (= 6.1.3.2)
-    activerecord (6.1.3.2)
-      activemodel (= 6.1.3.2)
-      activesupport (= 6.1.3.2)
+    activemodel (6.1.4.1)
+      activesupport (= 6.1.4.1)
+    activerecord (6.1.4.1)
+      activemodel (= 6.1.4.1)
+      activesupport (= 6.1.4.1)
     activerecord-explain-analyze (0.1.0)
       activerecord (>= 4)
       pg
-    activestorage (6.1.3.2)
-      actionpack (= 6.1.3.2)
-      activejob (= 6.1.3.2)
-      activerecord (= 6.1.3.2)
-      activesupport (= 6.1.3.2)
+    activestorage (6.1.4.1)
+      actionpack (= 6.1.4.1)
+      activejob (= 6.1.4.1)
+      activerecord (= 6.1.4.1)
+      activesupport (= 6.1.4.1)
       marcel (~> 1.0.0)
-      mini_mime (~> 1.0.2)
-    activesupport (6.1.3.2)
+      mini_mime (>= 1.1.0)
+    activesupport (6.1.4.1)
       concurrent-ruby (~> 1.0, >= 1.0.2)
       i18n (>= 1.6, < 2)
       minitest (>= 5.1)
@@ -505,8 +505,8 @@ GEM
       omniauth (~> 1.3)
       pyu-ruby-sasl (>= 0.0.3.3, < 0.1)
       rubyntlm (~> 0.5)
-    globalid (0.4.2)
-      activesupport (>= 4.2.0)
+    globalid (0.5.2)
+      activesupport (>= 5.0)
     gon (6.4.0)
       actionpack (>= 3.0.20)
       i18n (>= 0.7)
@@ -746,7 +746,7 @@ GEM
     mime-types-data (3.2020.0512)
     mini_histogram (0.3.1)
     mini_magick (4.10.1)
-    mini_mime (1.0.2)
+    mini_mime (1.1.1)
     mini_portile2 (2.5.3)
     minitest (5.11.3)
     mixlib-cli (2.1.8)
@@ -783,7 +783,7 @@ GEM
       net-ssh (>= 2.6.5, < 7.0.0)
     net-ssh (6.0.0)
     netrc (0.11.0)
-    nio4r (2.5.4)
+    nio4r (2.5.8)
     no_proxy_fix (0.1.2)
     nokogiri (1.11.7)
       mini_portile2 (~> 2.5.0)
@@ -964,20 +964,20 @@ GEM
     rack-test (1.1.0)
       rack (>= 1.0, < 3)
     rack-timeout (0.5.2)
-    rails (6.1.3.2)
-      actioncable (= 6.1.3.2)
-      actionmailbox (= 6.1.3.2)
-      actionmailer (= 6.1.3.2)
-      actionpack (= 6.1.3.2)
-      actiontext (= 6.1.3.2)
-      actionview (= 6.1.3.2)
-      activejob (= 6.1.3.2)
-      activemodel (= 6.1.3.2)
-      activerecord (= 6.1.3.2)
-      activestorage (= 6.1.3.2)
-      activesupport (= 6.1.3.2)
+    rails (6.1.4.1)
+      actioncable (= 6.1.4.1)
+      actionmailbox (= 6.1.4.1)
+      actionmailer (= 6.1.4.1)
+      actionpack (= 6.1.4.1)
+      actiontext (= 6.1.4.1)
+      actionview (= 6.1.4.1)
+      activejob (= 6.1.4.1)
+      activemodel (= 6.1.4.1)
+      activerecord (= 6.1.4.1)
+      activestorage (= 6.1.4.1)
+      activesupport (= 6.1.4.1)
       bundler (>= 1.15.0)
-      railties (= 6.1.3.2)
+      railties (= 6.1.4.1)
       sprockets-rails (>= 2.0.0)
     rails-controller-testing (1.0.5)
       actionpack (>= 5.0.1.rc1)
@@ -991,11 +991,11 @@ GEM
     rails-i18n (6.0.0)
       i18n (>= 0.7, < 2)
       railties (>= 6.0.0, < 7)
-    railties (6.1.3.2)
-      actionpack (= 6.1.3.2)
-      activesupport (= 6.1.3.2)
+    railties (6.1.4.1)
+      actionpack (= 6.1.4.1)
+      activesupport (= 6.1.4.1)
       method_source
-      rake (>= 0.8.7)
+      rake (>= 0.13)
       thor (~> 1.0)
     rainbow (3.0.0)
     rake (13.0.6)
@@ -1351,7 +1351,7 @@ GEM
       crack (>= 0.3.2)
       hashdiff (>= 0.4.0, < 2.0.0)
     webrick (1.6.1)
-    websocket-driver (0.7.3)
+    websocket-driver (0.7.5)
       websocket-extensions (>= 0.1.0)
     websocket-extensions (0.1.5)
     wikicloth (0.8.1)
@@ -1573,7 +1573,7 @@ DEPENDENCIES
   rack-oauth2 (~> 1.16.0)
   rack-proxy (~> 0.6.0)
   rack-timeout (~> 0.5.1)
-  rails (~> 6.1.3.2)
+  rails (~> 6.1.4.1)
   rails-controller-testing
   rails-i18n (~> 6.0)
   rainbow (~> 3.0)
diff --git a/config/initializers/postgresql_cte.rb b/config/initializers/postgresql_cte.rb
index 6a9af7b4868eb..7d00776e460ea 100644
--- a/config/initializers/postgresql_cte.rb
+++ b/config/initializers/postgresql_cte.rb
@@ -96,7 +96,7 @@ def with!(opts = :chain, *rest) # :nodoc:
       end
     end
 
-    def build_arel(aliases)
+    def build_arel(aliases = nil)
       arel = super
 
       build_with(arel) if @values[:with]
diff --git a/ee/app/services/security/report_summary_service.rb b/ee/app/services/security/report_summary_service.rb
index 966d17f7fe381..aa24f6e9aabf7 100644
--- a/ee/app/services/security/report_summary_service.rb
+++ b/ee/app/services/security/report_summary_service.rb
@@ -75,7 +75,7 @@ def scanned_resources_counts
     end
 
     def grouped_scans
-      @grouped_scans ||= @pipeline.security_scans.by_scan_types(@selection_information.keys).group_by(&:scan_type)
+      @grouped_scans ||= @pipeline.security_scans.by_scan_types(@selection_information.keys.map(&:to_sym) & Security::Scan.scan_types.keys.map(&:to_sym)).group_by(&:scan_type)
     end
   end
 end
diff --git a/ee/spec/controllers/admin/audit_log_reports_controller_spec.rb b/ee/spec/controllers/admin/audit_log_reports_controller_spec.rb
index 2789e45f70b3d..ae996570e539a 100644
--- a/ee/spec/controllers/admin/audit_log_reports_controller_spec.rb
+++ b/ee/spec/controllers/admin/audit_log_reports_controller_spec.rb
@@ -61,7 +61,7 @@
 
             expect(response).to have_gitlab_http_status(:ok)
             expect(response.headers["Content-Length"]).to be_nil
-            expect(response.headers["Cache-Control"]).to eq('no-store')
+            expect(response.headers["Cache-Control"]).to eq('private, no-store')
             expect(response.headers['Content-Type']).to eq('text/csv; charset=utf-8; header=present')
             expect(response.headers['X-Accel-Buffering']).to eq('no')
             expect(response.headers['Last-Modified']).to eq('0')
diff --git a/package.json b/package.json
index 65f0219fac979..c2fa1824653c6 100644
--- a/package.json
+++ b/package.json
@@ -59,8 +59,8 @@
     "@gitlab/tributejs": "1.0.0",
     "@gitlab/ui": "32.14.0",
     "@gitlab/visual-review-tools": "1.6.1",
-    "@rails/actioncable": "6.1.3-2",
-    "@rails/ujs": "6.1.3-2",
+    "@rails/actioncable": "6.1.4-1",
+    "@rails/ujs": "6.1.4-1",
     "@sentry/browser": "5.30.0",
     "@sourcegraph/code-host-integration": "0.0.60",
     "@tiptap/core": "^2.0.0-beta.116",
diff --git a/qa/Gemfile b/qa/Gemfile
index 493e7de1e7680..ee90d049d7bcc 100644
--- a/qa/Gemfile
+++ b/qa/Gemfile
@@ -3,7 +3,7 @@
 source 'https://rubygems.org'
 
 gem 'gitlab-qa', require: 'gitlab/qa'
-gem 'activesupport', '~> 6.1.3.2' # This should stay in sync with the root's Gemfile
+gem 'activesupport', '~> 6.1.4.1' # This should stay in sync with the root's Gemfile
 gem 'allure-rspec', '~> 2.15.0'
 gem 'capybara', '~> 3.35.0'
 gem 'capybara-screenshot', '~> 1.0.23'
diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock
index ede0fbe00deca..153a141d3fdfc 100644
--- a/qa/Gemfile.lock
+++ b/qa/Gemfile.lock
@@ -2,7 +2,7 @@ GEM
   remote: https://rubygems.org/
   specs:
     abstract_type (0.0.7)
-    activesupport (6.1.3.2)
+    activesupport (6.1.4.1)
       concurrent-ruby (~> 1.0, >= 1.0.2)
       i18n (>= 1.6, < 2)
       minitest (>= 5.1)
@@ -239,7 +239,7 @@ PLATFORMS
   ruby
 
 DEPENDENCIES
-  activesupport (~> 6.1.3.2)
+  activesupport (~> 6.1.4.1)
   airborne (~> 0.3.4)
   allure-rspec (~> 2.15.0)
   capybara (~> 3.35.0)
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
index 93491246e2c45..e9a49319f21dd 100644
--- a/spec/controllers/application_controller_spec.rb
+++ b/spec/controllers/application_controller_spec.rb
@@ -704,7 +704,7 @@ def index
 
         get :index
 
-        expect(response.headers['Cache-Control']).to eq 'no-store'
+        expect(response.headers['Cache-Control']).to eq 'private, no-store'
         expect(response.headers['Pragma']).to eq 'no-cache'
       end
 
@@ -740,7 +740,7 @@ def index
     it 'sets no-cache headers', :aggregate_failures do
       subject
 
-      expect(response.headers['Cache-Control']).to eq 'no-store'
+      expect(response.headers['Cache-Control']).to eq 'private, no-store'
       expect(response.headers['Pragma']).to eq 'no-cache'
       expect(response.headers['Expires']).to eq 'Fri, 01 Jan 1990 00:00:00 GMT'
     end
diff --git a/spec/controllers/projects/design_management/designs/resized_image_controller_spec.rb b/spec/controllers/projects/design_management/designs/resized_image_controller_spec.rb
index 56c0ef592cafe..cc0f4a426f421 100644
--- a/spec/controllers/projects/design_management/designs/resized_image_controller_spec.rb
+++ b/spec/controllers/projects/design_management/designs/resized_image_controller_spec.rb
@@ -91,7 +91,7 @@
       # (the record that represents the design at a specific version), to
       # verify that the correct file is being returned.
       def etag(action)
-        ActionDispatch::TestResponse.new.send(:generate_weak_etag, [action.cache_key, ''])
+        ActionDispatch::TestResponse.new.send(:generate_weak_etag, [action.cache_key])
       end
 
       specify { expect(newest_version.sha).not_to eq(oldest_version.sha) }
diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb
index 4e87a9fc1ba8c..6bcb88278a0fb 100644
--- a/spec/controllers/search_controller_spec.rb
+++ b/spec/controllers/search_controller_spec.rb
@@ -305,7 +305,7 @@
 
         expect(response).to have_gitlab_http_status(:ok)
 
-        expect(response.headers['Cache-Control']).to eq('no-store')
+        expect(response.headers['Cache-Control']).to eq('private, no-store')
       end
     end
 
diff --git a/spec/factories/design_management/versions.rb b/spec/factories/design_management/versions.rb
index 247a385bd0e4b..e505a77d6bd3f 100644
--- a/spec/factories/design_management/versions.rb
+++ b/spec/factories/design_management/versions.rb
@@ -52,9 +52,9 @@
         .where(design_id: evaluator.deleted_designs.map(&:id))
         .update_all(event: events[:deletion])
 
-      version.designs.reload
       # Ensure version.issue == design.issue for all version.designs
       version.designs.update_all(issue_id: version.issue_id)
+      version.designs.reload
 
       needed = evaluator.designs_count
       have = version.designs.size
diff --git a/spec/features/projects/badges/pipeline_badge_spec.rb b/spec/features/projects/badges/pipeline_badge_spec.rb
index 9d8f9872a1aae..e3a01ab6fa245 100644
--- a/spec/features/projects/badges/pipeline_badge_spec.rb
+++ b/spec/features/projects/badges/pipeline_badge_spec.rb
@@ -68,7 +68,7 @@
         visit pipeline_project_badges_path(project, ref: ref, format: :svg)
 
         expect(page.status_code).to eq(200)
-        expect(page.response_headers['Cache-Control']).to eq('no-store')
+        expect(page.response_headers['Cache-Control']).to eq('private, no-store')
       end
     end
 
diff --git a/spec/models/namespace/traversal_hierarchy_spec.rb b/spec/models/namespace/traversal_hierarchy_spec.rb
index 2cd66f4245892..d7b0ee888c078 100644
--- a/spec/models/namespace/traversal_hierarchy_spec.rb
+++ b/spec/models/namespace/traversal_hierarchy_spec.rb
@@ -3,7 +3,7 @@
 require 'spec_helper'
 
 RSpec.describe Namespace::TraversalHierarchy, type: :model do
-  let_it_be(:root, reload: true) { create(:group, :with_hierarchy) }
+  let!(:root) { create(:group, :with_hierarchy) }
 
   describe '.for_namespace' do
     let(:hierarchy) { described_class.for_namespace(group) }
@@ -62,7 +62,12 @@
 
     it { expect(hierarchy.incorrect_traversal_ids).to be_empty }
 
-    it_behaves_like 'hierarchy with traversal_ids'
+    it_behaves_like 'hierarchy with traversal_ids' do
+      before do
+        subject
+      end
+    end
+
     it_behaves_like 'locked row' do
       let(:recorded_queries) { ActiveRecord::QueryRecorder.new }
       let(:row) { root }
diff --git a/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb b/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb
index e8f7e62d0d7da..30710e43357a3 100644
--- a/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb
+++ b/spec/support/shared_examples/controllers/wiki_actions_shared_examples.rb
@@ -299,7 +299,7 @@
           expect(response.headers['Content-Disposition']).to match(/^inline/)
           expect(response.headers[Gitlab::Workhorse::DETECT_HEADER]).to eq('true')
           expect(response.cache_control[:public]).to be(false)
-          expect(response.headers['Cache-Control']).to eq('no-store')
+          expect(response.headers['Cache-Control']).to eq('private, no-store')
         end
       end
     end
diff --git a/yarn.lock b/yarn.lock
index f5e4ff2b752bf..20dc612711689 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1189,15 +1189,15 @@
   resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.9.2.tgz#adea7b6953cbb34651766b0548468e743c6a2353"
   integrity sha512-VZMYa7+fXHdwIq1TDhSXoVmSPEGM/aa+6Aiq3nVVJ9bXr24zScr+NlKFKC3iPljA7ho/GAZr+d2jOf5GIRC30Q==
 
-"@rails/actioncable@6.1.3-2":
-  version "6.1.3-2"
-  resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-6.1.3-2.tgz#de22e2d7474dcca051f7060829450412a17ecc04"
-  integrity sha512-3mBLDwM85oj0Ot+wgC3c0wsfx5qvf8XJwSbkJk4ZqW4bA7ctn8BFW+cRQxrnQau+NDfmJvSECY8mmNIANcpULA==
-
-"@rails/ujs@6.1.3-2":
-  version "6.1.3-2"
-  resolved "https://registry.yarnpkg.com/@rails/ujs/-/ujs-6.1.3-2.tgz#5d7e161e7061654e738a116a7ec8b58b51721a11"
-  integrity sha512-Nd0Im4cW8tIX8ZR3jE/dS3wnJrN46RJSdCfU59Cji2puctIWohq63LjKFMufUwm21bCasISNGoLdkr3S7nwONw==
+"@rails/actioncable@6.1.4-1":
+  version "6.1.4-1"
+  resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-6.1.4-1.tgz#69982e7f352d732f71fda0cc01b7ba8269c9945b"
+  integrity sha512-b6sLoMop3gX22Wm2P5LPpKcZGwsf1ZoAGS+g1HrTrdlsZ/ENOKIBiSNnHOJajHwcYlF0TefBs7e7jIYZHVYihQ==
+
+"@rails/ujs@6.1.4-1":
+  version "6.1.4-1"
+  resolved "https://registry.yarnpkg.com/@rails/ujs/-/ujs-6.1.4-1.tgz#37507fe288a1c7c3a593602aa4dea42e5cb5797f"
+  integrity sha512-Fewm2wHk1n6Kf4E86dzzHDJOFg4EWcSHH3FsMEGs59bTdmf7099mjkOssOQtBqju4R39iaAOQNui7r8P+Q5Dgg==
 
 "@sentry/browser@5.30.0":
   version "5.30.0"
-- 
GitLab