Skip to content
Snippets Groups Projects
Commit 0282449e authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 0ecdcf59
No related branches found
No related tags found
No related merge requests found
Showing
with 110 additions and 40 deletions
---
title: Removes caching for design tab discusisons
merge_request: 20374
author:
type: changed
Loading
Loading
@@ -266,7 +266,7 @@ these epics/issues:
| All database content | **Yes** | **Yes** | |
| Project repository | **Yes** | **Yes** | |
| Project wiki repository | **Yes** | **Yes** | |
| Project designs repository | [No][design-replication] | [No][design-verification] | |
| Project designs repository | **Yes** | [No][design-verification] | Behind feature flag (2) |
| Uploads | **Yes** | [No][upload-verification] | Verified only on transfer, or manually (1) |
| LFS Objects | **Yes** | [No][lfs-verification] | Verified only on transfer, or manually (1) |
| CI job artifacts (other than traces) | **Yes** | [No][artifact-verification] | Verified only manually (1) |
Loading
Loading
@@ -307,6 +307,12 @@ these epics/issues:
1. The integrity can be verified manually using
[Integrity Check Rake Task](../../raketasks/check.md)
on both nodes and comparing the output between them.
1. Enable the `enable_geo_design_sync` feature flag by running the
following in a Rails console:
```ruby
Feature.disable(:enable_geo_design_sync)
```
 
DANGER: **DANGER**
Features not on this list, or with **No** in the **Replicated** column,
Loading
Loading
Loading
Loading
@@ -12,7 +12,9 @@ describe Backup::Repository do
allow(progress).to receive(:print)
allow(FileUtils).to receive(:mv).and_return(true)
 
allow_any_instance_of(described_class).to receive(:progress).and_return(progress)
allow_next_instance_of(described_class) do |instance|
allow(instance).to receive(:progress).and_return(progress)
end
end
 
describe '#dump' do
Loading
Loading
@@ -47,7 +49,9 @@ describe Backup::Repository do
 
describe 'command failure' do
before do
allow_any_instance_of(Gitlab::Shell).to receive(:create_repository).and_return(false)
allow_next_instance_of(Gitlab::Shell) do |instance|
allow(instance).to receive(:create_repository).and_return(false)
end
end
 
context 'hashed storage' do
Loading
Loading
Loading
Loading
@@ -60,7 +60,9 @@ describe Banzai::Filter::CommitReferenceFilter do
end
 
it 'escapes the title attribute' do
allow_any_instance_of(Commit).to receive(:title).and_return(%{"></a>whatever<a title="})
allow_next_instance_of(Commit) do |instance|
allow(instance).to receive(:title).and_return(%{"></a>whatever<a title="})
end
 
doc = reference_filter("See #{reference}")
expect(doc.text).to eq "See #{commit.short_id}"
Loading
Loading
Loading
Loading
@@ -7,13 +7,17 @@ describe Banzai::Filter::MarkdownFilter do
 
describe 'markdown engine from context' do
it 'defaults to CommonMark' do
expect_any_instance_of(Banzai::Filter::MarkdownEngines::CommonMark).to receive(:render).and_return('test')
expect_next_instance_of(Banzai::Filter::MarkdownEngines::CommonMark) do |instance|
expect(instance).to receive(:render).and_return('test')
end
 
filter('test')
end
 
it 'uses CommonMark' do
expect_any_instance_of(Banzai::Filter::MarkdownEngines::CommonMark).to receive(:render).and_return('test')
expect_next_instance_of(Banzai::Filter::MarkdownEngines::CommonMark) do |instance|
expect(instance).to receive(:render).and_return('test')
end
 
filter('test', { markdown_engine: :common_mark })
end
Loading
Loading
Loading
Loading
@@ -214,7 +214,9 @@ describe Banzai::Filter::MilestoneReferenceFilter do
end
 
it 'escapes the name attribute' do
allow_any_instance_of(Milestone).to receive(:title).and_return(%{"></a>whatever<a title="})
allow_next_instance_of(Milestone) do |instance|
allow(instance).to receive(:title).and_return(%{"></a>whatever<a title="})
end
 
doc = reference_filter("See #{reference}")
 
Loading
Loading
@@ -251,7 +253,9 @@ describe Banzai::Filter::MilestoneReferenceFilter do
end
 
it 'escapes the name attribute' do
allow_any_instance_of(Milestone).to receive(:title).and_return(%{"></a>whatever<a title="})
allow_next_instance_of(Milestone) do |instance|
allow(instance).to receive(:title).and_return(%{"></a>whatever<a title="})
end
 
doc = reference_filter("See #{reference}")
 
Loading
Loading
@@ -288,7 +292,9 @@ describe Banzai::Filter::MilestoneReferenceFilter do
end
 
it 'escapes the name attribute' do
allow_any_instance_of(Milestone).to receive(:title).and_return(%{"></a>whatever<a title="})
allow_next_instance_of(Milestone) do |instance|
allow(instance).to receive(:title).and_return(%{"></a>whatever<a title="})
end
 
doc = reference_filter("See #{reference}")
 
Loading
Loading
Loading
Loading
@@ -42,7 +42,9 @@ describe Banzai::Filter::ReferenceRedactorFilter do
 
context 'valid projects' do
before do
allow_any_instance_of(Banzai::ReferenceParser::BaseParser).to receive(:can_read_reference?).and_return(true)
allow_next_instance_of(Banzai::ReferenceParser::BaseParser) do |instance|
allow(instance).to receive(:can_read_reference?).and_return(true)
end
end
 
it 'allows permitted Project references' do
Loading
Loading
@@ -59,7 +61,9 @@ describe Banzai::Filter::ReferenceRedactorFilter do
 
context 'invalid projects' do
before do
allow_any_instance_of(Banzai::ReferenceParser::BaseParser).to receive(:can_read_reference?).and_return(false)
allow_next_instance_of(Banzai::ReferenceParser::BaseParser) do |instance|
allow(instance).to receive(:can_read_reference?).and_return(false)
end
end
 
it 'removes unpermitted references' do
Loading
Loading
Loading
Loading
@@ -92,7 +92,9 @@ describe Banzai::Filter::SyntaxHighlightFilter do
 
context "when Rouge lexing fails" do
before do
allow_any_instance_of(Rouge::Lexers::Ruby).to receive(:stream_tokens).and_raise(StandardError)
allow_next_instance_of(Rouge::Lexers::Ruby) do |instance|
allow(instance).to receive(:stream_tokens).and_raise(StandardError)
end
end
 
it "highlights as plaintext" do
Loading
Loading
@@ -106,7 +108,9 @@ describe Banzai::Filter::SyntaxHighlightFilter do
 
context "when Rouge lexing fails after a retry" do
before do
allow_any_instance_of(Rouge::Lexers::PlainText).to receive(:stream_tokens).and_raise(StandardError)
allow_next_instance_of(Rouge::Lexers::PlainText) do |instance|
allow(instance).to receive(:stream_tokens).and_raise(StandardError)
end
end
 
it "does not add highlighting classes" do
Loading
Loading
Loading
Loading
@@ -25,7 +25,9 @@ describe Banzai::ObjectRenderer do
end
 
it 'calls Banzai::ReferenceRedactor to perform redaction' do
expect_any_instance_of(Banzai::ReferenceRedactor).to receive(:redact).and_call_original
expect_next_instance_of(Banzai::ReferenceRedactor) do |instance|
expect(instance).to receive(:redact).and_call_original
end
 
renderer.render([object], :note)
end
Loading
Loading
@@ -85,7 +87,9 @@ describe Banzai::ObjectRenderer do
end
 
it 'calls Banzai::ReferenceRedactor to perform redaction' do
expect_any_instance_of(Banzai::ReferenceRedactor).to receive(:redact).and_call_original
expect_next_instance_of(Banzai::ReferenceRedactor) do |instance|
expect(instance).to receive(:redact).and_call_original
end
 
renderer.render([cacheless_thing], :title)
end
Loading
Loading
Loading
Loading
@@ -35,8 +35,9 @@ describe Banzai::ReferenceParser::CommitParser do
it 'returns an Array of commits' do
commit = double(:commit)
 
allow_any_instance_of(Project).to receive(:valid_repo?)
.and_return(true)
allow_next_instance_of(Project) do |instance|
allow(instance).to receive(:valid_repo?).and_return(true)
end
 
expect(subject).to receive(:find_commits)
.with(project, ['123'])
Loading
Loading
@@ -46,8 +47,9 @@ describe Banzai::ReferenceParser::CommitParser do
end
 
it 'returns an empty Array when the commit could not be found' do
allow_any_instance_of(Project).to receive(:valid_repo?)
.and_return(true)
allow_next_instance_of(Project) do |instance|
allow(instance).to receive(:valid_repo?).and_return(true)
end
 
expect(subject).to receive(:find_commits)
.with(project, ['123'])
Loading
Loading
@@ -57,8 +59,9 @@ describe Banzai::ReferenceParser::CommitParser do
end
 
it 'skips projects without valid repositories' do
allow_any_instance_of(Project).to receive(:valid_repo?)
.and_return(false)
allow_next_instance_of(Project) do |instance|
allow(instance).to receive(:valid_repo?).and_return(false)
end
 
expect(subject.referenced_by([link])).to eq([])
end
Loading
Loading
@@ -66,8 +69,9 @@ describe Banzai::ReferenceParser::CommitParser do
 
context 'when the link does not have a data-commit attribute' do
it 'returns an empty Array' do
allow_any_instance_of(Project).to receive(:valid_repo?)
.and_return(true)
allow_next_instance_of(Project) do |instance|
allow(instance).to receive(:valid_repo?).and_return(true)
end
 
expect(subject.referenced_by([link])).to eq([])
end
Loading
Loading
@@ -76,8 +80,9 @@ describe Banzai::ReferenceParser::CommitParser do
 
context 'when the link does not have a data-project attribute' do
it 'returns an empty Array' do
allow_any_instance_of(Project).to receive(:valid_repo?)
.and_return(true)
allow_next_instance_of(Project) do |instance|
allow(instance).to receive(:valid_repo?).and_return(true)
end
 
expect(subject.referenced_by([link])).to eq([])
end
Loading
Loading
Loading
Loading
@@ -173,10 +173,11 @@ describe Banzai::ReferenceRedactor do
doc = Nokogiri::HTML.fragment('<a data-reference-type="issue"></a>')
node = doc.children[0]
 
expect_any_instance_of(Banzai::ReferenceParser::IssueParser)
.to receive(:nodes_visible_to_user)
.with(user, [node])
.and_return([node])
expect_next_instance_of(Banzai::ReferenceParser::IssueParser) do |instance|
expect(instance).to receive(:nodes_visible_to_user)
.with(user, [node])
.and_return([node])
end
 
expect(redactor.nodes_visible_to_user([node])).to eq(Set.new([node]))
end
Loading
Loading
Loading
Loading
@@ -4,12 +4,16 @@ require 'spec_helper'
 
describe Bitbucket::Connection do
before do
allow_any_instance_of(described_class).to receive(:provider).and_return(double(app_id: '', app_secret: ''))
allow_next_instance_of(described_class) do |instance|
allow(instance).to receive(:provider).and_return(double(app_id: '', app_secret: ''))
end
end
 
describe '#get' do
it 'calls OAuth2::AccessToken::get' do
expect_any_instance_of(OAuth2::AccessToken).to receive(:get).and_return(double(parsed: true))
expect_next_instance_of(OAuth2::AccessToken) do |instance|
expect(instance).to receive(:get).and_return(double(parsed: true))
end
 
connection = described_class.new({})
 
Loading
Loading
@@ -19,7 +23,9 @@ describe Bitbucket::Connection do
 
describe '#expired?' do
it 'calls connection.expired?' do
expect_any_instance_of(OAuth2::AccessToken).to receive(:expired?).and_return(true)
expect_next_instance_of(OAuth2::AccessToken) do |instance|
expect(instance).to receive(:expired?).and_return(true)
end
 
expect(described_class.new({}).expired?).to be_truthy
end
Loading
Loading
@@ -29,7 +35,9 @@ describe Bitbucket::Connection do
it 'calls connection.refresh!' do
response = double(token: nil, expires_at: nil, expires_in: nil, refresh_token: nil)
 
expect_any_instance_of(OAuth2::AccessToken).to receive(:refresh!).and_return(response)
expect_next_instance_of(OAuth2::AccessToken) do |instance|
expect(instance).to receive(:refresh!).and_return(response)
end
 
described_class.new({}).refresh!
end
Loading
Loading
Loading
Loading
@@ -88,7 +88,9 @@ describe ExtractsPath do
 
context 'subclass overrides get_id' do
it 'uses ref returned by get_id' do
allow_any_instance_of(self.class).to receive(:get_id) { '38008cb17ce1466d8fec2dfa6f6ab8dcfe5cf49e' }
allow_next_instance_of(self.class) do |instance|
allow(instance).to receive(:get_id) { '38008cb17ce1466d8fec2dfa6f6ab8dcfe5cf49e' }
end
 
assign_ref_vars
 
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
 
describe Gitlab::GitlabImport::Client do
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
 
describe Gitlab::GitlabImport::Importer do
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
 
describe Gitlab::GitlabImport::ProjectCreator do
Loading
Loading
Loading
Loading
@@ -30,8 +30,9 @@ describe GoogleApi::Auth do
end
 
before do
allow_any_instance_of(OAuth2::Strategy::AuthCode)
.to receive(:get_token).and_return(token)
allow_next_instance_of(OAuth2::Strategy::AuthCode) do |instance|
allow(instance).to receive(:get_token).and_return(token)
end
end
 
it 'returns token and expires_at' do
Loading
Loading
Loading
Loading
@@ -15,7 +15,9 @@ describe OmniAuth::Strategies::SAML, type: :strategy do
 
it 'stores request ID during request phase' do
request_id = double
allow_any_instance_of(OneLogin::RubySaml::Authrequest).to receive(:uuid).and_return(request_id)
allow_next_instance_of(OneLogin::RubySaml::Authrequest) do |instance|
allow(instance).to receive(:uuid).and_return(request_id)
end
 
post '/users/auth/saml'
expect(session['last_authn_request_id']).to eq(request_id)
Loading
Loading
Loading
Loading
@@ -1095,7 +1095,9 @@ describe Notify do
 
context 'when note is not on text' do
before do
allow_any_instance_of(DiffDiscussion).to receive(:on_text?).and_return(false)
allow_next_instance_of(DiffDiscussion) do |instance|
allow(instance).to receive(:on_text?).and_return(false)
end
end
 
it 'does not include diffs with character-level highlighting' do
Loading
Loading
Loading
Loading
@@ -2474,7 +2474,9 @@ describe Ci::Pipeline, :mailer do
let(:pipeline) { create(:ci_empty_pipeline, status: 'created', project: project, ref: 'master', sha: 'a288a022a53a5a944fae87bcec6efc87b7061808') }
 
it "returns merge requests whose `diff_head_sha` matches the pipeline's SHA" do
allow_any_instance_of(MergeRequest).to receive(:diff_head_sha) { 'a288a022a53a5a944fae87bcec6efc87b7061808' }
allow_next_instance_of(MergeRequest) do |instance|
allow(instance).to receive(:diff_head_sha) { 'a288a022a53a5a944fae87bcec6efc87b7061808' }
end
merge_request = create(:merge_request, source_project: project, head_pipeline: pipeline, source_branch: pipeline.ref)
 
expect(pipeline.merge_requests_as_head_pipeline).to eq([merge_request])
Loading
Loading
@@ -2488,7 +2490,9 @@ describe Ci::Pipeline, :mailer do
 
it "doesn't return merge requests whose `diff_head_sha` doesn't match the pipeline's SHA" do
create(:merge_request, source_project: project, source_branch: pipeline.ref)
allow_any_instance_of(MergeRequest).to receive(:diff_head_sha) { '97de212e80737a608d939f648d959671fb0a0142b' }
allow_next_instance_of(MergeRequest) do |instance|
allow(instance).to receive(:diff_head_sha) { '97de212e80737a608d939f648d959671fb0a0142b' }
end
 
expect(pipeline.merge_requests_as_head_pipeline).to be_empty
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment