Commit 63cfe86e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ce-to-ee' into 'master'

Merge CE to EE and fix tests



See merge request !83
parents 5335b7f6 be84510c
...@@ -6,7 +6,6 @@ v 8.3.0 (unreleased) ...@@ -6,7 +6,6 @@ v 8.3.0 (unreleased)
- Add open_issues_count to project API (Stan Hu) - Add open_issues_count to project API (Stan Hu)
- Expand character set of usernames created by Omniauth (Corey Hinshaw) - Expand character set of usernames created by Omniauth (Corey Hinshaw)
- Add button to automatically merge a merge request when the build succeeds (Zeger-Jan van de Weg) - Add button to automatically merge a merge request when the build succeeds (Zeger-Jan van de Weg)
- Merge when build succeeds (Zeger-Jan van de Weg)
- Provide better diagnostic message upon project creation errors (Stan Hu) - Provide better diagnostic message upon project creation errors (Stan Hu)
- Bump devise to 3.5.3 to fix reset token expiring after account creation (Stan Hu) - Bump devise to 3.5.3 to fix reset token expiring after account creation (Stan Hu)
- Bump gollum-lib to 4.1.0 (Stan Hu) - Bump gollum-lib to 4.1.0 (Stan Hu)
......
module GroupMembersHelper module GroupMembersHelper
def clear_ldap_permission_cache_message def clear_ldap_permission_cache_message
markdown(<<-EOT.strip_heredoc markdown(
<<-EOT.strip_heredoc
Be careful, all members of this group (except you) will have their Be careful, all members of this group (except you) will have their
**access level temporarily downgraded** to `Guest`. The next time that a group member **access level temporarily downgraded** to `Guest`. The next time that a group member
signs in to GitLab (or after one hour, whichever occurs first) their access level will signs in to GitLab (or after one hour, whichever occurs first) their access level will
......
...@@ -67,7 +67,7 @@ class JenkinsService < CiService ...@@ -67,7 +67,7 @@ class JenkinsService < CiService
def build_page(sha, ref = nil) def build_page(sha, ref = nil)
if multiproject_enabled? && ref.present? if multiproject_enabled? && ref.present?
URI.encode("#{base_project_url}/#{project.name}_#{ref.gsub('/', '_')}/scm/bySHA1/#{sha}").to_s URI.encode("#{base_project_url}/#{project.name}_#{ref.tr('/', '_')}/scm/bySHA1/#{sha}").to_s
else else
"#{project_url}/scm/bySHA1/#{sha}" "#{project_url}/scm/bySHA1/#{sha}"
end end
......
...@@ -20,16 +20,24 @@ ...@@ -20,16 +20,24 @@
%li %li
= link_to namespace_project_new_blob_path(@project.namespace, @project, @id), title: 'Create file', id: 'new-file-link' do = link_to namespace_project_new_blob_path(@project.namespace, @project, @id), title: 'Create file', id: 'new-file-link' do
= icon('pencil fw') = icon('pencil fw')
Create file New file
%li %li
= link_to '#modal-upload-blob', { 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal'} do = link_to '#modal-upload-blob', { 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal'} do
= icon('file fw') = icon('file fw')
Upload file Upload file
%li.divider
%li %li
= link_to '#modal-create-new-dir', { 'data-target' => '#modal-create-new-dir', 'data-toggle' => 'modal'} do = link_to '#modal-create-new-dir', { 'data-target' => '#modal-create-new-dir', 'data-toggle' => 'modal'} do
= icon('folder fw') = icon('folder fw')
New directory New directory
%li.divider
%li
= link_to new_namespace_project_branch_path(@project.namespace, @project) do
= icon('code-fork fw')
New branch
%li
= link_to new_namespace_project_tag_path(@project.namespace, @project) do
= icon('tags fw')
New tag
- elsif !on_top_of_branch? - elsif !on_top_of_branch?
%li %li
%span.btn.btn-sm.add-to-tree.disabled.has_tooltip{title: "You can only add files when you are on a branch.", data: {container: 'body'}} %span.btn.btn-sm.add-to-tree.disabled.has_tooltip{title: "You can only add files when you are on a branch.", data: {container: 'body'}}
......
...@@ -432,7 +432,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps ...@@ -432,7 +432,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
click_button "Submit merge request" click_button "Submit merge request"
page.within '.issuable-title' do page.within '.detail-page-header' do
click_link "Edit" click_link "Edit"
end end
......
...@@ -72,7 +72,7 @@ module API ...@@ -72,7 +72,7 @@ module API
expose :shared_runners_enabled expose :shared_runners_enabled
expose :creator_id expose :creator_id
expose :namespace expose :namespace
expose :forked_from_project, using: Entities::ForkedFromProject, if: lambda{ |project, options| project.forked? } expose :forked_from_project, using: Entities::ForkedFromProject, if: lambda { |project, options| project.forked? }
expose :avatar_url expose :avatar_url
expose :star_count, :forks_count expose :star_count, :forks_count
expose :open_issues_count, if: lambda { |project, options| project.issues_enabled? && project.default_issues_tracker? } expose :open_issues_count, if: lambda { |project, options| project.issues_enabled? && project.default_issues_tracker? }
...@@ -90,7 +90,7 @@ module API ...@@ -90,7 +90,7 @@ module API
class Group < Grape::Entity class Group < Grape::Entity
expose :id, :name, :path, :ldap_cn, :ldap_access, :description expose :id, :name, :path, :ldap_cn, :ldap_access, :description
expose :ldap_group_links, using: Entities::LdapGroupLink, if: lambda{ | group, options | group.ldap_group_links.any? } expose :ldap_group_links, using: Entities::LdapGroupLink, if: lambda { |group, options| group.ldap_group_links.any? }
expose :avatar_url expose :avatar_url
expose :web_url do |group, options| expose :web_url do |group, options|
......
...@@ -211,7 +211,7 @@ describe Gitlab::LDAP::Access, lib: true do ...@@ -211,7 +211,7 @@ describe Gitlab::LDAP::Access, lib: true do
it "should give admin privileges to an User" do it "should give admin privileges to an User" do
admin_group = Net::LDAP::Entry.from_single_ldif_string( admin_group = Net::LDAP::Entry.from_single_ldif_string(
%Q{dn: cn=#{access.admin_group},ou=groups,dc=bar,dc=com %Q{dn: cn=#{access.admin_group},ou=groups,dc=bar,dc=com
cn: #{access.admin_group} cn: #{access.admin_group}
description: GitLab admins description: GitLab admins
gidnumber: 42 gidnumber: 42
...@@ -220,7 +220,7 @@ memberuid: admin2 ...@@ -220,7 +220,7 @@ memberuid: admin2
memberuid: admin3 memberuid: admin3
objectclass: top objectclass: top
objectclass: posixGroup objectclass: posixGroup
}) })
allow_any_instance_of(Gitlab::LDAP::Adapter).to receive(:group) { Gitlab::LDAP::Group.new(admin_group) } allow_any_instance_of(Gitlab::LDAP::Adapter).to receive(:group) { Gitlab::LDAP::Group.new(admin_group) }
expect{ access.update_admin_status }.to change(user, :admin?).to(true) expect{ access.update_admin_status }.to change(user, :admin?).to(true)
...@@ -229,7 +229,7 @@ objectclass: posixGroup ...@@ -229,7 +229,7 @@ objectclass: posixGroup
it "should remove admin privileges from an User" do it "should remove admin privileges from an User" do
user.update_attribute(:admin, true) user.update_attribute(:admin, true)
admin_group = Net::LDAP::Entry.from_single_ldif_string( admin_group = Net::LDAP::Entry.from_single_ldif_string(
%Q{dn: cn=#{access.admin_group},ou=groups,dc=bar,dc=com %Q{dn: cn=#{access.admin_group},ou=groups,dc=bar,dc=com
cn: #{access.admin_group} cn: #{access.admin_group}
description: GitLab admins description: GitLab admins
gidnumber: 42 gidnumber: 42
...@@ -237,7 +237,7 @@ memberuid: admin1 ...@@ -237,7 +237,7 @@ memberuid: admin1
memberuid: admin3 memberuid: admin3
objectclass: top objectclass: top
objectclass: posixGroup objectclass: posixGroup
}) })
allow_any_instance_of(Gitlab::LDAP::Adapter).to receive(:group) { Gitlab::LDAP::Group.new(admin_group) } allow_any_instance_of(Gitlab::LDAP::Adapter).to receive(:group) { Gitlab::LDAP::Group.new(admin_group) }
expect{ access.update_admin_status }.to change(user, :admin?).to(false) expect{ access.update_admin_status }.to change(user, :admin?).to(false)
end end
...@@ -350,7 +350,7 @@ objectclass: posixGroup ...@@ -350,7 +350,7 @@ objectclass: posixGroup
describe 'ldap_groups' do describe 'ldap_groups' do
let(:ldap_group_1) do let(:ldap_group_1) do
Net::LDAP::Entry.from_single_ldif_string( Net::LDAP::Entry.from_single_ldif_string(
%Q{dn: cn=#{access.ldap_config.admin_group},ou=groups,dc=bar,dc=com %Q{dn: cn=#{access.ldap_config.admin_group},ou=groups,dc=bar,dc=com
cn: #{access.ldap_config.admin_group} cn: #{access.ldap_config.admin_group}
description: GitLab group 1 description: GitLab group 1
gidnumber: 42 gidnumber: 42
...@@ -358,7 +358,7 @@ memberuid: user1 ...@@ -358,7 +358,7 @@ memberuid: user1
memberuid: user2 memberuid: user2
objectclass: top objectclass: top
objectclass: posixGroup objectclass: posixGroup
}) })
end end
it "returns an interator of LDAP Groups" do it "returns an interator of LDAP Groups" do
...@@ -380,7 +380,7 @@ objectclass: posixGroup ...@@ -380,7 +380,7 @@ objectclass: posixGroup
describe :cns_with_access do describe :cns_with_access do
let(:ldap_group_response_1) do let(:ldap_group_response_1) do
Net::LDAP::Entry.from_single_ldif_string( Net::LDAP::Entry.from_single_ldif_string(
%Q{dn: cn=group1,ou=groups,dc=bar,dc=com %Q{dn: cn=group1,ou=groups,dc=bar,dc=com
cn: group1 cn: group1
description: GitLab group 1 description: GitLab group 1
gidnumber: 21 gidnumber: 21
...@@ -388,11 +388,12 @@ uniquemember: #{ldap_user.dn.downcase} ...@@ -388,11 +388,12 @@ uniquemember: #{ldap_user.dn.downcase}
uniquemember: uid=user2,ou=people,dc=example uniquemember: uid=user2,ou=people,dc=example
objectclass: top objectclass: top
objectclass: posixGroup objectclass: posixGroup
}) })
end end
let(:ldap_group_response_2) do let(:ldap_group_response_2) do
Net::LDAP::Entry.from_single_ldif_string( Net::LDAP::Entry.from_single_ldif_string(
%Q{dn: cn=group2,ou=groups,dc=bar,dc=com %Q{dn: cn=group2,ou=groups,dc=bar,dc=com
cn: group2 cn: group2
description: GitLab group 2 description: GitLab group 2
gidnumber: 42 gidnumber: 42
...@@ -400,14 +401,16 @@ memberuid: user3 ...@@ -400,14 +401,16 @@ memberuid: user3
memberuid: user4 memberuid: user4
objectclass: top objectclass: top
objectclass: posixGroup objectclass: posixGroup
}) })
end end
let(:ldap_groups) do let(:ldap_groups) do
[ [
Gitlab::LDAP::Group.new(ldap_group_response_1), Gitlab::LDAP::Group.new(ldap_group_response_1),
Gitlab::LDAP::Group.new(ldap_group_response_2) Gitlab::LDAP::Group.new(ldap_group_response_2)
] ]
end end
let(:ldap_user) { Gitlab::LDAP::Person.new(Net::LDAP::Entry.new, user.ldap_identity.provider) } let(:ldap_user) { Gitlab::LDAP::Person.new(Net::LDAP::Entry.new, user.ldap_identity.provider) }
before do before do
......
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