Commit b03b69e2 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq into ce-7-1

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Conflicts:
	app/assets/images/brand_logo.png
	app/assets/stylesheets/sections/login.scss
	app/controllers/projects/merge_requests_controller.rb
	app/helpers/appearances_helper.rb
	app/views/layouts/devise.html.haml
parents cd5b863f aa25c0ff
# Prefer single quotes
StringLiterals:
EnforcedStyle: single_quotes
Enabled: true
...@@ -20,6 +20,10 @@ v 7.1.0 ...@@ -20,6 +20,10 @@ v 7.1.0
- Show VERSION information on project sidebar - Show VERSION information on project sidebar
- Improve branch removal logic when accept MR - Improve branch removal logic when accept MR
- Fix bug where comment form is spawned inside the Reply button - Fix bug where comment form is spawned inside the Reply button
- Remove Dir.chdir from Satellite#lock for thread-safety
- Increased default git max_size value from 5MB to 20MB in gitlab.yml. Please update your configs!
- Show error message in case of timeout in satellite when create MR
- Show first 100 files for huge diff instead of hiding all
v 7.0.0 v 7.0.0
- The CPU no longer overheats when you hold down the spacebar - The CPU no longer overheats when you hold down the spacebar
......
...@@ -174,6 +174,7 @@ gem "font-awesome-rails", '~> 3.2' ...@@ -174,6 +174,7 @@ gem "font-awesome-rails", '~> 3.2'
gem "gitlab_emoji", "~> 0.0.1.1" gem "gitlab_emoji", "~> 0.0.1.1"
gem "gon", '~> 5.0.0' gem "gon", '~> 5.0.0'
gem 'nprogress-rails' gem 'nprogress-rails'
gem 'request_store'
group :development do group :development do
gem "annotate", "~> 2.6.0.beta2" gem "annotate", "~> 2.6.0.beta2"
......
...@@ -165,7 +165,7 @@ GEM ...@@ -165,7 +165,7 @@ GEM
multi_json multi_json
gitlab-grack (2.0.0.pre) gitlab-grack (2.0.0.pre)
rack (~> 1.5.1) rack (~> 1.5.1)
gitlab-grit (2.6.9) gitlab-grit (2.6.10)
charlock_holmes (~> 0.6) charlock_holmes (~> 0.6)
diff-lcs (~> 1.1) diff-lcs (~> 1.1)
mime-types (~> 1.15) mime-types (~> 1.15)
...@@ -409,6 +409,7 @@ GEM ...@@ -409,6 +409,7 @@ GEM
redis-store (1.1.4) redis-store (1.1.4)
redis (>= 2.2) redis (>= 2.2)
ref (1.0.5) ref (1.0.5)
request_store (1.0.5)
require_all (1.3.2) require_all (1.3.2)
rest-client (1.6.7) rest-client (1.6.7)
mime-types (>= 1.16) mime-types (>= 1.16)
...@@ -648,6 +649,7 @@ DEPENDENCIES ...@@ -648,6 +649,7 @@ DEPENDENCIES
rb-inotify rb-inotify
redcarpet (~> 2.2.2) redcarpet (~> 2.2.2)
redis-rails redis-rails
request_store
rspec-rails rspec-rails
sanitize (~> 2.0) sanitize (~> 2.0)
sass-rails (~> 4.0.2) sass-rails (~> 4.0.2)
......
app/assets/images/brand_logo.png

24.7 KB | W: | H:

app/assets/images/brand_logo.png

31.4 KB | W: | H:

app/assets/images/brand_logo.png
app/assets/images/brand_logo.png
app/assets/images/brand_logo.png
app/assets/images/brand_logo.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -346,3 +346,7 @@ table { ...@@ -346,3 +346,7 @@ table {
.wiki .highlight, .note-body .highlight { .wiki .highlight, .note-body .highlight {
margin-bottom: 9px; margin-bottom: 9px;
} }
.footer-links a {
margin-right: 15px;
}
...@@ -112,7 +112,9 @@ ...@@ -112,7 +112,9 @@
.commit-stat-summary { .commit-stat-summary {
color: #666; color: #666;
line-height: 2; font-size: 14px;
font-weight: normal;
padding: 10px 0;
} }
.commit-info-row { .commit-info-row {
......
...@@ -5,18 +5,13 @@ ...@@ -5,18 +5,13 @@
font-weight: 200; font-weight: 200;
} }
.login-box { .login-box{
position: relative;
margin: auto;
padding: 20px;
background: #f5f5f5;
border: 1px solid #EEE;
} }
.brand-image { .brand-image {
margin-bottom: 20px;
img { img {
max-width: 100%; max-width: 100%;
margin-bottom: 20px;
} }
} }
...@@ -26,7 +21,7 @@ ...@@ -26,7 +21,7 @@
} }
.form-control { .form-control {
background-color: #FFF; background-color: #F5F5F5;
font-size: 16px; font-size: 16px;
padding: 14px 10px; padding: 14px 10px;
width: 100%; width: 100%;
...@@ -48,6 +43,10 @@ ...@@ -48,6 +43,10 @@
margin-bottom:0px; margin-bottom:0px;
@include border-radius(0); @include border-radius(0);
} }
&:active, &:focus {
background-color: #FFF;
}
} }
.login-box a.forgot { .login-box a.forgot {
......
...@@ -172,8 +172,8 @@ ul.nav.nav-projects-tabs { ...@@ -172,8 +172,8 @@ ul.nav.nav-projects-tabs {
} }
.public-clone { .public-clone {
background: #333; background: #EEE;
color: #f5f5f5; color: #777;
padding: 6px 10px; padding: 6px 10px;
margin: 1px; margin: 1px;
font-weight: normal; font-weight: normal;
......
...@@ -68,7 +68,7 @@ class ApplicationController < ActionController::Base ...@@ -68,7 +68,7 @@ class ApplicationController < ActionController::Base
flash[:alert] = "Your account is blocked. Retry when an admin has unblocked it." flash[:alert] = "Your account is blocked. Retry when an admin has unblocked it."
new_user_session_path new_user_session_path
else else
@return_to || root_path stored_location_for(:redirect) || stored_location_for(resource) || root_path
end end
end end
......
...@@ -20,11 +20,10 @@ class Projects::CommitController < Projects::ApplicationController ...@@ -20,11 +20,10 @@ class Projects::CommitController < Projects::ApplicationController
end end
begin begin
@suppress_diff = true if commit.diff_suppress? && !params[:force_show_diff] @diffs = @commit.diffs
@force_suppress_diff = commit.diff_force_suppress?
rescue Grit::Git::GitTimeout rescue Grit::Git::GitTimeout
@suppress_diff = true @diffs = []
@status = :huge_commit @diff_timeout = true
end end
@note = project.build_commit_note(commit) @note = project.build_commit_note(commit)
...@@ -38,12 +37,7 @@ class Projects::CommitController < Projects::ApplicationController ...@@ -38,12 +37,7 @@ class Projects::CommitController < Projects::ApplicationController
} }
respond_to do |format| respond_to do |format|
format.html do format.html
if @status == :huge_commit
render "huge_commit" and return
end
end
format.diff { render text: @commit.to_diff } format.diff { render text: @commit.to_diff }
format.patch { render text: @commit.to_patch } format.patch { render text: @commit.to_patch }
end end
......
...@@ -15,11 +15,7 @@ class Projects::CompareController < Projects::ApplicationController ...@@ -15,11 +15,7 @@ class Projects::CompareController < Projects::ApplicationController
@diffs = compare.diffs @diffs = compare.diffs
@refs_are_same = compare.same @refs_are_same = compare.same
@line_notes = [] @line_notes = []
@timeout = compare.timeout @diff_timeout = compare.timeout
diff_line_count = Commit::diff_line_count(@diffs)
@suppress_diff = Commit::diff_suppress?(@diffs, diff_line_count) && !params[:force_show_diff]
@force_suppress_diff = Commit::diff_force_suppress?(@diffs, diff_line_count)
end end
def create def create
......
...@@ -34,6 +34,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -34,6 +34,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def show def show
@note_counts = Note.where(commit_id: @merge_request.commits.map(&:id)). @note_counts = Note.where(commit_id: @merge_request.commits.map(&:id)).
group(:commit_id).count group(:commit_id).count
respond_to do |format| respond_to do |format|
format.html format.html
format.diff { render text: @merge_request.to_diff(current_user) } format.diff { render text: @merge_request.to_diff(current_user) }
...@@ -43,16 +44,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -43,16 +44,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def diffs def diffs
@commit = @merge_request.last_commit @commit = @merge_request.last_commit
@comments_allowed = @reply_allowed = true @comments_allowed = @reply_allowed = true
@comments_target = {noteable_type: 'MergeRequest', @comments_target = {
noteable_id: @merge_request.id} noteable_type: 'MergeRequest',
noteable_id: @merge_request.id
}
@line_notes = @merge_request.notes.where("line_code is not null") @line_notes = @merge_request.notes.where("line_code is not null")
diff_line_count = Commit::diff_line_count(@merge_request.diffs)
@suppress_diff = Commit::diff_suppress?(@merge_request.diffs, diff_line_count) && !params[:force_show_diff]
@force_suppress_diff = Commit::diff_force_suppress?(@merge_request.diffs, diff_line_count)
respond_to do |format| respond_to do |format|
format.html format.html
format.json { render json: { html: view_to_html_string("projects/merge_requests/show/_diffs") } } format.json { render json: { html: view_to_html_string("projects/merge_requests/show/_diffs") } }
...@@ -60,51 +58,22 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -60,51 +58,22 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end end
def new def new
params[:merge_request] ||= ActionController::Parameters.new( params[:merge_request] ||= ActionController::Parameters.new(source_project: @project)
source_project: @project @merge_request = MergeRequests::BuildService.new(project, current_user, merge_request_params).execute
)
@target_branches = if @merge_request.target_project
@merge_request = MergeRequest.new(merge_request_params) @merge_request.target_project.repository.branch_names
@merge_request.source_project = @project unless @merge_request.source_project else
@merge_request.target_project ||= (@project.forked_from_project || @project) []
@target_branches = @merge_request.target_project.nil? ? [] : @merge_request.target_project.repository.branch_names end
@merge_request.target_branch ||= @merge_request.target_project.default_branch
@source_project = @merge_request.source_project @target_project = merge_request.target_project
@source_project = merge_request.source_project
if @merge_request.target_branch && @merge_request.source_branch @commits = @merge_request.compare_commits
compare_action = Gitlab::Satellite::CompareAction.new( @commit = @merge_request.compare_base_commit
current_user, @diffs = @merge_request.compare_diffs
@merge_request.target_project, @note_counts = Note.where(commit_id: @commits.map(&:id)).
@merge_request.target_branch, group(:commit_id).count
@merge_request.source_project,
@merge_request.source_branch
)
@compare_failed = false
@commits = compare_action.commits
if @commits
@commits.map! { |commit| Commit.new(commit) }
@commit = @commits.first
else
# false value because failed to get commits from satellite
@commits = []
@compare_failed = true
end
@note_counts = Note.where(commit_id: @commits.map(&:id)).
group(:commit_id).count
@diffs = compare_action.diffs
@merge_request.title = @merge_request.source_branch.titleize.humanize
@merge_request.description = @merge_request.target_project.merge_requests_template
@target_project = @merge_request.target_project
@target_repo = @target_project.repository
diff_line_count = Commit::diff_line_count(@diffs)
@suppress_diff = Commit::diff_suppress?(@diffs, diff_line_count)
@force_suppress_diff = @suppress_diff
end
end end
def edit def edit
......
class SessionsController < Devise::SessionsController
def new
if request.referer.present?
store_location_for(:redirect, URI(request.referer).path)
end
super
end
def create
super
end
end
class UsersSessionsController < Devise::SessionsController
def create
@return_to = params[:return_to]
super
end
end
...@@ -8,37 +8,15 @@ module AppearancesHelper ...@@ -8,37 +8,15 @@ module AppearancesHelper
end end
def brand_image def brand_image
if brand_item if brand_item.logo?
if brand_item.logo? image_tag brand_item.logo
image_tag brand_item.logo
else
nil
end
else else
image_tag 'brand_logo.png' nil
end end
end end
def brand_text def brand_text
default_text =<<eos markdown(brand_item.description)
### GitLab is open source software to collaborate on code.
Manage git repositories with fine grained access controls that keep your code secure.
Perform code reviews and enhance collaboration with merge requests.
Each project can also have an issue tracker and a wiki.
Used by more than 50,000 organizations, GitLab is the most popular solution to manage git repositories on-premises.
Read more about GitLab at #{link_to "www.gitlab.com", "https://www.gitlab.com/", target: "_blank"}.
eos
text = if brand_item
brand_item.description
else
default_text
end
markdown text
end end
def brand_item def brand_item
......
module DiffHelper
def safe_diff_files(diffs)
if diff_hard_limit_enabled?
diffs.first(Commit::DIFF_HARD_LIMIT_FILES)
else
diffs.first(Commit::DIFF_SAFE_FILES)
end
end
def show_diff_size_warninig?(diffs)
safe_diff_files(diffs).size < diffs.size
end
def diff_hard_limit_enabled?
# Enabling hard limit allows user to see more diff information
if params[:force_show_diff].present?
true
else
false
end
end
end
...@@ -221,4 +221,10 @@ module ProjectsHelper ...@@ -221,4 +221,10 @@ module ProjectsHelper
"Never" "Never"
end end
end end
def contribution_guide_url(project)
if project && project.repository.contribution_guide
project_blob_path(project, tree_join(project.default_branch, project.repository.contribution_guide.name))
end
end
end end
...@@ -67,40 +67,42 @@ class Ability ...@@ -67,40 +67,42 @@ class Ability
def project_abilities(user, project) def project_abilities(user, project)
rules = [] rules = []
key = "/user/#{user.id}/project/#{project.id}"
RequestStore.store[key] ||= begin
team = project.team
team = project.team # Rules based on role in project
if team.master?(user)
rules += project_master_rules
# Rules based on role in project elsif team.developer?(user)
if team.master?(user) rules += project_dev_rules
rules += project_master_rules
elsif team.developer?(user) elsif team.reporter?(user)
rules += project_dev_rules rules += project_report_rules
elsif team.reporter?(user) elsif team.guest?(user)
rules += project_report_rules rules += project_guest_rules
end
elsif team.guest?(user) if project.public? || project.internal?
rules += project_guest_rules rules += public_project_rules
end end
if project.public? || project.internal? if project.owner == user || user.admin?
rules += public_project_rules rules += project_admin_rules
end end
if project.owner == user || user.admin? if project.group && project.group.has_owner?(user)
rules += project_admin_rules rules += project_admin_rules
end end
if project.group && project.group.has_owner?(user) if project.archived?
rules += project_admin_rules rules -= project_archived_rules
end end
if project.archived? rules
rules -= project_archived_rules
end end
rules
end end
def public_project_rules def public_project_rules
......
...@@ -12,6 +12,7 @@ class Commit ...@@ -12,6 +12,7 @@ class Commit
# User can force display of diff above this size # User can force display of diff above this size
DIFF_SAFE_FILES = 100 DIFF_SAFE_FILES = 100
DIFF_SAFE_LINES = 5000 DIFF_SAFE_LINES = 5000
# Commits above this size will not be rendered in HTML # Commits above this size will not be rendered in HTML
DIFF_HARD_LIMIT_FILES = 1000 DIFF_HARD_LIMIT_FILES = 1000
DIFF_HARD_LIMIT_LINES = 50000 DIFF_HARD_LIMIT_LINES = 50000
...@@ -23,23 +24,7 @@ class Commit ...@@ -23,23 +24,7 @@ class Commit
# Calculate number of lines to render for diffs # Calculate number of lines to render for diffs
def diff_line_count(diffs) def diff_line_count(diffs)
diffs.reduce(0){|sum, d| sum + d.diff.lines.count} diffs.reduce(0) { |sum, d| sum + d.diff.lines.count }
end
def diff_suppress?(diffs, line_count = nil)
# optimize - check file count first
return true if diffs.size > DIFF_SAFE_FILES
line_count ||= Commit::diff_line_count(diffs)
line_count > DIFF_SAFE_LINES
end
def diff_force_suppress?(diffs, line_count = nil)
# optimize - check file count first
return true if diffs.size > DIFF_HARD_LIMIT_FILES
line_count ||= Commit::diff_line_count(diffs)
line_count > DIFF_HARD_LIMIT_LINES
end end
end end
...@@ -60,14 +45,6 @@ class Commit ...@@ -60,14 +45,6 @@ class Commit
@diff_line_count @diff_line_count
end end
def diff_suppress?
Commit::diff_suppress?(self.diffs, diff_line_count)
end
def diff_force_suppress?
Commit::diff_force_suppress?(self.diffs, diff_line_count)
end
# Returns a string describing the commit for use in a link title # Returns a string describing the commit for use in a link title
# #
# Example # Example
......
...@@ -50,10 +50,10 @@ class GroupMilestone ...@@ -50,10 +50,10 @@ class GroupMilestone
def state def state
state = milestones.map { |milestone| milestone.state } state = milestones.map { |milestone| milestone.state }
if state.count('active') == state.size if state.count('closed') == state.size
'active'
else
'closed' 'closed'
else
'active'
end end
end end
......
...@@ -42,6 +42,11 @@ class MergeRequest < ActiveRecord::Base ...@@ -42,6 +42,11 @@ class MergeRequest < ActiveRecord::Base
# It allows us to close or modify broken merge requests # It allows us to close or modify broken merge requests
attr_accessor :allow_broken attr_accessor :allow_broken
# Temporary fields to store compare vars
# when creating new merge request
attr_accessor :can_be_created, :compare_failed, :compare_base_commit,
:compare_commits, :compare_diffs
ActsAsTaggableOn.strict_case_match = true ActsAsTaggableOn.strict_case_match = true
acts_as_taggable_on :labels acts_as_taggable_on :labels
......
module MergeRequests
class BuildService < MergeRequests::BaseService
def execute
merge_request = MergeRequest.new(params)
# Set MR attributes
merge_request.can_be_created = false
merge_request.compare_failed = false
merge_request.compare_commits = []
merge_request.compare_diffs = []
merge_request.source_project = project unless merge_request.source_project
merge_request.target_project ||= (project.forked_from_project || project)
merge_request.target_branch ||= merge_request.target_project.default_branch
unless merge_request.target_branch && merge_request.source_branch
return build_failed(merge_request, "You must select source and target branches")
end
# Generate suggested MR title based on source branch name
merge_request.title = merge_request.source_branch.titleize.humanize
# Set MR description based on project template
merge_request.description = merge_request.target_project.merge_requests_template
# Try to compare branches to get commits list and diffs
compare_action = Gitlab::Satellite::CompareAction.new(
current_user,
merge_request.target_project,
merge_request.target_branch,
merge_request.source_project,
merge_request.source_branch
)
commits = compare_action.commits
# At this point we decide if merge request can be created
# If we have at least one commit to merge -> creation allowed
if commits.present?
merge_request.compare_commits = Commit.decorate(commits)
merge_request.compare_base_commit = Commit.new(commits.first)
merge_request.can_be_created = true
merge_request.compare_failed = false
# Try to collect diff for merge request.
diffs = compare_action.diffs
if diffs.present?
merge_request.compare_diffs = diffs
elsif diffs == false
# satellite timeout return false
merge_request.can_be_created = false
merge_request.compare_failed = true
end
else
merge_request.can_be_created = false
merge_request.compare_failed = false
end
merge_request
rescue Gitlab::Satellite::BranchesWithoutParent
return build_failed(merge_request, "Selected branches have no common commit so they cannot be merged.")
end
def build_failed(merge_request, message)
merge_request.errors.add(:base, message)
merge_request.compare_commits = []
merge_request.can_be_created = false
merge_request
end
end
end
.login-box .login-box.panel.panel-default
%h3.page-title Resend confirmation instructions .panel-heading
= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %h3.panel-title Resend confirmation instructions
.devise-errors .panel-body
= devise_error_messages! = form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
.clearfix.append-bottom-20 .devise-errors
= f.email_field :email, placeholder: 'Email', class: "form-control", required: true = devise_error_messages!
.clearfix.append-bottom-10 .clearfix.append-bottom-20
= f.submit "Resend confirmation instructions", class: 'btn btn-success' = f.email_field :email, placeholder: 'Email', class: "form-control", required: true
%hr .clearfix.append-bottom-10
%p = f.submit "Resend confirmation instructions", class: 'btn btn-success'
%span.light .panel-footer
Already have login and password? = render 'devise/shared/sign_in_link'
%strong
= link_to "Sign in", new_session_path(resource_name)
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: "login-box" }) do |f| .login-box.panel.panel-default
%h3 Change your password .panel-heading
.devise-errors %h3.panel-title Change your password
= devise_error_messages! .panel-body
= f.hidden_field :reset_password_token = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
%div .devise-errors
= f.password_field :password, class: "form-control top", placeholder: "New password", required: true = devise_error_messages!
%div = f.hidden_field :reset_password_token
= f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm new password", required: true %div
%div = f.password_field :password, class: "form-control top", placeholder: "New password", required: true
.clearfix.append-bottom-10 %div
= f.submit "Change my password", class: "btn btn-primary" = f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm new password", required: true
= link_to "Sign in", new_session_path(resource_name), class: "btn pull-right" .clearfix.append-bottom-10
%div = f.submit "Change my password", class: "btn btn-primary"
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) .panel-footer
%p
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
= render 'devise/shared/sign_in_link'
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { class: "login-box", method: :post }) do |f| .login-box.panel.panel-default
%h3.page-title Reset password .panel-heading
.devise-errors %h3.panel-title Reset password
= devise_error_messages! .panel-body
.clearfix.append-bottom-20 = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
= f.email_field :email, placeholder: "Email", class: "form-control", required: true .devise-errors
.clearfix.append-bottom-10 = devise_error_messages!
= f.submit "Reset password", class: "btn-primary btn" .clearfix.append-bottom-20
%hr = f.email_field :email, placeholder: "Email", class: "form-control", required: true
%p .clearfix.append-bottom-10
%span.light = f.submit "Reset password", class: "btn-primary btn"
Already have login and password? .panel-footer
%strong = render 'devise/shared/sign_in_link'
= link_to "Sign in", new_session_path(resource_name)
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "login-box" }) do |f| .login-box.panel.panel-success
%h3.page-title Sign Up .panel-heading
.devise-errors %h3.panel-title Sign up
= devise_error_messages! .panel-body
%div = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
= f.text_field :name, class: "form-control top", placeholder: "Name", required: true .devise-errors
%div = devise_error_messages!
= f.text_field :username, class: "form-control middle", placeholder: "Username", required: true %div
%div = f.text_field :name, class: "form-control top", placeholder: "Name", required: true
= f.email_field :email, class: "form-control middle", placeholder: "Email", required: true %div
%div = f.text_field :username, class: "form-control middle", placeholder: "Username", required: true
= f.password_field :password, class: "form-control middle", placeholder: "Password", required: true %div
%div = f.email_field :email, class: "form-control middle", placeholder: "Email", required: true
= f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm password", required: true %div
%div = f.password_field :password, class: "form-control middle", placeholder: "Password", required: true
= f.submit "Sign up", class: "btn-create btn" %div
%hr = f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm password", required: true
%p %div
%span.light = f.submit "Sign up", class: "btn-create btn"
Have an account? .panel-footer
%strong %p
= link_to "Sign in", new_session_path(resource_name) %span.light
%p Have an account?
= link_to "Forgot your password?", new_password_path(resource_name) %strong
= link_to "Sign in", new_session_path(resource_name)
%p
= link_to "Forgot your password?", new_password_path(resource_name)
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
= f.check_box :remember_me = f.check_box :remember_me
%span Remember me %span Remember me
%div %div
= hidden_field_tag 'return_to', params[:return_to] = f.submit "Sign in", class: "btn-save btn"
= f.submit "Sign in", class: "btn-create btn"
.pull-right .pull-right
= link_to "Forgot your password?", new_password_path(resource_name), class: "btn" = link_to "Forgot your password?", new_password_path(resource_name), class: "btn"
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
= text_field_tag :username, nil, {class: "form-control top", placeholder: "LDAP Login", autofocus: "autofocus"} = text_field_tag :username, nil, {class: "form-control top", placeholder: "LDAP Login", autofocus: "autofocus"}
= password_field_tag :password, nil, {class: "form-control bottom", placeholder: "Password"} = password_field_tag :password, nil, {class: "form-control bottom", placeholder: "Password"}
%br/ %br/
= submit_tag "LDAP Sign in", class: "btn-create btn" = submit_tag "LDAP Sign in", class: "btn-save btn"
.login-box .login-box.panel.panel-primary
%h3.page-title Sign in .panel-heading
- if ldap_enabled? && gitlab_config.signin_enabled %h3.panel-title Sign in
%ul.nav.nav-tabs .panel-body
%li.active - if ldap_enabled? && gitlab_config.signin_enabled
= link_to 'LDAP', '#tab-ldap', 'data-toggle' => 'tab' %ul.nav.nav-tabs
%li %li.active
= link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab' = link_to 'LDAP', '#tab-ldap', 'data-toggle' => 'tab'
.tab-content %li
%div#tab-ldap.tab-pane.active = link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab'
= render partial: 'devise/sessions/new_ldap' .tab-content
%div#tab-signin.tab-pane %div#tab-ldap.tab-pane.active
= render partial: 'devise/sessions/new_base' = render partial: 'devise/sessions/new_ldap'
%div#tab-signin.tab-pane
= render partial: 'devise/sessions/new_base'
- elsif ldap_enabled?
= render partial: 'devise/sessions/new_ldap'
- elsif gitlab_config.signin_enabled
= render partial: 'devise/sessions/new_base'
- else
%div
No authentication methods configured.
= render 'devise/sessions/oauth_providers' if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable?
.panel-footer
- if gitlab_config.signup_enabled
%p
%span.light
Don't have an account?
%strong
= link_to "Sign up", new_registration_path(resource_name)
- elsif ldap_enabled?
= render partial: 'devise/sessions/new_ldap'
- elsif gitlab_config.signin_enabled
= render partial: 'devise/sessions/new_base'
- else
%div
No authentication methods configured.
= render 'devise/sessions/oauth_providers' if Gitlab.config.omniauth.enabled && devise_mapping.omniauthable?
%hr
- if gitlab_config.signup_enabled
%p %p
%span.light %span.light Did not receive confirmation email?
Don't have an account? = link_to "Send again", new_confirmation_path(resource_name)
%strong
= link_to "Sign up", new_registration_path(resource_name)
%p
%span.light Did not receive confirmation email?
= link_to "Send again", new_confirmation_path(resource_name)
- if extra_config.has_key?('sign_in_text') - if extra_config.has_key?('sign_in_text')
%hr %hr
= markdown(extra_config.sign_in_text) = markdown(extra_config.sign_in_text)
%p
%span.light
Already have login and password?
%strong
= link_to "Sign in", new_session_path(resource_name)
...@@ -32,11 +32,11 @@ ...@@ -32,11 +32,11 @@
%h4 %h4
= link_to "#{milestone.project.name} - #{milestone.title}", project_milestone_path(milestone.project, milestone) = link_to "#{milestone.project.name} - #{milestone.title}", project_milestone_path(milestone.project, milestone)
%span.pull-right= milestone.expires_at %span.pull-right= milestone.expires_at
- if milestone.closed?
%span.label.label-danger #{milestone.state}
= preserve do = preserve do
- if milestone.description.present? - if milestone.description.present?
= milestone.description = milestone.description
- else
%em Project milestone has no description
.context .context
%p %p
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
%i.icon-reorder %i.icon-reorder
.pull-right.hidden-xs .pull-right.hidden-xs
= link_to "Sign in", new_session_path(:user, return_to: request.fullpath), class: 'btn btn-sign-in btn-new' = link_to "Sign in", new_session_path(:user), class: 'btn btn-sign-in btn-new'
.navbar-collapse.collapse .navbar-collapse.collapse
%ul.nav.navbar-nav %ul.nav.navbar-nav
%li.visible-xs %li.visible-xs
= link_to "Sign in", new_session_path(:user, return_to: request.fullpath) = link_to "Sign in", new_session_path(:user)
...@@ -11,10 +11,28 @@ ...@@ -11,10 +11,28 @@
.container .container
.content .content
.row .row
.col-sm-7 .col-md-7
.brand-image - if brand_item
= brand_image .brand-image
.brand_text = brand_image
= brand_text .brand_text
.col-sm-5 = brand_text
- else
.brand-image.hidden-sm.hidden-xs
= image_tag 'brand_logo.png'
.brand_text.hidden-xs
%h2 Open source software to collaborate on code
%p.lead
Manage git repositories with fine grained access controls that keep your code secure.
Perform code reviews and enhance collaboration with merge requests.
Each project can also have an issue tracker and a wiki.
.col-md-5
= yield = yield
%hr
.container
.footer-links
= link_to "Explore public projects", public_projects_path
= link_to "Documentation", "http://doc.gitlab.com/"
= link_to "About GitLab", "https://about.gitlab.com/"
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
.col-md-7 .col-md-7
.project-home-desc .project-home-desc
- if @project.description.present? - if @project.description.present?
= auto_link @project.description, link: :urls = auto_link ERB::Util.html_escape(@project.description), link: :urls
- if can?(current_user, :admin_project, @project) - if can?(current_user, :admin_project, @project)
&ndash; &ndash;
%strong= link_to 'Edit', edit_project_path %strong= link_to 'Edit', edit_project_path
......
= render "projects/commit/commit_box"
.alert.alert-danger
%h4 Commit diffs are too big to be displayed
= render "commit_box" = render "commit_box"
= render "projects/commits/diffs", diffs: @commit.diffs, project: @project = render "projects/commits/diffs", diffs: @diffs, project: @project
= render "projects/notes/notes_with_form" = render "projects/notes/notes_with_form"
- file = project.repository.blob_at(@commit.id, diff.new_path)
- file = project.repository.blob_at(@commit.parent_id, diff.old_path) unless file
- return unless file
.diff-file{id: "diff-#{i}"}
.diff-header{id: "file-path-#{hexdigest(diff.new_path || diff.old_path)}"}
- if diff.deleted_file
%span= diff.old_path
.diff-btn-group
- if @commit.parent_ids.present?
= link_to project_blob_path(project, tree_join(@commit.parent_id, diff.new_path)), { class: 'btn btn-small view-file' } do
View file @
%span.commit-short-id= @commit.short_id(6)
- else
%span= diff.new_path
- if diff_file_mode_changed?(diff)
%span.file-mode= "#{diff.a_mode}#{diff.b_mode}"
.diff-btn-group
= link_to "#", class: "js-toggle-diff-comments btn btn-small" do
%i.icon-chevron-down
Diff comments
&nbsp;
- if @merge_request && @merge_request.source_project
= link_to project_edit_tree_path(@merge_request.source_project, tree_join(@merge_request.source_branch, diff.new_path), from_merge_request_id: @merge_request.id), { class: 'btn btn-small' } do
Edit
&nbsp;
= link_to project_blob_path(project, tree_join(@commit.id, diff.new_path)), { class: 'btn btn-small view-file' } do
View file @
%span.commit-short-id= @commit.short_id(6)
.diff-content
-# Skipp all non non-supported blobs
- return unless file.respond_to?('text?')
- if file.text?
- if params[:view] == 'parallel'
= render "projects/commits/parallel_view", diff: diff, project: project, file: file, index: i
- else
= render "projects/commits/text_file", diff: diff, index: i
- elsif file.image?
- old_file = project.repository.blob_at(@commit.parent_id, diff.old_path) if @commit.parent_id
= render "projects/commits/image", diff: diff, old_file: old_file, file: file, index: i
- else
.nothing-here-block No preview for this file type
%ul.bordered-list
- diffs.each_with_index do |diff, i|
%li
- if diff.deleted_file
%span.deleted-file
%a{href: "#diff-#{i}"}
%i.icon-minus
= diff.old_path
- elsif diff.renamed_file
%span.renamed-file
%a{href: "#diff-#{i}"}
%i.icon-minus
= diff.old_path
= "->"
= diff.new_path
- elsif diff.new_file
%span.new-file
%a{href: "#diff-#{i}"}
%i.icon-plus
= diff.new_path
- else
%span.edit-file
%a{href: "#diff-#{i}"}
%i.icon-adjust
= diff.new_path
.js-toggle-container
.commit-stat-summary
Showing
%strong.cdark #{pluralize(diffs.count, "changed file")}
- if current_controller?(:commit)
- unless @commit.has_zero_stats?
with
%strong.cgreen #{@commit.stats.additions} additions
and
%strong.cred #{@commit.stats.deletions} deletions
&nbsp;
= link_to '#', class: 'btn btn-small js-toggle-button' do
Show diff stats
%i.icon-chevron-down
.file-stats.js-toggle-content.hide
%ul.bordered-list
- diffs.each_with_index do |diff, i|
%li
- if diff.deleted_file
%span.deleted-file
%a{href: "#diff-#{i}"}
%i.icon-minus
= diff.old_path
- elsif diff.renamed_file
%span.renamed-file
%a{href: "#diff-#{i}"}
%i.icon-minus
= diff.old_path
= "->"
= diff.new_path
- elsif diff.new_file
%span.new-file
%a{href: "#diff-#{i}"}
%i.icon-plus
= diff.new_path
- else
%span.edit-file
%a{href: "#diff-#{i}"}
%i.icon-adjust
= diff.new_path
.bs-callout.bs-callout-warning
%h4
Too many changes.
.pull-right
- unless diff_hard_limit_enabled?
= link_to "Reload with full diff", url_for(params.merge(force_show_diff: true)), class: "btn btn-small btn-warning"
- if current_controller?(:commit) or current_controller?(:merge_requests)
- if current_controller?(:commit)
= link_to "Plain diff", project_commit_path(@project, @commit, format: :diff), class: "btn btn-warning btn-small"
= link_to "Email patch", project_commit_path(@project, @commit, format: :patch), class: "btn btn-warning btn-small"
- elsif @merge_request && @merge_request.persisted?
= link_to "Plain diff", project_merge_request_path(@project, @merge_request, format: :diff), class: "btn btn-warning btn-small"
= link_to "Email patch", project_merge_request_path(@project, @merge_request, format: :patch), class: "btn btn-warning btn-small"
%p
To preserve performance only
%strong #{safe_diff_files(diffs).size} of #{diffs.size}
files displayed.
- @suppress_diff ||= @suppress_diff || @force_suppress_diff .row
- if @suppress_diff .col-md-8
.alert.alert-warning = render 'projects/commits/diff_stats', diffs: diffs
%p .col-md-4
%strong Warning! This is a large diff. %ul.nav.nav-tabs
%p %li.pull-right{class: params[:view] == 'parallel' ? 'active' : ''}
To preserve performance the diff is not shown. = link_to "Side-by-side Diff", url_for(view: 'parallel'), {id: "commit-diff-viewtype"}
- if current_controller?(:commit) or current_controller?(:merge_requests) %li.pull-right{class: params[:view] != 'parallel' ? 'active' : ''}
- if current_controller?(:commit) = link_to "Inline Diff", url_for(view: 'inline'), {id: "commit-diff-viewtype"}
Please, download the diff as
= link_to "plain diff", project_commit_path(@project, @commit, format: :diff), class: "underlined-link" - if show_diff_size_warninig?(diffs)
or = render 'projects/commits/diff_warning', diffs: diffs
= link_to "email patch", project_commit_path(@project, @commit, format: :patch), class: "underlined-link"
instead.
- elsif @merge_request && @merge_request.persisted?
Please, download the diff as
= link_to "plain diff", project_merge_request_path(@project, @merge_request, format: :diff), class: "underlined-link"
or
= link_to "email patch", project_merge_request_path(@project, @merge_request, format: :patch), class: "underlined-link"
instead.
- unless @force_suppress_diff
%p
If you still want to see the diff
= link_to "click this link", url_for(force_show_diff: true), class: "underlined-link"
%p.commit-stat-summary
Showing
%strong.cdark #{pluralize(diffs.count, "changed file")}
- if current_controller?(:commit)
- unless @commit.has_zero_stats?
with
%strong.cgreen #{@commit.stats.additions} additions
and
%strong.cred #{@commit.stats.deletions} deletions
- if params[:view] == 'parallel'
= link_to "Inline Diff", url_for(view: 'inline'), {id: "commit-diff-viewtype", class: 'btn btn-tiny pull-right'}
- else
= link_to "Side-by-side Diff", url_for(view: 'parallel'), {id: "commit-diff-viewtype", class: 'btn btn-tiny pull-right'}
.file-stats
= render "projects/commits/diff_head", diffs: diffs
.files .files
- unless @suppress_diff - safe_diff_files(diffs).each_with_index do |diff, i|
- diffs.each_with_index do |diff, i| = render 'projects/commits/diff_file', diff: diff, i: i, project: project
- file = project.repository.blob_at(@commit.id, diff.new_path)
- file = project.repository.blob_at(@commit.parent_id, diff.old_path) unless file
- next unless file
.diff-file{id: "diff-#{i}"}
.diff-header{id: "file-path-#{hexdigest(diff.new_path || diff.old_path)}"}
- if diff.deleted_file
%span= diff.old_path
.diff-btn-group
- if @commit.parent_ids.present?
= link_to project_blob_path(project, tree_join(@commit.parent_id, diff.new_path)), { class: 'btn btn-small view-file' } do
View file @
%span.commit-short-id= @commit.short_id(6)
- else
%span= diff.new_path
- if diff_file_mode_changed?(diff)
%span.file-mode= "#{diff.a_mode}#{diff.b_mode}"
.diff-btn-group
= link_to "#", class: "js-toggle-diff-comments btn btn-small" do
%i.icon-chevron-down
Diff comments
&nbsp;
- if @merge_request && @merge_request.source_project - if @diff_timeout
= link_to project_edit_tree_path(@merge_request.source_project, tree_join(@merge_request.source_branch, diff.new_path), from_merge_request_id: @merge_request.id), { class: 'btn btn-small' } do .alert.alert-danger
Edit %h4
&nbsp; Failed to collect changes
%p
= link_to project_blob_path(project, tree_join(@commit.id, diff.new_path)), { class: 'btn btn-small view-file' } do Maybe diff is really big and operation failed with timeout. Try to get diff localy
View file @
%span.commit-short-id= @commit.short_id(6)
.diff-content
-# Skipp all non non-supported blobs
- next unless file.respond_to?('text?')
- if file.text?
- if params[:view] == 'parallel'
= render "projects/commits/parallel_view", diff: diff, project: project, file: file, index: i
- else
= render "projects/commits/text_file", diff: diff, index: i
- elsif file.image?
- old_file = project.repository.blob_at(@commit.parent_id, diff.old_path) if @commit.parent_id
= render "projects/commits/image", diff: diff, old_file: old_file, file: file, index: i
- else
.nothing-here-block No preview for this file type
- too_big = diff.diff.lines.count > 1000 - too_big = diff.diff.lines.count > Commit::DIFF_SAFE_LINES
- if too_big - if too_big
%a.supp_diff_link Changes suppressed. Click to show %a.supp_diff_link Changes suppressed. Click to show
......
...@@ -18,18 +18,7 @@ ...@@ -18,18 +18,7 @@
- else - else
%ul.well-list= render Commit.decorate(@commits), project: @project %ul.well-list= render Commit.decorate(@commits), project: @project
%h4 Changes = render "projects/commits/diffs", diffs: @diffs, project: @project
- if @diffs.present?
= render "projects/commits/diffs", diffs: @diffs, project: @project
- elsif @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
.bs-callout.bs-callout-danger
%h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits.
%p To preserve performance the line changes are not shown.
- elsif @timeout
.bs-callout.bs-callout-danger
%h4 Number of changed files for this comparison is extremely large.
%p Use command line to browse through changes for this comparison.
- else - else
.light-well .light-well
......
...@@ -27,13 +27,13 @@ ...@@ -27,13 +27,13 @@
.panel-footer .panel-footer
.mr_target_commit .mr_target_commit
-if @merge_request.errors.any? - if @merge_request.errors.any?
.alert.alert-danger .alert.alert-danger
- @merge_request.errors.full_messages.each do |msg| - @merge_request.errors.full_messages.each do |msg|
%div= msg %div= msg
- if @merge_request.source_branch.present? && @merge_request.target_branch.present? - elsif @merge_request.source_branch.present? && @merge_request.target_branch.present?
- if @compare_failed - if @merge_request.compare_failed
.alert.alert-danger .alert.alert-danger
%h4 Compare failed %h4 Compare failed
%p We can't compare selected branches. It may be because of huge diff or satellite timeout. Please try again or select different branches. %p We can't compare selected branches. It may be because of huge diff or satellite timeout. Please try again or select different branches.
......
...@@ -44,11 +44,10 @@ ...@@ -44,11 +44,10 @@
Milestone Milestone
%div= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2'}) %div= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2'})
.panel-footer .panel-footer
- if @target_repo.contribution_guide - if contribution_guide_url(@target_project)
- contribution_guide_url = project_blob_path(@target_project, tree_join(@target_repo.root_ref, @target_repo.contribution_guide.name))
%p %p
Please review the Please review the
%strong #{link_to "guidelines for contribution", contribution_guide_url} %strong #{link_to "guidelines for contribution", contribution_guide_url(@target_project)}
to this repository. to this repository.
= f.hidden_field :source_project_id = f.hidden_field :source_project_id
= f.hidden_field :target_project_id = f.hidden_field :target_project_id
...@@ -76,6 +75,10 @@ ...@@ -76,6 +75,10 @@
.bs-callout.bs-callout-danger .bs-callout.bs-callout-danger
%h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits. %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits.
%p To preserve performance the line changes are not shown. %p To preserve performance the line changes are not shown.
- else
.bs-callout.bs-callout-danger
%h4 This comparison includes huge diff.
%p To preserve performance the line changes are not shown.
:javascript :javascript
......
- if @commits.present? - if @merge_request.can_be_created
= render 'new_submit' = render 'new_submit'
- else - else
= render 'new_compare' = render 'new_compare'
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
%small.access-icon %small.access-icon
= internal_icon = internal_icon
Internal Internal
.pull-right .pull-right.hidden-sm.hidden-xs
%pre.public-clone git clone #{project.http_url_to_repo} %pre.public-clone git clone #{project.http_url_to_repo}
- if project.description.present? - if project.description.present?
......
...@@ -244,7 +244,7 @@ production: &base ...@@ -244,7 +244,7 @@ production: &base
# The next value is the maximum memory size grit can use # The next value is the maximum memory size grit can use
# Given in number of bytes per git object (e.g. a commit) # Given in number of bytes per git object (e.g. a commit)
# This value can be increased if you have very large commits # This value can be increased if you have very large commits
max_size: 5242880 # 5.megabytes max_size: 20971520 # 20.megabytes
# Git timeout to read a commit, in seconds # Git timeout to read a commit, in seconds
timeout: 10 timeout: 10
......
...@@ -175,7 +175,7 @@ Gitlab::Application.routes.draw do ...@@ -175,7 +175,7 @@ Gitlab::Application.routes.draw do
resources :projects, constraints: { id: /[^\/]+/ }, only: [:new, :create] resources :projects, constraints: { id: /[^\/]+/ }, only: [:new, :create]
devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations , passwords: :passwords, sessions: :users_sessions } devise_for :users, controllers: { omniauth_callbacks: :omniauth_callbacks, registrations: :registrations , passwords: :passwords, sessions: :sessions }
devise_scope :user do devise_scope :user do
get "/users/auth/:provider/omniauth_error" => "omniauth_callbacks#omniauth_error", as: :omniauth_error get "/users/auth/:provider/omniauth_error" => "omniauth_callbacks#omniauth_error", as: :omniauth_error
......
...@@ -6,7 +6,7 @@ Get a list of users. ...@@ -6,7 +6,7 @@ Get a list of users.
This function takes pagination parameters `page` and `per_page` to restrict the list of users. This function takes pagination parameters `page` and `per_page` to restrict the list of users.
### For normal users: ### For normal users
``` ```
GET /users GET /users
...@@ -31,8 +31,7 @@ GET /users ...@@ -31,8 +31,7 @@ GET /users
] ]
``` ```
### For admins
### For admins:
``` ```
GET /users GET /users
...@@ -92,7 +91,7 @@ Also see `def search query` in `app/models/user.rb`. ...@@ -92,7 +91,7 @@ Also see `def search query` in `app/models/user.rb`.
Get a single user. Get a single user.
#### For user: ### For user
``` ```
GET /users/:id GET /users/:id
...@@ -112,8 +111,7 @@ Parameters: ...@@ -112,8 +111,7 @@ Parameters:
} }
``` ```
### For admin
#### For admin:
``` ```
GET /users/:id GET /users/:id
...@@ -161,13 +159,13 @@ Parameters: ...@@ -161,13 +159,13 @@ Parameters:
- `username` (required) - Username - `username` (required) - Username
- `name` (required) - Name - `name` (required) - Name
- `skype` (optional) - Skype ID - `skype` (optional) - Skype ID
- `linkedin` (optional) - Linkedin - `linkedin` (optional) - LinkedIn
- `twitter` (optional) - Twitter account - `twitter` (optional) - Twitter account
- `website_url` (optional) - Website url - `website_url` (optional) - Website URL
- `projects_limit` (optional) - Number of projects user can create - `projects_limit` (optional) - Number of projects user can create
- `extern_uid` (optional) - External UID - `extern_uid` (optional) - External UID
- `provider` (optional) - External provider name - `provider` (optional) - External provider name
- `bio` (optional) - User's bio - `bio` (optional) - User's biography
- `admin` (optional) - User is admin - true or false (default) - `admin` (optional) - User is admin - true or false (default)
- `can_create_group` (optional) - User can create groups - true or false - `can_create_group` (optional) - User can create groups - true or false
...@@ -181,26 +179,32 @@ PUT /users/:id ...@@ -181,26 +179,32 @@ PUT /users/:id
Parameters: Parameters:
- `email` - Email - `email` - Email
- `username` - Username - `username` - Username
- `name` - Name - `name` - Name
- `password` - Password - `password` - Password
- `skype` - Skype ID - `skype` - Skype ID
- `linkedin` - Linkedin - `linkedin` - LinkedIn
- `twitter` - Twitter account - `twitter` - Twitter account
- `website_url` - Website url - `website_url` - Website URL
- `projects_limit` - Limit projects each user can create - `projects_limit` - Limit projects each user can create
- `extern_uid` - External UID - `extern_uid` - External UID
- `provider` - External provider name - `provider` - External provider name
- `bio` - User's bio - `bio` - User's biography
- `admin` (optional) - User is admin - true or false (default) - `admin` (optional) - User is admin - true or false (default)
- `can_create_group` (optional) - User can create groups - true or false - `can_create_group` (optional) - User can create groups - true or false
Note, at the moment this method does only return a 404 error, even in cases where a 409 (Conflict) would be more appropriate, e.g. when renaming the email address to some existing one. Note, at the moment this method does only return a 404 error,
even in cases where a 409 (Conflict) would be more appropriate,
e.g. when renaming the email address to some existing one.
## User deletion ## User deletion
Deletes a user. Available only for administrators. This is an idempotent function, calling this function for a non-existent user id still returns a status code `200 Ok`. The JSON response differs if the user was actually deleted or not. In the former the user is returned and in the latter not. Deletes a user. Available only for administrators.
This is an idempotent function, calling this function for a non-existent user id
still returns a status code `200 Ok`.
The JSON response differs if the user was actually deleted or not.
In the former the user is returned and in the latter not.
``` ```
DELETE /users/:id DELETE /users/:id
...@@ -310,7 +314,7 @@ POST /user/keys ...@@ -310,7 +314,7 @@ POST /user/keys
Parameters: Parameters:
- `title` (required) - new SSH Key's title - `title` (required) - new SSH Key's title
- `key` (required) - new SSH key - `key` (required) - new SSH key
## Add SSH key for user ## Add SSH key for user
...@@ -322,15 +326,17 @@ POST /users/:id/keys ...@@ -322,15 +326,17 @@ POST /users/:id/keys
Parameters: Parameters:
- `id` (required) - id of specified user - `id` (required) - id of specified user
- `title` (required) - new SSH Key's title - `title` (required) - new SSH Key's title
- `key` (required) - new SSH key - `key` (required) - new SSH key
Will return created key with status `201 Created` on success, or `404 Not found` on fail. Will return created key with status `201 Created` on success, or `404 Not found` on fail.
## Delete SSH key for current user ## Delete SSH key for current user
Deletes key owned by currently authenticated user. This is an idempotent function and calling it on a key that is already deleted or not available results in `200 Ok`. Deletes key owned by currently authenticated user.
This is an idempotent function and calling it on a key that is already deleted
or not available results in `200 Ok`.
``` ```
DELETE /user/keys/:id DELETE /user/keys/:id
...@@ -351,6 +357,6 @@ DELETE /users/:uid/keys/:id ...@@ -351,6 +357,6 @@ DELETE /users/:uid/keys/:id
Parameters: Parameters:
- `uid` (required) - id of specified user - `uid` (required) - id of specified user
- `id` (required) - SSH key ID - `id` (required) - SSH key ID
Will return `200 Ok` on success, or `404 Not found` if either user or key cannot be found. Will return `200 Ok` on success, or `404 Not found` if either user or key cannot be found.
...@@ -16,7 +16,6 @@ If a user is a GitLab administrator they receive all permissions. ...@@ -16,7 +16,6 @@ If a user is a GitLab administrator they receive all permissions.
| Pull project code | | ✓ | ✓ | ✓ | ✓ | | Pull project code | | ✓ | ✓ | ✓ | ✓ |
| Download project | | ✓ | ✓ | ✓ | ✓ | | Download project | | ✓ | ✓ | ✓ | ✓ |
| Create code snippets | | ✓ | ✓ | ✓ | ✓ | | Create code snippets | | ✓ | ✓ | ✓ | ✓ |
| Create new milestones | | | ✓ | ✓ | ✓ |
| Create new merge request | | | ✓ | ✓ | ✓ | | Create new merge request | | | ✓ | ✓ | ✓ |
| Create new branches | | | ✓ | ✓ | ✓ | | Create new branches | | | ✓ | ✓ | ✓ |
| Push to non-protected branches | | | ✓ | ✓ | ✓ | | Push to non-protected branches | | | ✓ | ✓ | ✓ |
...@@ -24,6 +23,7 @@ If a user is a GitLab administrator they receive all permissions. ...@@ -24,6 +23,7 @@ If a user is a GitLab administrator they receive all permissions.
| Add tags | | | ✓ | ✓ | ✓ | | Add tags | | | ✓ | ✓ | ✓ |
| Write a wiki | | | ✓ | ✓ | ✓ | | Write a wiki | | | ✓ | ✓ | ✓ |
| Manage issue tracker | | | ✓ | ✓ | ✓ | | Manage issue tracker | | | ✓ | ✓ | ✓ |
| Create new milestones | | | | ✓ | ✓ |
| Add new team members | | | | ✓ | ✓ | | Add new team members | | | | ✓ | ✓ |
| Push to protected branches | | | | ✓ | ✓ | | Push to protected branches | | | | ✓ | ✓ |
| Enable/Disable branch protection | | | | ✓ | ✓ | | Enable/Disable branch protection | | | | ✓ | ✓ |
......
...@@ -14,13 +14,47 @@ A release manager is selected that coordinates the entire release of this versio ...@@ -14,13 +14,47 @@ A release manager is selected that coordinates the entire release of this versio
Any changes not yet added to the changelog are added by lead developer and in that merge request the complete team is asked if there is anything missing. Any changes not yet added to the changelog are added by lead developer and in that merge request the complete team is asked if there is anything missing.
# **18th - Releasing RC1** ### **4. Create an overall issue**
```
15th:
* Update the changelog (#LINK)
17th:
* Create x.x.0.rc1 (#LINK)
18th:
* Update GitLab.com with rc1 (#LINK)
* Regression issue and tweet about rc1 (#LINK)
* Start blog post (#LINK)
21th:
* Do QA and fix anything coming out of it (#LINK)
22nd:
* Release CE and EE (#LINK)
23th:
* Prepare package for GitLab.com release (#LINK)
24th:
* Deploy to GitLab.com (#LINK)
```
# **17th - Create RC1**
The RC1 release comes with the task to update the installation and upgrade docs. Be mindful that there might already be merge requests for this on GitLab or GitHub. The RC1 release comes with the task to update the installation and upgrade docs. Be mindful that there might already be merge requests for this on GitLab or GitHub.
### **1. Create an issue for RC1 release** ### **1. Merge the CE code into EE**
Consider naming the issue "Release x.x.x.rc1" to make it easier for later searches. Do this via a merge request.
### **2. Update the installation guide** ### **2. Update the installation guide**
...@@ -107,12 +141,22 @@ Create an annotated tag that points to the version change commit: ...@@ -107,12 +141,22 @@ Create an annotated tag that points to the version change commit:
git tag -a vx.x.0.rc1 -m 'Version x.x.0.rc1' git tag -a vx.x.0.rc1 -m 'Version x.x.0.rc1'
``` ```
### **7. Update GitLab.com** # **18th - Release RC1**
### **1. Update GitLab.com**
Merge the RC1 code into GitLab.com. Once the build is green, deploy in the morning. Merge the RC1 code into GitLab.com. Once the build is green, deploy in the morning.
It is important to do this as soon as possible, so we can catch any errors before we release the full version. It is important to do this as soon as possible, so we can catch any errors before we release the full version.
### **8. Create a regressions issue** ### **2. Prepare the blog post**
- Check the changelog of CE and EE for important changes. Based on [release blog template](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/doc/release_blog_template.md) fill in the important information.
- Create a WIP MR for the blog post and cc the team so everyone can give feedback.
- Ask Dmitriy to add screenshots to the WIP MR.
- Decide with team who will be the MVP user.
- Add a note if there are security fixes: This release fixes an important security issue and we advise everyone to upgrade as soon as possible.
### **3. Create a regressions issue**
On [the GitLab CE issue tracker on GitLab.com](https://gitlab.com/gitlab-org/gitlab-ce/issues/) create an issue titled "GitLab X.X regressions" add the following text: On [the GitLab CE issue tracker on GitLab.com](https://gitlab.com/gitlab-org/gitlab-ce/issues/) create an issue titled "GitLab X.X regressions" add the following text:
...@@ -123,23 +167,15 @@ The release manager will comment here about the plans for patch releases. ...@@ -123,23 +167,15 @@ The release manager will comment here about the plans for patch releases.
Assign the issue to the release manager and /cc all the core-team members active on the issue tracker. If there are any known bugs in the release add them immediately. Assign the issue to the release manager and /cc all the core-team members active on the issue tracker. If there are any known bugs in the release add them immediately.
### **9. Tweet** ### **4. Tweet**
Tweet about the RC release: Tweet about the RC release:
> GitLab x.x.x.rc1 is out. This release candidate is only suitable for testing. Please create issues for regressions and add a link from LINK_TO_ISSUE. > GitLab x.x.0.rc1 is out. This release candidate is only suitable for testing. Please create issues for regressions and add a link from LINK_TO_ISSUE.
# **21st - Preparation ** # **21st - Preparation **
### **1. Prepare the blog post** ### **1. Q&A**
- Check the changelog of CE and EE for important changes. Based on [release blog template](https://gitlab.com/gitlab-com/www-gitlab-com/blob/master/doc/release_blog_template.md) fill in the important information.
- Create a WIP MR for the blog post and cc the team so everyone can give feedback.
- Ask Dmitriy to add screenshots to the WIP MR.
- Decide with team who will be the MVP user.
- Add a note if there are security fixes: This release fixes an important security issue and we advise everyone to upgrade as soon as possible.
### **2. Q&A**
Create issue on dev.gitlab.org `gitlab` repository, named "GitLab X.X release" in order to keep track of the progress. Create issue on dev.gitlab.org `gitlab` repository, named "GitLab X.X release" in order to keep track of the progress.
...@@ -147,7 +183,7 @@ Use the omnibus packages of Enterprise Edition using [this guide](https://dev.gi ...@@ -147,7 +183,7 @@ Use the omnibus packages of Enterprise Edition using [this guide](https://dev.gi
**NOTE** Upgrader can only be tested when tags are pushed to all repositories. Do not forget to confirm it is working before releasing. Note that in the issue. **NOTE** Upgrader can only be tested when tags are pushed to all repositories. Do not forget to confirm it is working before releasing. Note that in the issue.
### **3. Fix anything coming out of the QA** ### **2. Fix anything coming out of the QA**
Create an issue with description of a problem, if it is quick fix fix yourself otherwise contact the team for advice. Create an issue with description of a problem, if it is quick fix fix yourself otherwise contact the team for advice.
......
...@@ -31,3 +31,8 @@ Feature: Project Redirects ...@@ -31,3 +31,8 @@ Feature: Project Redirects
And I click on "Sign In" And I click on "Sign In"
And Authenticate And Authenticate
Then I should be redirected to "Community" page Then I should be redirected to "Community" page
Scenario: I visit private project page without signing in
When I visit project "Enterprise" page
And I get redirected to signin page where I sign in
Then I should be redirected to "Enterprise" page
...@@ -201,7 +201,6 @@ class Groups < Spinach::FeatureSteps ...@@ -201,7 +201,6 @@ class Groups < Spinach::FeatureSteps
step 'I should see group milestone with descriptions and expiry date' do step 'I should see group milestone with descriptions and expiry date' do
page.should have_content('Lorem Ipsum is simply dummy text of the printing and typesetting industry') page.should have_content('Lorem Ipsum is simply dummy text of the printing and typesetting industry')
page.should have_content('expires at Aug 20, 2014') page.should have_content('expires at Aug 20, 2014')
page.should have_content('Project milestone has no description')
end end
step 'I should see group milestone with all issues and MRs assigned to that milestone' do step 'I should see group milestone with all issues and MRs assigned to that milestone' do
......
...@@ -61,8 +61,7 @@ class ProjectBrowseCommits < Spinach::FeatureSteps ...@@ -61,8 +61,7 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
Then 'I see big commit warning' do Then 'I see big commit warning' do
page.should have_content BigCommits::BIG_COMMIT_MESSAGE page.should have_content BigCommits::BIG_COMMIT_MESSAGE
page.should have_content "Warning! This is a large diff" page.should have_content "Too many changes"
page.should have_content "If you still want to see the diff"
end end
Given 'I visit huge commit page' do Given 'I visit huge commit page' do
...@@ -71,8 +70,6 @@ class ProjectBrowseCommits < Spinach::FeatureSteps ...@@ -71,8 +70,6 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
Then 'I see huge commit message' do Then 'I see huge commit message' do
page.should have_content BigCommits::HUGE_COMMIT_MESSAGE page.should have_content BigCommits::HUGE_COMMIT_MESSAGE
page.should have_content "Warning! This is a large diff"
page.should_not have_content "If you still want to see the diff"
end end
Given 'I visit a commit with an image that changed' do Given 'I visit a commit with an image that changed' do
......
...@@ -41,7 +41,6 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps ...@@ -41,7 +41,6 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
step 'Authenticate' do step 'Authenticate' do
admin = create(:admin) admin = create(:admin)
project = Project.find_by(name: 'Community') project = Project.find_by(name: 'Community')
find(:xpath, "//input[@id='return_to']").set "/#{project.path_with_namespace}"
fill_in "user_login", with: admin.email fill_in "user_login", with: admin.email
fill_in "user_password", with: admin.password fill_in "user_password", with: admin.password
click_button "Sign in" click_button "Sign in"
...@@ -53,5 +52,19 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps ...@@ -53,5 +52,19 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
page.current_path.should == "/#{project.path_with_namespace}" page.current_path.should == "/#{project.path_with_namespace}"
page.status_code.should == 200 page.status_code.should == 200
end end
end
step 'I get redirected to signin page where I sign in' do
admin = create(:admin)
project = Project.find_by(name: 'Enterprise')
fill_in "user_login", with: admin.email
fill_in "user_password", with: admin.password
click_button "Sign in"
Thread.current[:current_user] = admin
end
step 'I should be redirected to "Enterprise" page' do
project = Project.find_by(name: 'Enterprise')
page.current_path.should == "/#{project.path_with_namespace}"
page.status_code.should == 200
end
end
module Gitlab module Gitlab
module Satellite module Satellite
class BranchesWithoutParent < StandardError; end
class CompareAction < Action class CompareAction < Action
def initialize(user, target_project, target_branch, source_project, source_branch) def initialize(user, target_project, target_branch, source_project, source_branch)
super user, target_project super user, target_project
...@@ -22,7 +24,7 @@ module Gitlab ...@@ -22,7 +24,7 @@ module Gitlab
diffs diffs
end end
rescue Grit::Git::CommandFailed => ex rescue Grit::Git::CommandFailed => ex
handle_exception(ex) raise BranchesWithoutParent
end end
# Retrieve an array of commits between the source and the target # Retrieve an array of commits between the source and the target
......
...@@ -53,7 +53,7 @@ module Gitlab ...@@ -53,7 +53,7 @@ module Gitlab
File.open(lock_file, "w+") do |f| File.open(lock_file, "w+") do |f|
begin begin
f.flock File::LOCK_EX f.flock File::LOCK_EX
Dir.chdir(path) { return yield } yield
ensure ensure
f.flock File::LOCK_UN f.flock File::LOCK_UN
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