Skip to content
Snippets Groups Projects
Commit b04f9a9b authored by Alejandro Rodríguez's avatar Alejandro Rodríguez
Browse files

Fix merge conflicts after CE Upstream update

parent 36f255b2
No related branches found
No related tags found
No related merge requests found
Loading
@@ -327,11 +327,7 @@ class ProjectsController < Projects::ApplicationController
Loading
@@ -327,11 +327,7 @@ class ProjectsController < Projects::ApplicationController
   
def project_params def project_params
params.require(:project) params.require(:project)
<<<<<<< HEAD
.permit(project_params_ce << project_params_ee) .permit(project_params_ce << project_params_ee)
=======
.permit(project_params_ce)
>>>>>>> ce/master
end end
   
def project_params_ce def project_params_ce
Loading
@@ -368,7 +364,6 @@ class ProjectsController < Projects::ApplicationController
Loading
@@ -368,7 +364,6 @@ class ProjectsController < Projects::ApplicationController
wiki_access_level wiki_access_level
] ]
] ]
<<<<<<< HEAD
end end
   
def project_params_ee def project_params_ee
Loading
@@ -385,8 +380,6 @@ class ProjectsController < Projects::ApplicationController
Loading
@@ -385,8 +380,6 @@ class ProjectsController < Projects::ApplicationController
repository_size_limit repository_size_limit
reset_approvals_on_push reset_approvals_on_push
] ]
=======
>>>>>>> ce/master
end end
   
def repo_exists? def repo_exists?
Loading
Loading
Loading
@@ -223,11 +223,6 @@ class Project < ActiveRecord::Base
Loading
@@ -223,11 +223,6 @@ class Project < ActiveRecord::Base
scope :with_push, -> { joins(:events).where('events.action = ?', Event::PUSHED) } scope :with_push, -> { joins(:events).where('events.action = ?', Event::PUSHED) }
scope :with_remote_mirrors, -> { joins(:remote_mirrors).where(remote_mirrors: { enabled: true }).distinct } scope :with_remote_mirrors, -> { joins(:remote_mirrors).where(remote_mirrors: { enabled: true }).distinct }
   
<<<<<<< HEAD
scope :with_builds_enabled, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id').where('project_features.builds_access_level IS NULL or project_features.builds_access_level > 0') }
scope :with_issues_enabled, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id').where('project_features.issues_access_level IS NULL or project_features.issues_access_level > 0') }
scope :with_wiki_enabled, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id').where('project_features.wiki_access_level IS NULL or project_features.wiki_access_level > 0') }
=======
scope :with_project_feature, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id') } scope :with_project_feature, -> { joins('LEFT JOIN project_features ON projects.id = project_features.project_id') }
   
# "enabled" here means "not disabled". It includes private features! # "enabled" here means "not disabled". It includes private features!
Loading
@@ -244,6 +239,7 @@ class Project < ActiveRecord::Base
Loading
@@ -244,6 +239,7 @@ class Project < ActiveRecord::Base
   
scope :with_builds_enabled, -> { with_feature_enabled(:builds) } scope :with_builds_enabled, -> { with_feature_enabled(:builds) }
scope :with_issues_enabled, -> { with_feature_enabled(:issues) } scope :with_issues_enabled, -> { with_feature_enabled(:issues) }
scope :with_wiki_enabled, -> { with_project_feature(:wiki) }
   
# project features may be "disabled", "internal" or "enabled". If "internal", # project features may be "disabled", "internal" or "enabled". If "internal",
# they are only available to team members. This scope returns projects where # they are only available to team members. This scope returns projects where
Loading
@@ -260,7 +256,6 @@ class Project < ActiveRecord::Base
Loading
@@ -260,7 +256,6 @@ class Project < ActiveRecord::Base
union = Gitlab::SQL::Union.new([unconditional.select(:id), authorized.select(:id)]) union = Gitlab::SQL::Union.new([unconditional.select(:id), authorized.select(:id)])
where(arel_table[:id].in(Arel::Nodes::SqlLiteral.new(union.to_sql))) where(arel_table[:id].in(Arel::Nodes::SqlLiteral.new(union.to_sql)))
end end
>>>>>>> ce/master
   
scope :active, -> { joins(:issues, :notes, :merge_requests).order('issues.created_at, notes.created_at, merge_requests.created_at DESC') } scope :active, -> { joins(:issues, :notes, :merge_requests).order('issues.created_at, notes.created_at, merge_requests.created_at DESC') }
scope :abandoned, -> { where('projects.last_activity_at < ?', 6.months.ago) } scope :abandoned, -> { where('projects.last_activity_at < ?', 6.months.ago) }
Loading
Loading
Loading
@@ -23,12 +23,8 @@ module API
Loading
@@ -23,12 +23,8 @@ module API
else else
skip_ldap = params[:skip_ldap].present? && params[:skip_ldap] == 'true' skip_ldap = params[:skip_ldap].present? && params[:skip_ldap] == 'true'
@users = User.all @users = User.all
<<<<<<< HEAD
@users = @users.active if params[:active].present?
@users = @users.non_ldap if skip_ldap
=======
@users = @users.active if to_boolean(params[:active]) @users = @users.active if to_boolean(params[:active])
>>>>>>> ce/master @users = @users.non_ldap if skip_ldap
@users = @users.search(params[:search]) if params[:search].present? @users = @users.search(params[:search]) if params[:search].present?
@users = @users.blocked if to_boolean(params[:blocked]) @users = @users.blocked if to_boolean(params[:blocked])
@users = @users.external if to_boolean(params[:external]) && current_user.is_admin? @users = @users.external if to_boolean(params[:external]) && current_user.is_admin?
Loading
Loading
Loading
@@ -2,24 +2,9 @@
Loading
@@ -2,24 +2,9 @@
# class return an instance of `GitlabAccessStatus` # class return an instance of `GitlabAccessStatus`
module Gitlab module Gitlab
class GitAccess class GitAccess
<<<<<<< HEAD
include PathLocksHelper include PathLocksHelper
UnauthorizedError = Class.new(StandardError) UnauthorizedError = Class.new(StandardError)
   
DOWNLOAD_COMMANDS = %w{ git-upload-pack git-upload-archive }
PUSH_COMMANDS = %w{ git-receive-pack }
GIT_ANNEX_COMMANDS = %w{ git-annex-shell }
ALL_COMMANDS = DOWNLOAD_COMMANDS + PUSH_COMMANDS + GIT_ANNEX_COMMANDS
ERROR_MESSAGES = {
upload: 'You are not allowed to upload code for this project.',
download: 'You are not allowed to download code from this project.',
deploy_key: 'Deploy keys are not allowed to push code.',
no_repo: 'A repository for this project does not exist yet.'
}
=======
UnauthorizedError = Class.new(StandardError)
ERROR_MESSAGES = { ERROR_MESSAGES = {
upload: 'You are not allowed to upload code for this project.', upload: 'You are not allowed to upload code for this project.',
download: 'You are not allowed to download code from this project.', download: 'You are not allowed to download code from this project.',
Loading
@@ -29,8 +14,8 @@ module Gitlab
Loading
@@ -29,8 +14,8 @@ module Gitlab
   
DOWNLOAD_COMMANDS = %w{ git-upload-pack git-upload-archive } DOWNLOAD_COMMANDS = %w{ git-upload-pack git-upload-archive }
PUSH_COMMANDS = %w{ git-receive-pack } PUSH_COMMANDS = %w{ git-receive-pack }
ALL_COMMANDS = DOWNLOAD_COMMANDS + PUSH_COMMANDS GIT_ANNEX_COMMANDS = %w{ git-annex-shell }
>>>>>>> ce/master ALL_COMMANDS = DOWNLOAD_COMMANDS + PUSH_COMMANDS + GIT_ANNEX_COMMANDS
   
attr_reader :actor, :project, :protocol, :user_access, :authentication_abilities attr_reader :actor, :project, :protocol, :user_access, :authentication_abilities
   
Loading
@@ -47,22 +32,16 @@ module Gitlab
Loading
@@ -47,22 +32,16 @@ module Gitlab
check_active_user! check_active_user!
check_project_accessibility! check_project_accessibility!
check_command_existence!(cmd) check_command_existence!(cmd)
<<<<<<< HEAD
   
check_geo_license! check_geo_license!
=======
>>>>>>> ce/master
   
case cmd case cmd
when *DOWNLOAD_COMMANDS when *DOWNLOAD_COMMANDS
download_access_check download_access_check
when *PUSH_COMMANDS when *PUSH_COMMANDS
push_access_check(changes) push_access_check(changes)
<<<<<<< HEAD
when *GIT_ANNEX_COMMANDS when *GIT_ANNEX_COMMANDS
git_annex_access_check(project, changes) git_annex_access_check(project, changes)
=======
>>>>>>> ce/master
end end
   
build_status_object(true) build_status_object(true)
Loading
@@ -73,11 +52,7 @@ module Gitlab
Loading
@@ -73,11 +52,7 @@ module Gitlab
def download_access_check def download_access_check
if user if user
user_download_access_check user_download_access_check
<<<<<<< HEAD
elsif deploy_key.nil? && geo_node_key.nil? && !Guest.can?(:download_code, project) elsif deploy_key.nil? && geo_node_key.nil? && !Guest.can?(:download_code, project)
=======
elsif deploy_key.nil? && !Guest.can?(:download_code, project)
>>>>>>> ce/master
raise UnauthorizedError, ERROR_MESSAGES[:download] raise UnauthorizedError, ERROR_MESSAGES[:download]
end end
end end
Loading
@@ -125,7 +100,6 @@ module Gitlab
Loading
@@ -125,7 +100,6 @@ module Gitlab
   
unless project.repository.exists? unless project.repository.exists?
raise UnauthorizedError, ERROR_MESSAGES[:no_repo] raise UnauthorizedError, ERROR_MESSAGES[:no_repo]
<<<<<<< HEAD
end end
   
if project.above_size_limit? if project.above_size_limit?
Loading
@@ -135,8 +109,6 @@ module Gitlab
Loading
@@ -135,8 +109,6 @@ module Gitlab
if ::License.block_changes? if ::License.block_changes?
message = ::LicenseHelper.license_message(signed_in: true, is_admin: (user && user.is_admin?)) message = ::LicenseHelper.license_message(signed_in: true, is_admin: (user && user.is_admin?))
raise UnauthorizedError, message raise UnauthorizedError, message
=======
>>>>>>> ce/master
end end
   
changes_list = Gitlab::ChangesList.new(changes) changes_list = Gitlab::ChangesList.new(changes)
Loading
@@ -149,7 +121,6 @@ module Gitlab
Loading
@@ -149,7 +121,6 @@ module Gitlab
unless status.allowed? unless status.allowed?
# If user does not have access to make at least one change - cancel all push # If user does not have access to make at least one change - cancel all push
raise UnauthorizedError, status.message raise UnauthorizedError, status.message
<<<<<<< HEAD
end end
   
if project.size_limit_enabled? if project.size_limit_enabled?
Loading
@@ -160,10 +131,6 @@ module Gitlab
Loading
@@ -160,10 +131,6 @@ module Gitlab
if project.changes_will_exceed_size_limit?(push_size_in_bytes.to_mb) if project.changes_will_exceed_size_limit?(push_size_in_bytes.to_mb)
raise UnauthorizedError, Gitlab::RepositorySizeError.new(project).new_changes_error raise UnauthorizedError, Gitlab::RepositorySizeError.new(project).new_changes_error
end end
=======
end
end
>>>>>>> ce/master
end end
   
def change_access_check(change) def change_access_check(change)
Loading
@@ -200,15 +167,12 @@ module Gitlab
Loading
@@ -200,15 +167,12 @@ module Gitlab
end end
end end
   
<<<<<<< HEAD
def check_geo_license! def check_geo_license!
if Gitlab::Geo.secondary? && !Gitlab::Geo.license_allows? if Gitlab::Geo.secondary? && !Gitlab::Geo.license_allows?
raise UnauthorizedError, 'Your current license does not have GitLab Geo add-on enabled.' raise UnauthorizedError, 'Your current license does not have GitLab Geo add-on enabled.'
end end
end end
   
=======
>>>>>>> ce/master
def matching_merge_request?(newrev, branch_name) def matching_merge_request?(newrev, branch_name)
Checks::MatchingMergeRequest.new(newrev, branch_name, project).match? Checks::MatchingMergeRequest.new(newrev, branch_name, project).match?
end end
Loading
@@ -255,11 +219,8 @@ module Gitlab
Loading
@@ -255,11 +219,8 @@ module Gitlab
user_access.can_read_project? user_access.can_read_project?
elsif deploy_key elsif deploy_key
deploy_key_can_read_project? deploy_key_can_read_project?
<<<<<<< HEAD
elsif geo_node_key elsif geo_node_key
true true
=======
>>>>>>> ce/master
else else
Guest.can?(:read_project, project) Guest.can?(:read_project, project)
end end
Loading
Loading
Loading
@@ -101,13 +101,12 @@ module Gitlab
Loading
@@ -101,13 +101,12 @@ module Gitlab
options['timeout'].to_i options['timeout'].to_i
end end
   
<<<<<<< HEAD
def external_groups def external_groups
options['external_groups'] options['external_groups']
======= end
def has_auth? def has_auth?
options['password'] || options['bind_dn'] options['password'] || options['bind_dn']
>>>>>>> ce/master
end end
   
protected protected
Loading
Loading
Loading
@@ -20,11 +20,7 @@ describe Gitlab::GitAccessWiki, lib: true do
Loading
@@ -20,11 +20,7 @@ describe Gitlab::GitAccessWiki, lib: true do
project.team << [user, :developer] project.team << [user, :developer]
end end
   
<<<<<<< HEAD
subject { access.check('git-receive-pack', changes) } subject { access.check('git-receive-pack', changes) }
=======
subject { access.check('git-receive-pack', changes) }
>>>>>>> ce/master
   
it { expect(subject.allowed?).to be_truthy } it { expect(subject.allowed?).to be_truthy }
   
Loading
Loading
Loading
@@ -14,13 +14,8 @@ describe Gitlab::LDAP::Config, lib: true do
Loading
@@ -14,13 +14,8 @@ describe Gitlab::LDAP::Config, lib: true do
expect(config).to be_a described_class expect(config).to be_a described_class
end end
   
<<<<<<< HEAD
it "raises an error if a unknow provider is used" do it "raises an error if a unknow provider is used" do
expect{ Gitlab::LDAP::Config.new 'unknown' }.to raise_error(Gitlab::LDAP::Config::InvalidProvider) expect{ Gitlab::LDAP::Config.new 'unknown' }.to raise_error(Gitlab::LDAP::Config::InvalidProvider)
=======
it 'raises an error if a unknown provider is used' do
expect{ Gitlab::LDAP::Config.new 'unknown' }.to raise_error(RuntimeError)
>>>>>>> ce/master
end end
end end
   
Loading
Loading
Loading
@@ -147,7 +147,6 @@ describe 'Git HTTP requests', lib: true do
Loading
@@ -147,7 +147,6 @@ describe 'Git HTTP requests', lib: true do
end end
end end
end end
<<<<<<< HEAD
end end
   
context "when Kerberos token is provided" do context "when Kerberos token is provided" do
Loading
@@ -258,8 +257,6 @@ describe 'Git HTTP requests', lib: true do
Loading
@@ -258,8 +257,6 @@ describe 'Git HTTP requests', lib: true do
expect(response).to have_http_status(403) expect(response).to have_http_status(403)
end end
end end
=======
>>>>>>> ce/master
end end
   
context "when the project is private" do context "when the project is private" 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