Commit 860a80ea authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq

Conflicts:
	app/assets/stylesheets/common.scss
	db/schema.rb
parents cc36f6dc 96e89ec3
v 6.0.0
- Feature: Replace teams with group membership
We introduce group membership in 6.0 as a replacement for teams.
The old combination of groups and teams was confusing for a lot of people.
And when the members of a team where changed this wasn't reflected in the project permissions.
In GitLab 6.0 you will be able to add members to a group with a permission level for each member.
These group members will have access to the projects in that group.
Any changes to group members will immediately be reflected in the project permissions.
You can even have multiple owners for a group, greatly simplifying administration.
- Feature: Ability to have multiple owners for group
- Feature: Merge Requests between fork and project (Izaak Alpert)
- Feature: Generate fingerprint for ssh keys
......@@ -24,7 +31,7 @@ v 6.0.0
- Move all project controllers/views under Projects:: module
- Move all profile controllers/views under Profiles:: module
- Apply user project limit only for personal projects
- Unicorn is default web server for new installations
- Unicorn is default web server again
- Store satellites lock files inside satellites dir
- Disabled threadsafety mode in rails
- Fixed bug with loosing MR comments
......
......@@ -23,7 +23,7 @@ gem 'omniauth-github'
# Extracting information from a git repository
# Provide access to Gitlab::Git library
gem "gitlab_git", "~> 2.0.0.pre"
gem "gitlab_git", '2.0.1'
# Ruby/Rack Git Smart-HTTP Server Handler
gem 'gitlab-grack', '~> 1.0.1', require: 'grack'
......
......@@ -186,7 +186,7 @@ GEM
gitlab-pygments.rb (0.3.2)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
gitlab_git (2.0.0.pre)
gitlab_git (2.0.1)
activesupport (~> 3.2.13)
github-linguist (~> 2.3.4)
gitlab-grit (~> 2.6.0)
......@@ -285,7 +285,7 @@ GEM
minitest (4.7.4)
modernizr (2.6.2)
sprockets (~> 2.0)
multi_json (1.7.8)
multi_json (1.7.9)
multi_xml (0.5.4)
multipart-post (1.2.0)
mysql2 (0.3.11)
......@@ -578,7 +578,7 @@ DEPENDENCIES
gitlab-gollum-lib (~> 1.0.1)
gitlab-grack (~> 1.0.1)
gitlab-pygments.rb (~> 0.3.2)
gitlab_git (~> 2.0.0.pre)
gitlab_git (= 2.0.1)
gitlab_meta (= 6.0)
gitlab_omniauth-ldap (= 1.0.3)
gon
......
class ProjectImport
constructor: ->
setTimeout ->
Turbolinks.visit(location.href)
, 5000
@ProjectImport = ProjectImport
......@@ -16,7 +16,7 @@ class window.ContributorsStatGraph
_.each(limited_author_data, (d) =>
author_header = @create_author_header(d)
$(".contributors-list").append(author_header)
@authors[d.author] = author_graph = new ContributorsAuthorGraph(d.dates)
@authors[d.author_name] = author_graph = new ContributorsAuthorGraph(d.dates)
author_graph.draw()
)
format_author_commit_info: (author) ->
......@@ -46,13 +46,15 @@ class window.ContributorsStatGraph
class: 'person'
style: 'display: block;'
})
author_name = $('<h4>' + author.author + '</h4>')
author_name = $('<h4>' + author.author_name + '</h4>')
author_email = $('<p class="graph-author-email">' + author.author_email + '</p>')
author_commit_info_span = $('<span/>', {
class: 'commits'
})
author_commit_info = @format_author_commit_info(author)
author_commit_info_span.html(author_commit_info)
list_item.append(author_name)
list_item.append(author_email)
list_item.append(author_commit_info_span)
list_item
redraw_master: ->
......@@ -65,9 +67,9 @@ class window.ContributorsStatGraph
author_commits = ContributorsStatGraphUtil.get_author_data(@parsed_log, @field, x_domain)
_.each(author_commits, (d) =>
@redraw_author_commit_info(d)
$(@authors[d.author].list_item).appendTo("ol")
@authors[d.author].set_data(d.dates)
@authors[d.author].redraw()
$(@authors[d.author_name].list_item).appendTo("ol")
@authors[d.author_name].set_data(d.dates)
@authors[d.author_name].redraw()
)
set_current_field: (field) ->
@field = field
......@@ -77,6 +79,6 @@ class window.ContributorsStatGraph
print = print_date_format(x_domain[0]) + " - " + print_date_format(x_domain[1])
$("#date_header").text(print)
redraw_author_commit_info: (author) ->
author_list_item = $(@authors[author.author].list_item)
author_list_item = $(@authors[author.author_name].list_item)
author_commit_info = @format_author_commit_info(author)
author_list_item.find("span").html(author_commit_info)
class window.ContributorsGraph
MARGIN:
top: 20
right: 20
bottom: 30
right: 20
bottom: 30
left: 50
x_domain: null
y_domain: null
......@@ -38,7 +38,7 @@ class window.ContributorsGraph
@y = d3.scale.linear().range([height, 0]).nice()
draw_x_axis: ->
@svg.append("g").attr("class", "x axis").attr("transform", "translate(0, #{@height})")
.call(@x_axis);
.call(@x_axis)
draw_y_axis: ->
@svg.append("g").attr("class", "y axis").call(@y_axis)
set_data: (data) ->
......@@ -51,7 +51,7 @@ class window.ContributorsMasterGraph extends ContributorsGraph
else
@width = 870
@height = 125
@height = 200
@x = null
@y = null
@x_axis = null
......@@ -61,7 +61,7 @@ class window.ContributorsMasterGraph extends ContributorsGraph
@brush = null
@x_max_domain = null
process_dates: (data) ->
dates = @get_dates(data)
dates = @get_dates(data)
@parse_dates(data)
ContributorsGraph.set_dates(dates)
get_dates: (data) ->
......@@ -87,14 +87,16 @@ class window.ContributorsMasterGraph extends ContributorsGraph
@area = d3.svg.area().x((d) ->
x(d.date)
).y0(@height).y1((d) ->
y(d.commits = d.commits ? d.additions ? d.deletions)
xa = d.commits = d.commits ? d.additions ? d.deletions
console.log(xa)
y(xa)
).interpolate("basis")
create_brush: ->
@brush = d3.svg.brush().x(@x).on("brushend", @update_content);
@brush = d3.svg.brush().x(@x).on("brushend", @update_content)
draw_path: (data) ->
@svg.append("path").datum(data).attr("class", "area").attr("d", @area);
@svg.append("path").datum(data).attr("class", "area").attr("d", @area)
add_brush: ->
@svg.append("g").attr("class", "selection").call(@brush).selectAll("rect").attr("height", @height);
@svg.append("g").attr("class", "selection").call(@brush).selectAll("rect").attr("height", @height)
update_content: =>
ContributorsGraph.set_x_domain(if @brush.empty() then @x_max_domain else @brush.extent())
$("#brush_change").trigger('change')
......@@ -126,8 +128,8 @@ class window.ContributorsAuthorGraph extends ContributorsGraph
@width = 490
else
@width = 380
@height = 130
@height = 200
@x = null
@y = null
@x_axis = null
......
......@@ -4,9 +4,9 @@ window.ContributorsStatGraphUtil =
by_author = {}
for entry in log
@add_date(entry.date, total) unless total[entry.date]?
@add_author(entry.author, by_author) unless by_author[entry.author]?
@add_date(entry.date, by_author[entry.author]) unless by_author[entry.author][entry.date]
@store_data(entry, total[entry.date], by_author[entry.author][entry.date])
@add_author(entry, by_author) unless by_author[entry.author_name]?
@add_date(entry.date, by_author[entry.author_name]) unless by_author[entry.author_name][entry.date]
@store_data(entry, total[entry.date], by_author[entry.author_name][entry.date])
total = _.toArray(total)
by_author = _.toArray(by_author)
total: total, by_author: by_author
......@@ -16,8 +16,9 @@ window.ContributorsStatGraphUtil =
collection[date].date = date
add_author: (author, by_author) ->
by_author[author] = {}
by_author[author].author = author
by_author[author.author_name] = {}
by_author[author.author_name].author_name = author.author_name
by_author[author.author_name].author_email = author.author_email
store_data: (entry, total, by_author) ->
@store_commits(total, by_author)
......@@ -71,10 +72,11 @@ window.ContributorsStatGraphUtil =
parse_log_entry: (log_entry, field, date_range) ->
parsed_entry = {}
parsed_entry.author = log_entry.author
parsed_entry.author_name = log_entry.author_name
parsed_entry.author_email = log_entry.author_email
parsed_entry.dates = {}
parsed_entry.commits = parsed_entry.additions = parsed_entry.deletions = 0
_.each(_.omit(log_entry, 'author'), (value, key) =>
_.each(_.omit(log_entry, 'author_name', 'author_email'), (value, key) =>
if @in_range(value.date, date_range)
parsed_entry.dates[value.date] = value[field]
parsed_entry.commits += value.commits
......@@ -88,4 +90,4 @@ window.ContributorsStatGraphUtil =
true
else
false
\ No newline at end of file
......@@ -365,3 +365,10 @@ img.emoji {
.available-groups form {
margin: 5px 0;
}
table {
td.permission-x {
background: #D9EDF7 !important;
text-align: center;
}
}
/** COLORS **/
.cgray { color:gray }
.cred { color:#D12F19 }
.cgreen { color:#4a2 }
.cblue { color:#29A }
.cblack { color:#111 }
.cdark { color:#444 }
.cwhite { color:#fff!important }
.bgred { background:#F2DEDE!important }
.cgray { color: gray }
.cred { color: #D12F19 }
.cgreen { color: #4a2 }
.cblue { color: #29A }
.cblack { color: #111 }
.cdark { color: #444 }
.cwhite { color: #fff!important }
.bgred { background: #F2DEDE!important }
/** COMMON CLASSES **/
.left { float:left }
......
......@@ -24,6 +24,10 @@ input {
input[type="radio"], input[type="checkbox"] {
margin-top: 6px;
}
.add-on {
padding: 6px;
}
}
}
......@@ -27,7 +27,7 @@
&.nav-stacked-menu {
background: #FAFAFA;
li > a {
padding: 20px;
padding: 16px;
}
}
}
......
......@@ -436,19 +436,28 @@
background: none;
border: none;
margin: 0;
padding: 0;
margin-top: 10px;
}
.ui-box.commit-box {
margin-top: 0;
.commit-box {
margin: 10px 0;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
padding: 20px 0;
.commit-committer-link,
.commit-author-link {
color: #333;
.commit-title {
margin: 0;
font-size: 20px;
font-weight: bold;
text-shadow: 0 1px 1px #FFF;
}
.commit-description {
margin-top: 15px;
}
}
.commit-stat-summary {
color: #666;
line-height: 2;
......@@ -475,3 +484,15 @@ li.commit {
.commit-breadcrumb {
padding: 0;
}
.commit-info-row {
margin-bottom: 10px;
.avatar {
@extend .avatar-inline;
}
.commit-committer-link,
.commit-author-link {
color: #444;
font-weight: bold;
}
}
......@@ -22,6 +22,11 @@
.graph-author-commits-count {
}
.graph-author-email {
float: right;
color: #777;
}
.graph-additions {
color: #4a2;
}
......
......@@ -7,6 +7,13 @@
}
}
.project-name-holder {
.help-inline {
vertical-align: top;
padding: 7px;
}
}
.project_clone_panel {
@include border-radius(4px);
@include bg-gray-gradient;
......
......@@ -26,7 +26,7 @@ module Projects
# Ex.
# 'GitLab HQ'.parameterize => "gitlab-hq"
#
@project.path = @project.name.dup.parameterize
@project.path = @project.name.dup.parameterize unless @project.path.present?
if namespace_id
......@@ -45,26 +45,15 @@ module Projects
@project.creator = current_user
# Import project from cloneable resource
if @project.valid? && @project.import_url.present?
shell = Gitlab::Shell.new
if shell.import_repository(@project.path_with_namespace, @project.import_url)
# We should create satellite for imported repo
@project.satellite.create unless @project.satellite.exists?
@project.imported = true
true
else
@project.errors.add(:import_url, 'cannot clone repo')
end
end
if @project.save
@project.discover_default_branch
unless @project.group
@project.users_projects.create(project_access: UsersProject::MASTER, user: current_user)
@project.users_projects.create(
project_access: UsersProject::MASTER,
user: current_user
)
end
@project.discover_default_branch
end
@project
......
......@@ -19,8 +19,8 @@ class SearchContext
if params[:search_code].present?
result[:blobs] = project.repository.search_files(query, params[:repository_ref]) unless project.empty_repo?
else
result[:merge_requests] = MergeRequest.in_projects(project_ids).search(query).limit(20)
result[:issues] = Issue.where(project_id: project_ids).search(query).limit(20)
result[:merge_requests] = MergeRequest.in_projects(project_ids).search(query).order('updated_at DESC').limit(20)
result[:issues] = Issue.where(project_id: project_ids).search(query).order('updated_at DESC').limit(20)
result[:wiki_pages] = []
end
result
......
......@@ -57,6 +57,10 @@ class ProjectsController < Projects::ApplicationController
limit = (params[:limit] || 20).to_i
@events = @project.events.recent.limit(limit).offset(params[:offset] || 0)
# Ensure project default branch is set if it possible
# Normally it defined on push or during creation
@project.discover_default_branch
respond_to do |format|
format.html do
if @project.empty_repo?
......
......@@ -36,16 +36,16 @@ class Commit
# Returns the commits title.
#
# Usually, the commit title is the first line of the commit message.
# In case this first line is longer than 80 characters, it is cut off
# after 70 characters and ellipses (`&hellp;`) are appended.
# In case this first line is longer than 100 characters, it is cut off
# after 80 characters and ellipses (`&hellp;`) are appended.
def title
title = safe_message
return no_commit_message if title.blank?
title_end = title.index(/\n/)
if (!title_end && title.length > 80) || (title_end && title_end > 80)
title[0..69] << "&hellip;".html_safe
if (!title_end && title.length > 100) || (title_end && title_end > 100)
title[0..79] << "&hellip;".html_safe
else
title.split(/\n/, 2).first
end
......@@ -58,8 +58,8 @@ class Commit
description = safe_message
title_end = description.index(/\n/)
if (!title_end && description.length > 80) || (title_end && title_end > 80)
"&hellip;".html_safe << description[70..-1]
if (!title_end && description.length > 100) || (title_end && title_end > 100)
"&hellip;".html_safe << description[80..-1]
else
description.split(/\n/, 2)[1].try(:chomp)
end
......
......@@ -37,8 +37,6 @@ class Project < ActiveRecord::Base
acts_as_taggable_on :labels, :issues_default_labels
attr_accessor :import_url
# Relations
belongs_to :creator, foreign_key: "creator_id", class_name: "User"
belongs_to :group, foreign_key: "namespace_id", conditions: "type = 'Group'"
......@@ -78,11 +76,11 @@ class Project < ActiveRecord::Base
validates :description, length: { within: 0..2000 }
validates :name, presence: true, length: { within: 0..255 },
format: { with: Gitlab::Regex.project_name_regex,
message: "only letters, digits, spaces & '_' '-' '.' allowed. Letter should be first" }
message: "only letters, digits, spaces & '_' '-' '.' allowed. Letter or digit should be first" }
validates :path, presence: true, length: { within: 0..255 },
exclusion: { in: Gitlab::Blacklist.path },
format: { with: Gitlab::Regex.path_regex,
message: "only letters, digits & '_' '-' '.' allowed. Letter should be first" }
message: "only letters, digits & '_' '-' '.' allowed. Letter or digit should be first" }
validates :issues_enabled, :wall_enabled, :merge_requests_enabled,
:wiki_enabled, inclusion: { in: [true, false] }
validates :issues_tracker_id, length: { within: 0..255 }
......@@ -94,7 +92,7 @@ class Project < ActiveRecord::Base
format: { with: URI::regexp(%w(git http https)), message: "should be a valid url" },
if: :import?
validate :check_limit
validate :check_limit, on: :create
# Scopes
scope :without_user, ->(user) { where("projects.id NOT IN (:ids)", ids: user.authorized_projects.map(&:id) ) }
......@@ -160,6 +158,10 @@ class Project < ActiveRecord::Base
import_url.present?
end
def imported?
imported
end
def check_limit
unless creator.can_create_project?
errors[:limit_reached] << ("Your own projects limit is #{creator.projects_limit}! Please contact administrator to increase it")
......@@ -313,7 +315,7 @@ class Project < ActiveRecord::Base
def discover_default_branch
# Discover the default branch, but only if it hasn't already been set to
# something else
if repository && default_branch.nil?
if repository.exists? && default_branch.nil?
update_attributes(default_branch: self.repository.discover_default_branch)
end
end
......@@ -414,10 +416,6 @@ class Project < ActiveRecord::Base
!(forked_project_link.nil? || forked_project_link.forked_from_project.nil?)
end
def imported?
imported
end
def personal?
!group
end
......
......@@ -105,7 +105,11 @@ class Repository
def commit_count
Rails.cache.fetch(cache_key(:commit_count)) do
raw_repository.raw.commit_count
begin
raw_repository.raw.commit_count
rescue
0
end
end
end
......
......@@ -29,11 +29,11 @@ class ActivityObserver < BaseObserver
def create_event(record, status)
Event.create(
project: record.project,
target_id: record.id,
target_type: record.class.name,
action: status,
author_id: record.author_id
project: record.project,
target_id: record.id,
target_type: record.class.name,
action: status,
author_id: current_user.id
)
end
end
......@@ -46,8 +46,7 @@ class MergeRequestObserver < ActivityObserver
target_id: record.id,
target_type: record.class.name,
action: status,
author_id: record.author_id
author_id: current_user.id
)
end
end
class ProjectObserver < BaseObserver
def after_create(project)
return true if project.forked? || project.imported?
project.update_column(:last_activity_at, project.created_at)
GitlabShellWorker.perform_async(
:add_repository,
project.path_with_namespace
)
return true if project.forked?
if project.import?
RepositoryImportWorker.perform_in(5.seconds, project.id)
else
GitlabShellWorker.perform_async(
:add_repository,
project.path_with_namespace
)
log_info("#{project.owner.name} created a new project \"#{project.name_with_namespace}\"")
log_info("#{project.owner.name} created a new project \"#{project.name_with_namespace}\"")
end
end
def after_update(project)
......
.alert.alert-info
%span
Post receive hooks for binding events.
Post-receive hooks for binding events.
%br
Read more about system hooks
%strong #{link_to "here", help_system_hooks_path, class: "vlink"}
......
%h3.nothing_here_message
There are no projects you have access to.
You don't have access to any projects.
%br
- if current_user.can_create_project?
You can create up to
= current_user.projects_limit
projects. Click on button below to add a new one
= pluralize(current_user.projects_limit, "project") + "."
Click on the button below to add a new one
.link_holder
= link_to new_project_path, class: "btn btn-primary" do
New Project »
- else
If you will be added to project - it will be displayed here
If you are added to a project, it will be displayed here
......@@ -3,7 +3,7 @@
%span.pull-right #{@issues.total_count} issues
%p.light
For all issues you should visit project issues page. Or you can use search panel to find specific issue
For all issues you should visit the project's issues page, or use the search panel to find a specific issue.
%hr
.row
......
......@@ -4,7 +4,7 @@
%p.light
Only merge requests authored or assigned to you are listed here.
Only merge requests created by you or assigned to you are listed here.
%hr
.row
.span3
......
%h3.page-title My Projects
%p.light
All projects you have access to are listed here. Public projects are not included here unless you have membership in it
All projects you have access to are listed here. Public projects are not included here unless you are a member
%hr
.row
.span3
......@@ -46,7 +46,7 @@
- else
= private_icon
= link_to project_path(project), class: dom_class(project) do
= project.name_with_namespace
%strong= project.name_with_namespace
- if project.forked_from_project
%small.pull-right
......
%h3.page-title
Issues
%small (assigned to you)
%small.pull-right #{@issues.total_count} issues
Issues assigned to me
%span.pull-right #{@issues.total_count} issues
%p.light
Only issues from
%strong #{@group.name}
group are listed here. To see all issues you should visit #{link_to 'dashboard', issues_dashboard_path} page.
%hr
.row
.span3
= render 'shared/filter', entity: 'issue'
......
%h3.page-title
Merge Requests
%small (authored by or assigned to you)
%small.pull-right #{@merge_requests.total_count} merge requests
%span.pull-right #{@merge_requests.total_count} merge requests
%p.light
Authored or assigned to you from
%strong #{@group.name}
group. To see all merge requests you should visit #{link_to 'dashboard', merge_requests_dashboard_path} page.
%hr
.row
.span3
......
.row
.span3
= link_to help_path, class: 'btn append-bottom-20 btn-small' do
%i.icon-angle-left
Back to help
%br
.append-bottom-20
= link_to help_path, class: 'btn btn-small' do
%i.icon-angle-left
Back to help
%ul.nav.nav-pills.nav-stacked
- %w(README projects project_snippets repositories deploy_keys users groups session issues milestones merge_requests notes system_hooks).each do |file|
%li{class: file == @category ? 'active' : nil}
......
= render layout: 'help/layout' do
%h3.page-title Permissions
%fieldset
%legend Guest
%ul
%li Create new issue
%li Leave comments
%li Write on project wall
%fieldset
%legend Reporter
%ul
%li Create new issue
%li Leave comments
%li Write on project wall
%li Pull project code
%li Download project
%li Create a code snippets
%fieldset
%legend Developer
%ul
%li Create new issue
%li Leave comments
%li Write on project wall
%li Pull project code
%li Download project
%li Create new merge request
%li Create a code snippets
%li Create new branches
%li Push to non-protected branches
%li Remove non-protected branches
%li Add tags
%li Write a wiki
%fieldset
%legend Master
%ul
%li Create new issue
%li Leave comments
%li Write on project wall
%li Pull project code
%li Download project
%li Create new merge request
%li Create a code snippets
%li Create new branches
%li Push to non-protected branches
%li Remove non-protected branches
%li Add tags
%li Write a wiki
%li Add new team members
%li Push to protected branches
%li Remove protected branches
%li Edit project
%li Add Deploy Keys to project
%li Configure Project Hooks
%fieldset
%legend Owner
%ul
%li Switch public mode
%li Transfer project to another namespace
%li Remove project
%table.table
%thead
%tr
%th Action
%th Guest
%th Reporter
%th Developer
%th Master
%th Owner
%tbody
%tr
%td Create new issue
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Leave comments
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Write on project wall
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Pull project code
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Download project
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Create code snippets
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Create new merge request
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Create new branches
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Push to non-protected branches
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Remove non-protected branches
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Add tags
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Write a wiki
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Add new team members
%td
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Push to protected branches
%td
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Remove protected branches
%td
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Edit project
%td
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Add Deploy Keys to project
%td
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Configure Project Hooks
%td
%td
%td
%td.permission-x &#10003;
%td.permission-x &#10003;
%tr
%td Switch public mode
%td
%td
%td
%td
%td.permission-x &#10003;
%tr
%td Transfer project to another namespace
%td
%td
%td
%td
%td.permission-x &#10003;
%tr
%td Remove project
%td
%td
%td
%td
%td.permission-x &#10003;
%h3.page-title
Account settings
%p.light
You can change password, username, private token here.
You can change your password, username and private token here.
- if current_user.ldap_user?
Some options are unavailable for LDAP accounts
%hr
......@@ -20,7 +20,7 @@
%legend Password
= form_for @user, url: update_password_profile_path, method: :put do |f|
.padded
%p.slead After successful password update you will be redirected to login page where you should login with new password
%p.slead After a successful password update you will be redirected to login page where you should login with your new password
-if @user.errors.any?
.alert.alert-error
%ul
......@@ -49,9 +49,9 @@
= form_for @user, url: reset_private_token_profile_path, method: :put do |f|
.data
%p.slead
Private token used to access application resources without authentication.
Your private token is used to access application resources without authentication.
%br
It can be used for atom feed or API
It can be used for atom feeds or the API.
%p.cgray
- if current_user.private_token
= text_field_tag "token", current_user.private_token, class: "input-xxlarge large_text input-xpadding"
......@@ -81,8 +81,8 @@
%i.icon-remove
Failed
%ul.cred
%li It will change web url for personal projects.
%li It will change the git path to repositories for personal projects.
%li This will change the web URL for personal projects.
%li This will change the git path to repositories for personal projects.
.controls
= f.submit 'Save username', class: "btn btn-save"
......
......@@ -6,7 +6,7 @@
%i.icon-plus
New Group
%p.light
Members of group have access to all group projects.
Group members have access to all a group's projects
%hr
.ui-box
.title
......@@ -27,7 +27,7 @@
Leave
= link_to group, class: 'group-name' do
= group.name
%strong= group.name
as #{user_group.human_access}
......
%h3.page-title
Account history
%p.light
You can see all events authored by your account here
All events created by your account are listed here
%hr
.profile_history
= render @events
......
......@@ -3,9 +3,9 @@
.pull-right
= link_to "Add SSH Key", new_profile_key_path, class: "btn btn-new"
%p.light
SSH key allows you to establish a secure connection between your computer and GitLab
SSH keys allow you to establish a secure connection between your computer and GitLab
%br
Before you can add ssh key you need to
Before you can add an SSH key you need to
= link_to "generate it", help_ssh_path
%hr
......
%h3.page-title
Notifications settings
%p.light
Application use email specified in your profile for notifications
GitLab uses the email specified in your profile for notifications
%hr
.alert.alert-info
%p
......@@ -11,7 +11,7 @@
%p
%i.icon-circle.cblue
%strong Participating
&ndash; You will receive only notifications from related resources(ex. from assigned issue or your commit)
&ndash; You will only receive notifications from related resources (e.g. from your commits or assigned issues)
%p
%i.icon-circle.cgreen
%strong Watch
......
.ui-box.ui-box-show.commit-box
.ui-box-head
.pull-right
- if @notes_count > 0
%span.btn.disabled.grouped
%i.icon-comment
= @notes_count
.left.btn-group
%a.btn.grouped.dropdown-toggle{ data: {toggle: :dropdown} }
%i.icon-download-alt
Download as
%span.caret
%ul.dropdown-menu
%li= link_to "Email Patches", project_commit_path(@project, @commit, format: :patch)
%li= link_to "Plain Diff", project_commit_path(@project, @commit, format: :diff)
= link_to project_tree_path(@project, @commit), class: "btn btn-primary grouped" do
%span Browse Code »
%h3.commit-title.page-title
= gfm escape_once(@commit.title)
- if @commit.description.present?
%pre.commit-description
= gfm escape_once(@commit.description)
.ui-box-body
.row
.span5
.author
= commit_author_link(@commit, avatar: true, size: 32)
authored
%time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")}
#{time_ago_in_words(@commit.authored_date)} ago
- if @commit.different_committer?
.committer
&rarr;
= commit_committer_link(@commit)
committed
%time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")}
#{time_ago_in_words(@commit.committed_date)} ago
.span6.pull-right
.pull-right
.sha-block
%span.cgray commit
%span.label_commit= @commit.id
.clearfix
.pull-right
.sha-block
%span.cgray= pluralize(@commit.parents.count, "parent")
- @commit.parents.each do |parent|
= link_to parent.id[0...10], project_commit_path(@project, parent)
.pull-right
%div
- if @notes_count > 0
%span.btn.disabled.grouped
%i.icon-comment
= @notes_count
.pull-left.btn-group
%a.btn.grouped.dropdown-toggle{ data: {toggle: :dropdown} }
%i.icon-download-alt
Download as
%span.caret
%ul.dropdown-menu
%li= link_to "Email Patches", project_commit_path(@project, @commit, format: :patch)
%li= link_to "Plain Diff", project_commit_path(@project, @commit, format: :diff)
= link_to project_tree_path(@project, @commit), class: "btn btn-primary grouped" do
%span Browse Code »
%div
%p
%span.light Commit
= link_to @commit.id, project_commit_path(@project, @commit)
.commit-info-row
%span.light Authored by
%strong
= commit_author_link(@commit, avatar: true, size: 24)
%time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")}
#{time_ago_in_words(@commit.authored_date)} ago
- if @commit.different_committer?
.commit-info-row
%span.light Committed by
%strong
= commit_committer_link(@commit, avatar: true, size: 24)
%time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")}
#{time_ago_in_words(@commit.committed_date)} ago
.commit-info-row
%span.cgray= pluralize(@commit.parents.count, "parent")
- @commit.parents.each do |parent|
= link_to parent.id[0...10], project_commit_path(@project, parent)
.commit-box
%h3.commit-title
= gfm escape_once(@commit.title)
- if @commit.description.present?
%pre.commit-description
= gfm escape_once(@commit.description)
......@@ -13,7 +13,7 @@
= f.label :key
.controls
%p.light
Paste a machine public key here. Read more about how generate it
Paste a machine public key here. Read more about how to generate it
= link_to "here", help_ssh_path
= f.text_area :key, class: "input-xxlarge thin_area"
......
%h3.page-title
Deploy keys allow read-only access to repository
Deploy keys allow read-only access to the repository
= link_to new_project_deploy_key_path(@project), class: "btn btn-new pull-right", title: "New Deploy Key" do
%i.icon-plus
New Deploy Key
%p.light
They can be used for CI, staging or production servers.
You can create a deploy key or add existing one
Deploy keys can be used for CI, staging or production servers.
You can create a deploy key or add an existing one
%hr.clearfix
......@@ -20,13 +20,13 @@
= render @enabled_keys
- if @enabled_keys.blank?
.light-well
%p.nothing_here_message Create #{link_to 'new deploy key', new_project_deploy_key_path(@project)} or add existing one
%p.nothing_here_message Create a #{link_to 'new deploy key', new_project_deploy_key_path(@project)} or add an existing one
.span5.available-keys
%h5
%strong Deploy keys
from projects available for you
from projects available to you
%ul.bordered-list
= render @available_keys
- if @available_keys.blank?
.light-well
%p.nothing_here_message All deploy keys created in projects you participate will be displayed here
%p.nothing_here_message Deploy keys from projects you have access to will be displayed here
.project-edit-container
.project-edit-errors
.project-edit-content
.ui-box.white
.title
%strong= @project.name
project settings:
%div
%h3.page-title
Project settings:
%p.light Some settings, such as "Transfer Project", are hidden inside the danger area below
%hr
.form-holder
= form_for(@project, remote: true) do |f|
%fieldset
......@@ -100,58 +101,71 @@
.form-actions
= f.submit 'Save changes', class: "btn btn-save"
- if can?(current_user, :change_namespace, @project)
%center.light.prepend-top-20.padded
%h3
%i.icon-warning-sign
Dangerous settings
%p Project settings below may result in data loss!
= link_to '#', class: 'btn js-toggle-visibility-link' do
Show it to me
%i.icon-chevron-down
.js-toggle-visibility-container.hide
- if can?(current_user, :change_namespace, @project)
.ui-box.ui-box-danger
.title Transfer project
.errors-holder
.form-holder
= form_for(@project, url: transfer_project_path(@project), remote: true, html: { class: 'transfer-project' }) do |f|
.control-group
= f.label :namespace_id do
%span Namespace
.controls
.control-group
= f.select :namespace_id, namespaces_options(@project.namespace_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'}
%ul
%li Be careful. Changing the project's namespace can have unintended side effects.
%li You can only transfer the project to namespaces you manage.
%li You will need to update your local repositories to point to the new location.
.form-actions
= f.submit 'Transfer', class: "btn btn-remove"
- else
%p.nothing_here_message Only the project owner can transfer a project
.ui-box.ui-box-danger
.title Transfer project
.title Rename repository
.errors-holder
.form-holder
= form_for(@project, url: transfer_project_path(@project), remote: true, html: { class: 'transfer-project' }) do |f|
= form_for(@project) do |f|
.control-group
= f.label :namespace_id do
%span Namespace
= f.label :path do
%span Path
.controls
.control-group
= f.select :namespace_id, namespaces_options(@project.namespace_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'}
= f.text_field :path
%ul
%li Be careful. Changing project namespace can have unintended side effects
%li You can transfer project only to namespaces you can manage
%li Be careful. Renaming a project's repository can have unintended side effects.
%li You will need to update your local repositories to point to the new location.
.form-actions
= f.submit 'Transfer', class: "btn btn-remove"
- else
%p.nothing_here_message Only project owner can transfer a project
= f.submit 'Rename', class: "btn btn-remove"
.ui-box.ui-box-danger
.title Rename repository
.errors-holder
.form-holder
= form_for(@project) do |f|
.control-group
= f.label :path do
%span Path
.controls
.control-group
= f.text_field :path
%ul
%li Be careful. Rename of project repo can have unintended side effects
%li You will need to update your local repositories to point to the new location.
.form-actions
= f.submit 'Rename', class: "btn btn-remove"
- if can?(current_user, :remove_project, @project)
.ui-box.ui-box-danger
.title Remove project
.ui-box-body
%p
Remove of project will cause removing repository and all related resources like issues, merge requests etc.
%p
%strong Removed project can not be restored!
- if can?(current_user, :remove_project, @project)
.ui-box.ui-box-danger
.title Remove project
.ui-box-body
%p
Removing the project will delete its repository and all related resources including issues, merge requests etc.
%br
%strong Removed projects cannot be restored!
= link_to 'Remove project', @project, confirm: remove_project_message(@project), method: :delete, class: "btn btn-remove btn-small"
- else
%p.nothing_here_message Only project owner can remove a project
= link_to 'Remove project', @project, confirm: remove_project_message(@project), method: :delete, class: "btn btn-remove"
- else
%p.nothing_here_message Only project owner can remove a project
.save-project-loader.hide
%center
= image_tag "ajax_loader.gif"
%h3 Saving project. Please wait a moment, this page will automatically refresh when ready.
%h3 Saving project.
%p Please wait a moment, this page will automatically refresh when ready.
= render 'clone_panel'
%div.git-empty
%fieldset
%legend Git global setup:
%pre.dark
:preserve
git config --global user.name "#{current_user.name}"
git config --global user.email "#{current_user.email}"
- if @project.import? && !@project.imported
.save-project-loader
%center
= image_tag "ajax_loader.gif"
%h3 Importing repository.
%p.monospace git clone --bare #{@project.import_url}
%p Please wait until we import repository for you. Refresh at will.
:javascript
new ProjectImport();
%fieldset
%legend Create Repository
%pre.dark
:preserve
mkdir #{@project.path}
cd #{@project.path}
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin #{@project.url_to_repo}
git push -u origin master
- else
%div.git-empty
%fieldset
%legend Git global setup:
%pre.dark
:preserve
git config --global user.name "#{current_user.name}"
git config --global user.email "#{current_user.email}"
%fieldset
%legend Existing Git Repo?
%pre.dark
:preserve
cd existing_git_repo
git remote add origin #{@project.url_to_repo}
git push -u origin master
%fieldset
%legend Create Repository
%pre.dark
:preserve
mkdir #{@project.path}
cd #{@project.path}
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin #{@project.url_to_repo}
git push -u origin master
%fieldset
%legend Existing Git Repo?
%pre.dark
:preserve
cd existing_git_repo
git remote add origin #{@project.url_to_repo}
git push -u origin master
- if can? current_user, :remove_project, @project
.prepend-top-20
......
.loading-graph
%center
.loading
%h3.page-title Building repository graph. Please wait a moment.
%h3.page-title Building repository graph.
%p Please wait a moment, this page will automatically refresh when ready.
.stat-graph
.header.clearfix
......@@ -11,6 +12,8 @@
%option{:value => "additions"} Additions
%option{:value => "deletions"} Deletions
%h3#date_header.page-title
%p.light
Commits to #{@project.default_branch}, excluding merge commits. Limited by 8,000 commits
%input#brush_change{:type => "hidden"}
.graphs
#contributors-master
......
- if can? current_user, :admin_project, @project
.alert.alert-info
%span
Post receive hooks for binding events when someone push to repository.
%br
Read more about web hooks
%strong #{link_to "here", help_web_hooks_path, class: "vlink"}
%h3.page-title
Post-receive hooks
%p.light
#{link_to "Post-receive hooks ", help_web_hooks_path, class: "vlink"} can be
used for binding events when someone pushes to the repository.
%hr.clearfix
= form_for [@project, @hook], as: :hook, url: project_hooks_path(@project), html: { class: 'form-inline' } do |f|
-if @hook.errors.any?
......
......@@ -83,7 +83,7 @@
= render @issues
- if @issues.blank?
%li
%h4.nothing_here_message Nothing to show here
%h4.nothing_here_message No issues to show
- if @issues.present?
.pull-right
......
......@@ -65,7 +65,7 @@
= render @merge_requests
- if @merge_requests.blank?
%li
%h4.nothing_here_message Nothing to show here
%h4.nothing_here_message No merge requests to show
- if @merge_requests.present?
.pull-right
%span.cgray.pull-right #{@merge_requests.total_count} merge requests for this filter
......
- unless @allowed_to_merge
.alert
%strong You don't have enough permissions to merge this MR
%strong You don't have permission to merge this MR
- if @show_merge_controls
......@@ -27,7 +27,7 @@
.automerge_widget.no_satellite{style: "display:none"}
.alert.alert-error
%span
%strong This repository does not have satellite. Ask administrator to fix this issue
%strong This repository does not have satellite. Ask an administrator to fix this issue
.automerge_widget.cannot_be_merged{style: "display:none"}
.alert.alert-disabled
......
......@@ -26,6 +26,6 @@
- if @milestones.blank?
%li
%h3.nothing_here_message Nothing to show here
%h3.nothing_here_message No milestones to show
= paginate @milestones, theme: "gitlab"
%p.slead
New projects are private by default. You choose who can see the project and commit to repository.
%hr
.project-edit-container.prepend-top-10
.project-edit-container
.project-edit-errors
= render 'projects/errors'
.project-edit-content
%p.slead
New projects are private by default. You choose who can see the project and commit to repository.
%hr
= form_for @project, remote: true do |f|
.control-group.project_name_holder
.control-group.project-name-holder
= f.label :name do
%strong Project name is
.controls
= f.text_field :name, placeholder: "Example Project", class: "input-xlarge", tabindex: 1, autofocus: true
%span.help-inline
= link_to "#", class: 'js-toggle-visibility-link' do
%span Customize repository name?
.control-group.js-toggle-visibility-container.hide
= f.label :path do
%span Repository name
.controls
.input-append
= f.text_field :path
%span.add-on .git
- if current_user.can_select_namespace?
.control-group
......@@ -51,4 +63,5 @@
.save-project-loader.hide
%center
= image_tag "ajax_loader.gif"
%h3 Creating project &amp; repository. Please wait a moment, this page will automatically refresh when ready.
%h3 Creating project &amp; repository.
%p Please wait a moment, this page will automatically refresh when ready.
%h3.page-title Services
%p.light Services allow you to integrate GitLab with other applications
%hr
%ul.bordered-list
- @services.each do |service|
......
......@@ -36,7 +36,7 @@
%p
= link_to pluralize(@repository.round_commit_count, 'commit'), project_commits_path(@project, @ref || @repository.root_ref)
%p
= link_to pluralize(@repository.branch_names.count, 'branch'), project_repository_path(@project)
= link_to pluralize(@repository.branch_names.count, 'branch'), project_branches_path(@project)
%p
= link_to pluralize(@repository.tag_names.count, 'tag'), project_tags_path(@project)
......
%h3.page-title
= "Import members from another project"
%p.light
Only project members will be improted. Group members will be skipped.
Only project members will be imported. Group members will be skipped.
%hr
= form_tag apply_import_project_team_members_path(@project), method: 'post' do
.padded
......
......@@ -30,6 +30,9 @@
%span.light (#{merge_request.source_project.name_with_namespace}:#{merge_request.source_branch} &rarr; #{merge_request.target_project.name_with_namespace}:#{merge_request.target_branch})
- else
%span.light (#{merge_request.source_branch} &rarr; #{merge_request.target_branch})
- if merge_request.closed?
%span.label Closed
- @issues.each do |issue|
%li
issue:
......@@ -38,6 +41,9 @@
%strong.term
= truncate issue.title, length: 50
%span.light (#{issue.project.name_with_namespace})
- if issue.closed?
%span.label Closed
- @wiki_pages.each do |wiki_page|
%li
wiki:
......
......@@ -7,7 +7,7 @@
= hidden_field_tag :project_id, params[:project_id]
= hidden_field_tag :group_id, params[:group_id]
= hidden_field_tag :search_code, params[:search_code]
= submit_tag 'Search', class: "btn btn-primary wide"
= submit_tag 'Search', class: "btn btn-create"
.prepend-top-10
= render 'filter', f: f
......
......@@ -11,5 +11,5 @@
= render 'projects/issues/issue', issue: issue
= paginate @issues, theme: "gitlab"
- else
%p.nothing_here_message Nothing to show here
%p.nothing_here_message No issues to show
......@@ -10,4 +10,4 @@
= paginate @merge_requests, theme: "gitlab"
- else
%h3.nothing_here_message Nothing to show here
%h3.nothing_here_message No merge requests to show
class RepositoryImportWorker
include Sidekiq::Worker
include Gitlab::ShellAdapter
sidekiq_options queue: :gitlab_shell
def perform(project_id)
project = Project.find(project_id)
result = gitlab_shell.send(:import_repository,
project.path_with_namespace,
project.import_url)
if result
project.imported = true
project.save
project.satellite.create unless project.satellite.exists?
project.discover_default_branch
else
project.imported = false
end
end
end
......@@ -40,7 +40,14 @@ Gitlab::Application.configure do
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production
config.cache_store = :redis_store
config_file = Rails.root.join('config', 'resque.yml')
resque_url = if File.exists?(config_file)
YAML.load_file(config_file)[Rails.env]
else
"redis://localhost:6379"
end
config.cache_store = :redis_store, resque_url
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
......
class AddImportUrlToProject < ActiveRecord::Migration
def change
add_column :projects, :import_url, :string
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20130809124851) do
ActiveRecord::Schema.define(:version => 20130812143708) do
create_table "deploy_keys_projects", :force => true do |t|
t.integer "deploy_key_id", :null => false
......@@ -187,6 +187,7 @@ ActiveRecord::Schema.define(:version => 20130809124851) do
t.boolean "snippets_enabled", :default => true, :null => false
t.datetime "last_activity_at"
t.boolean "imported", :default => false, :null => false
t.string "import_url"
end
add_index "projects", ["creator_id"], :name => "index_projects_on_owner_id"
......
......@@ -153,10 +153,10 @@ To setup the MySQL/PostgreSQL database and dependencies please see [`doc/install
cd /home/git/gitlab
# Checkout to stable release
sudo -u git -H git checkout 5-3-stable
sudo -u git -H git checkout 5-4-stable
**Note:**
You can change `5-3-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server!
You can change `5-4-stable` to `master` if you want the *bleeding edge* version, but never install master on a production server!
## Configure it
......
# From 5.4 to 6.0
### Deprecations
#### Global projects
We deprecated root(global) namespace for projects.
So you need to move all your global projects under group/users manually before update or it will be moved automatically to owner namespace during update.
#### Teams
We deprecate teams as separate entity in 6.0 in favor of group membership.
The old combination of groups and teams was confusing for a lot of people.
And when the members of a team where changed this wasn't reflected in the project permissions.
In GitLab 6.0 you will be able to add members to a group with a permission level for each member.
These group members will have access to the projects in that group.
Any changes to group members will immediately be reflected in the project permissions.
You can even have multiple owners for a group, greatly simplifying administration.
### 0. Backup
It's useful to make a backup just in case things go south:
(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
```bash
cd /home/git/gitlab
sudo -u git -H RAILS_ENV=production bundle exec rake gitlab:backup:create
```
### 1. Stop server
sudo service gitlab stop
### 2. Get latest code
```bash
cd /home/git/gitlab
sudo -u git -H git fetch
sudo -u git -H git checkout 6-0-dev
```
### 3. Install additional packages
```bash
# For reStructuredText markup language support install required package:
sudo apt-get install python-docutils
```
### 4. Install libs, migrations, etc.
```bash
cd /home/git/gitlab
# MySQL
sudo -u git -H bundle install --without development test postgres --deployment
#PostgreSQL
sudo -u git -H bundle install --without development test mysql --deployment
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_groups RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_global_projects RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_keys RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_inline_notes RAILS_ENV=production
```
### 5. Update config files
* Make `/home/git/gitlab/config/gitlab.yml` same as https://github.com/gitlabhq/gitlabhq/blob/5-3-stable/config/gitlab.yml.example but with your settings.
* Make `/home/git/gitlab/config/puma.rb` same as https://github.com/gitlabhq/gitlabhq/blob/5-3-stable/config/puma.rb.example but with your settings.
### 6. Update Init script
```bash
sudo rm /etc/init.d/gitlab
sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5-3-stable/lib/support/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab
```
### 7. Start application
sudo service gitlab start
sudo service nginx restart
### 8. Check application status
Check if GitLab and its environment are configured correctly:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
To make sure you didn't miss anything run a more thorough check with:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
If all items are green, then congratulations upgrade complete!
# From 5.4 to 6.0
### Deprecations
#### Global projects
We deprecated root(global) namespace for projects.
So you need to move all your global projects under group/users manually before update or they will be automatically moved to the owner namespace during the update.
#### Teams
We introduce group membership in 6.0 as a replacement for teams.
The old combination of groups and teams was confusing for a lot of people.
And when the members of a team where changed this wasn't reflected in the project permissions.
In GitLab 6.0 you will be able to add members to a group with a permission level for each member.
These group members will have access to the projects in that group.
Any changes to group members will immediately be reflected in the project permissions.
You can even have multiple owners for a group, greatly simplifying administration.
### 0. Backup
It's useful to make a backup just in case things go south:
(With MySQL, this may require granting "LOCK TABLES" privileges to the GitLab user on the database version)
```bash
cd /home/git/gitlab
sudo -u git -H RAILS_ENV=production bundle exec rake gitlab:backup:create
```
### 1. Stop server
sudo service gitlab stop
### 2. Get latest code
```bash
cd /home/git/gitlab
sudo -u git -H git fetch
sudo -u git -H git checkout 6-0-dev
```
### 3. Install additional packages
```bash
# For reStructuredText markup language support install required package:
sudo apt-get install python-docutils
```
### 4. Install libs, migrations, etc.
```bash
cd /home/git/gitlab
# MySQL
sudo -u git -H bundle install --without development test postgres --deployment
#PostgreSQL
sudo -u git -H bundle install --without development test mysql --deployment
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_groups RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_global_projects RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_keys RAILS_ENV=production
sudo -u git -H bundle exec rake migrate_inline_notes RAILS_ENV=production
```
### 5. Update config files
Note: We switched from Puma in GitLab 5.4 to unicorn in GitLab 6.0.
* Make `/home/git/gitlab/config/gitlab.yml` the same as https://github.com/gitlabhq/gitlabhq/blob/master/config/gitlab.yml.example but with your settings.
* Make `/home/git/gitlab/config/unicorn.rb` the same as https://github.com/gitlabhq/gitlabhq/blob/master/config/unicorn.rb.example but with your settings.
### 6. Update Init script
```bash
sudo rm /etc/init.d/gitlab
sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/master/lib/support/init.d/gitlab
sudo chmod +x /etc/init.d/gitlab
```
### 7. Start application
sudo service gitlab start
sudo service nginx restart
### 8. Check application status
Check if GitLab and its environment are configured correctly:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
To make sure you didn't miss anything run a more thorough check with:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
If all items are green, then congratulations upgrade complete!
......@@ -61,10 +61,10 @@ module API
# name (required) - name for new project
# description (optional) - short project description
# default_branch (optional) - 'master' by default
# issues_enabled (optional)
# wall_enabled (optional)
# merge_requests_enabled (optional)
# wiki_enabled (optional)
# issues_enabled (optional)
# wall_enabled (optional)
# merge_requests_enabled (optional)
# wiki_enabled (optional)
# snippets_enabled (optional)
# namespace_id (optional) - defaults to user namespace
# public (optional) - false by default
......@@ -73,6 +73,7 @@ module API
post do
required_attributes! [:name]
attrs = attributes_for_keys [:name,
:path,
:description,
:default_branch,
:issues_enabled,
......@@ -100,9 +101,9 @@ module API
# name (required) - name for new project
# description (optional) - short project description
# default_branch (optional) - 'master' by default
# issues_enabled (optional)
# wall_enabled (optional)
# merge_requests_enabled (optional)
# issues_enabled (optional)
# wall_enabled (optional)
# merge_requests_enabled (optional)
# wiki_enabled (optional)
# snippets_enabled (optional)
# public (optional)
......
......@@ -7,7 +7,7 @@ module Gitlab
end
def project_name_regex
/\A[a-zA-Z][a-zA-Z0-9_\-\. ]*\z/
/\A[a-zA-Z0-9][a-zA-Z0-9_\-\. ]*\z/
end
def name_regex
......@@ -21,7 +21,7 @@ module Gitlab
protected
def default_regex
/\A[a-zA-Z][a-zA-Z0-9_\-\.]*\z/
/\A[a-zA-Z0-9][a-zA-Z0-9_\-\.]*\z/
end
end
end
......@@ -31,6 +31,11 @@ namespace :gitlab do
puts "Processing #{repo_path}".yellow
if path =~ /.wiki\Z/
puts " * Skipping wiki repo"
next
end
project = Project.find_with_namespace(path)
if project
......@@ -40,6 +45,7 @@ namespace :gitlab do
project_params = {
name: name,
path: name
}
# find group namespace
......
......@@ -9,11 +9,11 @@ describe Commit do
commit.title.should == "--no commit message"
end
it "truncates a message without a newline at 70 characters" do
it "truncates a message without a newline at 80 characters" do
message = commit.safe_message * 10
commit.stub(:safe_message).and_return(message)
commit.title.should == "#{message[0..69]}&hellip;"
commit.title.should == "#{message[0..79]}&hellip;"
end
it "truncates a message with a newline before 80 characters at the newline" do
......@@ -27,7 +27,7 @@ describe Commit do
message = (commit.safe_message * 10) + "\n"
commit.stub(:safe_message).and_return(message)
commit.title.should == "#{message[0..69]}&hellip;"
commit.title.should == "#{message[0..79]}&hellip;"
end
end
......
......@@ -68,9 +68,10 @@ describe Project do
it { should ensure_length_of(:issues_tracker_id).is_within(0..255) }
it "should not allow new projects beyond user limits" do
project.stub(:creator).and_return(double(can_create_project?: false, projects_limit: 1))
project.should_not be_valid
project.errors[:limit_reached].first.should match(/Your own projects limit is 1/)
project2 = build(:project)
project2.stub(:creator).and_return(double(can_create_project?: false, projects_limit: 0))
project2.should_not be_valid
project2.errors[:limit_reached].first.should match(/Your own projects limit is 0/)
end
end
......
......@@ -8,7 +8,6 @@ describe ActivityObserver do
it { @event.project.should == project }
end
describe "Issue created" do
before do
Issue.observers.enable :activity_observer 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