Skip to content
Snippets Groups Projects
Commit abb87832 authored by Gabriel Mazetto's avatar Gabriel Mazetto
Browse files

Rename many path_with_namespace -> full_path

parent 98615318
No related branches found
No related tags found
No related merge requests found
Showing
with 46 additions and 44 deletions
Loading
Loading
@@ -40,7 +40,7 @@ module MergeRequestsHelper
 
def merge_path_description(merge_request, separator)
if merge_request.for_fork?
"Project:Branches: #{@merge_request.source_project_path}:#{@merge_request.source_branch} #{separator} #{@merge_request.target_project.path_with_namespace}:#{@merge_request.target_branch}"
"Project:Branches: #{@merge_request.source_project_path}:#{@merge_request.source_branch} #{separator} #{@merge_request.target_project.full_path}:#{@merge_request.target_branch}"
else
"Branches: #{@merge_request.source_branch} #{separator} #{@merge_request.target_branch}"
end
Loading
Loading
Loading
Loading
@@ -398,7 +398,7 @@ module ProjectsHelper
if project
import_path = "/Home/Stacks/import"
 
repo = project.path_with_namespace
repo = project.full_path
branch ||= project.default_branch
sha ||= project.commit.short_id
 
Loading
Loading
@@ -458,7 +458,7 @@ module ProjectsHelper
 
def readme_cache_key
sha = @project.commit.try(:sha) || 'nil'
[@project.path_with_namespace, sha, "readme"].join('-')
[@project.full_path, sha, "readme"].join('-')
end
 
def current_ref
Loading
Loading
Loading
Loading
@@ -165,7 +165,7 @@ class Notify < BaseMailer
 
headers['X-GitLab-Project'] = @project.name
headers['X-GitLab-Project-Id'] = @project.id
headers['X-GitLab-Project-Path'] = @project.path_with_namespace
headers['X-GitLab-Project-Path'] = @project.full_path
end
 
def add_unsubscription_headers_and_links
Loading
Loading
Loading
Loading
@@ -317,7 +317,7 @@ module Ci
return @config_processor if defined?(@config_processor)
 
@config_processor ||= begin
Ci::GitlabCiYamlProcessor.new(ci_yaml_file, project.path_with_namespace)
Ci::GitlabCiYamlProcessor.new(ci_yaml_file, project.full_path)
rescue Ci::GitlabCiYamlProcessor::ValidationError, Psych::SyntaxError => e
self.yaml_errors = e.message
nil
Loading
Loading
Loading
Loading
@@ -630,7 +630,7 @@ class MergeRequest < ActiveRecord::Base
 
def target_project_path
if target_project
target_project.path_with_namespace
target_project.full_path
else
"(removed)"
end
Loading
Loading
@@ -638,7 +638,7 @@ class MergeRequest < ActiveRecord::Base
 
def source_project_path
if source_project
source_project.path_with_namespace
source_project.full_path
else
"(removed)"
end
Loading
Loading
Loading
Loading
@@ -379,7 +379,7 @@ class Project < ActiveRecord::Base
begin
Projects::HousekeepingService.new(project).execute
rescue Projects::HousekeepingService::LeaseTaken => e
Rails.logger.info("Could not perform housekeeping for project #{project.path_with_namespace} (#{project.id}): #{e}")
Rails.logger.info("Could not perform housekeeping for project #{project.full_path} (#{project.id}): #{e}")
end
end
end
Loading
Loading
@@ -485,7 +485,7 @@ class Project < ActiveRecord::Base
 
def container_registry_url
if Gitlab.config.registry.enabled
"#{Gitlab.config.registry.host_port}/#{path_with_namespace.downcase}"
"#{Gitlab.config.registry.host_port}/#{full_path.downcase}"
end
end
 
Loading
Loading
@@ -524,16 +524,16 @@ class Project < ActiveRecord::Base
job_id =
if forked?
RepositoryForkWorker.perform_async(id, forked_from_project.repository_storage_path,
forked_from_project.path_with_namespace,
forked_from_project.full_path,
self.namespace.full_path)
else
RepositoryImportWorker.perform_async(self.id)
end
 
if job_id
Rails.logger.info "Import job started for #{path_with_namespace} with job ID #{job_id}"
Rails.logger.info "Import job started for #{full_path} with job ID #{job_id}"
else
Rails.logger.error "Import job failed to start for #{path_with_namespace}"
Rails.logger.error "Import job failed to start for #{full_path}"
end
end
 
Loading
Loading
@@ -694,7 +694,7 @@ class Project < ActiveRecord::Base
# `from` argument can be a Namespace or Project.
def to_reference(from = nil, full: false)
if full || cross_namespace_reference?(from)
path_with_namespace
full_path
elsif cross_project_reference?(from)
path
end
Loading
Loading
@@ -718,7 +718,7 @@ class Project < ActiveRecord::Base
author.ensure_incoming_email_token!
 
Gitlab::IncomingEmail.reply_address(
"#{path_with_namespace}+#{author.incoming_email_token}")
"#{full_path}+#{author.incoming_email_token}")
end
 
def build_commit_note(commit)
Loading
Loading
@@ -1002,7 +1002,7 @@ class Project < ActiveRecord::Base
git_http_url: http_url_to_repo,
namespace: namespace.name,
visibility_level: visibility_level,
path_with_namespace: path_with_namespace,
path_with_namespace: full_path,
default_branch: default_branch,
ci_config_path: ci_config_path
}
Loading
Loading
@@ -1272,8 +1272,8 @@ class Project < ActiveRecord::Base
[
{ key: 'CI_PROJECT_ID', value: id.to_s, public: true },
{ key: 'CI_PROJECT_NAME', value: path, public: true },
{ key: 'CI_PROJECT_PATH', value: path_with_namespace, public: true },
{ key: 'CI_PROJECT_PATH_SLUG', value: path_with_namespace.parameterize, public: true },
{ key: 'CI_PROJECT_PATH', value: full_path, public: true },
{ key: 'CI_PROJECT_PATH_SLUG', value: full_path.parameterize, public: true },
{ key: 'CI_PROJECT_NAMESPACE', value: namespace.full_path, public: true },
{ key: 'CI_PROJECT_URL', value: web_url, public: true }
]
Loading
Loading
@@ -1378,6 +1378,7 @@ class Project < ActiveRecord::Base
 
alias_method :name_with_namespace, :full_name
alias_method :human_name, :full_name
# @deprecated cannot remove yet because it has an index with its name in elasticsearch
alias_method :path_with_namespace, :full_path
 
private
Loading
Loading
@@ -1432,7 +1433,7 @@ class Project < ActiveRecord::Base
def pending_delete_twin
return false unless path
 
Project.pending_delete.find_by_full_path(path_with_namespace)
Project.pending_delete.find_by_full_path(full_path)
end
 
##
Loading
Loading
Loading
Loading
@@ -35,9 +35,9 @@ class FlowdockService < Service
data[:after],
token: token,
repo: project.repository.path_to_repo,
repo_url: "#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}",
commit_url: "#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/commit/%s",
diff_url: "#{Gitlab.config.gitlab.url}/#{project.path_with_namespace}/compare/%s...%s"
repo_url: "#{Gitlab.config.gitlab.url}/#{project.full_path}",
commit_url: "#{Gitlab.config.gitlab.url}/#{project.full_path}/commit/%s",
diff_url: "#{Gitlab.config.gitlab.url}/#{project.full_path}/compare/%s...%s"
)
end
end
Loading
Loading
@@ -140,7 +140,7 @@ class JiraService < IssueTrackerService
url: resource_url(user_path(author))
},
project: {
name: project.path_with_namespace,
name: project.full_path,
url: resource_url(namespace_project_path(project.namespace, project)) # rubocop:disable Cop/ProjectPathHelper
},
entity: {
Loading
Loading
Loading
Loading
@@ -27,7 +27,7 @@ class ProjectWiki
end
 
def path_with_namespace
@project.path_with_namespace + ".wiki"
@project.full_path + '.wiki'
end
 
def web_url
Loading
Loading
@@ -47,7 +47,7 @@ class ProjectWiki
end
 
def wiki_base_path
[Gitlab.config.gitlab.relative_url_root, "/", @project.path_with_namespace, "/wikis"].join('')
[Gitlab.config.gitlab.relative_url_root, "/", @project.full_path, "/wikis"].join('')
end
 
# Returns the Gollum::Wiki object.
Loading
Loading
Loading
Loading
@@ -60,7 +60,7 @@ class GitOperationService
start_branch_name = nil if start_repository.empty_repo?
 
if start_branch_name && !start_repository.branch_exists?(start_branch_name)
raise ArgumentError, "Cannot find branch #{start_branch_name} in #{start_repository.path_with_namespace}"
raise ArgumentError, "Cannot find branch #{start_branch_name} in #{start_repository.full_path}"
end
 
update_branch_with_hooks(branch_name) do
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ module Projects
def async_execute
project.update_attribute(:pending_delete, true)
job_id = ProjectDestroyWorker.perform_async(project.id, current_user.id, params)
Rails.logger.info("User #{current_user.id} scheduled destruction of project #{project.path_with_namespace} with job ID #{job_id}")
Rails.logger.info("User #{current_user.id} scheduled destruction of project #{project.full_path} with job ID #{job_id}")
end
 
def execute
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ module Projects
 
success
rescue => e
error("Error importing repository #{project.import_url} into #{project.path_with_namespace} - #{e.message}")
error("Error importing repository #{project.import_url} into #{project.full_path} - #{e.message}")
end
 
private
Loading
Loading
Loading
Loading
@@ -34,7 +34,7 @@ module Projects
private
 
def transfer(project)
@old_path = project.path_with_namespace
@old_path = project.full_path
@old_group = project.group
@new_path = File.join(@new_namespace.try(:full_path) || '', project.path)
@old_namespace = project.namespace
Loading
Loading
Loading
Loading
@@ -24,7 +24,7 @@ class SystemHooksService
key: model.key,
id: model.id
)
if model.user
data[:username] = model.user.username
end
Loading
Loading
@@ -56,7 +56,7 @@ class SystemHooksService
when GroupMember
data.merge!(group_member_data(model))
end
data
end
 
Loading
Loading
@@ -79,7 +79,7 @@ class SystemHooksService
{
name: model.name,
path: model.path,
path_with_namespace: model.path_with_namespace,
path_with_namespace: model.full_path,
project_id: model.id,
owner_name: owner.name,
owner_email: owner.respond_to?(:email) ? owner.email : "",
Loading
Loading
@@ -93,7 +93,7 @@ class SystemHooksService
{
project_name: project.name,
project_path: project.path,
project_path_with_namespace: project.path_with_namespace,
project_path_with_namespace: project.full_path,
project_id: project.id,
user_username: model.user.username,
user_name: model.user.name,
Loading
Loading
Loading
Loading
@@ -66,7 +66,7 @@ class IrkerWorker
end
 
def send_new_branch(project, repo_name, committer, branch)
repo_path = project.path_with_namespace
repo_path = project.full_path
newbranch = "#{Gitlab.config.gitlab.url}/#{repo_path}/branches"
newbranch = "\x0302\x1f#{newbranch}\x0f" if @colors
 
Loading
Loading
@@ -109,7 +109,7 @@ class IrkerWorker
end
 
def send_commits_count(data, project, repo, committer, branch)
url = compare_url data, project.path_with_namespace
url = compare_url data, project.full_path
commits = colorize_commits data['total_commits_count']
 
new_commits = 'new commit'
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ class RepositoryImportWorker
 
Gitlab::Metrics.add_event(:import_repository,
import_url: @project.import_url,
path: @project.path_with_namespace)
path: @project.full_path)
 
project.update_columns(import_jid: self.jid, import_error: nil)
 
Loading
Loading
Loading
Loading
@@ -16,6 +16,7 @@ class MigrateProcessCommitWorkerJobs < ActiveRecord::Migration
end
 
def repository_path
# TODO: review if the change from Legacy storage needs to reflect here as well.
File.join(repository_storage_path, read_attribute(:path_with_namespace) + '.git')
end
 
Loading
Loading
Loading
Loading
@@ -30,8 +30,8 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
expect(@merge_request.source_project).to eq @forked_project
expect(@merge_request.source_branch).to eq "fix"
expect(@merge_request.target_branch).to eq "master"
expect(page).to have_content @forked_project.path_with_namespace
expect(page).to have_content @project.path_with_namespace
expect(page).to have_content @forked_project.full_path
expect(page).to have_content @project.full_path
expect(page).to have_content @merge_request.source_branch
expect(page).to have_content @merge_request.target_branch
 
Loading
Loading
@@ -43,10 +43,10 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
expect(page).to have_content('Target branch')
 
first('.js-source-project').click
first('.dropdown-source-project a', text: @forked_project.path_with_namespace)
first('.dropdown-source-project a', text: @forked_project.full_path)
 
first('.js-target-project').click
first('.dropdown-target-project a', text: @project.path_with_namespace)
first('.dropdown-target-project a', text: @project.full_path)
 
first('.js-source-branch').click
wait_for_requests
Loading
Loading
@@ -81,8 +81,8 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
expect(@merge_request.source_project).to eq @forked_project
expect(@merge_request.source_branch).to eq "fix"
expect(@merge_request.target_branch).to eq "master"
expect(page).to have_content @forked_project.path_with_namespace
expect(page).to have_content @project.path_with_namespace
expect(page).to have_content @forked_project.full_path
expect(page).to have_content @project.full_path
expect(page).to have_content @merge_request.source_branch
expect(page).to have_content @merge_request.target_branch
end
Loading
Loading
Loading
Loading
@@ -47,7 +47,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
 
step 'I should be redirected to "Community" page' do
project = Project.find_by(name: 'Community')
expect(current_path).to eq "/#{project.path_with_namespace}"
expect(current_path).to eq "/#{project.full_path}"
expect(status_code).to eq 200
end
 
Loading
Loading
@@ -61,7 +61,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
 
step 'I should be redirected to "Enterprise" page' do
project = Project.find_by(name: 'Enterprise')
expect(current_path).to eq "/#{project.path_with_namespace}"
expect(current_path).to eq "/#{project.full_path}"
expect(status_code).to eq 200
end
end
Loading
Loading
@@ -142,7 +142,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
end
 
step 'I should see non-escaped link in the pages list' do
expect(page).to have_xpath("//a[@href='/#{project.path_with_namespace}/wikis/one/two/three-test']")
expect(page).to have_xpath("//a[@href='/#{project.full_path}/wikis/one/two/three-test']")
end
 
step 'I edit the Wiki page with a path' do
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