Commit 04a4c443 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents e19bfdf5 42d44783
# frozen_string_literal: true
class Projects::GoogleCloudController < Projects::ApplicationController
before_action :authorize_can_manage_google_cloud_deployments!
feature_category :release_orchestration
def index
end
private
def authorize_can_manage_google_cloud_deployments!
access_denied! unless can?(current_user, :manage_project_google_cloud, project)
end
end
...@@ -438,6 +438,7 @@ class ProjectPolicy < BasePolicy ...@@ -438,6 +438,7 @@ class ProjectPolicy < BasePolicy
enable :destroy_freeze_period enable :destroy_freeze_period
enable :admin_feature_flags_client enable :admin_feature_flags_client
enable :update_runners_registration_token enable :update_runners_registration_token
enable :manage_project_google_cloud
end end
rule { public_project & metrics_dashboard_allowed }.policy do rule { public_project & metrics_dashboard_allowed }.policy do
......
- breadcrumb_title _('Google Cloud')
- page_title _('Google Cloud')
- @content_class = "limit-container-width" unless fluid_layout
#js-google-cloud
%h1.gl-font-size-h1 Google Cloud
%section#js-section-google-cloud-service-accounts
%h2.gl-font-size-h2 Service Accounts
%p= _('Service Accounts keys are required to authorize GitLab to deploy your Google Cloud project.')
%table.table.b-table.gl-table
%thead
%tr
%th Environment
%th GCP Project ID
%th Service Account Key
%tbody
%tr
%td *
%td serving-salutes-453
%td .....
%tr
%td production
%td crimson-corey-234
%td .....
%tr
%td review/*
%td roving-river-379
%td .....
%a.gl-button.btn.btn-primary= _('Add new service account')
%br
%section#js-section-google-cloud-deployments
.row.row-fluid
.col-lg-4
%h2.gl-font-size-h2 Deployments
%p= _('Google Cloud offers several deployment targets. Select the one most suitable for your project.')
%p
= _('Deployments to Google Kubernetes Engine can be ')
%a{ href: '#' }= _('managed')
= _('in Infrastructure :: Kubernetes clusters')
.col-lg-8
%br
.gl-card.gl-mb-6
.gl-card-body
.gl-display-flex.gl-align-items-baseline
%strong.gl-font-lg App Engine
.gl-ml-auto.gl-text-gray-500 Disabled
%p= _('App Engine description and apps that are suitable for this deployment target')
%button.gl-button.btn.btn-default= _('Configure via Merge Request')
.gl-card.gl-mb-6
.gl-card-body
.gl-display-flex.gl-align-items-baseline
%strong.gl-font-lg Cloud Functions
.gl-ml-auto.gl-text-gray-500 Disabled
%p= _('Cloud Functions description and apps that are suitable for this deployment target')
%button.gl-button.btn.btn-default= _('Configure via Merge Request')
.gl-card.gl-mb-6
.gl-card-body
.gl-display-flex.gl-align-items-baseline
%strong.gl-font-lg Cloud Run
.gl-ml-auto.gl-text-gray-500 Disabled
%p= _('Cloud Run description and apps that are suitable for this deployment target')
%button.gl-button.btn.btn-default= _('Configure via Merge Request')
---
name: incubation_5mp_google_cloud
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70715
rollout_issue_url:
milestone: '14.3'
type: development
group: group::incubation
default_enabled: false
...@@ -313,6 +313,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -313,6 +313,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
resources :terraform, only: [:index] resources :terraform, only: [:index]
resources :google_cloud, only: [:index]
resources :environments, except: [:destroy] do resources :environments, except: [:destroy] do
member do member do
post :stop post :stop
......
...@@ -12,6 +12,7 @@ full list of reference architectures, see ...@@ -12,6 +12,7 @@ full list of reference architectures, see
> - **Supported users (approximate):** 10,000 > - **Supported users (approximate):** 10,000
> - **High Availability:** Yes ([Praefect](#configure-praefect-postgresql) needs a third-party PostgreSQL solution for HA) > - **High Availability:** Yes ([Praefect](#configure-praefect-postgresql) needs a third-party PostgreSQL solution for HA)
> - **Cloud Native Hybrid:** [Yes](#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative)
> - **Test requests per second (RPS) rates:** API: 200 RPS, Web: 20 RPS, Git (Pull): 20 RPS, Git (Push): 4 RPS > - **Test requests per second (RPS) rates:** API: 200 RPS, Web: 20 RPS, Git (Pull): 20 RPS, Git (Push): 4 RPS
> - **[Latest 10k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/10k)** > - **[Latest 10k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/10k)**
......
...@@ -18,6 +18,8 @@ many organizations. ...@@ -18,6 +18,8 @@ many organizations.
> - **Supported users (approximate):** 1,000 > - **Supported users (approximate):** 1,000
> - **High Availability:** No. For a highly-available environment, you can > - **High Availability:** No. For a highly-available environment, you can
> follow a modified [3K reference architecture](3k_users.md#supported-modifications-for-lower-user-counts-ha). > follow a modified [3K reference architecture](3k_users.md#supported-modifications-for-lower-user-counts-ha).
> - **Cloud Native Hybrid:** No. For a cloud native hybrid environment, you
> can follow a [modified hybrid reference architecture](#cloud-native-hybrid-reference-architecture-with-helm-charts).
> - **Test requests per second (RPS) rates:** API: 20 RPS, Web: 2 RPS, Git (Pull): 2 RPS, Git (Push): 1 RPS > - **Test requests per second (RPS) rates:** API: 20 RPS, Web: 2 RPS, Git (Pull): 2 RPS, Git (Push): 1 RPS
> - **[Latest 1k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/1k)** > - **[Latest 1k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/1k)**
...@@ -58,3 +60,12 @@ Elasticsearch cluster design and requirements are dependent on your specific ...@@ -58,3 +60,12 @@ Elasticsearch cluster design and requirements are dependent on your specific
data. For recommended best practices about how to set up your Elasticsearch data. For recommended best practices about how to set up your Elasticsearch
cluster alongside your instance, read how to cluster alongside your instance, read how to
[choose the optimal cluster configuration](../../integration/elasticsearch.md#guidance-on-choosing-optimal-cluster-configuration). [choose the optimal cluster configuration](../../integration/elasticsearch.md#guidance-on-choosing-optimal-cluster-configuration).
## Cloud Native Hybrid reference architecture with Helm Charts
Cloud Native Hybrid Reference Architecture is an alternative approach where select _stateless_
components are deployed in Kubernetes via our official [Helm Charts](https://docs.gitlab.com/charts/),
and _stateful_ components are deployed in compute VMs with Omnibus.
The [2k GitLab Cloud Native Hybrid](2k_users.md#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative) (non HA) and [3k GitLab Cloud Native Hybrid](3k_users.md#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative) (HA) reference architectures are the smallest we recommend in Kubernetes.
For environments that need to serve less users, you can lower the node specs. Depending on your user count, you can lower all suggested node specs as desired. However, it's recommended that you don't go lower than the [general requirements](../../install/requirements.md).
...@@ -12,6 +12,7 @@ full list of reference architectures, see ...@@ -12,6 +12,7 @@ full list of reference architectures, see
> - **Supported users (approximate):** 25,000 > - **Supported users (approximate):** 25,000
> - **High Availability:** Yes ([Praefect](#configure-praefect-postgresql) needs a third-party PostgreSQL solution for HA) > - **High Availability:** Yes ([Praefect](#configure-praefect-postgresql) needs a third-party PostgreSQL solution for HA)
> - **Cloud Native Hybrid:** [Yes](#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative)
> - **Test requests per second (RPS) rates:** API: 500 RPS, Web: 50 RPS, Git (Pull): 50 RPS, Git (Push): 10 RPS > - **Test requests per second (RPS) rates:** API: 500 RPS, Web: 50 RPS, Git (Pull): 50 RPS, Git (Push): 10 RPS
> - **[Latest 25k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/25k)** > - **[Latest 25k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/25k)**
......
...@@ -13,6 +13,7 @@ For a full list of reference architectures, see ...@@ -13,6 +13,7 @@ For a full list of reference architectures, see
> - **Supported users (approximate):** 2,000 > - **Supported users (approximate):** 2,000
> - **High Availability:** No. For a highly-available environment, you can > - **High Availability:** No. For a highly-available environment, you can
> follow a modified [3K reference architecture](3k_users.md#supported-modifications-for-lower-user-counts-ha). > follow a modified [3K reference architecture](3k_users.md#supported-modifications-for-lower-user-counts-ha).
> - **Cloud Native Hybrid:** [Yes](#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative)
> - **Test requests per second (RPS) rates:** API: 40 RPS, Web: 4 RPS, Git (Pull): 4 RPS, Git (Push): 1 RPS > - **Test requests per second (RPS) rates:** API: 40 RPS, Web: 4 RPS, Git (Pull): 4 RPS, Git (Push): 1 RPS
> - **[Latest 2k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/2k)** > - **[Latest 2k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/2k)**
......
...@@ -22,6 +22,7 @@ For a full list of reference architectures, see ...@@ -22,6 +22,7 @@ For a full list of reference architectures, see
> - **Supported users (approximate):** 3,000 > - **Supported users (approximate):** 3,000
> - **High Availability:** Yes, although [Praefect](#configure-praefect-postgresql) needs a third-party PostgreSQL solution > - **High Availability:** Yes, although [Praefect](#configure-praefect-postgresql) needs a third-party PostgreSQL solution
> - **Cloud Native Hybrid:** [Yes](#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative)
> - **Test requests per second (RPS) rates:** API: 60 RPS, Web: 6 RPS, Git (Pull): 6 RPS, Git (Push): 1 RPS > - **Test requests per second (RPS) rates:** API: 60 RPS, Web: 6 RPS, Git (Pull): 6 RPS, Git (Push): 1 RPS
> - **[Latest 3k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/3k)** > - **[Latest 3k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/3k)**
......
...@@ -12,6 +12,7 @@ full list of reference architectures, see ...@@ -12,6 +12,7 @@ full list of reference architectures, see
> - **Supported users (approximate):** 50,000 > - **Supported users (approximate):** 50,000
> - **High Availability:** Yes ([Praefect](#configure-praefect-postgresql) needs a third-party PostgreSQL solution for HA) > - **High Availability:** Yes ([Praefect](#configure-praefect-postgresql) needs a third-party PostgreSQL solution for HA)
> - **Cloud Native Hybrid:** [Yes](#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative)
> - **Test requests per second (RPS) rates:** API: 1000 RPS, Web: 100 RPS, Git (Pull): 100 RPS, Git (Push): 20 RPS > - **Test requests per second (RPS) rates:** API: 1000 RPS, Web: 100 RPS, Git (Pull): 100 RPS, Git (Push): 20 RPS
> - **[Latest 50k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/50k)** > - **[Latest 50k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/50k)**
......
...@@ -19,6 +19,7 @@ costly-to-operate environment by using the ...@@ -19,6 +19,7 @@ costly-to-operate environment by using the
> - **Supported users (approximate):** 5,000 > - **Supported users (approximate):** 5,000
> - **High Availability:** Yes ([Praefect](#configure-praefect-postgresql) needs a third-party PostgreSQL solution for HA) > - **High Availability:** Yes ([Praefect](#configure-praefect-postgresql) needs a third-party PostgreSQL solution for HA)
> - **Cloud Native Hybrid:** [Yes](#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative)
> - **Test requests per second (RPS) rates:** API: 100 RPS, Web: 10 RPS, Git (Pull): 10 RPS, Git (Push): 2 RPS > - **Test requests per second (RPS) rates:** API: 100 RPS, Web: 10 RPS, Git (Pull): 10 RPS, Git (Push): 2 RPS
> - **[Latest 5k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/5k)** > - **[Latest 5k weekly performance testing results](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/5k)**
......
...@@ -62,8 +62,8 @@ The value must be the full URL of the merge request. ...@@ -62,8 +62,8 @@ The value must be the full URL of the merge request.
### GitLab Enterprise changes ### GitLab Enterprise changes
If a change is for GitLab Enterprise Edition, you must also add the trailer `EE: If a change is exclusively for GitLab Enterprise Edition, **you must add** the
true`: trailer `EE: true`:
```plaintext ```plaintext
Update git vendor to gitlab Update git vendor to gitlab
...@@ -77,6 +77,8 @@ MR: https://gitlab.com/foo/bar/-/merge_requests/123 ...@@ -77,6 +77,8 @@ MR: https://gitlab.com/foo/bar/-/merge_requests/123
EE: true EE: true
``` ```
**Do not** add the trailer for changes that apply to both EE and CE.
## What warrants a changelog entry? ## What warrants a changelog entry?
- Any change that introduces a database migration, whether it's regular, post, - Any change that introduces a database migration, whether it's regular, post,
......
...@@ -45,7 +45,7 @@ result (such as `ml-1` becoming `gl-ml-2`). ...@@ -45,7 +45,7 @@ result (such as `ml-1` becoming `gl-ml-2`).
If a class you need has not been added to GitLab UI, you get to add it! Follow the naming patterns documented in the [utility files](https://gitlab.com/gitlab-org/gitlab-ui/-/tree/main/src/scss/utility-mixins) and refer to [GitLab UI's CSS documentation](https://gitlab.com/gitlab-org/gitlab-ui/-/blob/main/doc/contributing/adding_css.md#adding-utility-mixins) for more details, especially about adding responsive and stateful rules. If a class you need has not been added to GitLab UI, you get to add it! Follow the naming patterns documented in the [utility files](https://gitlab.com/gitlab-org/gitlab-ui/-/tree/main/src/scss/utility-mixins) and refer to [GitLab UI's CSS documentation](https://gitlab.com/gitlab-org/gitlab-ui/-/blob/main/doc/contributing/adding_css.md#adding-utility-mixins) for more details, especially about adding responsive and stateful rules.
If it is not possible to wait for a GitLab UI update (generally one day), add the class to [`utilities.scss`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/stylesheets/utilities.scss) following the same naming conventions documented in GitLab UI. A followup issue to backport the class to GitLab UI and delete it from GitLab should be opened. If it is not possible to wait for a GitLab UI update (generally one day), add the class to [`utilities.scss`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/assets/stylesheets/utilities.scss) following the same naming conventions documented in GitLab UI. A follow-up issue to backport the class to GitLab UI and delete it from GitLab should be opened.
#### When should I create component classes? #### When should I create component classes?
......
...@@ -10,6 +10,24 @@ info: To determine the technical writer assigned to the Stage/Group associated w ...@@ -10,6 +10,24 @@ info: To determine the technical writer assigned to the Stage/Group associated w
Error Tracking allows developers to easily discover and view the errors that their application may be generating. By surfacing error information where the code is being developed, efficiency and awareness can be increased. Error Tracking allows developers to easily discover and view the errors that their application may be generating. By surfacing error information where the code is being developed, efficiency and awareness can be increased.
## How error tracking works
For error tracking to work, you need two pieces:
- **Your application with Sentry SDK:** when the error happens, Sentry SDK captures information
about it and sends it over the network to the backend. The backend stores information about all
errors.
- **Error tracking backend:** the backend can be either GitLab itself or Sentry. When it's GitLab,
we name it _integrated error tracking_ because you don't need to set up a separate backend. It's
already part of the product.
- To use the GitLab backend, see [integrated error tracking](#integrated-error-tracking).
- To use Sentry as the backend, see [Sentry error tracking](#sentry-error-tracking).
No matter what backend you choose, the [error tracking UI](#error-tracking-list)
is the same.
## Sentry error tracking ## Sentry error tracking
[Sentry](https://sentry.io/) is an open source error tracking system. GitLab allows administrators to connect Sentry to GitLab, to allow users to view a list of Sentry errors in GitLab. [Sentry](https://sentry.io/) is an open source error tracking system. GitLab allows administrators to connect Sentry to GitLab, to allow users to view a list of Sentry errors in GitLab.
...@@ -141,15 +159,14 @@ You must use the GitLab API to enable it. ...@@ -141,15 +159,14 @@ You must use the GitLab API to enable it.
1. Take the DSN from the previous step and configure your Sentry SDK with it. Errors are now 1. Take the DSN from the previous step and configure your Sentry SDK with it. Errors are now
reported to the GitLab collector and are visible in the [GitLab UI](#error-tracking-list). reported to the GitLab collector and are visible in the [GitLab UI](#error-tracking-list).
#### How to disable #### Managing DSN
To disable the feature, run this command. This is the same command as the one that enables the When you enable the feature you receive a DSN. It includes a hash used for authentication. This hash
feature, but with a `false` value instead: is a client key. GitLab uses client keys to authenticate error tracking requests from your
application to the GitLab backend.
```shell In some situations, you may want to create a new client key and remove an existing one.
curl --request PATCH --header "PRIVATE-TOKEN: <your_access_token>" \ You can do so by managing client keys with the [error tracking API](../api/error_tracking.md).
"https://gitlab.example.com/api/v4/projects/PROJECT_ID/error_tracking/settings?active=false&integrated=false"
```
#### Limitations #### Limitations
......
# frozen_string_literal: true # frozen_string_literal: true
class Elastic::ReindexingTask < ApplicationRecord class Elastic::ReindexingTask < ApplicationRecord
include IgnorableColumns
self.table_name = 'elastic_reindexing_tasks' self.table_name = 'elastic_reindexing_tasks'
validates :max_slices_running, presence: true validates :max_slices_running, presence: true
validates :slice_multiplier, presence: true validates :slice_multiplier, presence: true
ignore_columns %i[documents_count index_name_from index_name_to elastic_task documents_count_target], remove_with: '14.3', remove_after: '2021-09-10'
has_many :subtasks, class_name: 'Elastic::ReindexingSubtask', foreign_key: :elastic_reindexing_task_id has_many :subtasks, class_name: 'Elastic::ReindexingSubtask', foreign_key: :elastic_reindexing_task_id
enum state: { enum state: {
......
...@@ -16,6 +16,7 @@ RSpec.describe 'Project navbar' do ...@@ -16,6 +16,7 @@ RSpec.describe 'Project navbar' do
insert_package_nav(_('Infrastructure')) insert_package_nav(_('Infrastructure'))
insert_infrastructure_registry_nav insert_infrastructure_registry_nav
insert_infrastructure_google_cloud_nav
end end
context 'when issue analytics is available' do context 'when issue analytics is available' do
......
...@@ -11,6 +11,7 @@ module Sidebars ...@@ -11,6 +11,7 @@ module Sidebars
add_item(kubernetes_menu_item) add_item(kubernetes_menu_item)
add_item(serverless_menu_item) add_item(serverless_menu_item)
add_item(terraform_menu_item) add_item(terraform_menu_item)
add_item(google_cloud_menu_item)
true true
end end
...@@ -87,6 +88,22 @@ module Sidebars ...@@ -87,6 +88,22 @@ module Sidebars
item_id: :terraform item_id: :terraform
) )
end end
def google_cloud_menu_item
feature_is_enabled = Feature.enabled?(:incubation_5mp_google_cloud)
user_has_permissions = can?(context.current_user, :manage_project_google_cloud, context.project)
unless feature_is_enabled && user_has_permissions
return ::Sidebars::NilMenuItem.new(item_id: :incubation_5mp_google_cloud)
end
::Sidebars::MenuItem.new(
title: _('Google Cloud'),
link: project_google_cloud_index_path(context.project),
active_routes: {},
item_id: :google_cloud
)
end
end end
end end
end end
......
...@@ -2045,6 +2045,9 @@ msgstr "" ...@@ -2045,6 +2045,9 @@ msgstr ""
msgid "Add new directory" msgid "Add new directory"
msgstr "" msgstr ""
msgid "Add new service account"
msgstr ""
msgid "Add or remove previously merged commits" msgid "Add or remove previously merged commits"
msgstr "" msgstr ""
...@@ -3959,6 +3962,9 @@ msgstr "" ...@@ -3959,6 +3962,9 @@ msgstr ""
msgid "Any namespace" msgid "Any namespace"
msgstr "" msgstr ""
msgid "App Engine description and apps that are suitable for this deployment target"
msgstr ""
msgid "App ID" msgid "App ID"
msgstr "" msgstr ""
...@@ -7174,6 +7180,12 @@ msgstr "" ...@@ -7174,6 +7180,12 @@ msgstr ""
msgid "Closes this %{quick_action_target}." msgid "Closes this %{quick_action_target}."
msgstr "" msgstr ""
msgid "Cloud Functions description and apps that are suitable for this deployment target"
msgstr ""
msgid "Cloud Run description and apps that are suitable for this deployment target"
msgstr ""
msgid "Cloud licenses can not be removed." msgid "Cloud licenses can not be removed."
msgstr "" msgstr ""
...@@ -8613,6 +8625,9 @@ msgstr "" ...@@ -8613,6 +8625,9 @@ msgstr ""
msgid "Configure the way a user creates a new account." msgid "Configure the way a user creates a new account."
msgstr "" msgstr ""
msgid "Configure via Merge Request"
msgstr ""
msgid "Configure which lists are shown for anyone who visits this board" msgid "Configure which lists are shown for anyone who visits this board"
msgstr "" msgstr ""
...@@ -11385,6 +11400,9 @@ msgstr "" ...@@ -11385,6 +11400,9 @@ msgstr ""
msgid "Deployments" msgid "Deployments"
msgstr "" msgstr ""
msgid "Deployments to Google Kubernetes Engine can be "
msgstr ""
msgid "Deployments|%{deployments} environment impacted." msgid "Deployments|%{deployments} environment impacted."
msgid_plural "Deployments|%{deployments} environments impacted." msgid_plural "Deployments|%{deployments} environments impacted."
msgstr[0] "" msgstr[0] ""
...@@ -15832,6 +15850,12 @@ msgstr "" ...@@ -15832,6 +15850,12 @@ msgstr ""
msgid "Goal of the changes and what reviewers should be aware of" msgid "Goal of the changes and what reviewers should be aware of"
msgstr "" msgstr ""
msgid "Google Cloud"
msgstr ""
msgid "Google Cloud offers several deployment targets. Select the one most suitable for your project."
msgstr ""
msgid "Google authentication is not %{link_start}properly configured%{link_end}. Ask your GitLab administrator if you want to use this service." msgid "Google authentication is not %{link_start}properly configured%{link_end}. Ask your GitLab administrator if you want to use this service."
msgstr "" msgstr ""
...@@ -30832,6 +30856,9 @@ msgstr "" ...@@ -30832,6 +30856,9 @@ msgstr ""
msgid "Service" msgid "Service"
msgstr "" msgstr ""
msgid "Service Accounts keys are required to authorize GitLab to deploy your Google Cloud project."
msgstr ""
msgid "Service Desk" msgid "Service Desk"
msgstr "" msgstr ""
...@@ -40165,6 +40192,9 @@ msgstr "" ...@@ -40165,6 +40192,9 @@ msgstr ""
msgid "in" msgid "in"
msgstr "" msgstr ""
msgid "in Infrastructure :: Kubernetes clusters"
msgstr ""
msgid "in all GitLab" msgid "in all GitLab"
msgstr "" msgstr ""
...@@ -40320,6 +40350,9 @@ msgstr "" ...@@ -40320,6 +40350,9 @@ msgstr ""
msgid "log in" msgid "log in"
msgstr "" msgstr ""
msgid "managed"
msgstr ""
msgid "manual" msgid "manual"
msgstr "" msgstr ""
......
...@@ -18,6 +18,7 @@ RSpec.describe 'Project navbar' do ...@@ -18,6 +18,7 @@ RSpec.describe 'Project navbar' do
stub_config(registry: { enabled: false }) stub_config(registry: { enabled: false })
insert_package_nav(_('Infrastructure')) insert_package_nav(_('Infrastructure'))
insert_infrastructure_registry_nav insert_infrastructure_registry_nav
insert_infrastructure_google_cloud_nav
end end
it_behaves_like 'verified navigation bar' do it_behaves_like 'verified navigation bar' do
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Projects::GoogleCloudController do
let_it_be(:project) { create(:project, :public) }
describe 'GET index' do
let_it_be(:url) { "#{project_google_cloud_index_path(project)}" }
let(:subject) { get url }
context 'when user is authorized' do
let(:user) { project.creator }
before do
sign_in(user)
subject
end
it 'renders content' do
expect(response).to be_successful
end
end
context 'when user is unauthorized' do
let(:user) { create(:user) }
before do
project.add_guest(user)
sign_in(user)
subject
end
it 'shows 404' do
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'when no user is present' do
before do
subject
end
it 'shows 404' do
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
end
...@@ -52,4 +52,12 @@ module NavbarStructureHelper ...@@ -52,4 +52,12 @@ module NavbarStructureHelper
new_sub_nav_item_name: _('Infrastructure Registry') new_sub_nav_item_name: _('Infrastructure Registry')
) )
end end
def insert_infrastructure_google_cloud_nav
insert_after_sub_nav_item(
_('Terraform'),
within: _('Infrastructure'),
new_sub_nav_item_name: _('Google Cloud')
)
end
end end
...@@ -580,6 +580,23 @@ RSpec.describe 'layouts/nav/sidebar/_project' do ...@@ -580,6 +580,23 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
end end
end end
end end
describe 'Google Cloud' do
it 'has a link to the google cloud page' do
render
expect(rendered).to have_link('Google Cloud', href: project_google_cloud_index_path(project))
end
describe 'when the user does not have access' do
let(:user) { nil }
it 'does not have a link to the google cloud page' do
render
expect(rendered).not_to have_link('Google Cloud')
end
end
end
end end
describe 'Packages and Registries' do describe 'Packages and Registries' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment