Commit 93bef4f0 authored by Marin Jankovski's avatar Marin Jankovski

Merge remote-tracking branch 'ce/master'

Conflicts:
	VERSION
parents 61c651d7 d1e424bd
7.0.0-ee.rc1
7.0.0-ee
......@@ -23,13 +23,9 @@ class Admin::ProjectsController < Admin::ApplicationController
end
def transfer
result = ::Projects::TransferService.new(@project, current_user, project: params).execute(:admin)
::Projects::TransferService.new(@project, current_user, params.dup).execute
if result
redirect_to [:admin, @project]
else
render :show
end
redirect_to [:admin, @project.reload]
end
protected
......
......@@ -118,19 +118,30 @@ class ProjectTeam
end
def guest?(user)
find_tm(user.id).try(:access_field) == Gitlab::Access::GUEST
max_tm_access(user.id) == Gitlab::Access::GUEST
end
def reporter?(user)
find_tm(user.id).try(:access_field) == Gitlab::Access::REPORTER
max_tm_access(user.id) == Gitlab::Access::REPORTER
end
def developer?(user)
find_tm(user.id).try(:access_field) == Gitlab::Access::DEVELOPER
max_tm_access(user.id) == Gitlab::Access::DEVELOPER
end
def master?(user)
find_tm(user.id).try(:access_field) == Gitlab::Access::MASTER
max_tm_access(user.id) == Gitlab::Access::MASTER
end
def max_tm_access(user_id)
access = []
access << project.users_projects.find_by(user_id: user_id).try(:access_field)
if group
access << group.users_groups.find_by(user_id: user_id).try(:access_field)
end
access.compact.max
end
private
......
ActiveRecord::Base.observers.disable(:milestone_observer)
Milestone.seed(:id, [
{ id: 1, project_id: 1, title: 'v' + Faker::Address.zip_code },
{ id: 2, project_id: 1, title: 'v' + Faker::Address.zip_code },
......@@ -18,5 +16,3 @@ Milestone.all.map do |ml|
ml.set_iid
ml.save
end
ActiveRecord::Base.observers.enable(:milestone_observer)
......@@ -29,9 +29,14 @@ Consider naming the issue "Release x.x.x.rc1" to make it easier for later search
1. Check the [Git version](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/tasks/gitlab/check.rake#L794)
1. There might be other changes. Ask around.
### **3. Create an update guide**
### **3. Create an update guides**
It's best to copy paste the previous guide and make changes where necessary. The typical steps are listed below with any points you should specifically look at.
1. Create: CE update guide from previous version. Like `from-6-8-to-6.9`
1. Create: CE to EE update guide in EE repository for latest version.
1. Update: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/6.0-to-6.x.md to latest version.
It's best to copy paste the previous guide and make changes where necessary.
The typical steps are listed below with any points you should specifically look at.
#### 0. Any major changes?
......
# From 6.0 to 6.8
**In 6.1 we remove a lot of deprecated code.**
**You should update to 6.0 before installing 6.1 or higher so all the necessary conversions are run.**
# From 6.0 to 7.0
## Deprecations
The 'Wall' feature has been removed in GitLab 7.0. Existing wall comments will remain stored in the database after the upgrade.
## Global issue numbers
As of 6.1 issue numbers are project specific. This means all issues are renumbered and get a new number in their URL. If you use an old issue number URL and the issue number does not exist yet you are redirected to the new one. This conversion does not trigger if the old number already exists for this project, this is unlikely but will happen with old issues and large projects.
......@@ -34,7 +32,7 @@ sudo -u git -H git fetch --all
For GitLab Community Edition:
```bash
sudo -u git -H git checkout 6-8-stable
sudo -u git -H git checkout 7-0-stable
```
OR
......@@ -42,7 +40,7 @@ OR
For GitLab Enterprise Edition:
```bash
sudo -u git -H git checkout 6-8-stable-ee
sudo -u git -H git checkout 7-0-stable-ee
```
......@@ -91,12 +89,12 @@ sudo chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites
TIP: to see what changed in gitlab.yml.example in this release use next command:
```
git diff 6-0-stable:config/gitlab.yml.example 6-8-stable:config/gitlab.yml.example
git diff 6-0-stable:config/gitlab.yml.example 7-0-stable:config/gitlab.yml.example
```
* Make `/home/git/gitlab/config/gitlab.yml` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-8-stable/config/gitlab.yml.example but with your settings.
* Make `/home/git/gitlab/config/unicorn.rb` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-8-stable/config/unicorn.rb.example but with your settings.
* Make `/etc/nginx/sites-available/nginx` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/6-8-stable/lib/support/nginx/gitlab but with your settings.
* Make `/home/git/gitlab/config/gitlab.yml` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/config/gitlab.yml.example but with your settings.
* Make `/home/git/gitlab/config/unicorn.rb` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/config/unicorn.rb.example but with your settings.
* Make `/etc/nginx/sites-available/nginx` the same as https://gitlab.com/gitlab-org/gitlab-ce/blob/7-0-stable/lib/support/nginx/gitlab but with your settings.
* Copy rack attack middleware config
```bash
......
......@@ -12,3 +12,9 @@ Feature: Admin Projects
When I visit admin projects page
And I click on first project
Then I should see project details
Scenario: Transfer project
Given group 'Web'
And I visit admin project page
When I transfer project to group 'Web'
Then I should see project transfered
......@@ -19,4 +19,30 @@ class AdminProjects < Spinach::FeatureSteps
page.should have_content(project.name_with_namespace)
page.should have_content(project.creator.name)
end
step 'I visit admin project page' do
visit admin_project_path(project)
end
step 'I transfer project to group \'Web\'' do
find(:xpath, "//input[@id='namespace_id']").set group.id
click_button 'Transfer'
end
step 'group \'Web\'' do
create(:group, name: 'Web')
end
step 'I should see project transfered' do
page.should have_content 'Web / ' + project.name
page.should have_content 'Namespace: Web'
end
def project
@project ||= Project.first
end
def group
Group.find_by(name: 'Web')
end
end
require "spec_helper"
describe ProjectTeam do
let(:group) { create(:group) }
let(:project) { create(:empty_project, group: group) }
let(:master) { create(:user) }
let(:reporter) { create(:user) }
let(:guest) { create(:user) }
let(:nonmember) { create(:user) }
before do
group.add_user(master, Gitlab::Access::MASTER)
group.add_user(reporter, Gitlab::Access::REPORTER)
group.add_user(guest, Gitlab::Access::GUEST)
context 'personal project' do
let(:project) { create(:empty_project) }
# Add group guest as master to this project
# to test project access priority over group members
project.team << [guest, :master]
end
before do
project.team << [master, :master]
project.team << [reporter, :reporter]
project.team << [guest, :guest]
end
describe 'members collection' do
it { project.team.masters.should include(master) }
it { project.team.masters.should include(guest) }
it { project.team.masters.should_not include(reporter) }
it { project.team.masters.should_not include(nonmember) }
describe 'members collection' do
it { project.team.masters.should include(master) }
it { project.team.masters.should_not include(guest) }
it { project.team.masters.should_not include(reporter) }
it { project.team.masters.should_not include(nonmember) }
end
describe 'access methods' do
it { project.team.master?(master).should be_true }
it { project.team.master?(guest).should be_false }
it { project.team.master?(reporter).should be_false }
it { project.team.master?(nonmember).should be_false }
end
end
describe 'access methods' do
it { project.team.master?(master).should be_true }
it { project.team.master?(guest).should be_true }
it { project.team.master?(reporter).should be_false }
it { project.team.master?(nonmember).should be_false }
context 'group project' do
let(:group) { create(:group) }
let(:project) { create(:empty_project, group: group) }
before do
group.add_user(master, Gitlab::Access::MASTER)
group.add_user(reporter, Gitlab::Access::REPORTER)
group.add_user(guest, Gitlab::Access::GUEST)
# If user is a group and a project member - GitLab uses highest permission
# So we add group guest as master and add group master as guest
# to this project to test highest access
project.team << [guest, :master]
project.team << [master, :guest]
end
describe 'members collection' do
it { project.team.reporters.should include(reporter) }
it { project.team.masters.should include(master) }
it { project.team.masters.should include(guest) }
it { project.team.masters.should_not include(reporter) }
it { project.team.masters.should_not include(nonmember) }
end
describe 'access methods' do
it { project.team.reporter?(reporter).should be_true }
it { project.team.master?(master).should be_true }
it { project.team.master?(guest).should be_true }
it { project.team.master?(reporter).should be_false }
it { project.team.master?(nonmember).should be_false }
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