Commit 270bc4bd authored by Valery Sizov's avatar Valery Sizov

Merge remote-tracking branch 'origin/master' into ce_upstream

parents ed4b49b8 7c809985
...@@ -91,7 +91,7 @@ class Dispatcher ...@@ -91,7 +91,7 @@ class Dispatcher
new TreeView() new TreeView()
when 'projects:find_file:show' when 'projects:find_file:show'
shortcut_handler = true shortcut_handler = true
when 'projects:blob:show' when 'projects:blob:show', 'projects:blame:show'
new LineHighlighter() new LineHighlighter()
shortcut_handler = new ShortcutsNavigation() shortcut_handler = new ShortcutsNavigation()
when 'projects:labels:new', 'projects:labels:edit' when 'projects:labels:new', 'projects:labels:edit'
......
...@@ -146,6 +146,7 @@ class @MergeRequestTabs ...@@ -146,6 +146,7 @@ class @MergeRequestTabs
success: (data) => success: (data) =>
document.querySelector("div#diffs").innerHTML = data.html document.querySelector("div#diffs").innerHTML = data.html
$('div#diffs .js-syntax-highlight').syntaxHighlight() $('div#diffs .js-syntax-highlight').syntaxHighlight()
@expandViewContainer() if @diffViewType() is 'parallel'
@diffsLoaded = true @diffsLoaded = true
@scrollToElement("#diffs") @scrollToElement("#diffs")
...@@ -177,3 +178,10 @@ class @MergeRequestTabs ...@@ -177,3 +178,10 @@ class @MergeRequestTabs
options = $.extend({}, defaults, options) options = $.extend({}, defaults, options)
$.ajax(options) $.ajax(options)
# Returns diff view type
diffViewType: ->
$('.inline-parallel-buttons a.active').data('view-type')
expandViewContainer: ->
$('.container-fluid').removeClass('container-limited')
...@@ -386,7 +386,6 @@ table { ...@@ -386,7 +386,6 @@ table {
} }
.project-item-select-holder { .project-item-select-holder {
display: inline-block;
position: relative; position: relative;
.project-item-select { .project-item-select {
......
...@@ -77,6 +77,7 @@ header { ...@@ -77,6 +77,7 @@ header {
line-height: $header-height; line-height: $header-height;
font-weight: normal; font-weight: normal;
color: #4c4e54; color: #4c4e54;
overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
vertical-align: top; vertical-align: top;
white-space: nowrap; white-space: nowrap;
......
...@@ -44,8 +44,10 @@ ...@@ -44,8 +44,10 @@
white-space: nowrap; white-space: nowrap;
i { i {
float: left;
margin-top: 3px;
margin-right: 5px;
visibility: hidden; visibility: hidden;
@extend .pull-left;
} }
&:hover i { &:hover i {
......
...@@ -6,31 +6,28 @@ ...@@ -6,31 +6,28 @@
.status-box { .status-box {
@include border-radius(3px); @include border-radius(3px);
display: block; display: block;
float: left; float: left;
padding: 0 $gl-btn-padding; padding: 0 $gl-btn-padding;
font-weight: normal; margin-top: 5px;
margin-right: 10px; margin-right: 10px;
color: #FFF;
font-size: $gl-font-size; font-size: $gl-font-size;
line-height: 25px;
&.status-box-closed { &.status-box-closed {
background-color: $gl-danger; background-color: $gl-danger;
color: #FFF;
} }
&.status-box-merged { &.status-box-merged {
background-color: $gl-primary; background-color: $gl-primary;
color: #FFF;
} }
&.status-box-open { &.status-box-open {
background-color: $green-light; background-color: $green-light;
color: #FFF;
} }
&.status-box-expired { &.status-box-expired {
background: #cea61b; background: #cea61b;
color: #FFF;
} }
} }
...@@ -64,7 +64,6 @@ ...@@ -64,7 +64,6 @@
// This prevents the mess when resizing the sidebar // This prevents the mess when resizing the sidebar
// of elements repositioning themselves.. // of elements repositioning themselves..
width: $gutter_inner_width; width: $gutter_inner_width;
overflow-x: hidden;
// -- // --
&:first-child { &:first-child {
...@@ -90,7 +89,6 @@ ...@@ -90,7 +89,6 @@
.gutter-toggle { .gutter-toggle {
margin-left: 20px; margin-left: 20px;
border-left: 1px solid $border-gray-light;
padding-left: 10px; padding-left: 10px;
&:hover { &:hover {
...@@ -157,11 +155,10 @@ ...@@ -157,11 +155,10 @@
.right-sidebar { .right-sidebar {
position: fixed; position: fixed;
top: 58px; top: 58px;
bottom: 0;
right: 0; right: 0;
height: 100%; transition: width .3s;
transition-duration: .3s;
background: $gray-light; background: $gray-light;
overflow: scroll;
padding: 10px 20px; padding: 10px 20px;
&.right-sidebar-expanded { &.right-sidebar-expanded {
...@@ -170,6 +167,14 @@ ...@@ -170,6 +167,14 @@
hr { hr {
display: none; display: none;
} }
.sidebar-collapsed-icon {
display: none;
}
.gutter-toggle {
border-left: 1px solid $border-gray-light;
}
} }
.subscribe-button { .subscribe-button {
...@@ -181,7 +186,6 @@ ...@@ -181,7 +186,6 @@
&.right-sidebar-collapsed { &.right-sidebar-collapsed {
width: $sidebar_collapsed_width; width: $sidebar_collapsed_width;
padding-top: 0; padding-top: 0;
overflow-x: hidden;
hr { hr {
margin: 0; margin: 0;
...@@ -192,21 +196,13 @@ ...@@ -192,21 +196,13 @@
} }
.block { .block {
border-bottom: none; width: $sidebar_collapsed_width - 1px;
margin-left: -19px;
padding: 15px 0 0 0; padding: 15px 0 0 0;
} border-bottom: none;
} overflow: hidden;
.btn {
background: $gray-normal;
border: 1px solid $border-gray-normal;
&:hover {
background: $gray-dark;
border: 1px solid $border-gray-dark;
}
} }
&.right-sidebar-collapsed {
.issuable-count, .issuable-count,
.issuable-nav, .issuable-nav,
.assignee > *, .assignee > *,
...@@ -219,15 +215,13 @@ ...@@ -219,15 +215,13 @@
} }
.gutter-toggle { .gutter-toggle {
margin-left: -$gutter_inner_width + 4; margin-left: -36px;
} }
.sidebar-collapsed-icon { .sidebar-collapsed-icon {
display: block; display: block;
float: left; width: 100%;
width: 62px;
text-align: center; text-align: center;
margin-left: -19px;
padding-bottom: 10px; padding-bottom: 10px;
color: #999999; color: #999999;
...@@ -247,14 +241,15 @@ ...@@ -247,14 +241,15 @@
color: #999999; color: #999999;
} }
} }
} }
} }
&.right-sidebar-expanded { .btn {
.sidebar-collapsed-icon { background: $gray-normal;
display: none; border: 1px solid $border-gray-normal;
&:hover {
background: $gray-dark;
border: 1px solid $border-gray-dark;
} }
} }
} }
......
...@@ -130,7 +130,7 @@ module CommitsHelper ...@@ -130,7 +130,7 @@ module CommitsHelper
if can_collaborate_with_project? if can_collaborate_with_project?
content_tag :span, 'data-toggle' => 'modal', 'data-target' => '#modal-revert-commit' do content_tag :span, 'data-toggle' => 'modal', 'data-target' => '#modal-revert-commit' do
link_to 'Revert', '#modal-revert-commit', 'data-toggle' => 'tooltip', title: tooltip, class: "btn btn-default btn-grouped btn-#{btn_class}" link_to 'Revert', '#modal-revert-commit', 'data-toggle' => 'tooltip', 'data-container' => 'body', title: tooltip, class: "btn btn-default btn-grouped btn-#{btn_class}"
end end
elsif can?(current_user, :fork_project, @project) elsif can?(current_user, :fork_project, @project)
continue_params = { continue_params = {
...@@ -142,7 +142,7 @@ module CommitsHelper ...@@ -142,7 +142,7 @@ module CommitsHelper
namespace_key: current_user.namespace.id, namespace_key: current_user.namespace.id,
continue: continue_params) continue: continue_params)
link_to 'Revert', fork_path, class: 'btn btn-grouped btn-close', method: :post, 'data-toggle' => 'tooltip', title: tooltip link_to 'Revert', fork_path, class: 'btn btn-grouped btn-close', method: :post, 'data-toggle' => 'tooltip', 'data-container' => 'body', title: tooltip
end end
end end
......
...@@ -137,7 +137,7 @@ module DiffHelper ...@@ -137,7 +137,7 @@ module DiffHelper
# Always use HTML to handle case where JSON diff rendered this button # Always use HTML to handle case where JSON diff rendered this button
params_copy.delete(:format) params_copy.delete(:format)
link_to url_for(params_copy), id: "#{name}-diff-btn", class: (selected ? 'btn active' : 'btn') do link_to url_for(params_copy), id: "#{name}-diff-btn", class: (selected ? 'btn active' : 'btn'), data: { view_type: name } do
title title
end end
end end
......
...@@ -23,6 +23,7 @@ module NavHelper ...@@ -23,6 +23,7 @@ module NavHelper
if current_path?('merge_requests#show') || if current_path?('merge_requests#show') ||
current_path?('merge_requests#diffs') || current_path?('merge_requests#diffs') ||
current_path?('merge_requests#commits') || current_path?('merge_requests#commits') ||
current_path?('merge_requests#builds') ||
current_path?('issues#show') current_path?('issues#show')
if cookies[:collapsed_gutter] == 'true' if cookies[:collapsed_gutter] == 'true'
"page-gutter right-sidebar-collapsed" "page-gutter right-sidebar-collapsed"
......
...@@ -232,7 +232,7 @@ class Commit ...@@ -232,7 +232,7 @@ class Commit
end end
def reverts_commit?(commit) def reverts_commit?(commit)
description.include?(commit.revert_description) description? && description.include?(commit.revert_description)
end end
def merge_commit? def merge_commit?
......
...@@ -24,12 +24,16 @@ module MergeRequests ...@@ -24,12 +24,16 @@ module MergeRequests
merge_requests.each do |merge_request| merge_requests.each do |merge_request|
next unless merge_request.merge_when_build_succeeds? next unless merge_request.merge_when_build_succeeds?
next unless merge_request.mergeable?
ci_commit = merge_request.ci_commit
next unless ci_commit
next unless ci_commit.sha == commit_status.sha
next unless ci_commit.success?
if merge_request.ci_commit && merge_request.ci_commit.success? && merge_request.mergeable?
MergeWorker.perform_async(merge_request.id, merge_request.merge_user_id, merge_request.merge_params) MergeWorker.perform_async(merge_request.id, merge_request.merge_user_id, merge_request.merge_params)
end end
end end
end
# Cancels the automatic merge # Cancels the automatic merge
def cancel(merge_request) def cancel(merge_request)
...@@ -51,6 +55,8 @@ module MergeRequests ...@@ -51,6 +55,8 @@ module MergeRequests
# This is for ref-less builds # This is for ref-less builds
branches ||= @project.repository.branch_names_contains(commit_status.sha) branches ||= @project.repository.branch_names_contains(commit_status.sha)
return [] if branches.blank?
merge_requests = @project.origin_merge_requests.opened.where(source_branch: branches).to_a merge_requests = @project.origin_merge_requests.opened.where(source_branch: branches).to_a
merge_requests += @project.fork_merge_requests.opened.where(source_branch: branches).to_a merge_requests += @project.fork_merge_requests.opened.where(source_branch: branches).to_a
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
= favicon_link_tag 'touch-icon-ipad.png', rel: 'apple-touch-icon', sizes: '76x76' = favicon_link_tag 'touch-icon-ipad.png', rel: 'apple-touch-icon', sizes: '76x76'
= favicon_link_tag 'touch-icon-iphone-retina.png', rel: 'apple-touch-icon', sizes: '120x120' = favicon_link_tag 'touch-icon-iphone-retina.png', rel: 'apple-touch-icon', sizes: '120x120'
= favicon_link_tag 'touch-icon-ipad-retina.png', rel: 'apple-touch-icon', sizes: '152x152' = favicon_link_tag 'touch-icon-ipad-retina.png', rel: 'apple-touch-icon', sizes: '152x152'
%link{rel: 'mask-icon', href: image_path('logo.svg'), color: 'rgb(226, 67, 41)'}
-# Windows 8 pinned site tile -# Windows 8 pinned site tile
%meta{name: 'msapplication-TileImage', content: image_path('msapplication-tile.png')} %meta{name: 'msapplication-TileImage', content: image_path('msapplication-tile.png')}
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
%h3.page-title Blame view %h3.page-title Blame view
#tree-holder.tree-holder #blob-content-holder.tree-holder
.file-holder .file-holder
.file-title .file-title
= blob_icon @blob.mode, @blob.name = blob_icon @blob.mode, @blob.name
...@@ -33,7 +33,9 @@ ...@@ -33,7 +33,9 @@
%td.line-numbers %td.line-numbers
- line_count = blame_group[:lines].count - line_count = blame_group[:lines].count
- (current_line...(current_line + line_count)).each do |i| - (current_line...(current_line + line_count)).each do |i|
%a.diff-line-num= i %a.diff-line-num{href: "#L#{i}", id: "L#{i}", 'data-line-number' => i}
= icon("link")
= i
\ \
- current_line += line_count - current_line += line_count
%td.lines %td.lines
......
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
%span %span
= icon('star') = icon('star')
= project.star_count = project.star_count
%span.visibility-icon.has_tooltip{data: { container: 'body', placement: 'left' },
title: "#{visibility_level_label(project.visibility_level)} - #{project_visibility_level_description(project.visibility_level)}"}
= visibility_level_icon(project.visibility_level, fw: false)
- if show_last_commit_as_description - if show_last_commit_as_description
.project-description .project-description
= link_to_gfm project.commit.title, namespace_project_commit_path(project.namespace, project, project.commit), = link_to_gfm project.commit.title, namespace_project_commit_path(project.namespace, project, project.commit),
......
...@@ -169,6 +169,7 @@ Settings.omniauth['auto_sign_in_with_provider'] = false if Settings.omniauth['au ...@@ -169,6 +169,7 @@ Settings.omniauth['auto_sign_in_with_provider'] = false if Settings.omniauth['au
Settings.omniauth['allow_single_sign_on'] = false if Settings.omniauth['allow_single_sign_on'].nil? Settings.omniauth['allow_single_sign_on'] = false if Settings.omniauth['allow_single_sign_on'].nil?
Settings.omniauth['block_auto_created_users'] = true if Settings.omniauth['block_auto_created_users'].nil? Settings.omniauth['block_auto_created_users'] = true if Settings.omniauth['block_auto_created_users'].nil?
Settings.omniauth['auto_link_ldap_user'] = false if Settings.omniauth['auto_link_ldap_user'].nil? Settings.omniauth['auto_link_ldap_user'] = false if Settings.omniauth['auto_link_ldap_user'].nil?
Settings.omniauth['auto_link_saml_user'] = false if Settings.omniauth['auto_link_saml_user'].nil?
Settings.omniauth['providers'] ||= [] Settings.omniauth['providers'] ||= []
Settings.omniauth['cas3'] ||= Settingslogic.new({}) Settings.omniauth['cas3'] ||= Settingslogic.new({})
......
...@@ -257,6 +257,8 @@ Example of response ...@@ -257,6 +257,8 @@ Example of response
## Get build artifacts ## Get build artifacts
> [Introduced][ce-2893] in GitLab 8.5
Get build artifacts of a project Get build artifacts of a project
``` ```
...@@ -279,6 +281,8 @@ Response: ...@@ -279,6 +281,8 @@ Response:
| 200 | Serves the artifacts file | | 200 | Serves the artifacts file |
| 404 | Build not found or no artifacts | | 404 | Build not found or no artifacts |
[ce-2893]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2893
## Cancel a build ## Cancel a build
Cancel a single build of a project Cancel a single build of a project
......
# Runners API # Runners API
> [Introduced][ce-2640] in GitLab 8.5
[ce-2640]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2640
## List owned runners ## List owned runners
Get a list of specific runners available to the user. Get a list of specific runners available to the user.
......
...@@ -124,7 +124,7 @@ In GitLab, Runners run the builds that you define in `.gitlab-ci.yml`. ...@@ -124,7 +124,7 @@ In GitLab, Runners run the builds that you define in `.gitlab-ci.yml`.
A Runner can be a virtual machine, a VPS, a bare-metal machine, a docker A Runner can be a virtual machine, a VPS, a bare-metal machine, a docker
container or even a cluster of containers. GitLab and the Runners communicate container or even a cluster of containers. GitLab and the Runners communicate
through an API, so the only needed requirement is that the machine on which the through an API, so the only needed requirement is that the machine on which the
Runner is configured to has Internet access. Runner is configured to have Internet access.
A Runner can be specific to a certain project or serve multiple projects in A Runner can be specific to a certain project or serve multiple projects in
GitLab. If it serves all projects it's called a _Shared Runner_. GitLab. If it serves all projects it's called a _Shared Runner_.
......
...@@ -67,8 +67,8 @@ You need at least 2GB of addressable memory (RAM + swap) to install and use GitL ...@@ -67,8 +67,8 @@ You need at least 2GB of addressable memory (RAM + swap) to install and use GitL
With less memory GitLab will give strange errors during the reconfigure run and 500 errors during usage. With less memory GitLab will give strange errors during the reconfigure run and 500 errors during usage.
- 512MB RAM + 1.5GB of swap is the absolute minimum but we strongly **advise against** this amount of memory. See the unicorn worker section below for more advice. - 512MB RAM + 1.5GB of swap is the absolute minimum but we strongly **advise against** this amount of memory. See the unicorn worker section below for more advice.
- 1GB RAM + 1GB swap supports up to 100 users but it will be slow - 1GB RAM + 1GB swap supports up to 100 users but it will be very slow
- **2GB RAM** is the **recommended** memory size and supports up to 100 users - **2GB RAM** is the **recommended** memory size for all installations and supports up to 100 users
- 4GB RAM supports up to 1,000 users - 4GB RAM supports up to 1,000 users
- 8GB RAM supports up to 2,000 users - 8GB RAM supports up to 2,000 users
- 16GB RAM supports up to 4,000 users - 16GB RAM supports up to 4,000 users
......
...@@ -16,7 +16,7 @@ It offers a simple, transparent and effective way to work with git. ...@@ -16,7 +16,7 @@ It offers a simple, transparent and effective way to work with git.
![Four stages (working copy, index, local repo, remote repo) and three steps between them](four_stages.png) ![Four stages (working copy, index, local repo, remote repo) and three steps between them](four_stages.png)
When converting to git you have to get used to the fact that there are three steps before a commit is shared with colleagues. When converting to git you have to get used to the fact that there are three steps before a commit is shared with colleagues.
Most version control systems have only step, committing from the working copy to a shared server. Most version control systems have only one step, committing from the working copy to a shared server.
In git you add files from the working copy to the staging area. After that you commit them to the local repo. In git you add files from the working copy to the staging area. After that you commit them to the local repo.
The third step is pushing to a shared remote repository. The third step is pushing to a shared remote repository.
After getting used to these three steps the branching model becomes the challenge. After getting used to these three steps the branching model becomes the challenge.
......
...@@ -118,4 +118,38 @@ eos ...@@ -118,4 +118,38 @@ eos
it { expect(data[:modified]).to eq([".gitmodules"]) } it { expect(data[:modified]).to eq([".gitmodules"]) }
it { expect(data[:removed]).to eq([]) } it { expect(data[:removed]).to eq([]) }
end end
describe '#reverts_commit?' do
let(:another_commit) { double(:commit, revert_description: "This reverts commit #{commit.sha}") }
it { expect(commit.reverts_commit?(another_commit)).to be_falsy }
context 'commit has no description' do
before { allow(commit).to receive(:description?).and_return(false) }
it { expect(commit.reverts_commit?(another_commit)).to be_falsy }
end
context "another_commit's description does not revert commit" do
before { allow(commit).to receive(:description).and_return("Foo Bar") }
it { expect(commit.reverts_commit?(another_commit)).to be_falsy }
end
context "another_commit's description reverts commit" do
before { allow(commit).to receive(:description).and_return("Foo #{another_commit.revert_description} Bar") }
it { expect(commit.reverts_commit?(another_commit)).to be_truthy }
end
context "another_commit's description reverts merged merge request" do
before do
revert_description = "This reverts merge request !foo123"
allow(another_commit).to receive(:revert_description).and_return(revert_description)
allow(commit).to receive(:description).and_return("Foo #{another_commit.revert_description} Bar")
end
it { expect(commit.reverts_commit?(another_commit)).to be_truthy }
end
end
end end
...@@ -66,9 +66,25 @@ describe MergeRequests::MergeWhenBuildSucceedsService do ...@@ -66,9 +66,25 @@ describe MergeRequests::MergeWhenBuildSucceedsService do
end end
end end
context 'triggered by an old build' do
let(:old_build) { create(:ci_build, ref: mr_merge_if_green_enabled.source_branch, status: "success") }
let(:build) { create(:ci_build, ref: mr_merge_if_green_enabled.source_branch, status: "success") }
it "merges all merge requests with merge when build succeeds enabled" do
allow_any_instance_of(MergeRequest).to receive(:ci_commit).and_return(ci_commit)
allow(ci_commit).to receive(:success?).and_return(true)
allow(old_build).to receive(:sha).and_return('1234abcdef')
expect(MergeWorker).to_not receive(:perform_async)
service.trigger(old_build)
end
end
context 'commit status without ref' do context 'commit status without ref' do
let(:commit_status) { create(:generic_commit_status, status: 'success') } let(:commit_status) { create(:generic_commit_status, status: 'success') }
before { mr_merge_if_green_enabled }
it "doesn't merge a requests for status on other branch" do it "doesn't merge a requests for status on other branch" do
allow(project.repository).to receive(:branch_names_contains).with(commit_status.sha).and_return([]) allow(project.repository).to receive(:branch_names_contains).with(commit_status.sha).and_return([])
......
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