Redirect to GCP page if users try to create a cluster but the account is not enabled
Description
During cluster creation in CI/CD > Cluster, users are asked to connect to their existing Google account via OAuth2.
In order to be able to actually create a cluster, the account must meet some requisites, first of all it needs to have GCP enabled (with billing and a project). If this is not true, an error is raised and the process stops.
We already have the list of requirements in that page, we should also make simple for users to reach the GPC page.
Proposal
In case users are not enabled to GCP, instead of showing the error message we should redirect them to the GCP page so they can finalize the setup for their account and then be able to create the cluster.
As an additional feature, if users don't have a Google account yet (seems to be an edge case anyway), we can also provide a link to create one. Actually the OAuth2 login form allows you to create one, but the option is hidden and you should click on More options first, so adding a direct link just near to the Sign in with Google button can be easier. See https://gitlab.com/gitlab-org/gitlab-ce/issues/39957#note_46607914.
-
users that choose to create a new Google account will be redirected to Google Sign Up page, with then automatic redirection to GCP free trial sign up: https://accounts.google.com/SignUpWithoutGmail?service=cloudconsole&continue=https%3A%2F%2Fconsole.cloud.google.com%2Ffreetrial%3Futm_campaign%3D2018_cpanel%26utm_source%3Dgitlab%26utm_medium%3Dreferral
-
We will not include a dedicated page for the checks
-
If the user is not logged in, the checks are started when the login succeeds
-
If the user is already logged in, the checks are started when the user clicks the
Create on GKE
button -
After clicking the create button, the result of the checks is picked up (from Redis)
- if you don't have billing we fail the creation form: show validation message as we show form errors
- if we don't have check finished we still fail: show validation message as we show form errors
- if we validated that project we proceed with creation,
Authentication Flowchart
OUTDATED
Mockups
Google sign-in page
-
The Google sign-in page now includes a link to create a Google account
-
Since we'll be checking for the account's requirements in a different page, we can remove the bulletpoints we currently show on this page, making it simpler and friendlier.
-
The title shown below the dropdown on this page is
Sign in with Google
Google Cloud Platform check
THIS IS OUTDATED
-
If the account doesn't meet one of the GCP requirements, this page is shown.
-
The title shown on this page is
Enable Google Cloud Platform
-
If a requirement is not met, it will be shown as an empty bullet point
-
If a requirement is met, it will be shown as a checkmark
-
As long as one of the requirements is not met, the
Continue
button will be disabled -
This page should perform polling to determine when all requirements are met so the checkmarks can be displayed and the button enabled. If this is not possible, we can show a message instructing the user to refresh the page once they complete the requirements.
No requierments met | One requirement met | All requierements met |
---|---|---|
Cluster Form
Links / references
- Kubernetes/GKE integration: https://gitlab.com/gitlab-org/gitlab-ce/issues/35956