From 8ff73614a1466ffc39e4464462719e7456c03e29 Mon Sep 17 00:00:00 2001 From: Mayra Cabrera Date: Wed, 23 Jan 2019 10:28:19 -0600 Subject: Moves domain setting to Cluster setting Changes domain field to be on the Cluster page show, removing it from Auto DevOps setting. Also injects the new environment variable KUBE_INGRESS_BASE_DOMAIN into kubernetes#predefined_variables. Migration to move the information from ProjectAutoDevops#domain to Clusters::Cluster#domain. As well as necessary modifications to qa selectors Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52363 --- app/views/clusters/clusters/_form.html.haml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'app/views/clusters/clusters/_form.html.haml') diff --git a/app/views/clusters/clusters/_form.html.haml b/app/views/clusters/clusters/_form.html.haml index 4c47e11927e..068f14364ec 100644 --- a/app/views/clusters/clusters/_form.html.haml +++ b/app/views/clusters/clusters/_form.html.haml @@ -20,12 +20,28 @@ .form-text.text-muted= s_("ClusterIntegration|Choose which of your environments will use this cluster.") - else = text_field_tag :environment_scope, '*', class: 'col-md-6 form-control disabled', placeholder: s_('ClusterIntegration|Environment scope'), disabled: true - - environment_scope_url = 'https://docs.gitlab.com/ee/user/project/clusters/#setting-the-environment-scope-premium' + - environment_scope_url = 'https://docs.gitlab.com/ee/user/project/clusters/#base-domain' - environment_scope_start = ''.html_safe % { url: environment_scope_url } .form-text.text-muted %code * = s_("ClusterIntegration| is the default environment scope for this cluster. This means that all jobs, regardless of their environment, will use this cluster. %{environment_scope_start}More information%{environment_scope_end}").html_safe % { environment_scope_start: environment_scope_start, environment_scope_end: ''.html_safe } + .form-group + %h5= s_('ClusterIntegration|Base domain') + = field.text_field :domain, class: 'col-md-6 form-control js-select-on-focus' + .form-text.text-muted + - if @cluster.application_ingress_external_ip.present? + - auto_devops_url = 'https://docs.gitlab.com/ee/topics/autodevops/' + - auto_devops_start = ''.html_safe % { url: auto_devops_url } + = s_('ClusterIntegration|Specifying a domain will allow you to use Auto Review Apps and Auto Deploy stages for %{auto_devops_start}Auto DevOps%{auto_devops_end}. The domain should have a wildcard DNS configured to the Ingress IP Address below.').html_safe % { auto_devops_start: auto_devops_start, auto_devops_end: ''.html_safe } + = s_('ClusterIntegration|Alternatively') + %code #{@cluster.application_ingress_external_ip}.nip.io + - custom_domain_url = 'https://docs.gitlab.com/ee/user/project/clusters/#pointing-your-dns-at-the-cluster-ip' + - custom_domain_start = ''.html_safe % { url: custom_domain_url } + = s_('ClusterIntegration| can be used instead of a custom domain. %{custom_domain_start}More information%{custom_domain_end}').html_safe % { custom_domain_start: custom_domain_start, custom_domain_end: ''.html_safe } + - else + = s_('ClusterIntegration|Before setting a domain, you must first install Ingress on your cluster below.') + - if can?(current_user, :update_cluster, @cluster) .form-group = field.submit _('Save changes'), class: 'btn btn-success' -- cgit v1.2.1 From 087af654bbae1e4a843029b33e1aab546f4d7d61 Mon Sep 17 00:00:00 2001 From: Mayra Cabrera Date: Thu, 31 Jan 2019 08:58:58 -0600 Subject: Addresses backend/db review comments - Fixes multiple typos on AutoDevops script - Add an alias to Clusters::Cluster#domain as base_domain, so it's more descriptive - Removes unnecessary memoization on qa specs - Changes migration to a post migration to deal better with traffic on big instances (like gitlab.com) --- app/views/clusters/clusters/_form.html.haml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/views/clusters/clusters/_form.html.haml') diff --git a/app/views/clusters/clusters/_form.html.haml b/app/views/clusters/clusters/_form.html.haml index 068f14364ec..e0d3b7e1aec 100644 --- a/app/views/clusters/clusters/_form.html.haml +++ b/app/views/clusters/clusters/_form.html.haml @@ -20,7 +20,7 @@ .form-text.text-muted= s_("ClusterIntegration|Choose which of your environments will use this cluster.") - else = text_field_tag :environment_scope, '*', class: 'col-md-6 form-control disabled', placeholder: s_('ClusterIntegration|Environment scope'), disabled: true - - environment_scope_url = 'https://docs.gitlab.com/ee/user/project/clusters/#base-domain' + - environment_scope_url = help_page_path('user/project/clusters', anchor: 'base-domain') - environment_scope_start = ''.html_safe % { url: environment_scope_url } .form-text.text-muted %code * @@ -28,15 +28,15 @@ .form-group %h5= s_('ClusterIntegration|Base domain') - = field.text_field :domain, class: 'col-md-6 form-control js-select-on-focus' + = field.text_field :base_domain, class: 'col-md-6 form-control js-select-on-focus' .form-text.text-muted - if @cluster.application_ingress_external_ip.present? - - auto_devops_url = 'https://docs.gitlab.com/ee/topics/autodevops/' + - auto_devops_url = help_page_path('topics/autodevops/') - auto_devops_start = ''.html_safe % { url: auto_devops_url } = s_('ClusterIntegration|Specifying a domain will allow you to use Auto Review Apps and Auto Deploy stages for %{auto_devops_start}Auto DevOps%{auto_devops_end}. The domain should have a wildcard DNS configured to the Ingress IP Address below.').html_safe % { auto_devops_start: auto_devops_start, auto_devops_end: ''.html_safe } = s_('ClusterIntegration|Alternatively') %code #{@cluster.application_ingress_external_ip}.nip.io - - custom_domain_url = 'https://docs.gitlab.com/ee/user/project/clusters/#pointing-your-dns-at-the-cluster-ip' + - custom_domain_url = help_page_path('user/project/clusters/', anchor: 'pointing-your-dns-at-the-cluster-ip') - custom_domain_start = ''.html_safe % { url: custom_domain_url } = s_('ClusterIntegration| can be used instead of a custom domain. %{custom_domain_start}More information%{custom_domain_end}').html_safe % { custom_domain_start: custom_domain_start, custom_domain_end: ''.html_safe } - else -- cgit v1.2.1 From d9af3752fcfa6e97bcec82515b0cbc1ab88285de Mon Sep 17 00:00:00 2001 From: Mayra Cabrera Date: Tue, 5 Feb 2019 13:11:33 -0600 Subject: Addresses UX and BE comments: - Changes help text on clusters form to make it more explicit. - Removes unnecessary warnings on auto devops form - Simplifies cluster methods logic --- app/views/clusters/clusters/_form.html.haml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'app/views/clusters/clusters/_form.html.haml') diff --git a/app/views/clusters/clusters/_form.html.haml b/app/views/clusters/clusters/_form.html.haml index e0d3b7e1aec..7acd9ce0562 100644 --- a/app/views/clusters/clusters/_form.html.haml +++ b/app/views/clusters/clusters/_form.html.haml @@ -20,7 +20,7 @@ .form-text.text-muted= s_("ClusterIntegration|Choose which of your environments will use this cluster.") - else = text_field_tag :environment_scope, '*', class: 'col-md-6 form-control disabled', placeholder: s_('ClusterIntegration|Environment scope'), disabled: true - - environment_scope_url = help_page_path('user/project/clusters', anchor: 'base-domain') + - environment_scope_url = help_page_path('user/project/clusters/index', anchor: 'base-domain') - environment_scope_start = ''.html_safe % { url: environment_scope_url } .form-text.text-muted %code * @@ -30,17 +30,16 @@ %h5= s_('ClusterIntegration|Base domain') = field.text_field :base_domain, class: 'col-md-6 form-control js-select-on-focus' .form-text.text-muted + - auto_devops_url = help_page_path('topics/autodevops/index') + - auto_devops_start = ''.html_safe % { url: auto_devops_url } + = s_('ClusterIntegration|Specifying a domain will allow you to use Auto Review Apps and Auto Deploy stages for %{auto_devops_start}Auto DevOps%{auto_devops_end}. The domain should have a wildcard DNS configured matching the domain.').html_safe % { auto_devops_start: auto_devops_start, auto_devops_end: ''.html_safe } - if @cluster.application_ingress_external_ip.present? - - auto_devops_url = help_page_path('topics/autodevops/') - - auto_devops_start = ''.html_safe % { url: auto_devops_url } - = s_('ClusterIntegration|Specifying a domain will allow you to use Auto Review Apps and Auto Deploy stages for %{auto_devops_start}Auto DevOps%{auto_devops_end}. The domain should have a wildcard DNS configured to the Ingress IP Address below.').html_safe % { auto_devops_start: auto_devops_start, auto_devops_end: ''.html_safe } = s_('ClusterIntegration|Alternatively') %code #{@cluster.application_ingress_external_ip}.nip.io - - custom_domain_url = help_page_path('user/project/clusters/', anchor: 'pointing-your-dns-at-the-cluster-ip') - - custom_domain_start = ''.html_safe % { url: custom_domain_url } - = s_('ClusterIntegration| can be used instead of a custom domain. %{custom_domain_start}More information%{custom_domain_end}').html_safe % { custom_domain_start: custom_domain_start, custom_domain_end: ''.html_safe } - - else - = s_('ClusterIntegration|Before setting a domain, you must first install Ingress on your cluster below.') + = s_('ClusterIntegration| can be used instead of a custom domain.') + - custom_domain_url = help_page_path('user/project/clusters/index', anchor: 'pointing-your-dns-at-the-cluster-ip') + - custom_domain_start = ''.html_safe % { url: custom_domain_url } + = s_('ClusterIntegration| %{custom_domain_start}More information%{custom_domain_end}.').html_safe % { custom_domain_start: custom_domain_start, custom_domain_end: ''.html_safe } - if can?(current_user, :update_cluster, @cluster) .form-group -- cgit v1.2.1