From 2f3b69f34162d94f38452591d3ad7c0b0e4a7434 Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 13 Jun 2018 17:28:19 +0000 Subject: Merge branch 'bvl-missing-message-on-access-denied' into 'master' Render access denied without message Closes #47844 See merge request gitlab-org/gitlab-ce!19755 --- app/controllers/application_controller.rb | 6 ++++-- app/views/errors/access_denied.html.haml | 2 +- spec/controllers/application_controller_spec.rb | 10 ++++++++++ spec/views/errors/access_denied.html.haml_spec.rb | 7 +++++++ 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 spec/views/errors/access_denied.html.haml_spec.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 041837c5410..56312f801fb 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -284,8 +284,10 @@ class ApplicationController < ActionController::Base return unless current_user return if current_user.terms_accepted? + message = _("Please accept the Terms of Service before continuing.") + if sessionless_user? - render_403 + access_denied!(message) else # Redirect to the destination if the request is a get. # Redirect to the source if it was a post, so the user can re-submit after @@ -296,7 +298,7 @@ class ApplicationController < ActionController::Base URI(request.referer).path if request.referer end - flash[:notice] = _("Please accept the Terms of Service before continuing.") + flash[:notice] = message redirect_to terms_path(redirect: redirect_path), status: :found end end diff --git a/app/views/errors/access_denied.html.haml b/app/views/errors/access_denied.html.haml index 227c7884915..8ae29b9d337 100644 --- a/app/views/errors/access_denied.html.haml +++ b/app/views/errors/access_denied.html.haml @@ -1,4 +1,4 @@ -- message = local_assigns.fetch(:message) +- message = local_assigns.fetch(:message, nil) - content_for(:title, 'Access Denied') = image_tag('illustrations/error-403.svg', alt: '403', lazy: false) diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 773bf25ed44..fbafb4a4de8 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -458,6 +458,8 @@ describe ApplicationController do end context 'for sessionless users' do + render_views + before do sign_out user end @@ -468,6 +470,14 @@ describe ApplicationController do expect(response).to have_gitlab_http_status(403) end + it 'renders the error message when the format was html' do + get :index, + private_token: create(:personal_access_token, user: user).token, + format: :html + + expect(response.body).to have_content /accept the terms of service/i + end + it 'renders a 200 when the sessionless user accepted the terms' do accept_terms(user) diff --git a/spec/views/errors/access_denied.html.haml_spec.rb b/spec/views/errors/access_denied.html.haml_spec.rb new file mode 100644 index 00000000000..bde2f6f0169 --- /dev/null +++ b/spec/views/errors/access_denied.html.haml_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' + +describe 'errors/access_denied' do + it 'does not fail to render when there is no message provided' do + expect { render }.not_to raise_error + end +end -- cgit v1.2.3 From 83adcb74bc722dde7de215d3f39f4150f5061e96 Mon Sep 17 00:00:00 2001 From: Clement Ho Date: Wed, 13 Jun 2018 21:13:56 +0000 Subject: Merge branch 'jivl-fix-repository-instruction-wrapping-text' into 'master' Remove card class from the git-empty containers Closes #47847 See merge request gitlab-org/gitlab-ce!19785 --- app/views/projects/empty.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index bf6fc8af12d..69753427d17 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -44,14 +44,14 @@ .git-empty %fieldset %h5 Git global setup - %pre.card.bg-light + %pre.bg-light :preserve git config --global user.name "#{h git_user_name}" git config --global user.email "#{h git_user_email}" %fieldset %h5 Create a new repository - %pre.card.bg-light + %pre.bg-light :preserve git clone #{ content_tag(:span, default_url_to_repo, class: 'clone')} cd #{h @project.path} @@ -64,7 +64,7 @@ %fieldset %h5 Existing folder - %pre.card.bg-light + %pre.bg-light :preserve cd existing_folder git init @@ -77,7 +77,7 @@ %fieldset %h5 Existing Git repository - %pre.card.bg-light + %pre.bg-light :preserve cd existing_repo git remote rename origin old-origin -- cgit v1.2.3 From 56fb3e55956f4be577af9bf9ad341d69d0499cac Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Wed, 13 Jun 2018 12:54:07 +0000 Subject: Merge branch 'sql-buckets' into 'master' Adjust SQL and transaction Prometheus buckets See merge request gitlab-org/gitlab-ce!19650 --- changelogs/unreleased/sql-buckets.yml | 5 +++++ lib/gitlab/metrics/subscribers/active_record.rb | 2 +- lib/gitlab/metrics/transaction.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/sql-buckets.yml diff --git a/changelogs/unreleased/sql-buckets.yml b/changelogs/unreleased/sql-buckets.yml new file mode 100644 index 00000000000..afb13d5cb20 --- /dev/null +++ b/changelogs/unreleased/sql-buckets.yml @@ -0,0 +1,5 @@ +--- +title: Adjust SQL and transaction Prometheus buckets +merge_request: +author: +type: other diff --git a/lib/gitlab/metrics/subscribers/active_record.rb b/lib/gitlab/metrics/subscribers/active_record.rb index 4b3e8d0a6a0..38f119cf06d 100644 --- a/lib/gitlab/metrics/subscribers/active_record.rb +++ b/lib/gitlab/metrics/subscribers/active_record.rb @@ -20,7 +20,7 @@ module Gitlab define_histogram :gitlab_sql_duration_seconds do docstring 'SQL time' base_labels Transaction::BASE_LABELS - buckets [0.001, 0.01, 0.1, 1.0, 10.0] + buckets [0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0] end def current_transaction diff --git a/lib/gitlab/metrics/transaction.rb b/lib/gitlab/metrics/transaction.rb index f3e48083c19..9f903e96585 100644 --- a/lib/gitlab/metrics/transaction.rb +++ b/lib/gitlab/metrics/transaction.rb @@ -140,7 +140,7 @@ module Gitlab define_histogram :gitlab_transaction_duration_seconds do docstring 'Transaction duration' base_labels BASE_LABELS - buckets [0.001, 0.01, 0.1, 1.0, 10.0] + buckets [0.1, 0.25, 0.5, 1.0, 2.5, 5.0] end define_histogram :gitlab_transaction_allocated_memory_bytes do -- cgit v1.2.3 From a331fd3a5a08217a495df9e72fd417738985b842 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Thu, 14 Jun 2018 09:12:29 +0000 Subject: Merge branch 'assignee-lists-tiers-docs' into 'master' Add assignee lists to tiers table in docs See merge request gitlab-org/gitlab-ce!19756 --- doc/user/project/issue_board.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/user/project/issue_board.md b/doc/user/project/issue_board.md index aa2fcd82787..9ca1e6226c5 100644 --- a/doc/user/project/issue_board.md +++ b/doc/user/project/issue_board.md @@ -250,12 +250,12 @@ One group issue board per group was made available in GitLab 10.6 Core after mul Different issue board features are available in different [GitLab tiers](https://about.gitlab.com/pricing/), as shown in the following table: -| Tier | Number of project issue boards | Board with configuration in project issue boards | Number of group issue boards | Board with configuration in group issue boards | -| --- | --- | --- | --- | --- | -| Core | 1 | No | 1 | No | -| Starter | Multiple | Yes | 1 | No | -| Premium | Multiple | Yes | Multiple | Yes | -| Ultimate | Multiple | Yes | Multiple | Yes | +| Tier | Number of Project Issue Boards | Number of Group Issue Boards | Configurable Project Issue Boards | Configurable Group Issue Boards | Assignee Lists +| --- | --- | --- | --- | --- | --- | +| Core | 1 | 1 | No | No | No | +| Starter | Multiple | 1 | Yes | No | No | +| Premium | Multiple | Multiple | Yes | Yes | Yes | +| Ultimate | Multiple | Multiple | Yes | Yes | Yes | ## Tips -- cgit v1.2.3 From fec8bb5100e1a7c61dacb6095379fce0ac196210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Wed, 13 Jun 2018 16:53:16 +0000 Subject: Merge branch 'qa-clear-session-only-if-block-given-and-no-errors' into 'master' QA: Only clear the sessions if there's no error with a block Closes gitlab-qa#197 See merge request gitlab-org/gitlab-ce!19751 --- qa/qa/runtime/browser.rb | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb index a12d95683af..ecd273c6db8 100644 --- a/qa/qa/runtime/browser.rb +++ b/qa/qa/runtime/browser.rb @@ -102,19 +102,7 @@ module QA def perform(&block) visit(url) - yield if block_given? - rescue - raise if block.nil? - - # RSpec examples will take care of screenshots on their own - # - unless block.binding.receiver.is_a?(RSpec::Core::ExampleGroup) - screenshot_and_save_page - end - - raise - ensure - clear! if block_given? + yield.tap { clear! } if block_given? end ## -- cgit v1.2.3