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

Add latest changes from gitlab-org/gitlab@master

parent 988b28ec
No related branches found
No related tags found
No related merge requests found
Showing
with 149 additions and 59 deletions
Loading
Loading
@@ -183,8 +183,8 @@ describe IssuablesHelper do
@project = issue.project
 
expected_data = {
endpoint: "/#{@project.full_path}/issues/#{issue.iid}",
updateEndpoint: "/#{@project.full_path}/issues/#{issue.iid}.json",
endpoint: "/#{@project.full_path}/-/issues/#{issue.iid}",
updateEndpoint: "/#{@project.full_path}/-/issues/#{issue.iid}.json",
canUpdate: true,
canDestroy: true,
issuableRef: "##{issue.iid}",
Loading
Loading
Loading
Loading
@@ -200,7 +200,7 @@ describe IssuesHelper do
 
shared_examples 'successfully displays link to issue and with css class' do |action|
it 'returns link' do
link = "<a class=\"#{css_class}\" href=\"/#{new_issue.project.full_path}/issues/#{new_issue.iid}\">(#{action})</a>"
link = "<a class=\"#{css_class}\" href=\"/#{new_issue.project.full_path}/-/issues/#{new_issue.iid}\">(#{action})</a>"
 
expect(helper.issue_closed_link(issue, user, css_class: css_class)).to match(link)
end
Loading
Loading
Loading
Loading
@@ -56,7 +56,7 @@ describe LabelsHelper do
 
context 'without subject' do
it "uses the label's project" do
expect(link_to_label(label_presenter)).to match %r{<a.*href="/#{label.project.full_path}/issues\?label_name%5B%5D=#{label.name}".*>.*</a>}m
expect(link_to_label(label_presenter)).to match %r{<a.*href="/#{label.project.full_path}/-/issues\?label_name%5B%5D=#{label.name}".*>.*</a>}m
end
end
 
Loading
Loading
@@ -65,7 +65,7 @@ describe LabelsHelper do
let(:subject) { build(:project, namespace: namespace, name: 'bar3') }
 
it 'links to project issues page' do
expect(link_to_label(label_presenter)).to match %r{<a.*href="/foo3/bar3/issues\?label_name%5B%5D=#{label.name}".*>.*</a>}m
expect(link_to_label(label_presenter)).to match %r{<a.*href="/foo3/bar3/-/issues\?label_name%5B%5D=#{label.name}".*>.*</a>}m
end
end
 
Loading
Loading
@@ -78,15 +78,7 @@ describe LabelsHelper do
end
 
context 'with a type argument' do
['issue', :issue].each do |type|
context "set to #{type}" do
it 'links to correct page' do
expect(link_to_label(label_presenter, type: type)).to match %r{<a.*href="/#{label.project.full_path}/#{type.to_s.pluralize}\?label_name%5B%5D=#{label.name}".*>.*</a>}m
end
end
end
['merge_request', :merge_request].each do |type|
['issue', :issue, 'merge_request', :merge_request].each do |type|
context "set to #{type}" do
it 'links to correct page' do
expect(link_to_label(label_presenter, type: type)).to match %r{<a.*href="/#{label.project.full_path}/-/#{type.to_s.pluralize}\?label_name%5B%5D=#{label.name}".*>.*</a>}m
Loading
Loading
Loading
Loading
@@ -272,7 +272,7 @@ describe NotesHelper do
let(:note) { create(:note_on_issue, noteable: issue, project: project) }
 
it 'returns the noteable url with an anchor to the note' do
expect(noteable_note_url(note)).to match("/#{project.namespace.path}/#{project.path}/issues/#{issue.iid}##{dom_id(note)}")
expect(noteable_note_url(note)).to match("/#{project.namespace.path}/#{project.path}/-/issues/#{issue.iid}##{dom_id(note)}")
end
end
 
Loading
Loading
Loading
Loading
@@ -64,7 +64,7 @@ export default {
resolve_path:
'/gitlab-org/gitlab-test/-/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve',
resolve_with_issue_path:
'/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
'/gitlab-org/gitlab-test/-/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
},
{
id: '1753',
Loading
Loading
@@ -117,7 +117,7 @@ export default {
resolve_path:
'/gitlab-org/gitlab-test/-/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve',
resolve_with_issue_path:
'/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
'/gitlab-org/gitlab-test/-/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
},
{
id: '1754',
Loading
Loading
@@ -160,7 +160,7 @@ export default {
resolve_path:
'/gitlab-org/gitlab-test/-/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve',
resolve_with_issue_path:
'/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
'/gitlab-org/gitlab-test/-/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
},
{
id: '1755',
Loading
Loading
@@ -203,7 +203,7 @@ export default {
resolve_path:
'/gitlab-org/gitlab-test/-/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve',
resolve_with_issue_path:
'/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
'/gitlab-org/gitlab-test/-/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
},
{
id: '1756',
Loading
Loading
@@ -246,7 +246,7 @@ export default {
resolve_path:
'/gitlab-org/gitlab-test/-/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve',
resolve_with_issue_path:
'/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
'/gitlab-org/gitlab-test/-/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
},
],
individual_note: false,
Loading
Loading
@@ -255,7 +255,7 @@ export default {
resolve_path:
'/gitlab-org/gitlab-test/-/merge_requests/20/discussions/6b232e05bea388c6b043ccc243ba505faac04ea8/resolve',
resolve_with_issue_path:
'/gitlab-org/gitlab-test/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
'/gitlab-org/gitlab-test/-/issues/new?discussion_to_resolve=6b232e05bea388c6b043ccc243ba505faac04ea8&merge_request_to_resolve_discussions_of=20',
diff_file: {
submodule: false,
submodule_link: null,
Loading
Loading
Loading
Loading
@@ -40,17 +40,19 @@ describe('Issuable output', () => {
const IssuableDescriptionComponent = Vue.extend(issuableApp);
 
mock = new MockAdapter(axios);
mock.onGet('/gitlab-org/gitlab-shell/issues/9/realtime_changes/realtime_changes').reply(() => {
const res = Promise.resolve([200, REALTIME_REQUEST_STACK[realtimeRequestCount]]);
realtimeRequestCount += 1;
return res;
});
mock
.onGet('/gitlab-org/gitlab-shell/-/issues/9/realtime_changes/realtime_changes')
.reply(() => {
const res = Promise.resolve([200, REALTIME_REQUEST_STACK[realtimeRequestCount]]);
realtimeRequestCount += 1;
return res;
});
 
vm = new IssuableDescriptionComponent({
propsData: {
canUpdate: true,
canDestroy: true,
endpoint: '/gitlab-org/gitlab-shell/issues/9/realtime_changes',
endpoint: '/gitlab-org/gitlab-shell/-/issues/9/realtime_changes',
updateEndpoint: gl.TEST_HOST,
issuableRef: '#1',
initialTitleHtml: '',
Loading
Loading
Loading
Loading
@@ -216,7 +216,7 @@ export default {
remove_wip_path: '/root/acets-app/-/merge_requests/22/remove_wip',
cancel_auto_merge_path: '/root/acets-app/-/merge_requests/22/cancel_auto_merge',
create_issue_to_resolve_discussions_path:
'/root/acets-app/issues/new?merge_request_to_resolve_discussions_of=22',
'/root/acets-app/-/issues/new?merge_request_to_resolve_discussions_of=22',
merge_path: '/root/acets-app/-/merge_requests/22/merge',
cherry_pick_in_fork_path:
'/root/acets-app/forks?continue%5Bnotice%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+has+been+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.+Try+to+revert+this+commit+again.&continue%5Bnotice_now%5D=You%27re+not+allowed+to+make+changes+to+this+project+directly.+A+fork+of+this+project+is+being+created+that+you+can+make+changes+in%2C+so+you+can+submit+a+merge+request.&continue%5Bto%5D=%2Froot%2Facets-app%2Fmerge_requests%2F22&namespace_key=1',
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::Ci::Pipeline::Chain::Build::Associations do
let(:project) { create(:project, :repository) }
let(:user) { create(:user, developer_projects: [project]) }
let(:pipeline) { Ci::Pipeline.new }
let(:step) { described_class.new(pipeline, command) }
let(:command) do
Gitlab::Ci::Pipeline::Chain::Command.new(
source: :push,
origin_ref: 'master',
checkout_sha: project.commit.id,
after_sha: nil,
before_sha: nil,
trigger_request: nil,
schedule: nil,
merge_request: nil,
project: project,
current_user: user,
bridge: bridge)
end
context 'when a bridge is passed in to the pipeline creation' do
let(:bridge) { create(:ci_bridge) }
it 'links the pipeline to the upstream bridge job' do
step.perform!
expect(pipeline.source_pipeline).to be_present
expect(pipeline.source_pipeline).to be_valid
expect(pipeline.source_pipeline).to have_attributes(
source_pipeline: bridge.pipeline, source_project: bridge.project,
source_bridge: bridge, project: project
)
end
it 'never breaks the chain' do
step.perform!
expect(step.break?).to eq(false)
end
end
context 'when a bridge is not passed in to the pipeline creation' do
let(:bridge) { nil }
it 'leaves the source pipeline empty' do
step.perform!
expect(pipeline.source_pipeline).to be_nil
end
it 'never breaks the chain' do
step.perform!
expect(step.break?).to eq(false)
end
end
end
Loading
Loading
@@ -20,7 +20,7 @@ describe Gitlab::UrlBuilder do
 
url = described_class.build(issue)
 
expect(url).to eq "#{Settings.gitlab['url']}/#{issue.project.full_path}/issues/#{issue.iid}"
expect(url).to eq "#{Settings.gitlab['url']}/#{issue.project.full_path}/-/issues/#{issue.iid}"
end
end
 
Loading
Loading
@@ -107,7 +107,7 @@ describe Gitlab::UrlBuilder do
 
url = described_class.build(note)
 
expect(url).to eq "#{Settings.gitlab['url']}/#{issue.project.full_path}/issues/#{issue.iid}#note_#{note.id}"
expect(url).to eq "#{Settings.gitlab['url']}/#{issue.project.full_path}/-/issues/#{issue.iid}#note_#{note.id}"
end
end
 
Loading
Loading
Loading
Loading
@@ -33,9 +33,9 @@ describe GitlabIssueTrackerService do
end
 
it 'gives the correct path' do
expect(service.project_url).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.full_path}/issues")
expect(service.new_issue_url).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.full_path}/issues/new")
expect(service.issue_url(432)).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.full_path}/issues/432")
expect(service.project_url).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.full_path}/-/issues")
expect(service.new_issue_url).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.full_path}/-/issues/new")
expect(service.issue_url(432)).to eq("http://#{Gitlab.config.gitlab.host}/gitlab/root/#{project.full_path}/-/issues/432")
end
end
 
Loading
Loading
@@ -45,9 +45,9 @@ describe GitlabIssueTrackerService do
end
 
it 'gives the correct path' do
expect(service.issue_tracker_path).to eq("/gitlab/root/#{project.full_path}/issues")
expect(service.new_issue_path).to eq("/gitlab/root/#{project.full_path}/issues/new")
expect(service.issue_path(432)).to eq("/gitlab/root/#{project.full_path}/issues/432")
expect(service.issue_tracker_path).to eq("/gitlab/root/#{project.full_path}/-/issues")
expect(service.new_issue_path).to eq("/gitlab/root/#{project.full_path}/-/issues/new")
expect(service.issue_path(432)).to eq("/gitlab/root/#{project.full_path}/-/issues/432")
end
end
end
Loading
Loading
Loading
Loading
@@ -17,7 +17,7 @@ describe IssuePresenter do
 
describe '#web_url' do
it 'returns correct path' do
expect(presenter.web_url).to eq("http://localhost/#{group.name}/#{project.name}/issues/#{issue.iid}")
expect(presenter.web_url).to eq("http://localhost/#{group.name}/#{project.name}/-/issues/#{issue.iid}")
end
end
 
Loading
Loading
@@ -37,7 +37,7 @@ describe IssuePresenter do
 
describe '#issue_path' do
it 'returns correct path' do
expect(presenter.issue_path).to eq("/#{group.name}/#{project.name}/issues/#{issue.iid}")
expect(presenter.issue_path).to eq("/#{group.name}/#{project.name}/-/issues/#{issue.iid}")
end
end
end
Loading
Loading
@@ -128,11 +128,11 @@ describe MergeRequestPresenter do
subject { described_class.new(resource, current_user: user).closing_issues_links }
 
it 'presents closing issues links' do
is_expected.to match("#{project.full_path}/issues/#{issue_a.iid}")
is_expected.to match("#{project.full_path}/-/issues/#{issue_a.iid}")
end
 
it 'does not present related issues links' do
is_expected.not_to match("#{project.full_path}/issues/#{issue_b.iid}")
is_expected.not_to match("#{project.full_path}/-/issues/#{issue_b.iid}")
end
 
it 'appends status when closing issue is already closed' do
Loading
Loading
@@ -148,11 +148,11 @@ describe MergeRequestPresenter do
end
 
it 'presents related issues links' do
is_expected.to match("#{project.full_path}/issues/#{issue_b.iid}")
is_expected.to match("#{project.full_path}/-/issues/#{issue_b.iid}")
end
 
it 'does not present closing issues links' do
is_expected.not_to match("#{project.full_path}/issues/#{issue_a.iid}")
is_expected.not_to match("#{project.full_path}/-/issues/#{issue_a.iid}")
end
 
it 'appends status when mentioned issue is already closed' do
Loading
Loading
@@ -275,7 +275,7 @@ describe MergeRequestPresenter do
project.add_maintainer(user)
 
is_expected
.to eq("/#{resource.project.full_path}/issues/new?merge_request_to_resolve_discussions_of=#{resource.iid}")
.to eq("/#{resource.project.full_path}/-/issues/new?merge_request_to_resolve_discussions_of=#{resource.iid}")
end
end
 
Loading
Loading
Loading
Loading
@@ -78,7 +78,7 @@ describe API::Releases do
issue_uri = URI.parse(links['issues_url'])
 
expect(mr_uri.path).to eq("#{path_base}/-/merge_requests")
expect(issue_uri.path).to eq("#{path_base}/issues")
expect(issue_uri.path).to eq("#{path_base}/-/issues")
expect(mr_uri.query).to eq(expected_query)
expect(issue_uri.query).to eq(expected_query)
end
Loading
Loading
Loading
Loading
@@ -109,7 +109,7 @@ describe Ci::CreateCrossProjectPipelineService, '#execute' do
expect(pipeline.source_bridge).to be_a ::Ci::Bridge
end
 
it 'updates bridge status when downstream pipeline gets proceesed' do
it 'updates bridge status when downstream pipeline gets processed' do
pipeline = service.execute(bridge)
 
expect(pipeline.reload).to be_pending
Loading
Loading
@@ -128,6 +128,37 @@ describe Ci::CreateCrossProjectPipelineService, '#execute' do
end
end
 
context 'when downstream pipeline has yaml configuration error' do
before do
stub_ci_pipeline_yaml_file(YAML.dump(job: { invalid: 'yaml' }))
end
it 'creates only one new pipeline' do
expect { service.execute(bridge) }
.to change { Ci::Pipeline.count }.by(1)
end
it 'creates a new pipeline in a downstream project' do
pipeline = service.execute(bridge)
expect(pipeline.user).to eq bridge.user
expect(pipeline.project).to eq downstream_project
expect(bridge.sourced_pipelines.first.pipeline).to eq pipeline
expect(pipeline.triggered_by_pipeline).to eq upstream_pipeline
expect(pipeline.source_bridge).to eq bridge
expect(pipeline.source_bridge).to be_a ::Ci::Bridge
end
it 'does not update bridge status when downstream pipeline gets processed' do
pipeline = service.execute(bridge)
expect(pipeline.reload).to be_failed
# TODO: This should change to failed once #198354 gets fixed.
# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25706
expect(bridge.reload).to be_pending
end
end
context 'when downstream project is the same as the job project' do
let(:trigger) do
{ trigger: { project: upstream_project.full_path } }
Loading
Loading
@@ -173,7 +204,7 @@ describe Ci::CreateCrossProjectPipelineService, '#execute' do
expect(pipeline.source_bridge).to be_a ::Ci::Bridge
end
 
it 'updates bridge status when downstream pipeline gets proceesed' do
it 'updates bridge status when downstream pipeline gets processed' do
pipeline = service.execute(bridge)
 
expect(pipeline.reload).to be_pending
Loading
Loading
Loading
Loading
@@ -4,18 +4,22 @@ require 'spec_helper'
describe Ci::CreatePipelineService do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:user) { create(:admin) }
let(:upstream_pipeline) { create(:ci_pipeline) }
let(:ref) { 'refs/heads/master' }
let(:service) { described_class.new(project, user, { ref: ref }) }
 
context 'custom config content' do
let(:bridge) do
double(:bridge, yaml_for_downstream: <<~YML
rspec:
script: rspec
custom:
script: custom
YML
)
create(:ci_bridge, status: 'running', pipeline: upstream_pipeline, project: upstream_pipeline.project).tap do |bridge|
allow(bridge).to receive(:yaml_for_downstream).and_return(
<<~YML
rspec:
script: rspec
custom:
script: custom
YML
)
end
end
 
subject { service.execute(:push, bridge: bridge) }
Loading
Loading
Loading
Loading
@@ -27,7 +27,7 @@ describe ErrorTracking::IssueDetailsService do
create(:sentry_issue, issue: gitlab_issue, sentry_issue_identifier: detailed_error.id)
 
expect(result[:issue].gitlab_issue).to include(
"http", "/#{project.full_path}/issues/#{gitlab_issue.iid}"
"http", "/#{project.full_path}/-/issues/#{gitlab_issue.iid}"
)
end
 
Loading
Loading
Loading
Loading
@@ -11,7 +11,6 @@ describe 'admin/application_settings/integrations.html.haml' do
before do
assign(:application_setting, app_settings)
allow(Gitlab::Sourcegraph).to receive(:feature_available?).and_return(sourcegraph_flag)
allow(License).to receive(:feature_available?).with(:elastic_search).and_return(false) if defined?(License)
end
 
context 'when sourcegraph feature is enabled' do
Loading
Loading
Loading
Loading
@@ -801,10 +801,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.104.0.tgz#ebbf99788d74b7224f116f1c0040fa0c90034d99"
integrity sha512-lWg/EzxFdbx4YIdDWB2p5ag6Cna78AYGET8nXQYXYwd21/U3wKXKL7vsGR4kOxe1goA9ZAYG9eY+MK7cf+X2cA==
 
"@gitlab/ui@^9.18.2":
version "9.18.2"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-9.18.2.tgz#b82387a8c7bde1db069670596d5ef05d4a16400a"
integrity sha512-nBJMIdTX+LYYVGWiF3tdhQ5/tPaYIW80rz8DBzxfLaZYw9pJPolXZ8Vj7xlJWRHbqiM+HghvJPPvgcBXIfKzPw==
"@gitlab/ui@^9.20.0":
version "9.20.0"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-9.20.0.tgz#69d8d345408a727cfe7ebde3554c78c58f9065b2"
integrity sha512-ZWMpvK2Zd2xwQ9svvjzSSD3jI3NnE5izc/bR6kbzXoAe+KdUzLeHDih1ePwhU87BCJeS8JrhJhXT8xnYv/dICg==
dependencies:
"@babel/standalone" "^7.0.0"
"@gitlab/vue-toasted" "^1.3.0"
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