Commit 28cab284 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ce-7-1' into 'master'

Merge CE 7.1 into EE

Fixes https://dev.gitlab.org/gitlab/gitlabhq/issues/1438

See merge request !128
parents cd5b863f 253ae9fe
# Prefer single quotes
StringLiterals:
EnforcedStyle: single_quotes
Enabled: true
......@@ -20,6 +20,10 @@ v 7.1.0
- Show VERSION information on project sidebar
- Improve branch removal logic when accept MR
- 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
- The CPU no longer overheats when you hold down the spacebar
......
......@@ -174,6 +174,7 @@ gem "font-awesome-rails", '~> 3.2'
gem "gitlab_emoji", "~> 0.0.1.1"
gem "gon", '~> 5.0.0'
gem 'nprogress-rails'
gem 'request_store'
group :development do
gem "annotate", "~> 2.6.0.beta2"
......
......@@ -165,7 +165,7 @@ GEM
multi_json
gitlab-grack (2.0.0.pre)
rack (~> 1.5.1)
gitlab-grit (2.6.9)
gitlab-grit (2.6.10)
charlock_holmes (~> 0.6)
diff-lcs (~> 1.1)
mime-types (~> 1.15)
......@@ -409,6 +409,7 @@ GEM
redis-store (1.1.4)
redis (>= 2.2)
ref (1.0.5)
request_store (1.0.5)
require_all (1.3.2)
rest-client (1.6.7)
mime-types (>= 1.16)
......@@ -648,6 +649,7 @@ DEPENDENCIES
rb-inotify
redcarpet (~> 2.2.2)
redis-rails
request_store
rspec-rails
sanitize (~> 2.0)
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 {
.wiki .highlight, .note-body .highlight {
margin-bottom: 9px;
}
.footer-links a {
margin-right: 15px;
}
......@@ -112,7 +112,9 @@
.commit-stat-summary {
color: #666;
line-height: 2;
font-size: 14px;
font-weight: normal;
padding: 10px 0;
}
.commit-info-row {
......
......@@ -5,18 +5,13 @@
font-weight: 200;
}
.login-box {
position: relative;
margin: auto;
padding: 20px;
background: #f5f5f5;
border: 1px solid #EEE;
.login-box{
}
.brand-image {
margin-bottom: 20px;
img {
max-width: 100%;
max-width: 100%;
margin-bottom: 20px;
}
}
......@@ -26,7 +21,7 @@
}
.form-control {
background-color: #FFF;
background-color: #F5F5F5;
font-size: 16px;
padding: 14px 10px;
width: 100%;
......@@ -48,6 +43,10 @@
margin-bottom:0px;
@include border-radius(0);
}
&:active, &:focus {
background-color: #FFF;
}
}
.login-box a.forgot {
......
......@@ -172,8 +172,8 @@ ul.nav.nav-projects-tabs {
}
.public-clone {
background: #333;
color: #f5f5f5;
background: #EEE;
color: #777;
padding: 6px 10px;
margin: 1px;
font-weight: normal;
......
......@@ -59,15 +59,17 @@ class Admin::UsersController < Admin::ApplicationController
end
def update
user_params_with_pass = user_params.dup
if params[:user][:password].present?
user_params.merge(
user_params_with_pass.merge!(
password: params[:user][:password],
password_confirmation: params[:user][:password_confirmation],
)
end
respond_to do |format|
if user.update_attributes(user_params)
if user.update_attributes(user_params_with_pass)
user.confirm!
format.html { redirect_to [:admin, user], notice: 'User was successfully updated.' }
format.json { head :ok }
......
......@@ -68,7 +68,7 @@ class ApplicationController < ActionController::Base
flash[:alert] = "Your account is blocked. Retry when an admin has unblocked it."
new_user_session_path
else
@return_to || root_path
stored_location_for(:redirect) || stored_location_for(resource) || root_path
end
end
......
......@@ -20,11 +20,10 @@ class Projects::CommitController < Projects::ApplicationController
end
begin
@suppress_diff = true if commit.diff_suppress? && !params[:force_show_diff]
@force_suppress_diff = commit.diff_force_suppress?
@diffs = @commit.diffs
rescue Grit::Git::GitTimeout
@suppress_diff = true
@status = :huge_commit
@diffs = []
@diff_timeout = true
end
@note = project.build_commit_note(commit)
......@@ -38,12 +37,7 @@ class Projects::CommitController < Projects::ApplicationController
}
respond_to do |format|
format.html do
if @status == :huge_commit
render "huge_commit" and return
end
end
format.html
format.diff { render text: @commit.to_diff }
format.patch { render text: @commit.to_patch }
end
......
......@@ -15,11 +15,7 @@ class Projects::CompareController < Projects::ApplicationController
@diffs = compare.diffs
@refs_are_same = compare.same
@line_notes = []
@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)
@diff_timeout = compare.timeout
end
def create
......
......@@ -34,6 +34,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def show
@note_counts = Note.where(commit_id: @merge_request.commits.map(&:id)).
group(:commit_id).count
respond_to do |format|
format.html
format.diff { render text: @merge_request.to_diff(current_user) }
......@@ -43,16 +44,13 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def diffs
@commit = @merge_request.last_commit
@comments_allowed = @reply_allowed = true
@comments_target = {noteable_type: 'MergeRequest',
noteable_id: @merge_request.id}
@comments_target = {
noteable_type: 'MergeRequest',
noteable_id: @merge_request.id
}
@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|
format.html
format.json { render json: { html: view_to_html_string("projects/merge_requests/show/_diffs") } }
......@@ -60,51 +58,22 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def new
params[:merge_request] ||= ActionController::Parameters.new(
source_project: @project
)
@merge_request = MergeRequest.new(merge_request_params)
@merge_request.source_project = @project unless @merge_request.source_project
@merge_request.target_project ||= (@project.forked_from_project || @project)
@target_branches = @merge_request.target_project.nil? ? [] : @merge_request.target_project.repository.branch_names
@merge_request.target_branch ||= @merge_request.target_project.default_branch
@source_project = @merge_request.source_project
if @merge_request.target_branch && @merge_request.source_branch
compare_action = Gitlab::Satellite::CompareAction.new(
current_user,
@merge_request.target_project,
@merge_request.target_branch,
@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
params[:merge_request] ||= ActionController::Parameters.new(source_project: @project)
@merge_request = MergeRequests::BuildService.new(project, current_user, merge_request_params).execute
@target_branches = if @merge_request.target_project
@merge_request.target_project.repository.branch_names
else
[]
end
@target_project = merge_request.target_project
@source_project = merge_request.source_project
@commits = @merge_request.compare_commits
@commit = @merge_request.compare_base_commit
@diffs = @merge_request.compare_diffs
@note_counts = Note.where(commit_id: @commits.map(&:id)).
group(:commit_id).count
end
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
end
def brand_image
if brand_item
if brand_item.logo?
image_tag brand_item.logo
else
nil
end
if brand_item.logo?
image_tag brand_item.logo
else
image_tag 'brand_logo.png'
nil
end
end
def brand_text
default_text =<<eos
### 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
markdown(brand_item.description)
end
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
"Never"
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
......@@ -67,40 +67,42 @@ class Ability
def project_abilities(user, project)
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
if team.master?(user)
rules += project_master_rules
elsif team.developer?(user)
rules += project_dev_rules
elsif team.developer?(user)
rules += project_dev_rules
elsif team.reporter?(user)
rules += project_report_rules
elsif team.reporter?(user)
rules += project_report_rules
elsif team.guest?(user)
rules += project_guest_rules
end
elsif team.guest?(user)
rules += project_guest_rules
end
if project.public? || project.internal?
rules += public_project_rules
end
if project.public? || project.internal?
rules += public_project_rules
end
if project.owner == user || user.admin?
rules += project_admin_rules
end
if project.owner == user || user.admin?
rules += project_admin_rules
end
if project.group && project.group.has_owner?(user)
rules += project_admin_rules
end
if project.group && project.group.has_owner?(user)
rules += project_admin_rules
end
if project.archived?
rules -= project_archived_rules
end
if project.archived?
rules -= project_archived_rules
rules
end
rules
end
def public_project_rules
......
......@@ -12,6 +12,7 @@ class Commit
# User can force display of diff above this size
DIFF_SAFE_FILES = 100
DIFF_SAFE_LINES = 5000
# Commits above this size will not be rendered in HTML
DIFF_HARD_LIMIT_FILES = 1000
DIFF_HARD_LIMIT_LINES = 50000
......@@ -23,23 +24,7 @@ class Commit
# Calculate number of lines to render for diffs
def diff_line_count(diffs)
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
diffs.reduce(0) { |sum, d| sum + d.diff.lines.count }
end
end
......@@ -60,14 +45,6 @@ class Commit
@diff_line_count
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
#
# Example
......
......@@ -50,10 +50,10 @@ class GroupMilestone
def state
state = milestones.map { |milestone| milestone.state }
if state.count('active') == state.size
'active'
else
if state.count('closed') == state.size
'closed'
else
'active'
end
end
......
......@@ -42,6 +42,11 @@ class MergeRequest < ActiveRecord::Base
# It allows us to close or modify broken merge requests
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
acts_as_taggable_on :labels
......
......@@ -141,9 +141,29 @@ class ProjectTeam
access << group.users_groups.find_by(user_id: user_id).try(:access_field)
end
if project.invited_groups.any?
access << max_invited_level(user_id)
end
access.compact.max
end
def max_invited_level(user_id)
project.project_group_links.map do |group_link|
invited_group = group_link.group
access = invited_group.users_groups.find_by(user_id: user_id).try(:access_field)
# If group member has higher access level we should restrict it
# to max allowed access level
if access && access > group_link.group_access
access = group_link.group_access
end
access
end.compact.max
end
private
def fetch_members(level = nil)
......
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
%h3.page-title Resend confirmation instructions
= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
.devise-errors
= devise_error_messages!
.clearfix.append-bottom-20
= f.email_field :email, placeholder: 'Email', class: "form-control", required: true
.clearfix.append-bottom-10
= f.submit "Resend confirmation instructions", class: 'btn btn-success'
%hr
%p
%span.light
Already have login and password?
%strong
= link_to "Sign in", new_session_path(resource_name)
.login-box.panel.panel-default
.panel-heading
%h3.panel-title Resend confirmation instructions
.panel-body
= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
.devise-errors
= devise_error_messages!
.clearfix.append-bottom-20
= f.email_field :email, placeholder: 'Email', class: "form-control", required: true
.clearfix.append-bottom-10
= f.submit "Resend confirmation instructions", class: 'btn btn-success'
.panel-footer
= render 'devise/shared/sign_in_link'
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: "login-box" }) do |f|
%h3 Change your password
.devise-errors
= devise_error_messages!
= f.hidden_field :reset_password_token
%div
= f.password_field :password, class: "form-control top", placeholder: "New password", required: true
%div
= f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm new password", required: true
%div
.clearfix.append-bottom-10
= f.submit "Change my password", class: "btn btn-primary"
= link_to "Sign in", new_session_path(resource_name), class: "btn pull-right"
%div
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
.login-box.panel.panel-default
.panel-heading
%h3.panel-title Change your password
.panel-body
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
.devise-errors
= devise_error_messages!
= f.hidden_field :reset_password_token
%div
= f.password_field :password, class: "form-control top", placeholder: "New password", required: true
%div
= f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm new password", required: true
.clearfix.append-bottom-10
= f.submit "Change my password", class: "btn btn-primary"
.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|
%h3.page-title Reset password
.devise-errors
= devise_error_messages!
.clearfix.append-bottom-20
= f.email_field :email, placeholder: "Email", class: "form-control", required: true
.clearfix.append-bottom-10
= f.submit "Reset password", class: "btn-primary btn"
%hr
%p
%span.light
Already have login and password?
%strong
= link_to "Sign in", new_session_path(resource_name)
.login-box.panel.panel-default
.panel-heading
%h3.panel-title Reset password
.panel-body
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
.devise-errors
= devise_error_messages!
.clearfix.append-bottom-20
= f.email_field :email, placeholder: "Email", class: "form-control", required: true
.clearfix.append-bottom-10
= f.submit "Reset password", class: "btn-primary btn"
.panel-footer
= render 'devise/shared/sign_in_link'
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "login-box" }) do |f|
%h3.page-title Sign Up
.devise-errors
= devise_error_messages!
%div
= f.text_field :name, class: "form-control top", placeholder: "Name", required: true
%div
= f.text_field :username, class: "form-control middle", placeholder: "Username", required: true
%div
= f.email_field :email, class: "form-control middle", placeholder: "Email", required: true
%div
= f.password_field :password, class: "form-control middle", placeholder: "Password", required: true
%div
= f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm password", required: true
%div
= f.submit "Sign up", class: "btn-create btn"
%hr
%p
%span.light
Have an account?
%strong
= link_to "Sign in", new_session_path(resource_name)
%p
= link_to "Forgot your password?", new_password_path(resource_name)
.login-box.panel.panel-success
.panel-heading
%h3.panel-title Sign up
.panel-body
= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
.devise-errors
= devise_error_messages!
%div
= f.text_field :name, class: "form-control top", placeholder: "Name", required: true
%div
= f.text_field :username, class: "form-control middle", placeholder: "Username", required: true
%div
= f.email_field :email, class: "form-control middle", placeholder: "Email", required: true
%div
= f.password_field :password, class: "form-control middle", placeholder: "Password", required: true
%div
= f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm password", required: true
%div
= f.submit "Sign up", class: "btn-create btn"
.panel-footer
%p
%span.light
Have an account?
%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 @@
= f.check_box :remember_me
%span Remember me
%div
= hidden_field_tag 'return_to', params[:return_to]
= f.submit "Sign in", class: "btn-create btn"
= f.submit "Sign in", class: "btn-save btn"
.pull-right
= link_to "Forgot your password?", new_password_path(resource_name), class: "btn"
......@@ -2,4 +2,4 @@
= 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"}
%br/
= submit_tag "LDAP Sign in", class: "btn-create btn"
= submit_tag "LDAP Sign in", class: "btn-save btn"
.login-box
%h3.page-title Sign in
- if ldap_enabled? && gitlab_config.signin_enabled
%ul.nav.nav-tabs
%li.active
= link_to 'LDAP', '#tab-ldap', 'data-toggle' => 'tab'
%li
= link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab'
.tab-content
%div#tab-ldap.tab-pane.active
= render partial: 'devise/sessions/new_ldap'
%div#tab-signin.tab-pane
= render partial: 'devise/sessions/new_base'
.login-box.panel.panel-primary
.panel-heading
%h3.panel-title Sign in
.panel-body
- if ldap_enabled? && gitlab_config.signin_enabled
%ul.nav.nav-tabs
%li.active
= link_to 'LDAP', '#tab-ldap', 'data-toggle' => 'tab'
%li
= link_to 'Standard', '#tab-signin', 'data-toggle' => 'tab'
.tab-content
%div#tab-ldap.tab-pane.active
= 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
%span.light
Don't have an account?
%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)
%span.light Did not receive confirmation email?
= link_to "Send again", new_confirmation_path(resource_name)
- if extra_config.has_key?('sign_in_text')
%hr
= markdown(extra_config.sign_in_text)
- if extra_config.has_key?('sign_in_text')
%hr
= 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 @@
%h4
= link_to "#{milestone.project.name} - #{milestone.title}", project_milestone_path(milestone.project, milestone)
%span.pull-right= milestone.expires_at
- if milestone.closed?
%span.label.label-danger #{milestone.state}
= preserve do
- if milestone.description.present?
= milestone.description
- else
%em Project milestone has no description
.context
%p
......
......@@ -13,10 +13,10 @@
%i.icon-reorder
.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
%ul.nav.navbar-nav
%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 @@
.container
.content
.row
.col-sm-7
.brand-image
= brand_image
.brand_text
= brand_text
.col-sm-5
.col-md-7
- if brand_item
.brand-image
= brand_image
.brand_text
= 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
%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 @@
.col-md-7
.project-home-desc
- 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)
&ndash;
%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 "projects/commits/diffs", diffs: @commit.diffs, project: @project
= render "projects/commits/diffs", diffs: @diffs, project: @project
= 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
- if @suppress_diff
.alert.alert-warning
%p
%strong Warning! This is a large diff.
%p
To preserve performance the diff is not shown.
- if current_controller?(:commit) or current_controller?(:merge_requests)
- if current_controller?(:commit)
Please, download the diff as
= link_to "plain diff", project_commit_path(@project, @commit, format: :diff), class: "underlined-link"
or
= 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
.row
.col-md-8
= render 'projects/commits/diff_stats', diffs: diffs
.col-md-4
%ul.nav.nav-tabs
%li.pull-right{class: params[:view] == 'parallel' ? 'active' : ''}
= link_to "Side-by-side Diff", url_for(view: 'parallel'), {id: "commit-diff-viewtype"}
%li.pull-right{class: params[:view] != 'parallel' ? 'active' : ''}
= link_to "Inline Diff", url_for(view: 'inline'), {id: "commit-diff-viewtype"}
- if show_diff_size_warninig?(diffs)
= render 'projects/commits/diff_warning', diffs: diffs
.files
- unless @suppress_diff
- diffs.each_with_index do |diff, i|
- 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;
- safe_diff_files(diffs).each_with_index do |diff, i|
= render 'projects/commits/diff_file', diff: diff, i: i, project: project
- 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
- 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
- if @diff_timeout
.alert.alert-danger
%h4
Failed to collect changes
%p
Maybe diff is really big and operation failed with timeout. Try to get diff localy
- too_big = diff.diff.lines.count > 1000
- too_big = diff.diff.lines.count > Commit::DIFF_SAFE_LINES
- if too_big
%a.supp_diff_link Changes suppressed. Click to show
......
......@@ -18,18 +18,7 @@
- else
%ul.well-list= render Commit.decorate(@commits), project: @project
%h4 Changes
- 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.
= render "projects/commits/diffs", diffs: @diffs, project: @project
- else
.light-well
......
......@@ -27,13 +27,13 @@
.panel-footer
.mr_target_commit
-if @merge_request.errors.any?
- if @merge_request.errors.any?
.alert.alert-danger
- @merge_request.errors.full_messages.each do |msg|
%div= msg
- if @merge_request.source_branch.present? && @merge_request.target_branch.present?
- if @compare_failed
- elsif @merge_request.source_branch.present? && @merge_request.target_branch.present?
- if @merge_request.compare_failed
.alert.alert-danger
%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.
......
......@@ -44,11 +44,10 @@
Milestone
%div= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2'})
.panel-footer
- if @target_repo.contribution_guide
- contribution_guide_url = project_blob_path(@target_project, tree_join(@target_repo.root_ref, @target_repo.contribution_guide.name))
- if contribution_guide_url(@target_project)
%p
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.
= f.hidden_field :source_project_id
= f.hidden_field :target_project_id
......@@ -76,6 +75,10 @@
.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.
- else
.bs-callout.bs-callout-danger
%h4 This comparison includes huge diff.
%p To preserve performance the line changes are not shown.
:javascript
......
- if @commits.present?
- if @merge_request.can_be_created
= render 'new_submit'
- else
= render 'new_compare'
......@@ -45,7 +45,7 @@
%small.access-icon
= internal_icon
Internal
.pull-right
.pull-right.hidden-sm.hidden-xs
%pre.public-clone git clone #{project.http_url_to_repo}
- if project.description.present?
......
......@@ -244,7 +244,7 @@ production: &base
# The next value is the maximum memory size grit can use
# Given in number of bytes per git object (e.g. a commit)
# 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
timeout: 10
......
......@@ -175,7 +175,7 @@ Gitlab::Application.routes.draw do
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
get "/users/auth/:provider/omniauth_error" => "omniauth_callbacks#omniauth_error", as: :omniauth_error
......
......@@ -6,7 +6,7 @@ Get a 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
......@@ -31,8 +31,7 @@ GET /users
]
```
### For admins:
### For admins
```
GET /users
......@@ -92,7 +91,7 @@ Also see `def search query` in `app/models/user.rb`.
Get a single user.
#### For user:
### For user
```
GET /users/:id
......@@ -112,8 +111,7 @@ Parameters:
}
```
#### For admin:
### For admin
```
GET /users/:id
......@@ -161,13 +159,13 @@ Parameters:
- `username` (required) - Username
- `name` (required) - Name
- `skype` (optional) - Skype ID
- `linkedin` (optional) - Linkedin
- `linkedin` (optional) - LinkedIn
- `twitter` (optional) - Twitter account
- `website_url` (optional) - Website url
- `website_url` (optional) - Website URL
- `projects_limit` (optional) - Number of projects user can create
- `extern_uid` (optional) - External UID
- `provider` (optional) - External provider name
- `bio` (optional) - User's bio
- `bio` (optional) - User's biography
- `admin` (optional) - User is admin - true or false (default)
- `can_create_group` (optional) - User can create groups - true or false
......@@ -181,26 +179,32 @@ PUT /users/:id
Parameters:
- `email` - Email
- `username` - Username
- `name` - Name
- `password` - Password
- `skype` - Skype ID
- `linkedin` - Linkedin
- `twitter` - Twitter account
- `website_url` - Website url
- `projects_limit` - Limit projects each user can create
- `extern_uid` - External UID
- `provider` - External provider name
- `bio` - User's bio
- `admin` (optional) - User is admin - true or false (default)
- `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.
- `email` - Email
- `username` - Username
- `name` - Name
- `password` - Password
- `skype` - Skype ID
- `linkedin` - LinkedIn
- `twitter` - Twitter account
- `website_url` - Website URL
- `projects_limit` - Limit projects each user can create
- `extern_uid` - External UID
- `provider` - External provider name
- `bio` - User's biography
- `admin` (optional) - User is admin - true or false (default)
- `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.
## 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
......@@ -310,7 +314,7 @@ POST /user/keys
Parameters:
- `title` (required) - new SSH Key's title
- `key` (required) - new SSH key
- `key` (required) - new SSH key
## Add SSH key for user
......@@ -322,15 +326,17 @@ POST /users/:id/keys
Parameters:
- `id` (required) - id of specified user
- `id` (required) - id of specified user
- `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.
## 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
......@@ -351,6 +357,6 @@ DELETE /users/:uid/keys/:id
Parameters:
- `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.
......@@ -16,7 +16,6 @@ If a user is a GitLab administrator they receive all permissions.
| Pull project code | | ✓ | ✓ | ✓ | ✓ |
| Download project | | ✓ | ✓ | ✓ | ✓ |
| Create code snippets | | ✓ | ✓ | ✓ | ✓ |
| Create new milestones | | | ✓ | ✓ | ✓ |
| Create new merge request | | | ✓ | ✓ | ✓ |
| Create new branches | | | ✓ | ✓ | ✓ |
| Push to non-protected branches | | | ✓ | ✓ | ✓ |
......@@ -24,6 +23,7 @@ If a user is a GitLab administrator they receive all permissions.
| Add tags | | | ✓ | ✓ | ✓ |
| Write a wiki | | | ✓ | ✓ | ✓ |
| Manage issue tracker | | | ✓ | ✓ | ✓ |
| Create new milestones | | | | ✓ | ✓ |
| Add new team members | | | | ✓ | ✓ |
| Push to protected branches | | | | ✓ | ✓ |
| Enable/Disable branch protection | | | | ✓ | ✓ |
......
......@@ -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.
# **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.
### **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**
......@@ -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'
```
### **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.
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:
......@@ -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.
### **9. Tweet**
### **4. Tweet**
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 **
### **1. 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.
### **2. Q&A**
### **1. Q&A**
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
**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.
......
......@@ -31,3 +31,8 @@ Feature: Project Redirects
And I click on "Sign In"
And Authenticate
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
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('expires at Aug 20, 2014')
page.should have_content('Project milestone has no description')
end
step 'I should see group milestone with all issues and MRs assigned to that milestone' do
......
......@@ -61,8 +61,7 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
Then 'I see big commit warning' do
page.should have_content BigCommits::BIG_COMMIT_MESSAGE
page.should have_content "Warning! This is a large diff"
page.should have_content "If you still want to see the diff"
page.should have_content "Too many changes"
end
Given 'I visit huge commit page' do
......@@ -71,8 +70,6 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
Then 'I see huge commit message' do
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
Given 'I visit a commit with an image that changed' do
......
......@@ -41,7 +41,6 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
step 'Authenticate' do
admin = create(:admin)
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_password", with: admin.password
click_button "Sign in"
......@@ -53,5 +52,19 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps
page.current_path.should == "/#{project.path_with_namespace}"
page.status_code.should == 200
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 Satellite
class BranchesWithoutParent < StandardError; end
class CompareAction < Action
def initialize(user, target_project, target_branch, source_project, source_branch)
super user, target_project
......@@ -22,7 +24,7 @@ module Gitlab
diffs
end
rescue Grit::Git::CommandFailed => ex
handle_exception(ex)
raise BranchesWithoutParent
end
# Retrieve an array of commits between the source and the target
......
......@@ -53,7 +53,7 @@ module Gitlab
File.open(lock_file, "w+") do |f|
begin
f.flock File::LOCK_EX
Dir.chdir(path) { return yield }
yield
ensure
f.flock File::LOCK_UN
end
......
......@@ -62,5 +62,23 @@ describe ProjectTeam do
it { project.team.master?(nonmember).should be_false }
end
end
end
describe :max_invited_level do
let(:group) { create(:group) }
let(:project) { create(:empty_project) }
before do
project.project_group_links.create(
group: group,
group_access: Gitlab::Access::DEVELOPER
)
group.add_user(master, Gitlab::Access::MASTER)
group.add_user(reporter, Gitlab::Access::REPORTER)
end
it { project.team.max_invited_level(master.id).should == Gitlab::Access::DEVELOPER }
it { project.team.max_invited_level(reporter.id).should == Gitlab::Access::REPORTER }
it { project.team.max_invited_level(nonmember.id).should be_nil }
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