Commit b7ec4762 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'master' into mr-merge-base

parents 30b0d06e 9bf47f06
image: "ruby:2.1" image: "ruby:2.2"
services: services:
- mysql:latest - mysql:latest
...@@ -134,3 +134,26 @@ bundler:audit: ...@@ -134,3 +134,26 @@ bundler:audit:
- ruby - ruby
- mysql - mysql
allow_failure: true allow_failure: true
# Ruby 2.1 jobs
spec:ruby21:
image: ruby:2.1
script:
- RAILS_ENV=test bundle exec rake assets:precompile 2>/dev/null
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spec
tags:
- ruby
- mysql
only:
- master
spinach:ruby21:
image: ruby:2.1
script:
- RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach
tags:
- ruby
- mysql
only:
- master
...@@ -5,22 +5,27 @@ v 8.5.0 (unreleased) ...@@ -5,22 +5,27 @@ v 8.5.0 (unreleased)
- Ignore binary files in code search to prevent Error 500 (Stan Hu) - Ignore binary files in code search to prevent Error 500 (Stan Hu)
- Upgrade gitlab_git to 7.2.23 to fix commit message mentions in first branch push - Upgrade gitlab_git to 7.2.23 to fix commit message mentions in first branch push
- New UI for pagination - New UI for pagination
- Don't prevent sign out when 2FA enforcement is enabled and user hasn't yet
set it up
- Fix diff comments loaded by AJAX to load comment with diff in discussion tab - Fix diff comments loaded by AJAX to load comment with diff in discussion tab
- Whitelist raw "abbr" elements when parsing Markdown (Benedict Etzel) - Whitelist raw "abbr" elements when parsing Markdown (Benedict Etzel)
- Don't vendor minified JS - Don't vendor minified JS
- Display 404 error on group not found
- Track project import failure - Track project import failure
- Fix visibility level text in admin area (Zeger-Jan van de Weg) - Fix visibility level text in admin area (Zeger-Jan van de Weg)
- Update the ExternalIssue regex pattern (Blake Hitchcock) - Update the ExternalIssue regex pattern (Blake Hitchcock)
v 8.4.2 (unreleased) v 8.4.2
- Bump required gitlab-workhorse version to bring in a fix for missing - Bump required gitlab-workhorse version to bring in a fix for missing
artifacts in the build artifacts browser artifacts in the build artifacts browser
- Get rid of those ugly borders on the file tree view - Get rid of those ugly borders on the file tree view
- Fix updating the runner information when asking for builds
- Bump gitlab_git version to 7.2.24 in order to bring in a performance - Bump gitlab_git version to 7.2.24 in order to bring in a performance
improvement when checking if a repository was empty improvement when checking if a repository was empty
- Add instrumentation for Gitlab::Git::Repository instance methods so we can - Add instrumentation for Gitlab::Git::Repository instance methods so we can
track them in Performance Monitoring. track them in Performance Monitoring.
- Correctly highlight MR diff when MR has merge conflicts - Correctly highlight MR diff when MR has merge conflicts
- Increase contrast between highlighted code comments and inline diff marker
- Fix method undefined when using external commit status in builds - Fix method undefined when using external commit status in builds
v 8.4.1 v 8.4.1
......
...@@ -302,7 +302,7 @@ end ...@@ -302,7 +302,7 @@ end
gem "newrelic_rpm", '~> 3.9.4.245' gem "newrelic_rpm", '~> 3.9.4.245'
gem 'newrelic-grape' gem 'newrelic-grape'
gem 'octokit', '~> 3.7.0' gem 'octokit', '~> 3.8.0'
gem "mail_room", "~> 0.6.1" gem "mail_room", "~> 0.6.1"
......
...@@ -492,7 +492,7 @@ GEM ...@@ -492,7 +492,7 @@ GEM
multi_json (~> 1.3) multi_json (~> 1.3)
multi_xml (~> 0.5) multi_xml (~> 0.5)
rack (~> 1.2) rack (~> 1.2)
octokit (3.7.1) octokit (3.8.0)
sawyer (~> 0.6.0, >= 0.5.3) sawyer (~> 0.6.0, >= 0.5.3)
omniauth (1.2.2) omniauth (1.2.2)
hashie (>= 1.2, < 4) hashie (>= 1.2, < 4)
...@@ -965,7 +965,7 @@ DEPENDENCIES ...@@ -965,7 +965,7 @@ DEPENDENCIES
nokogiri (= 1.6.7.2) nokogiri (= 1.6.7.2)
nprogress-rails (~> 0.1.6.7) nprogress-rails (~> 0.1.6.7)
oauth2 (~> 1.0.0) oauth2 (~> 1.0.0)
octokit (~> 3.7.0) octokit (~> 3.8.0)
omniauth (~> 1.2.2) omniauth (~> 1.2.2)
omniauth-azure-oauth2 (~> 0.0.6) omniauth-azure-oauth2 (~> 0.0.6)
omniauth-bitbucket (~> 0.0.2) omniauth-bitbucket (~> 0.0.2)
......
...@@ -67,7 +67,7 @@ Instructions on how to start GitLab and how to run the tests can be found in the ...@@ -67,7 +67,7 @@ Instructions on how to start GitLab and how to run the tests can be found in the
GitLab is a Ruby on Rails application that runs on the following software: GitLab is a Ruby on Rails application that runs on the following software:
- Ubuntu/Debian/CentOS/RHEL - Ubuntu/Debian/CentOS/RHEL
- Ruby (MRI) 2.1 - Ruby (MRI) 2.1 or 2.2
- Git 1.7.10+ - Git 1.7.10+
- Redis 2.8+ - Redis 2.8+
- MySQL or PostgreSQL - MySQL or PostgreSQL
......
...@@ -5,7 +5,10 @@ ...@@ -5,7 +5,10 @@
# the compiled file. # the compiled file.
# #
#= require jquery #= require jquery
#= require jquery-ui #= require jquery-ui/autocomplete
#= require jquery-ui/datepicker
#= require jquery-ui/effect-highlight
#= require jquery-ui/sortable
#= require jquery_ujs #= require jquery_ujs
#= require jquery.cookie #= require jquery.cookie
#= require jquery.endless-scroll #= require jquery.endless-scroll
......
...@@ -50,6 +50,7 @@ class @Issue ...@@ -50,6 +50,7 @@ class @Issue
new Flash(issueFailMessage, 'alert') new Flash(issueFailMessage, 'alert')
success: (data, textStatus, jqXHR) -> success: (data, textStatus, jqXHR) ->
if data.saved if data.saved
$(document).trigger('issuable:change');
if isClose if isClose
$('a.btn-close').addClass('hidden') $('a.btn-close').addClass('hidden')
$('a.btn-reopen').removeClass('hidden') $('a.btn-reopen').removeClass('hidden')
......
...@@ -64,6 +64,9 @@ class @Notes ...@@ -64,6 +64,9 @@ class @Notes
# fetch notes when tab becomes visible # fetch notes when tab becomes visible
$(document).on "visibilitychange", @visibilityChange $(document).on "visibilitychange", @visibilityChange
# when issue status changes, we need to refresh data
$(document).on "issuable:change", @refresh
cleanBinding: -> cleanBinding: ->
$(document).off "ajax:success", ".js-main-target-form" $(document).off "ajax:success", ".js-main-target-form"
$(document).off "ajax:success", ".js-discussion-note-form" $(document).off "ajax:success", ".js-discussion-note-form"
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
ul, ol { ul, ol {
padding: 0; padding: 0;
margin: 6px 0 6px 18px !important; margin: 6px 0 6px 28px !important;
} }
li { li {
......
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
// Diff line // Diff line
.line_holder { .line_holder {
.diff-line-num.new, .line_content.new { .diff-line-num.new, .line_content.new {
@include diff_background(rgba(51, 255, 51, 0.1), rgba(51, 255, 51, 0.3), #808080); @include diff_background(rgba(51, 255, 51, 0.1), rgba(51, 255, 51, 0.2), #808080);
} }
.diff-line-num.old, .line_content.old { .diff-line-num.old, .line_content.old {
@include diff_background(rgba(255, 51, 51, 0.2), rgba(255, 51, 51, 0.3), #808080); @include diff_background(rgba(255, 51, 51, 0.2), rgba(255, 51, 51, 0.25), #808080);
} }
.line_content.match { .line_content.match {
......
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
// Diff line // Diff line
.line_holder { .line_holder {
.diff-line-num.new, .line_content.new { .diff-line-num.new, .line_content.new {
@include diff_background(rgba(166, 226, 46, 0.2), rgba(166, 226, 46, 0.3), #808080); @include diff_background(rgba(166, 226, 46, 0.1), rgba(166, 226, 46, 0.15), #808080);
} }
.diff-line-num.old, .line_content.old { .diff-line-num.old, .line_content.old {
@include diff_background(rgba(254, 147, 140, 0.2), rgba(254, 147, 140, 0.3), #808080); @include diff_background(rgba(254, 147, 140, 0.15), rgba(254, 147, 140, 0.2), #808080);
} }
.line_content.match { .line_content.match {
......
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
// Diff line // Diff line
.line_holder { .line_holder {
.diff-line-num.new, .line_content.new { .diff-line-num.new, .line_content.new {
@include diff_background(rgba(133, 153, 0, 0.2), rgba(133, 153, 0, 0.3), #113b46); @include diff_background(rgba(133, 153, 0, 0.15), rgba(133, 153, 0, 0.25), #113b46);
} }
.diff-line-num.old, .line_content.old { .diff-line-num.old, .line_content.old {
@include diff_background(rgba(220, 50, 47, 0.3), rgba(220, 50, 47, 0.3), #113b46); @include diff_background(rgba(220, 50, 47, 0.3), rgba(220, 50, 47, 0.25), #113b46);
} }
.line_content.match { .line_content.match {
......
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
// Diff line // Diff line
.line_holder { .line_holder {
.diff-line-num.new, .line_content.new { .diff-line-num.new, .line_content.new {
@include diff_background(rgba(133, 153, 0, 0.2), rgba(133, 153, 0, 0.3), #c5d0d4); @include diff_background(rgba(133, 153, 0, 0.2), rgba(133, 153, 0, 0.25), #c5d0d4);
} }
.diff-line-num.old, .line_content.old { .diff-line-num.old, .line_content.old {
@include diff_background(rgba(220, 50, 47, 0.2), rgba(220, 50, 47, 0.3), #c5d0d4); @include diff_background(rgba(220, 50, 47, 0.2), rgba(220, 50, 47, 0.25), #c5d0d4);
} }
.line_content.match { .line_content.match {
......
...@@ -36,7 +36,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController ...@@ -36,7 +36,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
private private
def load_events def load_events
@events = Event.in_projects(@projects.pluck(:id)) @events = Event.in_projects(@projects)
@events = @event_filter.apply_filter(@events).with_associations @events = @event_filter.apply_filter(@events).with_associations
@events = @events.limit(20).offset(params[:offset] || 0) @events = @events.limit(20).offset(params[:offset] || 0)
end end
......
...@@ -23,14 +23,14 @@ class DashboardController < Dashboard::ApplicationController ...@@ -23,14 +23,14 @@ class DashboardController < Dashboard::ApplicationController
protected protected
def load_events def load_events
project_ids = projects =
if params[:filter] == "starred" if params[:filter] == "starred"
current_user.starred_projects current_user.starred_projects
else else
current_user.authorized_projects current_user.authorized_projects
end.pluck(:id) end
@events = Event.in_projects(project_ids) @events = Event.in_projects(projects)
@events = @event_filter.apply_filter(@events).with_associations @events = @event_filter.apply_filter(@events).with_associations
@events = @events.limit(20).offset(params[:offset] || 0) @events = @events.limit(20).offset(params[:offset] || 0)
end end
......
...@@ -82,16 +82,13 @@ class GroupsController < Groups::ApplicationController ...@@ -82,16 +82,13 @@ class GroupsController < Groups::ApplicationController
def group def group
@group ||= Group.find_by(path: params[:id]) @group ||= Group.find_by(path: params[:id])
@group || render_404
end end
def load_projects def load_projects
@projects ||= ProjectsFinder.new.execute(current_user, group: group).sorted_by_activity.non_archived @projects ||= ProjectsFinder.new.execute(current_user, group: group).sorted_by_activity.non_archived
end end
def project_ids
@projects.pluck(:id)
end
# Dont allow unauthorized access to group # Dont allow unauthorized access to group
def authorize_read_group! def authorize_read_group!
unless @group and (@projects.present? or can?(current_user, :read_group, @group)) unless @group and (@projects.present? or can?(current_user, :read_group, @group))
...@@ -124,7 +121,7 @@ class GroupsController < Groups::ApplicationController ...@@ -124,7 +121,7 @@ class GroupsController < Groups::ApplicationController
end end
def load_events def load_events
@events = Event.in_projects(project_ids) @events = Event.in_projects(@projects)
@events = event_filter.apply_filter(@events).with_associations @events = event_filter.apply_filter(@events).with_associations
@events = @events.limit(20).offset(params[:offset] || 0) @events = @events.limit(20).offset(params[:offset] || 0)
end end
......
...@@ -13,10 +13,10 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController ...@@ -13,10 +13,10 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
current_user.save! if current_user.changed? current_user.save! if current_user.changed?
if two_factor_grace_period_expired? if two_factor_grace_period_expired?
flash.now[:alert] = 'You must configure Two-Factor Authentication in your account.' flash.now[:alert] = 'You must enable Two-factor Authentication for your account.'
else else
grace_period_deadline = current_user.otp_grace_period_started_at + two_factor_grace_period.hours grace_period_deadline = current_user.otp_grace_period_started_at + two_factor_grace_period.hours
flash.now[:alert] = "You must configure Two-Factor Authentication in your account until #{l(grace_period_deadline)}." flash.now[:alert] = "You must enable Two-factor Authentication for your account before #{l(grace_period_deadline)}."
end end
@qr_code = build_qr_code @qr_code = build_qr_code
......
...@@ -2,6 +2,8 @@ class SessionsController < Devise::SessionsController ...@@ -2,6 +2,8 @@ class SessionsController < Devise::SessionsController
include AuthenticatesWithTwoFactor include AuthenticatesWithTwoFactor
include Recaptcha::ClientHelper include Recaptcha::ClientHelper
skip_before_action :check_2fa_requirement, only: [:destroy]
prepend_before_action :authenticate_with_two_factor, only: [:create] prepend_before_action :authenticate_with_two_factor, only: [:create]
prepend_before_action :store_redirect_path, only: [:new] prepend_before_action :store_redirect_path, only: [:new]
before_action :auto_sign_in_with_provider, only: [:new] before_action :auto_sign_in_with_provider, only: [:new]
......
...@@ -152,7 +152,7 @@ module CommitsHelper ...@@ -152,7 +152,7 @@ module CommitsHelper
options = { options = {
class: "commit-#{options[:source]}-link has_tooltip", class: "commit-#{options[:source]}-link has_tooltip",
data: { :'original-title' => sanitize(source_email) } data: { 'original-title': sanitize(source_email) }
} }
if user.nil? if user.nil?
......
...@@ -40,7 +40,7 @@ module ProjectsHelper ...@@ -40,7 +40,7 @@ module ProjectsHelper
link_to(author_html, user_path(author), class: "author_link").html_safe link_to(author_html, user_path(author), class: "author_link").html_safe
else else
title = opts[:title].sub(":name", sanitize(author.name)) title = opts[:title].sub(":name", sanitize(author.name))
link_to(author_html, user_path(author), class: "author_link has_tooltip", data: { :'original-title' => title, container: 'body' } ).html_safe link_to(author_html, user_path(author), class: "author_link has_tooltip", data: { 'original-title': title, container: 'body' } ).html_safe
end end
end end
......
...@@ -47,7 +47,11 @@ class Event < ActiveRecord::Base ...@@ -47,7 +47,11 @@ class Event < ActiveRecord::Base
# Scopes # Scopes
scope :recent, -> { reorder(id: :desc) } scope :recent, -> { reorder(id: :desc) }
scope :code_push, -> { where(action: PUSHED) } scope :code_push, -> { where(action: PUSHED) }
scope :in_projects, ->(project_ids) { where(project_id: project_ids).recent }
scope :in_projects, ->(projects) do
where(project_id: projects.select(:id).reorder(nil)).recent
end
scope :with_associations, -> { includes(project: :namespace) } scope :with_associations, -> { includes(project: :namespace) }
scope :for_milestone_id, ->(milestone_id) { where(target_type: "Milestone", target_id: milestone_id) } scope :for_milestone_id, ->(milestone_id) { where(target_type: "Milestone", target_id: milestone_id) }
...@@ -64,12 +68,6 @@ class Event < ActiveRecord::Base ...@@ -64,12 +68,6 @@ class Event < ActiveRecord::Base
[Event::CREATED, Event::CLOSED, Event::MERGED]) [Event::CREATED, Event::CLOSED, Event::MERGED])
end end
def latest_update_time
row = select(:updated_at, :project_id).reorder(id: :desc).take
row ? row.updated_at : nil
end
def limit_recent(limit = 20, offset = nil) def limit_recent(limit = 20, offset = nil)
recent.limit(limit).offset(offset) recent.limit(limit).offset(offset)
end end
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
- @hooks.each do |hook| - @hooks.each do |hook|
%li %li
.list-item-name .list-item-name
= link_to admin_hook_path(hook) do
%strong= hook.url %strong= hook.url
%p SSL Verification: #{hook.enable_ssl_verification ? "enabled" : "disabled"} %p SSL Verification: #{hook.enable_ssl_verification ? "enabled" : "disabled"}
......
...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: dashboard_projects_url(format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: dashboard_projects_url(format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: dashboard_projects_url, rel: "alternate", type: "text/html" xml.link href: dashboard_projects_url, rel: "alternate", type: "text/html"
xml.id dashboard_projects_url xml.id dashboard_projects_url
xml.updated @events.latest_update_time.xmlschema if @events.any? xml.updated @events[0].updated_at.xmlschema if @events[0]
@events.each do |event| @events.each do |event|
event_to_atom(xml, event) event_to_atom(xml, event)
......
...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: group_url(@group, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: group_url(@group, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: group_url(@group), rel: "alternate", type: "text/html" xml.link href: group_url(@group), rel: "alternate", type: "text/html"
xml.id group_url(@group) xml.id group_url(@group)
xml.updated @events.latest_update_time.xmlschema if @events.any? xml.updated @events[0].updated_at.xmlschema if @events[0]
@events.each do |event| @events.each do |event|
event_to_atom(xml, event) event_to_atom(xml, event)
......
...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: namespace_project_url(@project.namespace, @project, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml" xml.link href: namespace_project_url(@project.namespace, @project, format: :atom, private_token: current_user.try(:private_token)), rel: "self", type: "application/atom+xml"
xml.link href: namespace_project_url(@project.namespace, @project), rel: "alternate", type: "text/html" xml.link href: namespace_project_url(@project.namespace, @project), rel: "alternate", type: "text/html"
xml.id namespace_project_url(@project.namespace, @project) xml.id namespace_project_url(@project.namespace, @project)
xml.updated @events.latest_update_time.xmlschema if @events.any? xml.updated @events[0].updated_at.xmlschema if @events[0?
@events.each do |event| @events.each do |event|
event_to_atom(xml, event) event_to_atom(xml, event)
......
...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear ...@@ -4,7 +4,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom", "xmlns:media" => "http://sear
xml.link href: user_url(@user, :atom), rel: "self", type: "application/atom+xml" xml.link href: user_url(@user, :atom), rel: "self", type: "application/atom+xml"
xml.link href: user_url(@user), rel: "alternate", type: "text/html" xml.link href: user_url(@user), rel: "alternate", type: "text/html"
xml.id user_url(@user) xml.id user_url(@user)
xml.updated @events.latest_update_time.xmlschema if @events.any? xml.updated @events[0].updated_at.xmlschema if @events[0]
@events.each do |event| @events.each do |event|
event_to_atom(xml, event) event_to_atom(xml, event)
......
...@@ -56,12 +56,12 @@ gitlab-ci-multi-runner register \ ...@@ -56,12 +56,12 @@ gitlab-ci-multi-runner register \
--non-interactive \ --non-interactive \
--url "https://gitlab.com/ci/" \ --url "https://gitlab.com/ci/" \
--registration-token "PROJECT_REGISTRATION_TOKEN" \ --registration-token "PROJECT_REGISTRATION_TOKEN" \
--description "ruby-2.1" \ --description "ruby-2.2" \
--executor "docker" \ --executor "docker" \
--docker-image ruby:2.1 \ --docker-image ruby:2.2 \
--docker-postgres latest --docker-postgres latest
``` ```
With the command above, you create a runner that uses [ruby:2.1](https://registry.hub.docker.com/u/library/ruby/) image and uses [postgres](https://registry.hub.docker.com/u/library/postgres/) database. With the command above, you create a runner that uses [ruby:2.2](https://registry.hub.docker.com/u/library/ruby/) image and uses [postgres](https://registry.hub.docker.com/u/library/postgres/) database.
To access PostgreSQL database you need to connect to `host: postgres` as user `postgres` without password. To access PostgreSQL database you need to connect to `host: postgres` as user `postgres` without password.
...@@ -33,7 +33,7 @@ The YAML syntax allows for using more complex job specifications than in the ...@@ -33,7 +33,7 @@ The YAML syntax allows for using more complex job specifications than in the
above example: above example:
```yaml ```yaml
image: ruby:2.1 image: ruby:2.2
services: services:
- postgres - postgres
......
...@@ -26,7 +26,7 @@ We use [these build scripts](https://gitlab.com/gitlab-org/gitlab-ci/blob/master ...@@ -26,7 +26,7 @@ We use [these build scripts](https://gitlab.com/gitlab-org/gitlab-ci/blob/master
# Build configuration on [Semaphore](https://semaphoreapp.com/gitlabhq/gitlabhq/) for testing the [GitHub.com repo](https://github.com/gitlabhq/gitlabhq) # Build configuration on [Semaphore](https://semaphoreapp.com/gitlabhq/gitlabhq/) for testing the [GitHub.com repo](https://github.com/gitlabhq/gitlabhq)
- Language: Ruby - Language: Ruby
- Ruby version: 2.1.2 - Ruby version: 2.2.4
- database.yml: pg - database.yml: pg
Build commands Build commands
......
...@@ -107,7 +107,7 @@ Then select 'Internet Site' and press enter to confirm the hostname. ...@@ -107,7 +107,7 @@ Then select 'Internet Site' and press enter to confirm the hostname.
## 2. Ruby ## 2. Ruby
_**Note:** The current supported Ruby versions are 2.1.x. Ruby 2.2 and 2.3 are _**Note:** The current supported Ruby versions are 2.1.x and 2.2.x. Ruby 2.3 is
currently not supported._ currently not supported._
The use of Ruby version managers such as [RVM], [rbenv] or [chruby] with GitLab The use of Ruby version managers such as [RVM], [rbenv] or [chruby] with GitLab
...@@ -123,9 +123,9 @@ Remove the old Ruby 1.8 if present: ...@@ -123,9 +123,9 @@ Remove the old Ruby 1.8 if present:
Download Ruby and compile it: Download Ruby and compile it:
mkdir /tmp/ruby && cd /tmp/ruby mkdir /tmp/ruby && cd /tmp/ruby
curl -O --progress https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.7.tar.gz curl -O --progress https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.gz
echo 'e2e195a4a58133e3ad33b955c829bb536fa3c075 ruby-2.1.7.tar.gz' | shasum -c - && tar xzf ruby-2.1.7.tar.gz echo 'e2e195a4a58133e3ad33b955c829bb536fa3c075 ruby-2.2.4.tar.gz' | shasum -c - && tar xzf ruby-2.2.4.tar.gz
cd ruby-2.1.7 cd ruby-2.2.4
./configure --disable-install-rdoc ./configure --disable-install-rdoc
make make
sudo make install sudo make install
...@@ -355,7 +355,7 @@ GitLab Shell is an SSH access and repository management software developed speci ...@@ -355,7 +355,7 @@ GitLab Shell is an SSH access and repository management software developed speci
cd /home/git cd /home/git
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git
cd gitlab-workhorse cd gitlab-workhorse
sudo -u git -H git checkout 0.5.4 sudo -u git -H git checkout 0.6.2
sudo -u git -H make sudo -u git -H make
### Initialize Database and Activate Advanced Features ### Initialize Database and Activate Advanced Features
......
...@@ -32,8 +32,7 @@ Please consider using a virtual machine to run GitLab. ...@@ -32,8 +32,7 @@ Please consider using a virtual machine to run GitLab.
## Ruby versions ## Ruby versions
GitLab requires Ruby (MRI) 2.1.x and currently does not work with versions 2.2 GitLab requires Ruby (MRI) 2.1.x or 2.2.x and currently does not work with version 2.3.
and 2.3.
You will have to use the standard MRI implementation of Ruby. You will have to use the standard MRI implementation of Ruby.
We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/) but GitLab We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/) but GitLab
......
...@@ -48,7 +48,7 @@ which should already be on your system from GitLab 8.1. ...@@ -48,7 +48,7 @@ which should already be on your system from GitLab 8.1.
```bash ```bash
cd /home/git/gitlab-workhorse cd /home/git/gitlab-workhorse
sudo -u git -H git fetch --all sudo -u git -H git fetch --all
sudo -u git -H git checkout 0.6.1 sudo -u git -H git checkout 0.6.2
sudo -u git -H make sudo -u git -H make
``` ```
......
...@@ -3,6 +3,10 @@ Feature: Groups ...@@ -3,6 +3,10 @@ Feature: Groups
Given I sign in as "John Doe" Given I sign in as "John Doe"
And "John Doe" is owner of group "Owned" And "John Doe" is owner of group "Owned"
Scenario: I should not see a group if it does not exist
When I visit group "NonExistentGroup" page
Then page status code should be 404
Scenario: I should have back to group button Scenario: I should have back to group button
When I visit group "Owned" page When I visit group "Owned" page
Then I should see back to dashboard button Then I should see back to dashboard button
......
...@@ -120,6 +120,10 @@ class Spinach::Features::Groups < Spinach::FeatureSteps ...@@ -120,6 +120,10 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
expect(page).to have_xpath("//span[@class='label label-warning']", text: 'archived') expect(page).to have_xpath("//span[@class='label label-warning']", text: 'archived')
end end
step 'I visit group "NonExistentGroup" page' do
visit group_path(-1)
end
private private
def assigned_to_me(key) def assigned_to_me(key)
......
...@@ -153,10 +153,11 @@ module API ...@@ -153,10 +153,11 @@ module API
end end
def attributes_for_keys(keys, custom_params = nil) def attributes_for_keys(keys, custom_params = nil)
params_hash = custom_params || params
attrs = {} attrs = {}
keys.each do |key| keys.each do |key|
if params[key].present? or (params.has_key?(key) and params[key] == false) if params_hash[key].present? or (params_hash.has_key?(key) and params_hash[key] == false)
attrs[key] = params[key] attrs[key] = params_hash[key]
end end
end end
ActionController::Parameters.new(attrs).permit! ActionController::Parameters.new(attrs).permit!
......
...@@ -25,7 +25,7 @@ module Ci ...@@ -25,7 +25,7 @@ module Ci
format :json format :json
helpers Helpers helpers ::Ci::API::Helpers
helpers ::API::Helpers helpers ::API::Helpers
helpers Gitlab::CurrentSettings helpers Gitlab::CurrentSettings
......
...@@ -13,13 +13,13 @@ module Ci ...@@ -13,13 +13,13 @@ module Ci
post "register" do post "register" do
authenticate_runner! authenticate_runner!
update_runner_last_contact update_runner_last_contact
update_runner_info
required_attributes! [:token] required_attributes! [:token]
not_found! unless current_runner.active? not_found! unless current_runner.active?
build = Ci::RegisterBuildService.new.execute(current_runner) build = Ci::RegisterBuildService.new.execute(current_runner)
if build if build
update_runner_info
present build, with: Entities::BuildDetails present build, with: Entities::BuildDetails
else else
not_found! not_found!
......
...@@ -34,10 +34,14 @@ module Ci ...@@ -34,10 +34,14 @@ module Ci
@runner ||= Runner.find_by_token(params[:token].to_s) @runner ||= Runner.find_by_token(params[:token].to_s)
end end
def update_runner_info def get_runner_version_from_params
return unless params["info"].present? return unless params["info"].present?
info = attributes_for_keys(["name", "version", "revision", "platform", "architecture"], params["info"]) attributes_for_keys(["name", "version", "revision", "platform", "architecture"], params["info"])
current_runner.update(info) end
def update_runner_info
current_runner.assign_attributes(get_runner_version_from_params)
current_runner.save if current_runner.changed?
end end
def max_artifacts_size def max_artifacts_size
......
...@@ -47,6 +47,7 @@ module Ci ...@@ -47,6 +47,7 @@ module Ci
return forbidden! unless runner return forbidden! unless runner
if runner.id if runner.id
runner.update(get_runner_version_from_params)
present runner, with: Entities::Runner present runner, with: Entities::Runner
else else
not_found! not_found!
......
...@@ -112,10 +112,10 @@ feature 'Login', feature: true do ...@@ -112,10 +112,10 @@ feature 'Login', feature: true do
context 'within the grace period' do context 'within the grace period' do
it 'redirects to two-factor configuration page' do it 'redirects to two-factor configuration page' do
expect(current_path).to eq new_profile_two_factor_auth_path expect(current_path).to eq new_profile_two_factor_auth_path
expect(page).to have_content('You must configure Two-Factor Authentication in your account until') expect(page).to have_content('You must enable Two-factor Authentication for your account before')
end end
it 'two-factor configuration is skippable' do it 'disallows skipping two-factor configuration' do
expect(current_path).to eq new_profile_two_factor_auth_path expect(current_path).to eq new_profile_two_factor_auth_path
click_link 'Configure it later' click_link 'Configure it later'
...@@ -128,10 +128,10 @@ feature 'Login', feature: true do ...@@ -128,10 +128,10 @@ feature 'Login', feature: true do
it 'redirects to two-factor configuration page' do it 'redirects to two-factor configuration page' do
expect(current_path).to eq new_profile_two_factor_auth_path expect(current_path).to eq new_profile_two_factor_auth_path
expect(page).to have_content('You must configure Two-Factor Authentication in your account.') expect(page).to have_content('You must enable Two-factor Authentication for your account.')
end end
it 'two-factor configuration is not skippable' do it 'disallows skipping two-factor configuration' do
expect(current_path).to eq new_profile_two_factor_auth_path expect(current_path).to eq new_profile_two_factor_auth_path
expect(page).not_to have_link('Configure it later') expect(page).not_to have_link('Configure it later')
end end
...@@ -146,7 +146,7 @@ feature 'Login', feature: true do ...@@ -146,7 +146,7 @@ feature 'Login', feature: true do
it 'redirects to two-factor configuration page' do it 'redirects to two-factor configuration page' do
expect(current_path).to eq new_profile_two_factor_auth_path expect(current_path).to eq new_profile_two_factor_auth_path
expect(page).to have_content('You must configure Two-Factor Authentication in your account.') expect(page).to have_content('You must enable Two-factor Authentication for your account.')
end end
end end
end end
......
...@@ -37,7 +37,7 @@ describe CaseSensitivity, models: true do ...@@ -37,7 +37,7 @@ describe CaseSensitivity, models: true do
with(%q{LOWER("foo"."bar") = LOWER(:value)}, value: 'bar'). with(%q{LOWER("foo"."bar") = LOWER(:value)}, value: 'bar').
and_return(criteria) and_return(criteria)
expect(model.iwhere(:'foo.bar' => 'bar')).to eq(criteria) expect(model.iwhere('foo.bar': 'bar')).to eq(criteria)
end end
end end
...@@ -87,8 +87,8 @@ describe CaseSensitivity, models: true do ...@@ -87,8 +87,8 @@ describe CaseSensitivity, models: true do
with(%q{LOWER("foo"."baz") = LOWER(:value)}, value: 'baz'). with(%q{LOWER("foo"."baz") = LOWER(:value)}, value: 'baz').
and_return(final) and_return(final)
got = model.iwhere(:'foo.bar' => 'bar', got = model.iwhere('foo.bar': 'bar',
:'foo.baz' => 'baz') 'foo.baz': 'baz')
expect(got).to eq(final) expect(got).to eq(final)
end end
...@@ -127,7 +127,7 @@ describe CaseSensitivity, models: true do ...@@ -127,7 +127,7 @@ describe CaseSensitivity, models: true do
with(%q{`foo`.`bar` = :value}, value: 'bar'). with(%q{`foo`.`bar` = :value}, value: 'bar').
and_return(criteria) and_return(criteria)
expect(model.iwhere(:'foo.bar' => 'bar')). expect(model.iwhere('foo.bar': 'bar')).
to eq(criteria) to eq(criteria)
end end
end end
...@@ -178,8 +178,8 @@ describe CaseSensitivity, models: true do ...@@ -178,8 +178,8 @@ describe CaseSensitivity, models: true do
with(%q{`foo`.`baz` = :value}, value: 'baz'). with(%q{`foo`.`baz` = :value}, value: 'baz').
and_return(final) and_return(final)
got = model.iwhere(:'foo.bar' => 'bar', got = model.iwhere('foo.bar': 'bar',
:'foo.baz' => 'baz') 'foo.baz': 'baz')
expect(got).to eq(final) expect(got).to eq(final)
end end
......
...@@ -65,27 +65,6 @@ describe Event, models: true do ...@@ -65,27 +65,6 @@ describe Event, models: true do
it { expect(@event.author).to eq(@user) } it { expect(@event.author).to eq(@user) }
end end
describe '.latest_update_time' do
describe 'when events are present' do
let(:time) { Time.utc(2015, 1, 1) }
before do
create(:closed_issue_event, updated_at: time)
create(:closed_issue_event, updated_at: time + 5)
end
it 'returns the latest update time' do
expect(Event.latest_update_time).to eq(time + 5)
end
end
describe 'when no events exist' do
it 'returns nil' do
expect(Event.latest_update_time).to be_nil
end
end
end
describe '.limit_recent' do describe '.limit_recent' do
let!(:event1) { create(:closed_issue_event) } let!(:event1) { create(:closed_issue_event) }
let!(:event2) { create(:closed_issue_event) } let!(:event2) { create(:closed_issue_event) }
......
...@@ -113,6 +113,21 @@ describe Ci::API::API do ...@@ -113,6 +113,21 @@ describe Ci::API::API do
expect(json_response["depends_on_builds"].count).to eq(2) expect(json_response["depends_on_builds"].count).to eq(2)
expect(json_response["depends_on_builds"][0]["name"]).to eq("rspec") expect(json_response["depends_on_builds"][0]["name"]).to eq("rspec")
end end
%w(name version revision platform architecture).each do |param|
context "updates runner #{param}" do
let(:value) { "#{param}_value" }
subject { runner.read_attribute(param.to_sym) }
it do
post ci_api("/builds/register"), token: runner.token, info: { param => value }
expect(response.status).to eq(404)
runner.reload
is_expected.to eq(value)
end
end
end
end end
describe "PUT /builds/:id" do describe "PUT /builds/:id" do
......
...@@ -51,6 +51,20 @@ describe Ci::API::API do ...@@ -51,6 +51,20 @@ describe Ci::API::API do
expect(response.status).to eq(400) expect(response.status).to eq(400)
end end
%w(name version revision platform architecture).each do |param|
context "creates runner with #{param} saved" do
let(:value) { "#{param}_value" }
subject { Ci::Runner.first.read_attribute(param.to_sym) }
it do
post ci_api("/runners/register"), token: registration_token, info: { param => value }
expect(response.status).to eq(201)
is_expected.to eq(value)
end
end
end
end end
describe "DELETE /runners/delete" do describe "DELETE /runners/delete" do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment