summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-07 15:05:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-07 15:05:59 +0000
commit31040b5bfe48f8d73830f473513164427522b3a6 (patch)
tree6301b395ad45d7a0f84aa0f9c31373889208d09b /app/controllers
parent185f428fa5e6123ffa0f29e307523da138e7b028 (diff)
downloadgitlab-ce-31040b5bfe48f8d73830f473513164427522b3a6.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/health_controller.rb20
-rw-r--r--app/controllers/registrations_controller.rb18
2 files changed, 26 insertions, 12 deletions
diff --git a/app/controllers/health_controller.rb b/app/controllers/health_controller.rb
index 99840e40af1..d88ec06a18b 100644
--- a/app/controllers/health_controller.rb
+++ b/app/controllers/health_controller.rb
@@ -5,23 +5,21 @@ class HealthController < ActionController::Base
include RequiresWhitelistedMonitoringClient
def readiness
- results = checks.flat_map(&:readiness)
- success = results.all?(&:success)
-
- # disable static error pages at the gitlab-workhorse level, we want to see this error response even in production
- headers["X-GitLab-Custom-Error"] = 1 unless success
-
- response = results.map { |result| [result.name, result.payload] }.to_h
- render json: response, status: success ? :ok : :service_unavailable
+ render_probe(::Gitlab::HealthChecks::Probes::Readiness)
end
def liveness
- render json: { status: 'ok' }, status: :ok
+ render_probe(::Gitlab::HealthChecks::Probes::Liveness)
end
private
- def checks
- ::Gitlab::HealthChecks::CHECKS
+ def render_probe(probe_class)
+ result = probe_class.new.execute
+
+ # disable static error pages at the gitlab-workhorse level, we want to see this error response even in production
+ headers["X-GitLab-Custom-Error"] = 1 unless result.success?
+
+ render json: result.json, status: result.http_status
end
end
diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb
index 2e4c6a801b0..3a2975e92d6 100644
--- a/app/controllers/registrations_controller.rb
+++ b/app/controllers/registrations_controller.rb
@@ -6,13 +6,19 @@ class RegistrationsController < Devise::RegistrationsController
include RecaptchaExperimentHelper
include InvisibleCaptcha
+ layout :choose_layout
+
prepend_before_action :check_captcha, only: :create
before_action :whitelist_query_limiting, only: [:destroy]
before_action :ensure_terms_accepted,
if: -> { action_name == 'create' && Gitlab::CurrentSettings.current_application_settings.enforce_terms? }
def new
- redirect_to(new_user_session_path)
+ if helpers.use_experimental_separate_sign_up_flow?
+ @resource = build_resource
+ else
+ redirect_to new_user_session_path(anchor: 'register-pane')
+ end
end
def create
@@ -144,6 +150,16 @@ class RegistrationsController < Devise::RegistrationsController
def stored_location_or_dashboard(user)
stored_location_for(user) || dashboard_projects_path
end
+
+ # Part of an experiment to build a new sign up flow. Will be resolved
+ # with https://gitlab.com/gitlab-org/growth/engineering/issues/64
+ def choose_layout
+ if helpers.use_experimental_separate_sign_up_flow?
+ 'devise_experimental_separate_sign_up_flow'
+ else
+ 'devise'
+ end
+ end
end
RegistrationsController.prepend_if_ee('EE::RegistrationsController')