Commit c3d78515 authored by Nick Thomas's avatar Nick Thomas

Merge remote-tracking branch 'ce/master' into ce-to-ee-2017-08-10

parents b5dbe0ba 0ff2f664
Remove this section and replace it with a description of your MR. Also follow the
checklist below and check off any tasks that are done. If a certain task can not
be done you should explain so in the MR body. You are free to remove any
sections that do not apply to your MR.
When gathering statistics (e.g. the output of `EXPLAIN ANALYZE`) you should make
sure your database has enough data. Having around 10 000 rows in the tables
being queries should provide a reasonable estimate of how a query will behave.
Also make sure that PostgreSQL uses the following settings:
* `random_page_cost`: `1`
* `work_mem`: `16MB`
* `maintenance_work_mem`: at least `64MB`
* `shared_buffers`: at least `256MB`
If you have access to GitLab.com's staging environment you should also run your
measurements there, and include the results in this MR.
## Database Checklist
When adding migrations:
- [ ] Updated `db/schema.rb`
- [ ] Added a `down` method so the migration can be reverted
- [ ] Added the output of the migration(s) to the MR body
- [ ] Added the execution time of the migration(s) to the MR body
- [ ] Added tests for the migration in `spec/migrations` if necessary (e.g. when
migrating data)
- [ ] Made sure the migration won't interfere with a running GitLab cluster,
for example by disabling transactions for long running migrations
When adding or modifying queries to improve performance:
- [ ] Included the raw SQL queries of the relevant queries
- [ ] Included the output of `EXPLAIN ANALYZE` and execution timings of the
relevant queries
- [ ] Added tests for the relevant changes
When adding indexes:
- [ ] Described the need for these indexes in the MR body
- [ ] Made sure existing indexes can not be reused instead
When adding foreign keys to existing tables:
- [ ] Included a migration to remove orphaned rows in the source table
- [ ] Removed any instances of `dependent: ...` that may no longer be necessary
When adding tables:
- [ ] Ordered columns based on their type sizes in descending order
- [ ] Added foreign keys if necessary
- [ ] Added indexes if necessary
When removing columns, tables, indexes or other structures:
- [ ] Removed these in a post-deployment migration
- [ ] Made sure the application no longer uses (or ignores) these structures
## General Checklist
- [ ] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added, if necessary
- [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- [ ] Tests added for this feature/bug
- Review
- [ ] Has been reviewed by UX
- [ ] Has been reviewed by Frontend
- [ ] Has been reviewed by Backend
- [ ] Has been reviewed by Database
- [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
...@@ -773,6 +773,7 @@ GEM ...@@ -773,6 +773,7 @@ GEM
rubocop-gitlab-security (0.0.6) rubocop-gitlab-security (0.0.6)
rubocop (>= 0.47.1) rubocop (>= 0.47.1)
rubocop-rspec (1.15.1) rubocop-rspec (1.15.1)
rubocop (>= 0.42.0)
ruby-fogbugz (0.2.1) ruby-fogbugz (0.2.1)
crack (~> 0.4) crack (~> 0.4)
ruby-prof (0.16.2) ruby-prof (0.16.2)
......
...@@ -82,6 +82,7 @@ import initNotes from './init_notes'; ...@@ -82,6 +82,7 @@ import initNotes from './init_notes';
import initLegacyFilters from './init_legacy_filters'; import initLegacyFilters from './init_legacy_filters';
import initIssuableSidebar from './init_issuable_sidebar'; import initIssuableSidebar from './init_issuable_sidebar';
import UserFeatureHelper from './helpers/user_feature_helper'; import UserFeatureHelper from './helpers/user_feature_helper';
import initChangesDropdown from './init_changes_dropdown';
// EE-only // EE-only
import ApproversSelect from './approvers_select'; import ApproversSelect from './approvers_select';
...@@ -255,6 +256,7 @@ import initGroupAnalytics from './init_group_analytics'; ...@@ -255,6 +256,7 @@ import initGroupAnalytics from './init_group_analytics';
break; break;
case 'projects:compare:show': case 'projects:compare:show':
new gl.Diff(); new gl.Diff();
initChangesDropdown();
break; break;
case 'projects:branches:new': case 'projects:branches:new':
case 'projects:branches:create': case 'projects:branches:create':
...@@ -348,6 +350,7 @@ import initGroupAnalytics from './init_group_analytics'; ...@@ -348,6 +350,7 @@ import initGroupAnalytics from './init_group_analytics';
container: '.js-commit-pipeline-graph', container: '.js-commit-pipeline-graph',
}).bindEvents(); }).bindEvents();
initNotes(); initNotes();
initChangesDropdown();
$('.commit-info.branches').load(document.querySelector('.js-commit-box').dataset.commitPath); $('.commit-info.branches').load(document.querySelector('.js-commit-box').dataset.commitPath);
break; break;
case 'projects:commit:pipelines': case 'projects:commit:pipelines':
......
...@@ -49,7 +49,8 @@ export const hideSubLevelItems = (el) => { ...@@ -49,7 +49,8 @@ export const hideSubLevelItems = (el) => {
el.classList.remove('is-showing-fly-out'); el.classList.remove('is-showing-fly-out');
el.classList.remove('is-over'); el.classList.remove('is-over');
subItems.style.display = 'none'; subItems.style.display = '';
subItems.style.transform = '';
subItems.classList.remove('is-above'); subItems.classList.remove('is-above');
}; };
......
import stickyMonitor from './lib/utils/sticky';
export default () => {
stickyMonitor(document.querySelector('.js-diff-files-changed'));
$('.js-diff-stats-dropdown').glDropdown({
filterable: true,
remoteFilter: false,
});
};
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
label: 'New issue', label: 'New issue',
path: this.job.new_issue_path, path: this.job.new_issue_path,
cssClass: 'js-new-issue btn btn-new btn-inverted visible-md-block visible-lg-block', cssClass: 'js-new-issue btn btn-new btn-inverted visible-md-block visible-lg-block',
type: 'ujs-link', type: 'link',
}); });
} }
......
...@@ -7,7 +7,7 @@ import Cookies from 'js-cookie'; ...@@ -7,7 +7,7 @@ import Cookies from 'js-cookie';
import './breakpoints'; import './breakpoints';
import './flash'; import './flash';
import BlobForkSuggestion from './blob/blob_fork_suggestion'; import BlobForkSuggestion from './blob/blob_fork_suggestion';
import stickyMonitor from './lib/utils/sticky'; import initChangesDropdown from './init_changes_dropdown';
/* eslint-disable max-len */ /* eslint-disable max-len */
// MergeRequestTabs // MergeRequestTabs
...@@ -267,9 +267,7 @@ import stickyMonitor from './lib/utils/sticky'; ...@@ -267,9 +267,7 @@ import stickyMonitor from './lib/utils/sticky';
const $container = $('#diffs'); const $container = $('#diffs');
$container.html(data.html); $container.html(data.html);
this.initChangesDropdown(); initChangesDropdown();
stickyMonitor(document.querySelector('.js-diff-files-changed'));
if (typeof gl.diffNotesCompileComponents !== 'undefined') { if (typeof gl.diffNotesCompileComponents !== 'undefined') {
gl.diffNotesCompileComponents(); gl.diffNotesCompileComponents();
...@@ -319,13 +317,6 @@ import stickyMonitor from './lib/utils/sticky'; ...@@ -319,13 +317,6 @@ import stickyMonitor from './lib/utils/sticky';
}); });
} }
initChangesDropdown() {
$('.js-diff-stats-dropdown').glDropdown({
filterable: true,
remoteFilter: false,
});
}
// Show or hide the loading spinner // Show or hide the loading spinner
// //
// status - Boolean, true to show, false to hide // status - Boolean, true to show, false to hide
......
import _ from 'underscore'; import _ from 'underscore';
import Cookies from 'js-cookie';
export default { export default {
init() { init() {
if (!this.initialized) { if (!this.initialized) {
if (Cookies.get('new_nav') === 'true' && $('.js-issuable-sidebar').length) return;
this.$window = $(window); this.$window = $(window);
this.$rightSidebar = $('.js-right-sidebar'); this.$rightSidebar = $('.js-right-sidebar');
this.$navHeight = $('.navbar-gitlab').outerHeight() + this.$navHeight = $('.navbar-gitlab').outerHeight() +
......
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
</a> </a>
<a <a
v-if="action.type === 'ujs-link'" v-else-if="action.type === 'ujs-link'"
:href="action.path" :href="action.path"
data-method="post" data-method="post"
rel="nofollow" rel="nofollow"
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
</a> </a>
<button <button
v-else="action.type === 'button'" v-else-if="action.type === 'button'"
@click="onClickAction(action)" @click="onClickAction(action)"
:disabled="action.isLoading" :disabled="action.isLoading"
:class="action.cssClass" :class="action.cssClass"
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
font-family: $monospace_font; font-family: $monospace_font;
display: block; display: block;
font-size: $code_font_size !important; font-size: $code_font_size !important;
line-height: 19px; min-height: 19px;
white-space: nowrap; white-space: nowrap;
i { i {
......
...@@ -218,6 +218,10 @@ $new-sidebar-collapsed-width: 50px; ...@@ -218,6 +218,10 @@ $new-sidebar-collapsed-width: 50px;
&:hover { &:hover {
color: $gl-text-color; color: $gl-text-color;
svg {
fill: $gl-text-color;
}
} }
} }
......
...@@ -574,10 +574,14 @@ ...@@ -574,10 +574,14 @@
@media (min-width: $screen-sm-min) { @media (min-width: $screen-sm-min) {
position: -webkit-sticky; position: -webkit-sticky;
position: sticky; position: sticky;
top: 84px; top: 34px;
background-color: $white-light; background-color: $white-light;
z-index: 190; z-index: 190;
&.diff-files-changed-merge-request {
top: 84px;
}
+ .files, + .files,
+ .alert { + .alert {
margin-top: 1px; margin-top: 1px;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
.commit-box, .commit-box,
.info-well, .info-well,
.commit-ci-menu, .commit-ci-menu,
.files-changed, .files-changed-inner,
.limited-header-width, .limited-header-width,
.limited-width-notes { .limited-width-notes {
@extend .fixed-width-container; @extend .fixed-width-container;
......
...@@ -574,14 +574,14 @@ a.deploy-project-label { ...@@ -574,14 +574,14 @@ a.deploy-project-label {
&::before { &::before {
content: "OR"; content: "OR";
position: absolute; position: absolute;
left: 0; left: -10px;
top: 40%; top: 50%;
z-index: 10; z-index: 10;
padding: 8px 0; padding: 8px 0;
text-align: center; text-align: center;
background-color: $white-light; background-color: $white-light;
color: $gl-text-color-tertiary; color: $gl-text-color-tertiary;
transform: translateX(-50%); transform: translateY(-50%);
font-size: 12px; font-size: 12px;
font-weight: bold; font-weight: bold;
line-height: 20px; line-height: 20px;
...@@ -589,8 +589,8 @@ a.deploy-project-label { ...@@ -589,8 +589,8 @@ a.deploy-project-label {
// Mobile // Mobile
@media (max-width: $screen-xs-max) { @media (max-width: $screen-xs-max) {
left: 50%; left: 50%;
top: 10px; top: 0;
transform: translateY(-50%); transform: translateX(-50%);
padding: 0 8px; padding: 0 8px;
} }
} }
......
...@@ -260,18 +260,6 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -260,18 +260,6 @@ class Projects::IssuesController < Projects::ApplicationController
return render_404 unless @project.feature_available?(:issues, current_user) return render_404 unless @project.feature_available?(:issues, current_user)
end end
def redirect_to_external_issue_tracker
external = @project.external_issue_tracker
return unless external
if action_name == 'new'
redirect_to external.new_issue_path
else
redirect_to external.issue_tracker_path
end
end
def issue_params def issue_params
params.require(:issue).permit(*issue_params_attributes) params.require(:issue).permit(*issue_params_attributes)
end end
......
...@@ -8,5 +8,13 @@ class RedirectRoute < ActiveRecord::Base ...@@ -8,5 +8,13 @@ class RedirectRoute < ActiveRecord::Base
presence: true, presence: true,
uniqueness: { case_sensitive: false } uniqueness: { case_sensitive: false }
scope :matching_path_and_descendants, -> (path) { where('redirect_routes.path = ? OR redirect_routes.path LIKE ?', path, "#{sanitize_sql_like(path)}/%") } scope :matching_path_and_descendants, -> (path) do
wheres = if Gitlab::Database.postgresql?
'LOWER(redirect_routes.path) = LOWER(?) OR LOWER(redirect_routes.path) LIKE LOWER(?)'
else
'redirect_routes.path = ? OR redirect_routes.path LIKE ?'
end
where(wheres, path, "#{sanitize_sql_like(path)}/%")
end
end end
...@@ -2,22 +2,24 @@ ...@@ -2,22 +2,24 @@
- show_whitespace_toggle = local_assigns.fetch(:show_whitespace_toggle, true) - show_whitespace_toggle = local_assigns.fetch(:show_whitespace_toggle, true)
- can_create_note = !@diff_notes_disabled && can?(current_user, :create_note, diffs.project) - can_create_note = !@diff_notes_disabled && can?(current_user, :create_note, diffs.project)
- diff_files = diffs.diff_files - diff_files = diffs.diff_files
- merge_request = local_assigns.fetch(:merge_request, false)
.content-block.oneline-block.files-changed.diff-files-changed.js-diff-files-changed .content-block.oneline-block.files-changed.diff-files-changed.js-diff-files-changed{ class: ("diff-files-changed-merge-request" if merge_request) }
.inline-parallel-buttons .files-changed-inner
- if !diffs_expanded? && diff_files.any? { |diff_file| diff_file.collapsed? } .inline-parallel-buttons
= link_to 'Expand all', url_for(params.merge(expanded: 1, format: nil)), class: 'btn btn-default' - if !diffs_expanded? && diff_files.any? { |diff_file| diff_file.collapsed? }
- if show_whitespace_toggle = link_to 'Expand all', url_for(params.merge(expanded: 1, format: nil)), class: 'btn btn-default'
- if current_controller?(:commit) - if show_whitespace_toggle
= commit_diff_whitespace_link(diffs.project, @commit, class: 'hidden-xs') - if current_controller?(:commit)
- elsif current_controller?('projects/merge_requests/diffs') = commit_diff_whitespace_link(diffs.project, @commit, class: 'hidden-xs')
= diff_merge_request_whitespace_link(diffs.project, @merge_request, class: 'hidden-xs') - elsif current_controller?('projects/merge_requests/diffs')
- elsif current_controller?(:compare) = diff_merge_request_whitespace_link(diffs.project, @merge_request, class: 'hidden-xs')
= diff_compare_whitespace_link(diffs.project, params[:from], params[:to], class: 'hidden-xs') - elsif current_controller?(:compare)
.btn-group = diff_compare_whitespace_link(diffs.project, params[:from], params[:to], class: 'hidden-xs')
= inline_diff_btn .btn-group
= parallel_diff_btn = inline_diff_btn
= render 'projects/diffs/stats', diff_files: diff_files = parallel_diff_btn
= render 'projects/diffs/stats', diff_files: diff_files
- if render_overflow_warning?(diff_files) - if render_overflow_warning?(diff_files)
= render 'projects/diffs/warning', diff_files: diffs = render 'projects/diffs/warning', diff_files: diffs
......
- if @merge_request_diff.collected? || @merge_request_diff.overflow? - if @merge_request_diff.collected? || @merge_request_diff.overflow?
= render 'projects/merge_requests/diffs/versions' = render 'projects/merge_requests/diffs/versions'
= render "projects/diffs/diffs", diffs: @diffs, environment: @environment = render "projects/diffs/diffs", diffs: @diffs, environment: @environment, merge_request: true
- elsif @merge_request_diff.empty? - elsif @merge_request_diff.empty?
.nothing-here-block Nothing to merge from #{@merge_request.source_branch} into #{@merge_request.target_branch} .nothing-here-block Nothing to merge from #{@merge_request.source_branch} into #{@merge_request.target_branch}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
= page_specific_javascript_bundle_tag('common_vue') = page_specific_javascript_bundle_tag('common_vue')
= page_specific_javascript_bundle_tag('sidebar') = page_specific_javascript_bundle_tag('sidebar')
%aside.right-sidebar.js-right-sidebar{ data: { "offset-top" => "50", "spy" => "affix", signed: { in: current_user.present? } }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite' } %aside.right-sidebar.js-right-sidebar.js-issuable-sidebar{ data: { "offset-top" => ("50" unless show_new_nav?), "spy" => ("affix" unless show_new_nav?), signed: { in: current_user.present? } }, class: sidebar_gutter_collapsed_class, 'aria-live' => 'polite' }
.issuable-sidebar{ data: { endpoint: "#{issuable_json_path(issuable)}" } } .issuable-sidebar{ data: { endpoint: "#{issuable_json_path(issuable)}" } }
- can_edit_issuable = can?(current_user, :"admin_#{issuable.to_ability_name}", @project) - can_edit_issuable = can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
.block.issuable-sidebar-header .block.issuable-sidebar-header
......
---
title: Fix the alignment of line numbers to lines of code in code viewer
merge_request: 13403
author: Trevor Flynn
\ No newline at end of file
---
title: Fixes new issue button for failed job returning 404
merge_request:
author:
---
title: Align OR separator to center in new project page
merge_request:
author:
---
title: Fix destroy of case-insensitive conflicting redirects
merge_request: 13357
author:
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
resource :repository, only: [:create] do resource :repository, only: [:create] do
member do member do
get ':ref/archive', constraints: { format: Gitlab::PathRegex.archive_formats_regex, ref: /.+/ }, action: 'archive', as: 'archive' get ':ref/archive', constraints: { format: Gitlab::PathRegex.archive_formats_regex, ref: /.+/ }, action: 'archive', as: 'archive'
# deprecated since GitLab 9.5
get 'archive', constraints: { format: Gitlab::PathRegex.archive_formats_regex }, as: 'archive_alternative'
end end
end end
......
...@@ -66,6 +66,9 @@ Install the required packages (needed to compile Ruby and native extensions to R ...@@ -66,6 +66,9 @@ Install the required packages (needed to compile Ruby and native extensions to R
sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libre2-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate python-docutils pkg-config cmake sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libre2-dev libreadline-dev libncurses5-dev libffi-dev curl openssh-server checkinstall libxml2-dev libxslt-dev libcurl4-openssl-dev libicu-dev logrotate python-docutils pkg-config cmake
Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but
you can [install re2 manually](https://github.com/google/re2/wiki/Install).
If you want to use Kerberos for user authentication, then install libkrb5-dev: If you want to use Kerberos for user authentication, then install libkrb5-dev:
sudo apt-get install libkrb5-dev sudo apt-get install libkrb5-dev
......
...@@ -264,6 +264,16 @@ sudo systemctl daemon-reload ...@@ -264,6 +264,16 @@ sudo systemctl daemon-reload
### 9. Install libs, migrations, etc. ### 9. Install libs, migrations, etc.
GitLab 9.0.11 [introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/24570)
a dependency on on the `re2` regular expression library. To install this dependency:
```bash
sudo apt-get install libre2-dev
```
Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but
you can [install re2 manually](https://github.com/google/re2/wiki/Install).
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
......
...@@ -264,6 +264,16 @@ sudo systemctl daemon-reload ...@@ -264,6 +264,16 @@ sudo systemctl daemon-reload
### 9. Install libs, migrations, etc. ### 9. Install libs, migrations, etc.
GitLab 9.1.8 [introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/24570)
a dependency on on the `re2` regular expression library. To install this dependency:
```bash
sudo apt-get install libre2-dev
```
Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but
you can [install re2 manually](https://github.com/google/re2/wiki/Install).
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
......
...@@ -222,6 +222,16 @@ sudo systemctl daemon-reload ...@@ -222,6 +222,16 @@ sudo systemctl daemon-reload
### 10. Install libs, migrations, etc. ### 10. Install libs, migrations, etc.
GitLab 9.2.8 [introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/24570)
a dependency on on the `re2` regular expression library. To install this dependency:
```bash
sudo apt-get install libre2-dev
```
Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but
you can [install re2 manually](https://github.com/google/re2/wiki/Install).
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
......
...@@ -258,6 +258,16 @@ sudo systemctl daemon-reload ...@@ -258,6 +258,16 @@ sudo systemctl daemon-reload
### 12. Install libs, migrations, etc. ### 12. Install libs, migrations, etc.
GitLab 9.3.8 [introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/24570)
a dependency on on the `re2` regular expression library. To install this dependency:
```bash
sudo apt-get install libre2-dev
```
Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but
you can [install re2 manually](https://github.com/google/re2/wiki/Install).
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
......
...@@ -271,6 +271,16 @@ sudo systemctl daemon-reload ...@@ -271,6 +271,16 @@ sudo systemctl daemon-reload
### 12. Install libs, migrations, etc. ### 12. Install libs, migrations, etc.
GitLab 9.4 [introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/24570)
a dependency on on the `re2` regular expression library. To install this dependency:
```bash
sudo apt-get install libre2-dev
```
Ubuntu 14.04 (Trusty Tahr) doesn't have the `libre2-dev` package available, but
you can [install re2 manually](https://github.com/google/re2/wiki/Install).
```bash ```bash
cd /home/git/gitlab cd /home/git/gitlab
......
...@@ -295,6 +295,10 @@ sudo -u git -H bundle clean ...@@ -295,6 +295,10 @@ sudo -u git -H bundle clean
# Run database migrations # Run database migrations
sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production
# Compile GetText PO files
sudo -u git -H bundle exec rake gettext:compile RAILS_ENV=production
# Update node dependencies and recompile assets # Update node dependencies and recompile assets
sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production sudo -u git -H bundle exec rake yarn:install gitlab:assets:clean gitlab:assets:compile RAILS_ENV=production NODE_ENV=production
......
...@@ -98,10 +98,11 @@ module Gitlab ...@@ -98,10 +98,11 @@ module Gitlab
if status.zero? if status.zero?
@ee_branch_found = ee_branch_prefix @ee_branch_found = ee_branch_prefix
else return
_, status = step("Fetching origin/#{ee_branch_suffix}", %W[git fetch origin #{ee_branch_suffix}])
end end
_, status = step("Fetching origin/#{ee_branch_suffix}", %W[git fetch origin #{ee_branch_suffix}])
if status.zero? if status.zero?
@ee_branch_found = ee_branch_suffix @ee_branch_found = ee_branch_suffix
else else
......
...@@ -10,7 +10,7 @@ module Gitlab ...@@ -10,7 +10,7 @@ module Gitlab
def exists? def exists?
request = Gitaly::RepositoryExistsRequest.new(repository: @gitaly_repo) request = Gitaly::RepositoryExistsRequest.new(repository: @gitaly_repo)
GitalyClient.call(@storage, :repository_service, :exists, request).exists GitalyClient.call(@storage, :repository_service, :repository_exists, request).exists
end end
def garbage_collect(create_bitmap) def garbage_collect(create_bitmap)
......
...@@ -18,8 +18,11 @@ server { ...@@ -18,8 +18,11 @@ server {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache off;
# The same address as passed to GitLab Pages: `-listen-proxy` # The same address as passed to GitLab Pages: `-listen-proxy`
proxy_pass http://localhost:8090/; proxy_pass http://localhost:8090/;
} }
# Define custom error pages # Define custom error pages
......
...@@ -67,8 +67,11 @@ server { ...@@ -67,8 +67,11 @@ server {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache off;
# The same address as passed to GitLab Pages: `-listen-proxy` # The same address as passed to GitLab Pages: `-listen-proxy`
proxy_pass http://localhost:8090/; proxy_pass http://localhost:8090/;
} }
# Define custom error pages # Define custom error pages
......
...@@ -59,7 +59,7 @@ describe('Fly out sidebar navigation', () => { ...@@ -59,7 +59,7 @@ describe('Fly out sidebar navigation', () => {
expect( expect(
el.querySelector('.sidebar-sub-level-items').style.display, el.querySelector('.sidebar-sub-level-items').style.display,
).toBe('none'); ).toBe('');
}); });
it('does not hude subitems on mobile', () => { it('does not hude subitems on mobile', () => {
......
require 'spec_helper'
describe Gitlab::GitalyClient::RepositoryService do
set(:project) { create(:project) }
let(:storage_name) { project.repository_storage }
let(:relative_path) { project.path_with_namespace + '.git' }
let(:client) { described_class.new(project.repository) }
describe '#exists?' do
it 'sends an exists message' do
expect_any_instance_of(Gitaly::RepositoryService::Stub)
.to receive(:exists)
.with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash))
.and_call_original
client.exists?
end
end
end
...@@ -15,7 +15,11 @@ describe Gitlab::LDAP::Config do ...@@ -15,7 +15,11 @@ describe Gitlab::LDAP::Config do
end end
it 'raises an error if a unknown provider is used' do it 'raises an error if a unknown provider is used' do
<<<<<<< HEAD
expect { described_class.new 'unknown' }.to raise_error(Gitlab::LDAP::Config::InvalidProvider) expect { described_class.new 'unknown' }.to raise_error(Gitlab::LDAP::Config::InvalidProvider)
=======
expect { described_class.new 'unknown' }.to raise_error(RuntimeError)
>>>>>>> ce/master
end end
end end
......
...@@ -20,8 +20,16 @@ describe RedirectRoute do ...@@ -20,8 +20,16 @@ describe RedirectRoute do
let!(:redirect4) { group.redirect_routes.create(path: 'gitlabb/test/foo/bar') } let!(:redirect4) { group.redirect_routes.create(path: 'gitlabb/test/foo/bar') }
let!(:redirect5) { group.redirect_routes.create(path: 'gitlabb/test/baz') } let!(:redirect5) { group.redirect_routes.create(path: 'gitlabb/test/baz') }
it 'returns correct routes' do context 'when the redirect route matches with same casing' do
expect(described_class.matching_path_and_descendants('gitlabb/test')).to match_array([redirect2, redirect3, redirect4, redirect5]) it 'returns correct routes' do
expect(described_class.matching_path_and_descendants('gitlabb/test')).to match_array([redirect2, redirect3, redirect4, redirect5])
end
end
context 'when the redirect route matches with different casing' do
it 'returns correct routes' do
expect(described_class.matching_path_and_descendants('GitLABB/test')).to match_array([redirect2, redirect3, redirect4, redirect5])
end
end end
end end
end end
...@@ -145,45 +145,71 @@ describe Route do ...@@ -145,45 +145,71 @@ describe Route do
describe '#delete_conflicting_redirects' do describe '#delete_conflicting_redirects' do
context 'when a redirect route with the same path exists' do context 'when a redirect route with the same path exists' do
let!(:redirect1) { route.create_redirect(route.path) } context 'when the redirect route has matching case' do
let!(:redirect1) { route.create_redirect(route.path) }
it 'deletes the redirect' do it 'deletes the redirect' do
route.delete_conflicting_redirects expect do
expect(route.conflicting_redirects).to be_empty route.delete_conflicting_redirects
end.to change { RedirectRoute.count }.by(-1)
end
context 'when redirect routes with paths descending from the route path exists' do
let!(:redirect2) { route.create_redirect("#{route.path}/foo") }
let!(:redirect3) { route.create_redirect("#{route.path}/foo/bar") }
let!(:redirect4) { route.create_redirect("#{route.path}/baz/quz") }
let!(:other_redirect) { route.create_redirect("other") }
it 'deletes all redirects with paths that descend from the route path' do
expect do
route.delete_conflicting_redirects
end.to change { RedirectRoute.count }.by(-4)
end
end
end end
context 'when redirect routes with paths descending from the route path exists' do context 'when the redirect route is differently cased' do
let!(:redirect2) { route.create_redirect("#{route.path}/foo") } let!(:redirect1) { route.create_redirect(route.path.upcase) }
let!(:redirect3) { route.create_redirect("#{route.path}/foo/bar") }
let!(:redirect4) { route.create_redirect("#{route.path}/baz/quz") }
let!(:other_redirect) { route.create_redirect("other") }
it 'deletes all redirects with paths that descend from the route path' do it 'deletes the redirect' do
route.delete_conflicting_redirects expect do
expect(route.conflicting_redirects).to be_empty route.delete_conflicting_redirects
end.to change { RedirectRoute.count }.by(-1)
end end
end end
end end
end end
describe '#conflicting_redirects' do describe '#conflicting_redirects' do
it 'returns an ActiveRecord::Relation' do
expect(route.conflicting_redirects).to be_an(ActiveRecord::Relation)
end
context 'when a redirect route with the same path exists' do context 'when a redirect route with the same path exists' do
let!(:redirect1) { route.create_redirect(route.path) } context 'when the redirect route has matching case' do
let!(:redirect1) { route.create_redirect(route.path) }
it 'returns the redirect route' do it 'returns the redirect route' do
expect(route.conflicting_redirects).to be_an(ActiveRecord::Relation) expect(route.conflicting_redirects).to match_array([redirect1])
expect(route.conflicting_redirects).to match_array([redirect1]) end
context 'when redirect routes with paths descending from the route path exists' do
let!(:redirect2) { route.create_redirect("#{route.path}/foo") }
let!(:redirect3) { route.create_redirect("#{route.path}/foo/bar") }
let!(:redirect4) { route.create_redirect("#{route.path}/baz/quz") }
let!(:other_redirect) { route.create_redirect("other") }
it 'returns the redirect routes' do
expect(route.conflicting_redirects).to match_array([redirect1, redirect2, redirect3, redirect4])
end
end
end end
context 'when redirect routes with paths descending from the route path exists' do context 'when the redirect route is differently cased' do
let!(:redirect2) { route.create_redirect("#{route.path}/foo") } let!(:redirect1) { route.create_redirect(route.path.upcase) }
let!(:redirect3) { route.create_redirect("#{route.path}/foo/bar") }
let!(:redirect4) { route.create_redirect("#{route.path}/baz/quz") }
let!(:other_redirect) { route.create_redirect("other") }
it 'returns the redirect routes' do it 'returns the redirect route' do
expect(route.conflicting_redirects).to be_an(ActiveRecord::Relation) expect(route.conflicting_redirects).to match_array([redirect1])
expect(route.conflicting_redirects).to match_array([redirect1, redirect2, redirect3, redirect4])
end end
end end
end end
......
...@@ -111,7 +111,11 @@ describe PipelineSerializer do ...@@ -111,7 +111,11 @@ describe PipelineSerializer do
shared_examples 'no N+1 queries' do shared_examples 'no N+1 queries' do
it 'verifies number of queries', :request_store do it 'verifies number of queries', :request_store do
recorded = ActiveRecord::QueryRecorder.new { subject } recorded = ActiveRecord::QueryRecorder.new { subject }
<<<<<<< HEAD
expect(recorded.count).to be_within(1).of(61) expect(recorded.count).to be_within(1).of(61)
=======
expect(recorded.count).to be_within(1).of(57)
>>>>>>> ce/master
expect(recorded.cached_count).to eq(0) expect(recorded.cached_count).to eq(0)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment