Read about our upcoming Code of Conduct on this issue

Commit abb87832 authored by Gabriel Mazetto's avatar Gabriel Mazetto
Browse files

Rename many path_with_namespace -> full_path

parent 98efcda80168
......@@ -90,7 +90,7 @@ class Runner < Grape::API
if result.valid?
if result.build
Gitlab::Metrics.add_event(:build_found,
project: result.build.project.path_with_namespace)
project: result.build.project.full_path)
present result.build, with: Entities::JobRequest::Response
else
Gitlab::Metrics.add_event(:build_not_found)
......@@ -119,7 +119,7 @@ class Runner < Grape::API
job.trace.set(params[:trace]) if params[:trace]
Gitlab::Metrics.add_event(:update_build,
project: job.project.path_with_namespace)
project: job.project.full_path)
case params[:state].to_s
when 'success'
......
......@@ -7,7 +7,7 @@ def dump
prepare
Project.find_each(batch_size: 1000) do |project|
progress.print " * #{project.path_with_namespace} ... "
progress.print " * #{project.full_path} ... "
path_to_project_repo = path_to_repo(project)
path_to_project_bundle = path_to_bundle(project)
......@@ -71,7 +71,7 @@ def restore
end
Project.find_each(batch_size: 1000) do |project|
progress.print " * #{project.path_with_namespace} ... "
progress.print " * #{project.full_path} ... "
path_to_project_repo = path_to_repo(project)
path_to_project_bundle = path_to_bundle(project)
......@@ -185,7 +185,7 @@ def silent
def progress_warn(project, cmd, output)
progress.puts "[WARNING] Executing #{cmd}".color(:orange)
progress.puts "Ignoring error on #{project.path_with_namespace} - #{output}".color(:orange)
progress.puts "Ignoring error on #{project.full_path} - #{output}".color(:orange)
end
def empty_repo?(project_or_wiki)
......
......@@ -259,7 +259,7 @@ def find_projects_for_paths(paths)
found = []
projects.each do |project|
ref = project.path_with_namespace
ref = project.full_path
get_or_set_cache(cache, ref) { project }
found << ref
end
......@@ -277,7 +277,7 @@ def find_projects_for_paths(paths)
end
def current_project_path
@current_project_path ||= project.path_with_namespace
@current_project_path ||= project.full_path
end
def current_project_namespace_path
......
......@@ -28,7 +28,7 @@ def process_link_attr(html_attr)
end
def build_url(uri)
File.join(Gitlab.config.gitlab.url, project.path_with_namespace, uri)
File.join(Gitlab.config.gitlab.url, project.full_path, uri)
end
def project
......
......@@ -29,7 +29,7 @@ class Builds < Grape::API
if result.valid?
if result.build
Gitlab::Metrics.add_event(:build_found,
project: result.build.project.path_with_namespace)
project: result.build.project.full_path)
present result.build, with: Entities::BuildDetails
else
......@@ -64,7 +64,7 @@ class Builds < Grape::API
build.trace.set(params[:trace]) if params[:trace]
Gitlab::Metrics.add_event(:update_build,
project: build.project.path_with_namespace)
project: build.project.full_path)
case params[:state].to_s
when 'success'
......
......@@ -93,7 +93,7 @@ def fetch_repository
def fetch_wiki_repository
wiki_url = "https://#{options.fetch(:token)}@github.com/#{repo}.wiki.git"
wiki_path = "#{project.path_with_namespace}.wiki"
wiki_path = "#{project.full_path}.wiki"
unless project.wiki.repository_exists?
gitlab_shell.import_repository(project.repository_storage_path, wiki_path, wiki_url)
......
......@@ -61,7 +61,7 @@ def repo
def import_wiki
return if project.wiki.repository_exists?
path_with_namespace = "#{project.path_with_namespace}.wiki"
path_with_namespace = "#{project.full_path}.wiki"
import_url = project.import_url.sub(/\.git\z/, ".git/wiki")
gitlab_shell.import_repository(project.repository_storage_path, path_with_namespace, import_url)
rescue StandardError => e
......
......@@ -117,7 +117,7 @@ def reply_to
def subject
subject_text = '[Git]'
subject_text << "[#{project.path_with_namespace}]"
subject_text << "[#{project.full_path}]"
subject_text << "[#{ref_name}]" if @action == :push
subject_text << ' '
......
......@@ -8,7 +8,7 @@ def initialize(project)
end
def path_with_namespace
"#{project.path_with_namespace}.wiki"
"#{project.full_path}.wiki"
end
def import_url
......
......@@ -48,7 +48,7 @@
let(:id) { 'markdown/doc' }
it 'redirects' do
expect(subject)
.to redirect_to("/#{project.path_with_namespace}/tree/markdown/doc")
.to redirect_to("/#{project.full_path}/tree/markdown/doc")
end
end
end
......
......@@ -33,7 +33,7 @@
let(:ref) { "master" }
it 'redirects' do
expect(subject)
.to redirect_to("/#{project.path_with_namespace}/tree/merge_branch")
.to redirect_to("/#{project.full_path}/tree/merge_branch")
end
end
......@@ -42,7 +42,7 @@
let(:ref) { "master" }
it 'redirects' do
expect(subject)
.to redirect_to("/#{project.path_with_namespace}/tree/alert('merge');")
.to redirect_to("/#{project.full_path}/tree/alert('merge');")
end
end
......@@ -82,7 +82,7 @@
issue_iid: issue.iid
expect(subject)
.to redirect_to("/#{project.path_with_namespace}/tree/1-feature-branch")
.to redirect_to("/#{project.full_path}/tree/1-feature-branch")
end
it 'posts a system note' do
......
......@@ -609,7 +609,7 @@ def post_assign_issues
end
it 'links to the environment on that project' do
expect(json_response.first['url']).to match /#{forked.path_with_namespace}/
expect(json_response.first['url']).to match /#{forked.full_path}/
end
end
end
......
......@@ -81,7 +81,7 @@
context 'redirect to blob' do
let(:id) { 'master/README.md' }
it 'redirects' do
redirect_url = "/#{project.path_with_namespace}/blob/master/README.md"
redirect_url = "/#{project.full_path}/blob/master/README.md"
expect(subject)
.to redirect_to(redirect_url)
end
......@@ -107,7 +107,7 @@
it 'redirects to the new directory' do
expect(subject)
.to redirect_to("/#{project.path_with_namespace}/tree/#{branch_name}/#{path}")
.to redirect_to("/#{project.full_path}/tree/#{branch_name}/#{path}")
expect(flash[:notice]).to eq('The directory has been successfully created.')
end
end
......@@ -118,7 +118,7 @@
it 'does not allow overwriting of existing files' do
expect(subject)
.to redirect_to("/#{project.path_with_namespace}/tree/master")
.to redirect_to("/#{project.full_path}/tree/master")
expect(flash[:alert]).to eq('A file with this name already exists')
end
end
......
......@@ -67,8 +67,8 @@
visit project_new_merge_request_path(project, merge_request: { target_project_id: private_project.id })
expect(page).not_to have_content private_project.path_with_namespace
expect(page).to have_content project.path_with_namespace
expect(page).not_to have_content private_project.full_path
expect(page).to have_content project.full_path
end
end
......@@ -78,8 +78,8 @@
visit project_new_merge_request_path(project, merge_request: { source_project_id: private_project.id })
expect(page).not_to have_content private_project.path_with_namespace
expect(page).to have_content project.path_with_namespace
expect(page).not_to have_content private_project.full_path
expect(page).to have_content project.full_path
end
end
......
......@@ -38,10 +38,10 @@
expect(page).to have_content("regular link")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a/b/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a/b/c/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a/b/c/e/f/relative\">relative link 3</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a/b/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a/b/c/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a/b/c/e/f/relative\">relative link 3</a>")
end
end
......@@ -60,10 +60,10 @@
expect(page).to have_content("regular link")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/c-page/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/c-page/e/f/relative\">relative link 3</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/c-page/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/c-page/e/f/relative\">relative link 3</a>")
end
end
......@@ -82,10 +82,10 @@
expect(page).to have_content("regular link")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/c-page/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/c-page/e/f/relative\">relative link 3</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/c-page/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/c-page/e/f/relative\">relative link 3</a>")
end
end
end
......@@ -115,10 +115,10 @@ def create_wiki_page(path)
expect(page).to have_content("regular link")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a/b/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a/b/c/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a/b/c/e/f/relative\">relative link 3</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a/b/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a/b/c/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a/b/c/e/f/relative\">relative link 3</a>")
end
end
......@@ -132,10 +132,10 @@ def create_wiki_page(path)
expect(page).to have_content("regular link")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/c-page/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/c-page/e/f/relative\">relative link 3</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/c-page/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/c-page/e/f/relative\">relative link 3</a>")
end
end
......@@ -149,10 +149,10 @@ def create_wiki_page(path)
expect(page).to have_content("regular link")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/c-page/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.path_with_namespace}/wikis/a-page/b-page/c-page/e/f/relative\">relative link 3</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/regular\">regular link</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/relative\">relative link 1</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/c-page/relative\">relative link 2</a>")
expect(page.html).to include("<a href=\"/#{project.full_path}/wikis/a-page/b-page/c-page/e/f/relative\">relative link 3</a>")
end
end
end
......
......@@ -7,7 +7,7 @@
context 'without subject' do
it "uses the label's project" do
expect(link_to_label(label)).to match %r{<a href="/#{label.project.path_with_namespace}/issues\?label_name%5B%5D=#{label.name}">.*</a>}
expect(link_to_label(label)).to match %r{<a href="/#{label.project.full_path}/issues\?label_name%5B%5D=#{label.name}">.*</a>}
end
end
......@@ -32,7 +32,7 @@
['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, type: type)).to match %r{<a href="/#{label.project.path_with_namespace}/#{type.to_s.pluralize}\?label_name%5B%5D=#{label.name}">.*</a>}
expect(link_to_label(label, type: type)).to match %r{<a href="/#{label.project.full_path}/#{type.to_s.pluralize}\?label_name%5B%5D=#{label.name}">.*</a>}
end
end
end
......
......@@ -210,11 +210,11 @@
describe '#cross_project_reference' do
it 'shows the full MR reference' do
expect(helper.cross_project_reference(project, merge_request)).to include(project.path_with_namespace)
expect(helper.cross_project_reference(project, merge_request)).to include(project.full_path)
end
it 'shows the full issue reference' do
expect(helper.cross_project_reference(project, issue)).to include(project.path_with_namespace)
expect(helper.cross_project_reference(project, issue)).to include(project.full_path)
end
end
end
......@@ -34,8 +34,8 @@
let(:fork_project) { create(:empty_project, forked_from_project: project) }
let(:merge_request) { create(:merge_request, source_project: fork_project, target_project: project) }
subject { format_mr_branch_names(merge_request) }
let(:source_title) { "#{fork_project.path_with_namespace}:#{merge_request.source_branch}" }
let(:target_title) { "#{project.path_with_namespace}:#{merge_request.target_branch}" }
let(:source_title) { "#{fork_project.full_path}:#{merge_request.source_branch}" }
let(:target_title) { "#{project.full_path}:#{merge_request.target_branch}" }
it { is_expected.to eq([source_title, target_title]) }
end
......
......@@ -53,13 +53,13 @@
end
it "returns a valid cach key" do
expect(helper.send(:readme_cache_key)).to eq("#{project.path_with_namespace}-#{project.commit.id}-readme")
expect(helper.send(:readme_cache_key)).to eq("#{project.full_path}-#{project.commit.id}-readme")
end
it "returns a valid cache key if HEAD does not exist" do
allow(project).to receive(:commit) { nil }
expect(helper.send(:readme_cache_key)).to eq("#{project.path_with_namespace}-nil-readme")
expect(helper.send(:readme_cache_key)).to eq("#{project.full_path}-nil-readme")
end
end
......
......@@ -5,7 +5,7 @@
describe '#references_per_project' do
it 'returns a Hash containing references grouped per project paths' do
doc = Nokogiri::HTML.fragment("#1 #{project.path_with_namespace}#2")
doc = Nokogiri::HTML.fragment("#1 #{project.full_path}#2")
filter = described_class.new(doc, project: project)
expect(filter).to receive(:object_class).exactly(4).times.and_return(Issue)
......@@ -14,7 +14,7 @@
refs = filter.references_per_project
expect(refs).to be_an_instance_of(Hash)
expect(refs[project.path_with_namespace]).to eq(Set.new(%w[1 2]))
expect(refs[project.full_path]).to eq(Set.new(%w[1 2]))
end
end
......@@ -24,10 +24,10 @@
filter = described_class.new(doc, project: project)
expect(filter).to receive(:references_per_project)
.and_return({ project.path_with_namespace => Set.new(%w[1]) })
.and_return({ project.full_path => Set.new(%w[1]) })
expect(filter.projects_per_reference)
.to eq({ project.path_with_namespace => project })
.to eq({ project.full_path => project })
end
end
......@@ -37,7 +37,7 @@
context 'with RequestStore disabled' do
it 'returns a list of Projects for a list of paths' do
expect(filter.find_projects_for_paths([project.path_with_namespace]))
expect(filter.find_projects_for_paths([project.full_path]))
.to eq([project])
end
......@@ -49,7 +49,7 @@
context 'with RequestStore enabled', :request_store do
it 'returns a list of Projects for a list of paths' do
expect(filter.find_projects_for_paths([project.path_with_namespace]))
expect(filter.find_projects_for_paths([project.full_path]))
.to eq([project])
end
......@@ -88,7 +88,7 @@
doc = Nokogiri::HTML.fragment('')
filter = described_class.new(doc, project: project)
expect(filter.current_project_path).to eq(project.path_with_namespace)
expect(filter.current_project_path).to eq(project.full_path)
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment