From 1c51fb1778e5e14f245f9e8d8a3531a4effc811f Mon Sep 17 00:00:00 2001 From: James Lopez Date: Thu, 21 Jan 2016 16:12:49 +0100 Subject: update Ruby version to 2.2.4 (latest previous stable) and update docs --- .ruby-version | 2 +- doc/ci/examples/test-and-deploy-ruby-application-to-heroku.md | 6 +++--- doc/ci/yaml/README.md | 2 +- doc/development/ci_setup.md | 2 +- doc/install/installation.md | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.ruby-version b/.ruby-version index 04b10b4f150..530cdd91a20 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.1.7 +2.2.4 diff --git a/doc/ci/examples/test-and-deploy-ruby-application-to-heroku.md b/doc/ci/examples/test-and-deploy-ruby-application-to-heroku.md index e52e1547461..c1bb47e4291 100644 --- a/doc/ci/examples/test-and-deploy-ruby-application-to-heroku.md +++ b/doc/ci/examples/test-and-deploy-ruby-application-to-heroku.md @@ -56,12 +56,12 @@ gitlab-ci-multi-runner register \ --non-interactive \ --url "https://gitlab.com/ci/" \ --registration-token "PROJECT_REGISTRATION_TOKEN" \ - --description "ruby-2.1" \ + --description "ruby-2.2" \ --executor "docker" \ - --docker-image ruby:2.1 \ + --docker-image ruby:2.2 \ --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. diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index fd0d49de4e4..779b9db6486 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -33,7 +33,7 @@ The YAML syntax allows for using more complex job specifications than in the above example: ```yaml -image: ruby:2.1 +image: ruby:2.2 services: - postgres diff --git a/doc/development/ci_setup.md b/doc/development/ci_setup.md index f9b48868182..05db30b4a7e 100644 --- a/doc/development/ci_setup.md +++ b/doc/development/ci_setup.md @@ -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) - Language: Ruby -- Ruby version: 2.1.2 +- Ruby version: 2.2.4 - database.yml: pg Build commands diff --git a/doc/install/installation.md b/doc/install/installation.md index 00030729a4b..376a02d4534 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -116,9 +116,9 @@ Remove the old Ruby 1.8 if present Download Ruby and compile it: mkdir /tmp/ruby && cd /tmp/ruby - curl -O --progress https://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.7.tar.gz - echo 'e2e195a4a58133e3ad33b955c829bb536fa3c075 ruby-2.1.7.tar.gz' | shasum -c - && tar xzf ruby-2.1.7.tar.gz - cd ruby-2.1.7 + curl -O --progress https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.gz + echo 'e2e195a4a58133e3ad33b955c829bb536fa3c075 ruby-2.2.4.tar.gz' | shasum -c - && tar xzf ruby-2.2.4.tar.gz + cd ruby-2.2.4 ./configure --disable-install-rdoc make sudo make install -- cgit v1.2.1 From ba07a4c96a90a0cbe81ae7e987f32cc8eac20323 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Thu, 21 Jan 2016 18:28:09 +0100 Subject: update gitlab ci docker image version --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ac8390074f4..9bd558c7d0e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,5 @@ # This file is generated by GitLab CI +image: ruby:2.2 before_script: - ./scripts/prepare_build.sh - ruby -v -- cgit v1.2.1 From 8e14cb4b5ad1906b4f7337c85d9459581965c274 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Thu, 21 Jan 2016 12:51:24 -0500 Subject: Bump octokit to `~> 3.8.0` Closes #2877 --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 746d8e5d6de..07ddbf87130 100644 --- a/Gemfile +++ b/Gemfile @@ -301,7 +301,7 @@ end gem "newrelic_rpm", '~> 3.9.4.245' gem 'newrelic-grape' -gem 'octokit', '~> 3.7.0' +gem 'octokit', '~> 3.8.0' gem "mail_room", "~> 0.6.1" diff --git a/Gemfile.lock b/Gemfile.lock index 5e0718af70f..cd11d388bbd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -492,7 +492,7 @@ GEM multi_json (~> 1.3) multi_xml (~> 0.5) rack (~> 1.2) - octokit (3.7.1) + octokit (3.8.0) sawyer (~> 0.6.0, >= 0.5.3) omniauth (1.2.2) hashie (>= 1.2, < 4) @@ -965,7 +965,7 @@ DEPENDENCIES nokogiri (= 1.6.7.1) nprogress-rails (~> 0.1.6.7) oauth2 (~> 1.0.0) - octokit (~> 3.7.0) + octokit (~> 3.8.0) omniauth (~> 1.2.2) omniauth-azure-oauth2 (~> 0.0.6) omniauth-bitbucket (~> 0.0.2) -- cgit v1.2.1 From fdf68a8d4dec9000ec1e48f66ad64d63050685a1 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sat, 23 Jan 2016 16:44:46 -0800 Subject: Skip the 2FA requirement during logout --- app/controllers/sessions_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 825f85199be..44eb58e418b 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -2,6 +2,8 @@ class SessionsController < Devise::SessionsController include AuthenticatesWithTwoFactor include Recaptcha::ClientHelper + skip_before_action :check_2fa_requirement, only: [:destroy] + prepend_before_action :authenticate_with_two_factor, only: [:create] prepend_before_action :store_redirect_path, only: [:new] before_action :auto_sign_in_with_provider, only: [:new] -- cgit v1.2.1 From fcab1345da15020e5bf31055f52f9634fa8dd3ae Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sat, 23 Jan 2016 17:23:42 -0800 Subject: Update wording for 2FA requirement notice --- app/controllers/profiles/two_factor_auths_controller.rb | 4 ++-- spec/features/login_spec.rb | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/profiles/two_factor_auths_controller.rb b/app/controllers/profiles/two_factor_auths_controller.rb index 6e91d9b4ad9..f3bfede4354 100644 --- a/app/controllers/profiles/two_factor_auths_controller.rb +++ b/app/controllers/profiles/two_factor_auths_controller.rb @@ -13,10 +13,10 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController current_user.save! if current_user.changed? 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 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 @qr_code = build_qr_code diff --git a/spec/features/login_spec.rb b/spec/features/login_spec.rb index 2451e56fe7c..dac9205449a 100644 --- a/spec/features/login_spec.rb +++ b/spec/features/login_spec.rb @@ -112,10 +112,10 @@ feature 'Login', feature: true do context 'within the grace period' do it 'redirects to two-factor configuration page' do 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 - 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 click_link 'Configure it later' @@ -128,10 +128,10 @@ feature 'Login', feature: true do it 'redirects to two-factor configuration page' do 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 - 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(page).not_to have_link('Configure it later') end @@ -146,7 +146,7 @@ feature 'Login', feature: true do it 'redirects to two-factor configuration page' do 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 -- cgit v1.2.1 From 0ae588255cc224e8704f714843cf488949c11426 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Sun, 24 Jan 2016 15:27:50 -0800 Subject: Remove link from system hook Closes #12672 --- app/views/admin/hooks/index.html.haml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index b120f4dea67..53b3cd04c68 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -37,8 +37,7 @@ - @hooks.each do |hook| %li .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"} .pull-right -- cgit v1.2.1 From ee209cc936d9242af2b2d8d45ecb64adc55e3a51 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Mon, 25 Jan 2016 11:44:25 +0100 Subject: fix rubocop new 2.2 syntax issues --- app/helpers/commits_helper.rb | 2 +- app/helpers/projects_helper.rb | 2 +- spec/models/concerns/case_sensitivity_spec.rb | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index d26f007c8e6..53f8f913b33 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -152,7 +152,7 @@ module CommitsHelper options = { class: "commit-#{options[:source]}-link has_tooltip", - data: { :'original-title' => sanitize(source_email) } + data: { 'original-title': sanitize(source_email) } } if user.nil? diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 77ba612548a..c5823e50096 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -40,7 +40,7 @@ module ProjectsHelper link_to(author_html, user_path(author), class: "author_link").html_safe else 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 diff --git a/spec/models/concerns/case_sensitivity_spec.rb b/spec/models/concerns/case_sensitivity_spec.rb index 25b3f4e50da..6535246bf2d 100644 --- a/spec/models/concerns/case_sensitivity_spec.rb +++ b/spec/models/concerns/case_sensitivity_spec.rb @@ -37,7 +37,7 @@ describe CaseSensitivity, models: true do with(%q{LOWER("foo"."bar") = LOWER(:value)}, value: 'bar'). and_return(criteria) - expect(model.iwhere(:'foo.bar' => 'bar')).to eq(criteria) + expect(model.iwhere('foo.bar': 'bar')).to eq(criteria) end end @@ -87,8 +87,8 @@ describe CaseSensitivity, models: true do with(%q{LOWER("foo"."baz") = LOWER(:value)}, value: 'baz'). and_return(final) - got = model.iwhere(:'foo.bar' => 'bar', - :'foo.baz' => 'baz') + got = model.iwhere('foo.bar': 'bar', + 'foo.baz': 'baz') expect(got).to eq(final) end @@ -127,7 +127,7 @@ describe CaseSensitivity, models: true do with(%q{`foo`.`bar` = :value}, value: 'bar'). and_return(criteria) - expect(model.iwhere(:'foo.bar' => 'bar')). + expect(model.iwhere('foo.bar': 'bar')). to eq(criteria) end end @@ -178,8 +178,8 @@ describe CaseSensitivity, models: true do with(%q{`foo`.`baz` = :value}, value: 'baz'). and_return(final) - got = model.iwhere(:'foo.bar' => 'bar', - :'foo.baz' => 'baz') + got = model.iwhere('foo.bar': 'bar', + 'foo.baz': 'baz') expect(got).to eq(final) end -- cgit v1.2.1 From 870e38ead93901bbe5a2a809422e60d555cbf8e8 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Mon, 25 Jan 2016 12:39:50 +0100 Subject: updated docs to reflect version update [ci skip] --- README.md | 2 +- doc/install/installation.md | 2 +- doc/install/requirements.md | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3ec1d4a776c..6ab3b1fcc5f 100644 --- a/README.md +++ b/README.md @@ -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: - Ubuntu/Debian/CentOS/RHEL -- Ruby (MRI) 2.1 +- Ruby (MRI) 2.2 - Git 1.7.10+ - Redis 2.8+ - MySQL or PostgreSQL diff --git a/doc/install/installation.md b/doc/install/installation.md index aef35436571..1c0da6fbef4 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -107,7 +107,7 @@ Then select 'Internet Site' and press enter to confirm the hostname. ## 2. Ruby -_**Note:** The current supported Ruby versions are 2.1.x. Ruby 2.2 and 2.3 are +_**Note:** The current supported Ruby version is 2.2.x. Ruby 2.3 is currently not supported._ The use of Ruby version managers such as [RVM], [rbenv] or [chruby] with GitLab diff --git a/doc/install/requirements.md b/doc/install/requirements.md index c0425f27ab1..fde1aaa90f3 100644 --- a/doc/install/requirements.md +++ b/doc/install/requirements.md @@ -32,8 +32,7 @@ Please consider using a virtual machine to run GitLab. ## Ruby versions -GitLab requires Ruby (MRI) 2.1.x and currently does not work with versions 2.2 -and 2.3. +GitLab requires Ruby (MRI) 2.2.x and currently does not work with version 2.3. You will have to use the standard MRI implementation of Ruby. We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/) but GitLab -- cgit v1.2.1 From 05697adb42acc943d666f629ddfa07f7cc9e636c Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Fri, 1 Jan 2016 18:23:47 -0500 Subject: Limit jquery-ui requires to what we actually use This commit is a smoke test to run CI and see if we get back any JS errors. --- app/assets/javascripts/application.js.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee index 48c9890cfb5..d5e6ff0717a 100644 --- a/app/assets/javascripts/application.js.coffee +++ b/app/assets/javascripts/application.js.coffee @@ -5,7 +5,10 @@ # the compiled file. # #= 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.cookie #= require jquery.endless-scroll -- cgit v1.2.1 From 9b7dd5a4ee2fee8f57a720c6942a0126b982cfcf Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Mon, 25 Jan 2016 23:18:51 -0500 Subject: Makes ol margin big enough for 3 digits. Fixes #7960 --- app/assets/stylesheets/framework/typography.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/framework/typography.scss b/app/assets/stylesheets/framework/typography.scss index 4866a17005d..8d8f41287da 100644 --- a/app/assets/stylesheets/framework/typography.scss +++ b/app/assets/stylesheets/framework/typography.scss @@ -115,7 +115,7 @@ ul, ol { padding: 0; - margin: 6px 0 6px 18px !important; + margin: 6px 0 6px 28px !important; } li { -- cgit v1.2.1 From 55e031a0d0b3a96b6e4b867d4e934572726bcd63 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Tue, 26 Jan 2016 00:25:41 -0500 Subject: Adds feature: Ajax Close/Open updates discussion automatically Triggers jQuery event Fixes #5544 --- app/assets/javascripts/issue.js.coffee | 1 + app/assets/javascripts/notes.js.coffee | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/assets/javascripts/issue.js.coffee b/app/assets/javascripts/issue.js.coffee index cbc70cd846c..d663e34871c 100644 --- a/app/assets/javascripts/issue.js.coffee +++ b/app/assets/javascripts/issue.js.coffee @@ -50,6 +50,7 @@ class @Issue new Flash(issueFailMessage, 'alert') success: (data, textStatus, jqXHR) -> if data.saved + $(document).trigger('issuable:change'); if isClose $('a.btn-close').addClass('hidden') $('a.btn-reopen').removeClass('hidden') diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 53d72be66e3..e12eb857f80 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -64,6 +64,8 @@ class @Notes # fetch notes when tab becomes visible $(document).on "visibilitychange", @visibilityChange + $(document).on "issuable:change", @refresh + cleanBinding: -> $(document).off "ajax:success", ".js-main-target-form" $(document).off "ajax:success", ".js-discussion-note-form" -- cgit v1.2.1 From ed8256a28bcfffc9eb8b9f2d52b47dc01c543884 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Tue, 26 Jan 2016 00:28:27 -0500 Subject: Adds comment about event listener --- app/assets/javascripts/notes.js.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index e12eb857f80..3347ab65c90 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -64,6 +64,7 @@ class @Notes # fetch notes when tab becomes visible $(document).on "visibilitychange", @visibilityChange + # when issue status changes, we need to refresh data $(document).on "issuable:change", @refresh cleanBinding: -> -- cgit v1.2.1 From 128a6411d2a60c855e3c99303d0157f436e32f13 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 25 Jan 2016 16:56:23 +0100 Subject: Don't pluck project IDs for events By instead using a sub-query we save ourselves the overhead of loading any data into memory only to pass it on to another query. --- app/controllers/dashboard/projects_controller.rb | 2 +- app/controllers/dashboard_controller.rb | 6 +++--- app/controllers/groups_controller.rb | 6 +----- app/models/event.rb | 6 +++++- app/models/project.rb | 2 ++ 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/controllers/dashboard/projects_controller.rb b/app/controllers/dashboard/projects_controller.rb index 58e9049f158..0b7fcdf5e9e 100644 --- a/app/controllers/dashboard/projects_controller.rb +++ b/app/controllers/dashboard/projects_controller.rb @@ -36,7 +36,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController private def load_events - @events = Event.in_projects(@projects.pluck(:id)) + @events = Event.in_projects(@projects) @events = @event_filter.apply_filter(@events).with_associations @events = @events.limit(20).offset(params[:offset] || 0) end diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 087da935087..139e40db180 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -23,14 +23,14 @@ class DashboardController < Dashboard::ApplicationController protected def load_events - project_ids = + projects = if params[:filter] == "starred" current_user.starred_projects else 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 = @events.limit(20).offset(params[:offset] || 0) end diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index fb26a4e6fc3..7bbef5ab29c 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -87,10 +87,6 @@ class GroupsController < Groups::ApplicationController @projects ||= ProjectsFinder.new.execute(current_user, group: group).sorted_by_activity.non_archived end - def project_ids - @projects.pluck(:id) - end - # Dont allow unauthorized access to group def authorize_read_group! unless @group and (@projects.present? or can?(current_user, :read_group, @group)) @@ -123,7 +119,7 @@ class GroupsController < Groups::ApplicationController end def load_events - @events = Event.in_projects(project_ids) + @events = Event.in_projects(@projects) @events = event_filter.apply_filter(@events).with_associations @events = @events.limit(20).offset(params[:offset] || 0) end diff --git a/app/models/event.rb b/app/models/event.rb index 01d008035a5..8dfc1d04709 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -47,7 +47,11 @@ class Event < ActiveRecord::Base # Scopes scope :recent, -> { reorder(id: :desc) } 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.reorder(nil).id_only).recent + end + scope :with_associations, -> { includes(project: :namespace) } scope :for_milestone_id, ->(milestone_id) { where(target_type: "Milestone", target_id: milestone_id) } diff --git a/app/models/project.rb b/app/models/project.rb index 4bd51449c25..63ecf5b7105 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -215,6 +215,8 @@ class Project < ActiveRecord::Base scope :public_and_internal_only, -> { where(visibility_level: Project.public_and_internal_levels) } scope :non_archived, -> { where(archived: false) } + scope :id_only, -> { select(:id) } + state_machine :import_status, initial: :none do event :import_start do transition [:none, :finished] => :started -- cgit v1.2.1 From 89aeed183ccbadc9580945a68b8df83f50856c2c Mon Sep 17 00:00:00 2001 From: James Lopez Date: Tue, 26 Jan 2016 12:16:47 +0100 Subject: feature and fix for 500 on group missing --- app/controllers/groups_controller.rb | 1 + features/explore/groups.feature | 5 +++++ features/steps/explore/groups.rb | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index fb26a4e6fc3..828e5509262 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -81,6 +81,7 @@ class GroupsController < Groups::ApplicationController def group @group ||= Group.find_by(path: params[:id]) + render_404 unless @group end def load_projects diff --git a/features/explore/groups.feature b/features/explore/groups.feature index 5fc9b135601..7529dcc3d9d 100644 --- a/features/explore/groups.feature +++ b/features/explore/groups.feature @@ -3,6 +3,11 @@ Feature: Explore Groups Background: Given group "TestGroup" has private project "Enterprise" + Scenario: I should not see a group if it does not exist + When I sign in as a user + And I visit group "NonExistentGroup" page + Then page status code should be 404 + Scenario: I should see group with private and internal projects as user Given group "TestGroup" has internal project "Internal" When I sign in as a user diff --git a/features/steps/explore/groups.rb b/features/steps/explore/groups.rb index 87f32e70d59..68c473e7b29 100644 --- a/features/steps/explore/groups.rb +++ b/features/steps/explore/groups.rb @@ -26,6 +26,10 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps visit group_path(Group.find_by(name: "TestGroup")) end + step 'I visit group "NonExistentGroup" page' do + visit group_path(-1) + end + step 'I visit group "TestGroup" issues page' do visit issues_group_path(Group.find_by(name: "TestGroup")) end -- cgit v1.2.1 From d6a186135f320904507bf9f195fc9637719552d0 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Tue, 26 Jan 2016 15:43:09 +0100 Subject: fix for failing spec --- app/controllers/groups_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 828e5509262..f7c6607aff7 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -81,7 +81,8 @@ class GroupsController < Groups::ApplicationController def group @group ||= Group.find_by(path: params[:id]) - render_404 unless @group + return @group if @group + render_404 end def load_projects -- cgit v1.2.1 From 5ea32ba4982aef37f2a43b0324d45033992a9a60 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 26 Jan 2016 19:05:04 +0100 Subject: Fix hot reloading for CI API --- lib/ci/api/api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ci/api/api.rb b/lib/ci/api/api.rb index 5c347e432b4..4e85d2c3c74 100644 --- a/lib/ci/api/api.rb +++ b/lib/ci/api/api.rb @@ -25,7 +25,7 @@ module Ci format :json - helpers Helpers + helpers ::Ci::API::Helpers helpers ::API::Helpers helpers Gitlab::CurrentSettings -- cgit v1.2.1 From de7c9c7ab17a8b36ca0c645ba1a7a6971a077fb1 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 26 Jan 2016 11:54:57 +0100 Subject: Use Atom update times of the first event By simply loading the first event from the already sorted set we save ourselves extra (slow) queries just to get the latest update timestamp. This removes the need for Event.latest_update_time and significantly reduces the time needed to build an Atom feed. Fixes gitlab-org/gitlab-ce#12415 --- app/models/event.rb | 8 +------- app/models/project.rb | 2 -- app/views/dashboard/projects/index.atom.builder | 2 +- app/views/groups/show.atom.builder | 2 +- app/views/projects/show.atom.builder | 2 +- app/views/users/show.atom.builder | 2 +- spec/models/event_spec.rb | 21 --------------------- 7 files changed, 5 insertions(+), 34 deletions(-) diff --git a/app/models/event.rb b/app/models/event.rb index 8dfc1d04709..4be23a1cf72 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -49,7 +49,7 @@ class Event < ActiveRecord::Base scope :code_push, -> { where(action: PUSHED) } scope :in_projects, ->(projects) do - where(project_id: projects.reorder(nil).id_only).recent + where(project_id: projects.select(:id).reorder(nil)).recent end scope :with_associations, -> { includes(project: :namespace) } @@ -68,12 +68,6 @@ class Event < ActiveRecord::Base [Event::CREATED, Event::CLOSED, Event::MERGED]) 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) recent.limit(limit).offset(offset) end diff --git a/app/models/project.rb b/app/models/project.rb index 63ecf5b7105..4bd51449c25 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -215,8 +215,6 @@ class Project < ActiveRecord::Base scope :public_and_internal_only, -> { where(visibility_level: Project.public_and_internal_levels) } scope :non_archived, -> { where(archived: false) } - scope :id_only, -> { select(:id) } - state_machine :import_status, initial: :none do event :import_start do transition [:none, :finished] => :started diff --git a/app/views/dashboard/projects/index.atom.builder b/app/views/dashboard/projects/index.atom.builder index 2e2712c5146..d4daf07c6c0 100644 --- a/app/views/dashboard/projects/index.atom.builder +++ b/app/views/dashboard/projects/index.atom.builder @@ -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, rel: "alternate", type: "text/html" 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| event_to_atom(xml, event) diff --git a/app/views/groups/show.atom.builder b/app/views/groups/show.atom.builder index 5cc0f5e1d2e..c66b82bb484 100644 --- a/app/views/groups/show.atom.builder +++ b/app/views/groups/show.atom.builder @@ -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), rel: "alternate", type: "text/html" 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| event_to_atom(xml, event) diff --git a/app/views/projects/show.atom.builder b/app/views/projects/show.atom.builder index d6762219108..2468509242a 100644 --- a/app/views/projects/show.atom.builder +++ b/app/views/projects/show.atom.builder @@ -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), rel: "alternate", type: "text/html" 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| event_to_atom(xml, event) diff --git a/app/views/users/show.atom.builder b/app/views/users/show.atom.builder index 114d1e7a379..e9e466c6350 100644 --- a/app/views/users/show.atom.builder +++ b/app/views/users/show.atom.builder @@ -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), rel: "alternate", type: "text/html" 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| event_to_atom(xml, event) diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index 071582b0282..ec2a923f91b 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -65,27 +65,6 @@ describe Event, models: true do it { expect(@event.author).to eq(@user) } 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 let!(:event1) { create(:closed_issue_event) } let!(:event2) { create(:closed_issue_event) } -- cgit v1.2.1 From eef9c9d4476c46cf13215814944eed47576f862a Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 27 Jan 2016 10:44:24 +0100 Subject: update fix based on feedback --- app/controllers/groups_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index f7c6607aff7..3d175a0717e 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -81,8 +81,7 @@ class GroupsController < Groups::ApplicationController def group @group ||= Group.find_by(path: params[:id]) - return @group if @group - render_404 + @group || render_404 end def load_projects -- cgit v1.2.1 From 5eb936dc318297473a40ab9cac06de106dc71c41 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 27 Jan 2016 11:23:28 +0100 Subject: moved and refactored feature based on feedback. Also updated CHANGELOG --- CHANGELOG | 1 + features/explore/groups.feature | 5 ----- features/groups.feature | 4 ++++ features/steps/explore/groups.rb | 4 ---- features/steps/groups.rb | 4 ++++ 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8d1f8d59b3c..a9102ea4206 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ v 8.5.0 (unreleased) - Fix diff comments loaded by AJAX to load comment with diff in discussion tab - Whitelist raw "abbr" elements when parsing Markdown (Benedict Etzel) - Don't vendor minified JS + - Display 404 error on group not found v 8.4.1 - Apply security updates for Rails (4.2.5.1), rails-html-sanitizer (1.0.3), diff --git a/features/explore/groups.feature b/features/explore/groups.feature index 7529dcc3d9d..5fc9b135601 100644 --- a/features/explore/groups.feature +++ b/features/explore/groups.feature @@ -3,11 +3,6 @@ Feature: Explore Groups Background: Given group "TestGroup" has private project "Enterprise" - Scenario: I should not see a group if it does not exist - When I sign in as a user - And I visit group "NonExistentGroup" page - Then page status code should be 404 - Scenario: I should see group with private and internal projects as user Given group "TestGroup" has internal project "Internal" When I sign in as a user diff --git a/features/groups.feature b/features/groups.feature index c803e952980..55fffb012ae 100644 --- a/features/groups.feature +++ b/features/groups.feature @@ -3,6 +3,10 @@ Feature: Groups Given I sign in as "John Doe" 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 When I visit group "Owned" page Then I should see back to dashboard button diff --git a/features/steps/explore/groups.rb b/features/steps/explore/groups.rb index 68c473e7b29..87f32e70d59 100644 --- a/features/steps/explore/groups.rb +++ b/features/steps/explore/groups.rb @@ -26,10 +26,6 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps visit group_path(Group.find_by(name: "TestGroup")) end - step 'I visit group "NonExistentGroup" page' do - visit group_path(-1) - end - step 'I visit group "TestGroup" issues page' do visit issues_group_path(Group.find_by(name: "TestGroup")) end diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 4c5122d1b7d..1e2a78a6029 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -120,6 +120,10 @@ class Spinach::Features::Groups < Spinach::FeatureSteps expect(page).to have_xpath("//span[@class='label label-warning']", text: 'archived') end + step 'I visit group "NonExistentGroup" page' do + visit group_path(-1) + end + private def assigned_to_me(key) -- cgit v1.2.1 From 95d2f0fb51de2c5800d41b7c4f285ed533ffe21a Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 26 Jan 2016 19:25:48 +0100 Subject: Fix CI runner version not being properly updated when asking for a build Due to broken implementation of attribute_for_keys the runner information was not updated correctly. This MR adds test to check that such scenario will never happen again. --- CHANGELOG | 1 + lib/api/helpers.rb | 5 +++-- lib/ci/api/builds.rb | 2 +- lib/ci/api/helpers.rb | 10 +++++++--- lib/ci/api/runners.rb | 1 + spec/requests/ci/api/builds_spec.rb | 15 +++++++++++++++ spec/requests/ci/api/runners_spec.rb | 14 ++++++++++++++ 7 files changed, 42 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 4b283f235a4..c2b43d32c48 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,6 +16,7 @@ v 8.4.2 (unreleased) - Bump required gitlab-workhorse version to bring in a fix for missing artifacts in the build artifacts browser - 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 improvement when checking if a repository was empty - Add instrumentation for Gitlab::Git::Repository instance methods so we can diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 3f528b9f7c0..9dacf7c1e86 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -153,10 +153,11 @@ module API end def attributes_for_keys(keys, custom_params = nil) + params_hash = custom_params || params attrs = {} keys.each do |key| - if params[key].present? or (params.has_key?(key) and params[key] == false) - attrs[key] = params[key] + if params_hash[key].present? or (params_hash.has_key?(key) and params_hash[key] == false) + attrs[key] = params_hash[key] end end ActionController::Parameters.new(attrs).permit! diff --git a/lib/ci/api/builds.rb b/lib/ci/api/builds.rb index 690bbf97a89..416b0b5f0b4 100644 --- a/lib/ci/api/builds.rb +++ b/lib/ci/api/builds.rb @@ -13,13 +13,13 @@ module Ci post "register" do authenticate_runner! update_runner_last_contact + update_runner_info required_attributes! [:token] not_found! unless current_runner.active? build = Ci::RegisterBuildService.new.execute(current_runner) if build - update_runner_info present build, with: Entities::BuildDetails else not_found! diff --git a/lib/ci/api/helpers.rb b/lib/ci/api/helpers.rb index 1c91204e98c..199d62d9b8a 100644 --- a/lib/ci/api/helpers.rb +++ b/lib/ci/api/helpers.rb @@ -34,10 +34,14 @@ module Ci @runner ||= Runner.find_by_token(params[:token].to_s) end - def update_runner_info + def get_runner_version_from_params return unless params["info"].present? - info = attributes_for_keys(["name", "version", "revision", "platform", "architecture"], params["info"]) - current_runner.update(info) + attributes_for_keys(["name", "version", "revision", "platform", "architecture"], params["info"]) + end + + def update_runner_info + current_runner.assign_attributes(get_runner_version_from_params) + current_runner.save if current_runner.changed? end def max_artifacts_size diff --git a/lib/ci/api/runners.rb b/lib/ci/api/runners.rb index bfc14fe7a6b..192b1d18a51 100644 --- a/lib/ci/api/runners.rb +++ b/lib/ci/api/runners.rb @@ -47,6 +47,7 @@ module Ci return forbidden! unless runner if runner.id + runner.update(get_runner_version_from_params) present runner, with: Entities::Runner else not_found! diff --git a/spec/requests/ci/api/builds_spec.rb b/spec/requests/ci/api/builds_spec.rb index eec927102aa..244947762dd 100644 --- a/spec/requests/ci/api/builds_spec.rb +++ b/spec/requests/ci/api/builds_spec.rb @@ -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"][0]["name"]).to eq("rspec") 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 describe "PUT /builds/:id" do diff --git a/spec/requests/ci/api/runners_spec.rb b/spec/requests/ci/api/runners_spec.rb index 5942aa7a1b5..db8189ffb79 100644 --- a/spec/requests/ci/api/runners_spec.rb +++ b/spec/requests/ci/api/runners_spec.rb @@ -51,6 +51,20 @@ describe Ci::API::API do expect(response.status).to eq(400) 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 describe "DELETE /runners/delete" do -- cgit v1.2.1 From 1b84de573d0afe8c8d81db4ef2897a925686d212 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 27 Jan 2016 14:48:15 +0100 Subject: updated docs to reflect min requirement of 2.1 [ci skip] --- doc/install/installation.md | 2 +- doc/install/requirements.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 1c0da6fbef4..f05097fedc5 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -107,7 +107,7 @@ Then select 'Internet Site' and press enter to confirm the hostname. ## 2. Ruby -_**Note:** The current supported Ruby version is 2.2.x. Ruby 2.3 is +_**Note:** The current supported Ruby versions are 2.1.x and 2.2.x. Ruby 2.3 is currently not supported._ The use of Ruby version managers such as [RVM], [rbenv] or [chruby] with GitLab diff --git a/doc/install/requirements.md b/doc/install/requirements.md index fde1aaa90f3..006dae8ca9a 100644 --- a/doc/install/requirements.md +++ b/doc/install/requirements.md @@ -32,7 +32,7 @@ Please consider using a virtual machine to run GitLab. ## Ruby versions -GitLab requires Ruby (MRI) 2.2.x and currently does not work with version 2.3. +GitLab requires Ruby (MRI) 2.1.x or 2.2.x and currently does not work with version 2.3. You will have to use the standard MRI implementation of Ruby. We love [JRuby](http://jruby.org/) and [Rubinius](http://rubini.us/) but GitLab -- cgit v1.2.1 From b8ed5789c03961444fc40baca31f870b30a73766 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 27 Jan 2016 15:41:05 +0100 Subject: update gitlab ci settings to include ruby 2.1 images --- .gitlab-ci.yml | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dca861faf12..414344a7f75 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -134,3 +134,119 @@ bundler:audit: - ruby - mysql allow_failure: true + +# Ruby 2.1 jobs + +spec:feature: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:feature + tags: + - ruby + - mysql + only: + - master + +spec:api:ruby21: + image: ruby:2.1 + script: + - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:api + tags: + - ruby + - mysql + only: + - master + +spec:models:ruby21: + image: ruby:2.1 + script: + - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:models + tags: + - ruby + - mysql + only: + - master + +spec:lib:ruby21: + image: ruby:2.1 + script: + - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:lib + tags: + - ruby + - mysql + only: + - master + +spec:services:ruby21: + image: ruby:2.1 + script: + - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:services + tags: + - ruby + - mysql + only: + - master + +spec:benchmark:ruby21: + image: ruby:2.1 + script: + - RAILS_ENV=test bundle exec rake spec:benchmark + tags: + - ruby + - mysql + allow_failure: true + only: + - master + +spec:other:ruby21: + image: ruby:2.1 + script: + - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:other + tags: + - ruby + - mysql + only: + - master + +spinach:project:half:ruby21: + image: ruby:2.1 + script: + - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half + tags: + - ruby + - mysql + only: + - master + +spinach:project:rest:ruby21: + image: ruby:2.1 + script: + - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest + tags: + - ruby + - mysql + only: + - master + +spinach:other:ruby21: + image: ruby:2.1 + script: + - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:other + tags: + - ruby + - mysql + only: + - master + +bundler:audit:ruby21: + image: ruby:2.1 + script: + - "bundle exec bundle-audit update" + - "bundle exec bundle-audit check" + tags: + - ruby + - mysql + allow_failure: true + only: + - master -- cgit v1.2.1 From 606f8e91905cfefd1f68044aeeedcb27e04fe081 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Wed, 27 Jan 2016 16:08:42 +0100 Subject: Increase contrast between highlighted code comments and inline diff marker. --- CHANGELOG | 1 + app/assets/stylesheets/highlight/dark.scss | 4 ++-- app/assets/stylesheets/highlight/monokai.scss | 4 ++-- app/assets/stylesheets/highlight/solarized_dark.scss | 4 ++-- app/assets/stylesheets/highlight/solarized_light.scss | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 4b283f235a4..b52a6b33e9c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,6 +20,7 @@ v 8.4.2 (unreleased) improvement when checking if a repository was empty - Add instrumentation for Gitlab::Git::Repository instance methods so we can track them in Performance Monitoring. + - Increase contrast between highlighted code comments and inline diff marker. v 8.4.2 (unreleased) - Fix method undefined when using external commit status in builds diff --git a/app/assets/stylesheets/highlight/dark.scss b/app/assets/stylesheets/highlight/dark.scss index 41a4579e1bc..b794da2ce98 100644 --- a/app/assets/stylesheets/highlight/dark.scss +++ b/app/assets/stylesheets/highlight/dark.scss @@ -22,11 +22,11 @@ // Diff line .line_holder { .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 { - @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 { diff --git a/app/assets/stylesheets/highlight/monokai.scss b/app/assets/stylesheets/highlight/monokai.scss index 22cee1af39f..9098e07adcd 100644 --- a/app/assets/stylesheets/highlight/monokai.scss +++ b/app/assets/stylesheets/highlight/monokai.scss @@ -22,11 +22,11 @@ // Diff line .line_holder { .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 { - @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 { diff --git a/app/assets/stylesheets/highlight/solarized_dark.scss b/app/assets/stylesheets/highlight/solarized_dark.scss index 0e8f30b4b0b..8b1a2824f76 100644 --- a/app/assets/stylesheets/highlight/solarized_dark.scss +++ b/app/assets/stylesheets/highlight/solarized_dark.scss @@ -22,11 +22,11 @@ // Diff line .line_holder { .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 { - @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 { diff --git a/app/assets/stylesheets/highlight/solarized_light.scss b/app/assets/stylesheets/highlight/solarized_light.scss index 08b6c835907..7ad89dd2c7c 100644 --- a/app/assets/stylesheets/highlight/solarized_light.scss +++ b/app/assets/stylesheets/highlight/solarized_light.scss @@ -22,11 +22,11 @@ // Diff line .line_holder { .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 { - @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 { -- cgit v1.2.1 From e862af95375ed9e7ff778352c3900946bbb8e7e7 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 27 Jan 2016 16:16:03 +0100 Subject: merge spec and spinach jobs --- .gitlab-ci.yml | 101 +++------------------------------------------------------ 1 file changed, 4 insertions(+), 97 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 414344a7f75..dbdbae9d787 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -137,116 +137,23 @@ bundler:audit: # Ruby 2.1 jobs -spec:feature:ruby21: +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:feature - tags: - - ruby - - mysql - only: - - master - -spec:api:ruby21: - image: ruby:2.1 - script: - - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:api - tags: - - ruby - - mysql - only: - - master - -spec:models:ruby21: - image: ruby:2.1 - script: - - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:models - tags: - - ruby - - mysql - only: - - master - -spec:lib:ruby21: - image: ruby:2.1 - script: - - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:lib - tags: - - ruby - - mysql - only: - - master - -spec:services:ruby21: - image: ruby:2.1 - script: - - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:services - tags: - - ruby - - mysql - only: - - master - -spec:benchmark:ruby21: - image: ruby:2.1 - script: - - RAILS_ENV=test bundle exec rake spec:benchmark - tags: - - ruby - - mysql - allow_failure: true - only: - - master - -spec:other:ruby21: - image: ruby:2.1 - script: - - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec:other + - RAILS_ENV=test SIMPLECOV=true bundle exec rake spec tags: - ruby - mysql only: - master -spinach:project:half:ruby21: +spinach:ruby21: image: ruby:2.1 script: - - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:half + - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach tags: - ruby - mysql only: - master - -spinach:project:rest:ruby21: - image: ruby:2.1 - script: - - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:project:rest - tags: - - ruby - - mysql - only: - - master - -spinach:other:ruby21: - image: ruby:2.1 - script: - - RAILS_ENV=test SIMPLECOV=true bundle exec rake spinach:other - tags: - - ruby - - mysql - only: - - master - -bundler:audit:ruby21: - image: ruby:2.1 - script: - - "bundle exec bundle-audit update" - - "bundle exec bundle-audit check" - tags: - - ruby - - mysql - allow_failure: true - only: - - master -- cgit v1.2.1 From 47e0d6b16242cef440244e7d31f1310dea42f5ef Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 27 Jan 2016 16:19:16 +0100 Subject: updated README to include Ruby 2.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ab3b1fcc5f..22dbf841bdc 100644 --- a/README.md +++ b/README.md @@ -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: - Ubuntu/Debian/CentOS/RHEL -- Ruby (MRI) 2.2 +- Ruby (MRI) 2.1 or 2.2 - Git 1.7.10+ - Redis 2.8+ - MySQL or PostgreSQL -- cgit v1.2.1 From 8c6231d1844c651eae31841e879a31a9c5d32cb8 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 27 Jan 2016 16:13:43 -0500 Subject: Update CHANGELOG [ci skip] --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index d78c38cf1dc..6727751dd63 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,8 @@ v 8.5.0 (unreleased) - 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 - 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 - Whitelist raw "abbr" elements when parsing Markdown (Benedict Etzel) -- cgit v1.2.1 From 716892b4fdc93dbf21a1d0142444174d7415d747 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 27 Jan 2016 17:48:52 -0500 Subject: Update CHANGELOG [ci skip] --- CHANGELOG | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1c809254341..14f2f14becd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -15,7 +15,7 @@ v 8.5.0 (unreleased) - Fix visibility level text in admin area (Zeger-Jan van de Weg) - 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 artifacts in the build artifacts browser - Get rid of those ugly borders on the file tree view @@ -24,9 +24,7 @@ v 8.4.2 (unreleased) improvement when checking if a repository was empty - Add instrumentation for Gitlab::Git::Repository instance methods so we can track them in Performance Monitoring. - - Increase contrast between highlighted code comments and inline diff marker. - -v 8.4.2 (unreleased) + - Increase contrast between highlighted code comments and inline diff marker - Fix method undefined when using external commit status in builds v 8.4.1 -- cgit v1.2.1 From ca171b8190623023f3e6d00146abee8651cec857 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 27 Jan 2016 18:29:00 -0500 Subject: Update gitlab-workhorse versions in documentation [ci skip] --- doc/install/installation.md | 2 +- doc/update/8.3-to-8.4.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index f05097fedc5..2cc2dbef41b 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -355,7 +355,7 @@ GitLab Shell is an SSH access and repository management software developed speci cd /home/git sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git 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 ### Initialize Database and Activate Advanced Features diff --git a/doc/update/8.3-to-8.4.md b/doc/update/8.3-to-8.4.md index 164cbcb53ce..616b1f58b65 100644 --- a/doc/update/8.3-to-8.4.md +++ b/doc/update/8.3-to-8.4.md @@ -48,7 +48,7 @@ which should already be on your system from GitLab 8.1. ```bash cd /home/git/gitlab-workhorse 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 ``` -- cgit v1.2.1