summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GITALY_SERVER_VERSION2
-rw-r--r--app/assets/javascripts/ci/pipeline_editor/components/header/validation_segment.vue111
-rw-r--r--app/assets/javascripts/ci/pipeline_editor/index.js4
-rw-r--r--app/helpers/ci/pipeline_editor_helper.rb2
-rw-r--r--app/models/protected_branch.rb27
-rw-r--r--config/feature_flags/development/rely_on_protected_branches_cache.yml8
-rw-r--r--doc/development/feature_flags/controls.md2
-rw-r--r--doc/topics/autodevops/cloud_deployments/auto_devops_with_eks.md301
-rw-r--r--doc/topics/autodevops/index.md1
-rw-r--r--doc/user/admin_area/reporting/git_abuse_rate_limit.md8
-rw-r--r--doc/user/group/reporting/git_abuse_rate_limit.md10
-rw-r--r--doc/user/project/merge_requests/creating_merge_requests.md2
-rw-r--r--doc/user/project/repository/branches/img/branch_filter_search_box_v13_12.pngbin15803 -> 0 bytes
-rw-r--r--doc/user/project/repository/branches/img/compare_branches_v13_12.pngbin46536 -> 0 bytes
-rw-r--r--doc/user/project/repository/branches/img/repository_filter_search_box_v13_12.pngbin12634 -> 0 bytes
-rw-r--r--doc/user/project/repository/branches/img/swap_revisions_after_v13_12.pngbin8949 -> 0 bytes
-rw-r--r--doc/user/project/repository/branches/img/swap_revisions_before_v13_12.pngbin8935 -> 0 bytes
-rw-r--r--doc/user/project/repository/branches/index.md86
-rw-r--r--locale/gitlab.pot18
-rw-r--r--spec/frontend/ci/pipeline_editor/components/header/validation_segment_spec.js102
-rw-r--r--spec/frontend/ci/pipeline_editor/mock_data.js2
-rw-r--r--spec/frontend/ci/pipeline_editor/pipeline_editor_app_spec.js6
-rw-r--r--spec/helpers/ci/pipeline_editor_helper_spec.rb2
-rw-r--r--spec/models/protected_branch_spec.rb85
-rw-r--r--workhorse/go.mod2
-rw-r--r--workhorse/go.sum4
26 files changed, 511 insertions, 274 deletions
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION
index 5f0bd4e7c8a..40b9cacdd09 100644
--- a/GITALY_SERVER_VERSION
+++ b/GITALY_SERVER_VERSION
@@ -1 +1 @@
-770edd2d7f8324da646df478eb271544393316df
+212f0e3545668faeb671dac213eaf25be5840bc0
diff --git a/app/assets/javascripts/ci/pipeline_editor/components/header/validation_segment.vue b/app/assets/javascripts/ci/pipeline_editor/components/header/validation_segment.vue
index 84c0eef441f..68b5e00735a 100644
--- a/app/assets/javascripts/ci/pipeline_editor/components/header/validation_segment.vue
+++ b/app/assets/javascripts/ci/pipeline_editor/components/header/validation_segment.vue
@@ -1,8 +1,7 @@
<script>
-import { GlIcon, GlLink, GlLoadingIcon } from '@gitlab/ui';
-import { __, s__, sprintf } from '~/locale';
+import { GlIcon, GlLink, GlLoadingIcon, GlSprintf } from '@gitlab/ui';
+import { s__, sprintf } from '~/locale';
import getAppStatus from '~/ci/pipeline_editor/graphql/queries/client/app_status.query.graphql';
-import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue';
import {
EDITOR_APP_STATUS_EMPTY,
EDITOR_APP_STATUS_LINT_UNAVAILABLE,
@@ -11,15 +10,20 @@ import {
} from '../../constants';
export const i18n = {
- empty: __(
- "We'll continuously validate your pipeline configuration. The validation results will appear here.",
+ empty: s__(
+ "Pipelines|We'll continuously validate your pipeline configuration. The validation results will appear here.",
),
- learnMore: __('Learn more'),
loading: s__('Pipelines|Validating GitLab CI configuration…'),
- invalid: s__('Pipelines|This GitLab CI configuration is invalid.'),
- invalidWithReason: s__('Pipelines|This GitLab CI configuration is invalid: %{reason}.'),
- unavailableValidation: s__('Pipelines|Configuration validation currently not available.'),
- valid: s__('Pipelines|Pipeline syntax is correct.'),
+ invalid: s__(
+ 'Pipelines|This GitLab CI configuration is invalid. %{linkStart}Learn more%{linkEnd}',
+ ),
+ invalidWithReason: s__(
+ 'Pipelines|This GitLab CI configuration is invalid: %{reason}. %{linkStart}Learn more%{linkEnd}',
+ ),
+ unavailableValidation: s__(
+ 'Pipelines|Unable to validate CI/CD configuration. See the %{linkStart}GitLab CI/CD troubleshooting guide%{linkEnd} for more details.',
+ ),
+ valid: s__('Pipelines|Pipeline syntax is correct. %{linkStart}Learn more%{linkEnd}'),
};
export default {
@@ -28,10 +32,10 @@ export default {
GlIcon,
GlLink,
GlLoadingIcon,
- TooltipOnTruncate,
+ GlSprintf,
},
inject: {
- lintUnavailableHelpPagePath: {
+ ciTroubleshootingPath: {
default: '',
},
ymlHelpPagePath: {
@@ -54,49 +58,48 @@ export default {
},
},
computed: {
- helpPath() {
- return this.isLintUnavailable ? this.lintUnavailableHelpPagePath : this.ymlHelpPagePath;
+ APP_STATUS_CONFIG() {
+ return {
+ [EDITOR_APP_STATUS_EMPTY]: {
+ icon: 'check',
+ message: this.$options.i18n.empty,
+ },
+ [EDITOR_APP_STATUS_LINT_UNAVAILABLE]: {
+ icon: 'time-out',
+ link: this.ciTroubleshootingPath,
+ message: this.$options.i18n.unavailableValidation,
+ },
+ [EDITOR_APP_STATUS_VALID]: {
+ icon: 'check',
+ message: this.$options.i18n.valid,
+ },
+ };
},
- isEmpty() {
- return this.appStatus === EDITOR_APP_STATUS_EMPTY;
+ currentAppStatusConfig() {
+ return this.APP_STATUS_CONFIG[this.appStatus] || {};
},
- isLintUnavailable() {
- return this.appStatus === EDITOR_APP_STATUS_LINT_UNAVAILABLE;
+ hasLink() {
+ return this.appStatus !== EDITOR_APP_STATUS_EMPTY;
+ },
+ helpPath() {
+ return this.currentAppStatusConfig.link || this.ymlHelpPagePath;
},
isLoading() {
return this.appStatus === EDITOR_APP_STATUS_LOADING;
},
- isValid() {
- return this.appStatus === EDITOR_APP_STATUS_VALID;
- },
icon() {
- switch (this.appStatus) {
- case EDITOR_APP_STATUS_EMPTY:
- return 'check';
- case EDITOR_APP_STATUS_LINT_UNAVAILABLE:
- return 'time-out';
- case EDITOR_APP_STATUS_VALID:
- return 'check';
- default:
- return 'warning-solid';
- }
+ return this.currentAppStatusConfig.icon || 'warning-solid';
},
message() {
const [reason] = this.ciConfig?.errors || [];
- switch (this.appStatus) {
- case EDITOR_APP_STATUS_EMPTY:
- return this.$options.i18n.empty;
- case EDITOR_APP_STATUS_LINT_UNAVAILABLE:
- return this.$options.i18n.unavailableValidation;
- case EDITOR_APP_STATUS_VALID:
- return this.$options.i18n.valid;
- default:
- // Only display first error as a reason
- return this.ciConfig?.errors?.length > 0
- ? sprintf(this.$options.i18n.invalidWithReason, { reason }, false)
- : this.$options.i18n.invalid;
- }
+ return (
+ this.currentAppStatusConfig.message ||
+ // Only display first error as a reason
+ (reason
+ ? sprintf(this.$options.i18n.invalidWithReason, { reason }, false)
+ : this.$options.i18n.invalid)
+ );
},
},
};
@@ -108,18 +111,16 @@ export default {
<gl-loading-icon size="sm" inline />
{{ $options.i18n.loading }}
</template>
-
- <span v-else class="gl-display-inline-flex gl-white-space-nowrap gl-max-w-full">
- <tooltip-on-truncate :title="message" class="gl-text-truncate">
+ <span v-else data-testid="validation-segment">
+ <span class="gl-max-w-full">
<gl-icon :name="icon" />
- <span data-qa-selector="validation_message_content" data-testid="validationMsg">
- {{ message }}
- </span>
- </tooltip-on-truncate>
- <span v-if="!isEmpty" class="gl-flex-shrink-0 gl-pl-2">
- <gl-link data-testid="learnMoreLink" :href="helpPath">
- {{ $options.i18n.learnMore }}
- </gl-link>
+ <gl-sprintf :message="message">
+ <template v-if="hasLink" #link="{ content }">
+ <gl-link data-qa-selector="validation_message_content" :href="helpPath">{{
+ content
+ }}</gl-link>
+ </template>
+ </gl-sprintf>
</span>
</span>
</div>
diff --git a/app/assets/javascripts/ci/pipeline_editor/index.js b/app/assets/javascripts/ci/pipeline_editor/index.js
index 50d1cb42f5c..d65a7c321ce 100644
--- a/app/assets/javascripts/ci/pipeline_editor/index.js
+++ b/app/assets/javascripts/ci/pipeline_editor/index.js
@@ -30,12 +30,12 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
ciExamplesHelpPagePath,
ciHelpPagePath,
ciLintPath,
+ ciTroubleshootingPath,
defaultBranch,
emptyStateIllustrationPath,
helpPaths,
includesHelpPagePath,
lintHelpPagePath,
- lintUnavailableHelpPagePath,
needsHelpPagePath,
newMergeRequestPath,
pipelinePagePath,
@@ -123,6 +123,7 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
ciExamplesHelpPagePath,
ciHelpPagePath,
ciLintPath,
+ ciTroubleshootingPath,
configurationPaths,
dataMethod: 'graphql',
defaultBranch,
@@ -130,7 +131,6 @@ export const initPipelineEditor = (selector = '#js-pipeline-editor') => {
helpPaths,
includesHelpPagePath,
lintHelpPagePath,
- lintUnavailableHelpPagePath,
needsHelpPagePath,
newMergeRequestPath,
pipelinePagePath,
diff --git a/app/helpers/ci/pipeline_editor_helper.rb b/app/helpers/ci/pipeline_editor_helper.rb
index 99a92ba9b59..4d1bdf5fa7f 100644
--- a/app/helpers/ci/pipeline_editor_helper.rb
+++ b/app/helpers/ci/pipeline_editor_helper.rb
@@ -18,12 +18,12 @@ module Ci
"ci-examples-help-page-path" => help_page_path('ci/examples/index'),
"ci-help-page-path" => help_page_path('ci/index'),
"ci-lint-path" => project_ci_lint_path(project),
+ "ci-troubleshooting-path" => help_page_path('ci/troubleshooting', anchor: 'common-cicd-issues'),
"default-branch" => project.default_branch_or_main,
"empty-state-illustration-path" => image_path('illustrations/empty-state/empty-dag-md.svg'),
"initial-branch-name" => initial_branch,
"includes-help-page-path" => help_page_path('ci/yaml/includes'),
"lint-help-page-path" => help_page_path('ci/lint', anchor: 'check-cicd-syntax'),
- "lint-unavailable-help-page-path" => help_page_path('ci/pipeline_editor/index', anchor: 'configuration-validation-currently-not-available-message'),
"needs-help-page-path" => help_page_path('ci/yaml/index', anchor: 'needs'),
"new-merge-request-path" => namespace_project_new_merge_request_path,
"pipeline_etag" => latest_commit ? graphql_etag_pipeline_sha_path(latest_commit.sha) : '',
diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb
index b3331b99a6b..ac42b3febc6 100644
--- a/app/models/protected_branch.rb
+++ b/app/models/protected_branch.rb
@@ -37,36 +37,11 @@ class ProtectedBranch < ApplicationRecord
return true if project.empty_repo? && project.default_branch_protected?
return false if ref_name.blank?
- dry_run = Feature.disabled?(:rely_on_protected_branches_cache, project)
-
- new_cache_result = new_cache(project, ref_name, dry_run: dry_run)
-
- return new_cache_result unless new_cache_result.nil?
-
- deprecated_cache(project, ref_name)
- end
-
- def self.new_cache(project, ref_name, dry_run: true)
- ProtectedBranches::CacheService.new(project).fetch(ref_name, dry_run: dry_run) do # rubocop: disable CodeReuse/ServiceClass
- self.matching(ref_name, protected_refs: protected_refs(project)).present?
- end
- end
-
- # Deprecated: https://gitlab.com/gitlab-org/gitlab/-/issues/370608
- # ----------------------------------------------------------------
- CACHE_EXPIRE_IN = 1.hour
-
- def self.deprecated_cache(project, ref_name)
- Rails.cache.fetch(protected_ref_cache_key(project, ref_name), expires_in: CACHE_EXPIRE_IN) do
+ ProtectedBranches::CacheService.new(project).fetch(ref_name) do # rubocop: disable CodeReuse/ServiceClass
self.matching(ref_name, protected_refs: protected_refs(project)).present?
end
end
- def self.protected_ref_cache_key(project, ref_name)
- "protected_ref-#{project.cache_key}-#{Digest::SHA1.hexdigest(ref_name)}"
- end
- # End of deprecation --------------------------------------------
-
def self.allow_force_push?(project, ref_name)
if Feature.enabled?(:group_protected_branches)
protected_branches = project.all_protected_branches.matching(ref_name)
diff --git a/config/feature_flags/development/rely_on_protected_branches_cache.yml b/config/feature_flags/development/rely_on_protected_branches_cache.yml
deleted file mode 100644
index 5154d4cee08..00000000000
--- a/config/feature_flags/development/rely_on_protected_branches_cache.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: rely_on_protected_branches_cache
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92937
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/370608
-milestone: '15.4'
-type: development
-group: group::source code
-default_enabled: false
diff --git a/doc/development/feature_flags/controls.md b/doc/development/feature_flags/controls.md
index 3adf5248b8d..f8a592f98f5 100644
--- a/doc/development/feature_flags/controls.md
+++ b/doc/development/feature_flags/controls.md
@@ -84,6 +84,8 @@ When a feature has successfully been
environment and verified as safe and working, you can roll out the
change to GitLab.com (production).
+If a feature is [deprecated](../../update/deprecations.md), do not enable the flag.
+
#### Communicate the change
Some feature flag changes on GitLab.com should be communicated with
diff --git a/doc/topics/autodevops/cloud_deployments/auto_devops_with_eks.md b/doc/topics/autodevops/cloud_deployments/auto_devops_with_eks.md
new file mode 100644
index 00000000000..30cbe06ab95
--- /dev/null
+++ b/doc/topics/autodevops/cloud_deployments/auto_devops_with_eks.md
@@ -0,0 +1,301 @@
+---
+stage: Configure
+group: Configure
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
+---
+
+# Use Auto DevOps to deploy an application to Amazon Elastic Kubernetes Service (EKS)
+
+In this tutorial, we'll help you to get started with [Auto DevOps](../index.md)
+through an example of how to deploy an application to Amazon Elastic Kubernetes Service (EKS).
+
+The tutorial uses the GitLab native Kubernetes integration, so you don't need
+to create a Kubernetes cluster manually using the AWS console.
+
+You can also follow this tutorial on a self-managed instance.
+Ensure your own [runners are configured](../../../ci/runners/index.md).
+
+To deploy a project to EKS:
+
+1. [Configure your Amazon account](#configure-your-amazon-account)
+1. [Create a Kubernetes cluster and deploy the agent](#create-a-kubernetes-cluster)
+1. [Create a new project from a template](#create-an-application-project-from-a-template)
+1. [Configure the agent](#configure-the-agent)
+1. [Install Ingress](#install-ingress)
+1. [Configure Auto DevOps](#configure-auto-devops)
+1. [Enable Auto DevOps and run the pipeline](#enable-auto-devops-and-run-the-pipeline)
+1. [Deploy the application](#deploy-the-application)
+
+## Configure your Amazon account
+
+Before you create and connect your Kubernetes cluster to your GitLab project,
+you need an [Amazon Web Services account](https://https://aws.amazon.com/).
+Sign in with an existing Amazon account or create a new one.
+
+## Create a Kubernetes cluster
+
+To create an new cluster on Amazon EKS:
+
+- Follow the steps in [Create an Amazon EKS cluster](../../../user/infrastructure/clusters/connect/new_eks_cluster.md).
+
+If you prefer, you can also create a cluster manually using `eksctl`.
+
+## Create an application project from a template
+
+Use a GitLab project template to get started. As the name suggests,
+those projects provide a bare-bones application built on some well-known frameworks.
+
+WARNING:
+Create the application project in the group hierarchy at the same level or below the project for cluster management. Otherwise, it fails to [authorize the agent](../../../user/clusters/agent/ci_cd_workflow.md#authorize-the-agent).
+
+1. On the top bar in GitLab, select the plus icon (**{plus-square}**), and select
+ **New project/repository**.
+1. Select **Create from template**.
+1. Select the **Ruby on Rails** template.
+1. Give your project a name, optionally a description, and make it public so that
+ you can take advantage of the features available in the
+ [GitLab Ultimate plan](https://about.gitlab.com/pricing/).
+1. Select **Create project**.
+
+Now you have an application project you are going to deploy to the EKS cluster.
+
+## Configure the agent
+
+Next, we'll configure the GitLab agent for Kubernetes so we can use it to deploy the application project.
+
+1. Go to the project [we created to manage the cluster](#create-a-kubernetes-cluster).
+1. Navigate to the [agent configuration file](../../../user/clusters/agent/install/index.md#create-an-agent-configuration-file) (`.gitlab/agents/eks-agent/config.yaml`) and edit it.
+1. Configure `ci_access:projects` attribute. Use the application project path as `id`:
+
+```yaml
+ci_access:
+ projects:
+ - id: path/to/application-project
+```
+
+## Install Ingress
+
+After your cluster is running, you must install NGINX Ingress Controller as a
+load balancer to route traffic from the internet to your application.
+Install the NGINX Ingress Controller
+through the GitLab [Cluster management project template](../../../user/clusters/management_project_template.md),
+or manually via the command line:
+
+1. Ensure you have `kubectl` and Helm installed on your machine.
+1. Create an IAM role to access the cluster.
+1. Create an access token to access the cluster.
+1. Use `kubectl` to connect to your cluster:
+
+ ```shell
+ helm upgrade --install ingress-nginx ingress-nginx \
+ --repo https://kubernetes.github.io/ingress-nginx \
+ --namespace gitlab-managed-apps --create-namespace
+
+ # Check that the ingress controller is installed successfully
+ kubectl get service ingress-nginx-controller -n gitlab-managed-apps
+ ```
+
+## Configure Auto DevOps
+
+Follow these steps to configure the base domain and other settings required for Auto DevOps.
+
+1. A few minutes after you install NGINX, the load balancer obtains an IP address, and you can
+ get the external IP address with the following command:
+
+ ```shell
+ kubectl get all -n gitlab-managed-apps --selector app.kubernetes.io/instance=ingress-nginx
+ ```
+
+ Replace `gitlab-managed-apps` if you have overwritten your namespace.
+
+ Next, find the actual external IP address for your cluster with the following command:
+
+ ```shell
+ nslookup [External IP]
+ ```
+
+ Where the `[External IP]` is the hostname found with the previous command.
+
+ The IP address might be listed in the `Non-authoritative answer:` section of the response.
+
+ Copy this IP address, as you need it in the next step.
+
+1. Go back to the application project.
+1. On the left sidebar, select **Settings > CI/CD** and expand **Variables**.
+ - Add a key called `KUBE_INGRESS_BASE_DOMAIN` with the application deployment domain as the value. For this example, use the domain `<IP address>.nip.io`.
+ - Add a key called `KUBE_NAMESPACE` with a value of the Kubernetes namespace for your deployments to target. You can use different namespaces per environment. Configure the environment, use the environment scope.
+ - Add a key called `KUBE_CONTEXT` with a value like `path/to/agent/project:eks-agent`. Select the environment scope of your choice.
+ - Select **Save changes**.
+
+## Enable Auto DevOps and run the pipeline
+
+While Auto DevOps is enabled by default, Auto DevOps can be disabled at both
+the instance level (for self-managed instances) and the group level. Complete
+these steps to enable Auto DevOps if it's disabled:
+
+1. On the top bar, select **Main menu > Projects** and find the application project.
+1. On the left sidebar, select **Settings > CI/CD**.
+1. Expand **Auto DevOps**.
+1. Select **Default to Auto DevOps pipeline** to display more options.
+1. In **Deployment strategy**, select your desired [continuous deployment strategy](../requirements.md#auto-devops-deployment-strategy)
+ to deploy the application to production after the pipeline successfully runs on the default branch.
+1. Select **Save changes**.
+1. Edit `.gitlab-ci.yml` file to include the Auto DevOps template and commit the change to the default branch:
+
+ ```yaml
+ include:
+ - template: Auto-DevOps.gitlab-ci.yml
+ ```
+
+The commit should trigger a pipeline. In the next section, we explain what each job does in the pipeline.
+
+## Deploy the application
+
+When your pipeline runs, what is it doing?
+
+To view the jobs in the pipeline, select the pipeline's status badge. The
+**{status_running}** icon displays when pipeline jobs are running, and updates
+without refreshing the page to **{status_success}** (for success) or
+**{status_failed}** (for failure) when the jobs complete.
+
+The jobs are separated into stages:
+
+![Pipeline stages](img/guide_pipeline_stages_v13_0.png)
+
+- **Build** - The application builds a Docker image and uploads it to your project's
+ [Container Registry](../../../user/packages/container_registry/index.md) ([Auto Build](../stages.md#auto-build)).
+- **Test** - GitLab runs various checks on the application, but all jobs except `test`
+ are allowed to fail in the test stage:
+
+ - The `test` job runs unit and integration tests by detecting the language and
+ framework ([Auto Test](../stages.md#auto-test-deprecated))
+ - The `code_quality` job checks the code quality and is allowed to fail
+ ([Auto Code Quality](../stages.md#auto-code-quality))
+ - The `container_scanning` job checks the Docker container if it has any
+ vulnerabilities and is allowed to fail ([Auto Container Scanning](../stages.md#auto-container-scanning))
+ - The `dependency_scanning` job checks if the application has any dependencies
+ susceptible to vulnerabilities and is allowed to fail
+ ([Auto Dependency Scanning](../stages.md#auto-dependency-scanning))
+ - Jobs suffixed with `-sast` run static analysis on the current code to check for potential
+ security issues, and are allowed to fail ([Auto SAST](../stages.md#auto-sast))
+ - The `secret-detection` job checks for leaked secrets and is allowed to fail ([Auto Secret Detection](../stages.md#auto-secret-detection))
+ - The `license_scanning` job searches the application's dependencies to determine each of their
+ licenses and is allowed to fail
+ ([Auto License Compliance](../stages.md#auto-license-compliance))
+
+- **Review** - Pipelines on the default branch include this stage with a `dast_environment_deploy` job.
+ To learn more, see [Dynamic Application Security Testing (DAST)](../../../user/application_security/dast/index.md).
+
+- **Production** - After the tests and checks finish, the application deploys in
+ Kubernetes ([Auto Deploy](../stages.md#auto-deploy)).
+
+- **Performance** - Performance tests are run on the deployed application
+ ([Auto Browser Performance Testing](../stages.md#auto-browser-performance-testing)).
+
+- **Cleanup** - Pipelines on the default branch include this stage with a `stop_dast_environment` job.
+
+After running a pipeline, you should view your deployed website and learn how
+to monitor it.
+
+### Monitor your project
+
+After successfully deploying your application, you can view its website and check
+on its health on the **Environments** page by navigating to
+**Deployments > Environments**. This page displays details about
+the deployed applications, and the right-hand column displays icons that link
+you to common environment tasks:
+
+![Environments](img/guide_environments_v12_3.png)
+
+- **Open live environment** (**{external-link}**) - Opens the URL of the application deployed in production
+- **Monitoring** (**{chart}**) - Opens the metrics page where Prometheus collects data
+ about the Kubernetes cluster and how the application
+ affects it in terms of memory usage, CPU usage, and latency
+- **Deploy to** (**{play}** **{chevron-lg-down}**) - Displays a list of environments you can deploy to
+- **Terminal** (**{terminal}**) - Opens a [web terminal](../../../ci/environments/index.md#web-terminals-deprecated)
+ session inside the container where the application is running
+- **Re-deploy to environment** (**{repeat}**) - For more information, see
+ [Retrying and rolling back](../../../ci/environments/index.md#retry-or-roll-back-a-deployment)
+- **Stop environment** (**{stop}**) - For more information, see
+ [Stopping an environment](../../../ci/environments/index.md#stop-an-environment)
+
+GitLab displays the [deploy board](../../../user/project/deploy_boards.md) below the
+environment's information, with squares representing pods in your
+Kubernetes cluster, color-coded to show their status. Hovering over a square on
+the deploy board displays the state of the deployment, and selecting the square
+takes you to the pod's logs page.
+
+Although the example shows only one pod hosting the application at the moment, you can add
+more pods by defining the [`REPLICAS` CI/CD variable](../cicd_variables.md)
+in **Settings > CI/CD > Variables**.
+
+### Work with branches
+
+Following the [GitLab flow](../../gitlab_flow.md#working-with-feature-branches),
+you should next create a feature branch to add content to your application:
+
+1. In your project's repository, go to the following file: `app/views/welcome/index.html.erb`.
+ This file should only contain a paragraph: `<p>You're on Rails!</p>`.
+1. Open the GitLab [Web IDE](../../../user/project/web_ide/index.md) to make the change.
+1. Edit the file so it contains:
+
+ ```html
+ <p>You're on Rails! Powered by GitLab Auto DevOps.</p>
+ ```
+
+1. Stage the file. Add a commit message, then create a new branch and a merge request
+ by selecting **Commit**.
+
+ ![Web IDE commit](img/guide_ide_commit_v12_3.png)
+
+After submitting the merge request, GitLab runs your pipeline, and all the jobs
+in it, as [described previously](#deploy-the-application), in addition to
+a few more that run only on branches other than the default branch.
+
+After a few minutes a test fails, which means a test was
+'broken' by your change. Select the failed `test` job to see more information
+about it:
+
+```plaintext
+Failure:
+WelcomeControllerTest#test_should_get_index [/app/test/controllers/welcome_controller_test.rb:7]:
+<You're on Rails!> expected but was
+<You're on Rails! Powered by GitLab Auto DevOps.>..
+Expected 0 to be >= 1.
+
+bin/rails test test/controllers/welcome_controller_test.rb:4
+```
+
+To fix the broken test:
+
+1. Return to your merge request.
+1. In the upper right corner, select **Code**, then select **Open in Gitpod**.
+1. In the left-hand directory of files, find the `test/controllers/welcome_controller_test.rb`
+ file, and select it to open it.
+1. Change line 7 to say `You're on Rails! Powered by GitLab Auto DevOps.`
+1. Select **Commit**.
+1. In the left-hand column, under **Unstaged changes**, select the checkmark icon
+ (**{stage-all}**) to stage the changes.
+1. Write a commit message, and select **Commit**.
+
+Return to the **Overview** page of your merge request, and you should not only
+see the test passing, but also the application deployed as a
+[review application](../stages.md#auto-review-apps). You can visit it by selecting
+the **View app** **{external-link}** button to see your changes deployed.
+
+After merging the merge request, GitLab runs the pipeline on the default branch,
+and then deploys the application to production.
+
+## Conclusion
+
+After implementing this project, you should have a solid understanding of the basics of Auto DevOps.
+You started from building and testing, to deploying and monitoring an application
+all in GitLab. Despite its automatic nature, Auto DevOps can also be configured
+and customized to fit your workflow. Here are some helpful resources for further reading:
+
+1. [Auto DevOps](../index.md)
+1. [Multiple Kubernetes clusters](../multiple_clusters_auto_devops.md)
+1. [Incremental rollout to production](../cicd_variables.md#incremental-rollout-to-production)
+1. [Disable jobs you don't need with CI/CD variables](../cicd_variables.md)
+1. [Use your own buildpacks to build your application](../customize.md#custom-buildpacks)
+1. [Prometheus monitoring](../../../user/project/integrations/prometheus.md)
diff --git a/doc/topics/autodevops/index.md b/doc/topics/autodevops/index.md
index 588be855659..2a0cc7f39b1 100644
--- a/doc/topics/autodevops/index.md
+++ b/doc/topics/autodevops/index.md
@@ -185,6 +185,7 @@ and clear the **Default to Auto DevOps pipeline** checkbox.
### Deploy your app to a cloud provider
- [Use Auto DevOps to deploy to a Kubernetes cluster on Google Kubernetes Engine (GKE)](cloud_deployments/auto_devops_with_gke.md)
+- [Use Auto DevOps to deploy to a Kubernetes cluster on Amazon Elastic Kubernetes Service (EKS)](cloud_deployments/auto_devops_with_eks.md)
- [Use Auto DevOps to deploy to EC2](cloud_deployments/auto_devops_with_ec2.md)
- [Use Auto DevOps to deploy to ECS](cloud_deployments/auto_devops_with_ecs.md)
diff --git a/doc/user/admin_area/reporting/git_abuse_rate_limit.md b/doc/user/admin_area/reporting/git_abuse_rate_limit.md
index 1b1656523ff..1dd9497fed9 100644
--- a/doc/user/admin_area/reporting/git_abuse_rate_limit.md
+++ b/doc/user/admin_area/reporting/git_abuse_rate_limit.md
@@ -11,7 +11,13 @@ info: To determine the technical writer assigned to the Stage/Group associated w
FLAG:
On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `git_abuse_rate_limit_feature_flag`. On GitLab.com, this feature is available.
-Git abuse rate limiting is a feature to automatically [ban users](../moderate_users.md#ban-and-unban-users) who download or clone more than a specified number of repositories in any project in the instance within a given time frame. Banned users cannot sign in to the instance and cannot access any non-public group via HTTP or SSH.
+This is the administration documentation. For information about Git abuse rate limiting at the group level, see the [group-level documentation](../../group/reporting/git_abuse_rate_limit.md).
+
+Git abuse rate limiting is a feature to automatically [ban users](../moderate_users.md#ban-and-unban-users) who download or clone more than a specified number of repositories in any project in the instance in a given time frame. Banned users cannot sign in to the instance and cannot access any non-public group via HTTP or SSH. The rate limit also applies to users who authenticate with a [personal](../../../user/profile/personal_access_tokens.md) or [group access token](../../../user/group/settings/group_access_tokens.md).
+
+Git abuse rate limiting does not apply to instance administrators, [deploy tokens](../../../user/project/deploy_tokens/index.md), or [deploy keys](../../../user/project/deploy_keys/index.md).
+
+## Automatic ban notifications
If the `git_abuse_rate_limit_feature_flag` feature flag is enabled, selected users receive an email when a user is about to be banned.
diff --git a/doc/user/group/reporting/git_abuse_rate_limit.md b/doc/user/group/reporting/git_abuse_rate_limit.md
index a092b823b58..f8f721b2fad 100644
--- a/doc/user/group/reporting/git_abuse_rate_limit.md
+++ b/doc/user/group/reporting/git_abuse_rate_limit.md
@@ -11,9 +11,15 @@ info: To determine the technical writer assigned to the Stage/Group associated w
FLAG:
On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to [enable the feature flag](../../../administration/feature_flags.md) named `limit_unique_project_downloads_per_namespace_user`. On GitLab.com, this feature is available.
-Git abuse rate limiting is a feature to automatically ban users who download or clone more than a specified number of repositories in a group or any of its subgroups within a given time frame. Banned users cannot access the main group or any of its non-public subgroups via HTTP or SSH. Access to unrelated groups is unaffected.
+This is the group-level documentation. For self-managed instances, see the [administration documentation](../../admin_area/reporting/git_abuse_rate_limit.md).
-If the `limit_unique_project_downloads_per_namespace_user` feature flag is enabled, selected users receive an email when a user is about to be banned.
+Git abuse rate limiting is a feature to automatically [ban users](#unban-a-user) who download or clone more than a specified number of repositories of a group in a given time frame. Banned users cannot access the top-level group or any of its non-public subgroups via HTTP or SSH. Access to unrelated groups is unaffected. The rate limit also applies to users who authenticate with a [personal](../../../user/profile/personal_access_tokens.md) or [group access token](../../../user/group/settings/group_access_tokens.md). Access to unrelated groups is unaffected.
+
+Git abuse rate limiting does not apply to top-level group owners, [deploy tokens](../../../user/project/deploy_tokens/index.md), or [deploy keys](../../../user/project/deploy_keys/index.md).
+
+## Automatic ban notifications
+
+If the `git_abuse_rate_limit_feature_flag` feature flag is enabled, selected users receive an email when a user is about to be banned.
If automatic banning is disabled, a user is not banned automatically when they exceed the limit. However, notifications are still sent. You can use this setup to determine the correct values of the rate limit settings before enabling automatic banning.
diff --git a/doc/user/project/merge_requests/creating_merge_requests.md b/doc/user/project/merge_requests/creating_merge_requests.md
index d704e9fa5d1..4ea549e5986 100644
--- a/doc/user/project/merge_requests/creating_merge_requests.md
+++ b/doc/user/project/merge_requests/creating_merge_requests.md
@@ -11,7 +11,7 @@ disqus_identifier: 'https://docs.gitlab.com/ee/gitlab-basics/add-merge-request.h
There are many different ways to create a merge request.
NOTE:
-Use [branch naming patterns](../repository/branches/index.md#naming) to streamline merge request creation.
+Use [branch naming patterns](../repository/branches/index.md#prefix-branch-names-with-issue-numbers) to streamline merge request creation.
## From the merge request list
diff --git a/doc/user/project/repository/branches/img/branch_filter_search_box_v13_12.png b/doc/user/project/repository/branches/img/branch_filter_search_box_v13_12.png
deleted file mode 100644
index a1cf9f10122..00000000000
--- a/doc/user/project/repository/branches/img/branch_filter_search_box_v13_12.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/repository/branches/img/compare_branches_v13_12.png b/doc/user/project/repository/branches/img/compare_branches_v13_12.png
deleted file mode 100644
index 29627406729..00000000000
--- a/doc/user/project/repository/branches/img/compare_branches_v13_12.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/repository/branches/img/repository_filter_search_box_v13_12.png b/doc/user/project/repository/branches/img/repository_filter_search_box_v13_12.png
deleted file mode 100644
index 230abf0d875..00000000000
--- a/doc/user/project/repository/branches/img/repository_filter_search_box_v13_12.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/repository/branches/img/swap_revisions_after_v13_12.png b/doc/user/project/repository/branches/img/swap_revisions_after_v13_12.png
deleted file mode 100644
index 7eb10d10938..00000000000
--- a/doc/user/project/repository/branches/img/swap_revisions_after_v13_12.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/repository/branches/img/swap_revisions_before_v13_12.png b/doc/user/project/repository/branches/img/swap_revisions_before_v13_12.png
deleted file mode 100644
index f92c4279871..00000000000
--- a/doc/user/project/repository/branches/img/swap_revisions_before_v13_12.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/repository/branches/index.md b/doc/user/project/repository/branches/index.md
index 60504b94502..8169956c02e 100644
--- a/doc/user/project/repository/branches/index.md
+++ b/doc/user/project/repository/branches/index.md
@@ -14,7 +14,7 @@ other.
After pushing your changes to a new branch, you can:
- Create a [merge request](../../merge_requests/index.md). You can streamline this process
- by following [branch naming patterns](#naming).
+ by following [branch naming patterns](#prefix-branch-names-with-issue-numbers).
- Perform inline code review.
- [Discuss](../../../discussions/index.md) your implementation with your team.
- Preview changes submitted to a new branch with [Review Apps](../../../../ci/review_apps/index.md).
@@ -30,7 +30,6 @@ For more information on managing branches using the GitLab UI, see:
- [Create a branch](../web_editor.md#create-a-branch)
- [Protected branches](../../protected_branches.md#protected-branches)
- [Delete merged branches](#delete-merged-branches)
-- [Branch filter search box](#branch-filter-search-box)
You can also manage branches using the
[command line](../../../../gitlab-basics/start-using-git.md#create-a-branch).
@@ -43,29 +42,36 @@ See also:
- [GitLab Flow](../../../../topics/gitlab_flow.md) documentation.
- [Getting started with Git](../../../../topics/git/index.md) and GitLab.
-## Naming
+## Prefix branch names with issue numbers
-Prefix a branch name with an issue number to streamline merge request creation.
-When you create a merge request for a branch with a name beginning with an issue
-number, GitLab:
+To streamline the creation of merge requests, start your branch name with an
+issue number. GitLab uses the issue number to import data into the merge request:
-- Marks the issue as related. If your project is configured with a
+- The issue is marked as related. The issue and merge request display links to each other.
+- If your project is configured with a
[default closing pattern](../../issues/managing_issues.md#default-closing-pattern),
- merging this merge request [also closes](../../issues/managing_issues.md#closing-issues-automatically)
+ merging the merge request [also closes](../../issues/managing_issues.md#closing-issues-automatically)
the related issue.
-- Copies label and milestone metadata from the issue.
+- The issue milestone and labels are copied to the merge request.
-## Compare
+## Compare branches
-To compare branches in a repository:
+> - Repository filter search box [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52967) in GitLab 13.10.
+> - Revision swapping [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60491) in GitLab 13.12.
-1. Navigate to your project's repository.
-1. Select **Repository > Compare** in the sidebar.
-1. Select the target repository to compare with the [repository filter search box](#repository-filter-search-box).
-1. Select branches to compare using the [branch filter search box](#branch-filter-search-box).
-1. Select **Compare** to view the changes inline:
+To compare branches in a repository:
- ![compare branches](img/compare_branches_v13_12.png)
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, select **Repository > Compare**.
+1. Select the **Source** branch to search for your desired branch. Exact matches are
+ shown first. You can refine your search with operators:
+ - `^` matches the beginning of the branch name: `^feat` matches `feat/user-authentication`.
+ - `$` matches the end of the branch name: `widget$` matches `feat/search-box-widget`.
+ - `*` matches using a wildcard: `branch*cache*` matches `fix/branch-search-cache-expiration`.
+ - You can combine operators: `^chore/*migration$` matches `chore/user-data-migration`.
+1. Select the **Target** repository and branch. Exact matches are shown first.
+1. Select **Compare** to show the list of commits, and changed files. To reverse
+ the **Source** and **Target**, select **Swap revisions**.
## Delete merged branches
@@ -79,46 +85,6 @@ this operation.
It's particularly useful to clean up old branches that were not deleted
automatically when a merge request was merged.
-## Repository filter search box
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52967) in GitLab 13.10.
-
-This feature allows you to search and select a repository quickly when [comparing branches](#compare).
-
-![Repository filter search box](img/repository_filter_search_box_v13_12.png)
-
-Search results appear in the following order:
-
-- Repositories with names exactly matching the search terms.
-- Other repositories with names that include search terms, sorted alphabetically.
-
-## Branch filter search box
-
-![Branch filter search box](img/branch_filter_search_box_v13_12.png)
-
-This feature allows you to search and select branches quickly. Search results appear in the following order:
-
-- Branches with names that matched search terms exactly.
-- Other branches with names that include search terms, sorted alphabetically.
-
-Sometimes when you have hundreds of branches you may want a more flexible matching pattern. In such cases you can use the following operators:
-
-- `^` matches beginning of branch name, for example `^feat` would match `feat/user-authentication`
-- `$` matches end of branch name, for example `widget$` would match `feat/search-box-widget`
-- `*` wildcard matcher, for example `branch*cache*` would match `fix/branch-search-cache-expiration`
-
-These operators can be mixed, for example `^chore/*migration$` would match `chore/user-data-migration`
-
-## Swap revisions
-
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60491) in GitLab 13.12.
-
-![Before swap revisions](img/swap_revisions_before_v13_12.png)
-
-The Swap revisions feature allows you to swap the Source and Target revisions. When the Swap revisions button is selected, the selected revisions for Source and Target is swapped.
-
-![After swap revisions](img/swap_revisions_after_v13_12.png)
-
## View branches with configured protections **(FREE SELF)**
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/88279) in GitLab 15.1 with a flag named `branch_rules`. Disabled by default.
@@ -143,6 +109,12 @@ To view the **Branch rules overview** list:
- [Approval rules](../../merge_requests/approvals/rules.md).
- [Status checks](../../merge_requests/status_checks.md).
+## Related topics
+
+- [Protected branches](../../protected_branches.md) user documentation
+- [Branches API](../../../../api/branches.md)
+- [Protected Branches API](../../../../api/protected_branches.md)
+
## Troubleshooting
### Multiple branches containing the same commit
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index aac81ca574e..f00eadd07c1 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -31524,9 +31524,6 @@ msgstr ""
msgid "Pipelines|Clear runner caches"
msgstr ""
-msgid "Pipelines|Configuration validation currently not available."
-msgstr ""
-
msgid "Pipelines|Configure pipeline"
msgstr ""
@@ -31623,7 +31620,7 @@ msgstr ""
msgid "Pipelines|Pipeline Editor"
msgstr ""
-msgid "Pipelines|Pipeline syntax is correct."
+msgid "Pipelines|Pipeline syntax is correct. %{linkStart}Learn more%{linkEnd}"
msgstr ""
msgid "Pipelines|Project cache successfully reset."
@@ -31668,13 +31665,13 @@ msgstr ""
msgid "Pipelines|There was an error fetching the pipelines. Try again in a few moments or contact your support team."
msgstr ""
-msgid "Pipelines|This GitLab CI configuration is invalid."
+msgid "Pipelines|This GitLab CI configuration is invalid. %{linkStart}Learn more%{linkEnd}"
msgstr ""
msgid "Pipelines|This GitLab CI configuration is invalid:"
msgstr ""
-msgid "Pipelines|This GitLab CI configuration is invalid: %{reason}."
+msgid "Pipelines|This GitLab CI configuration is invalid: %{reason}. %{linkStart}Learn more%{linkEnd}"
msgstr ""
msgid "Pipelines|This GitLab CI configuration is valid."
@@ -31704,6 +31701,9 @@ msgstr ""
msgid "Pipelines|Try test template"
msgstr ""
+msgid "Pipelines|Unable to validate CI/CD configuration. See the %{linkStart}GitLab CI/CD troubleshooting guide%{linkEnd} for more details."
+msgstr ""
+
msgid "Pipelines|Use a sample %{codeStart}.gitlab-ci.yml%{codeEnd} template file to explore how CI/CD works."
msgstr ""
@@ -31725,6 +31725,9 @@ msgstr ""
msgid "Pipelines|Visualize"
msgstr ""
+msgid "Pipelines|We'll continuously validate your pipeline configuration. The validation results will appear here."
+msgstr ""
+
msgid "Pipelines|We'll guide you through a simple pipeline set-up."
msgstr ""
@@ -48050,9 +48053,6 @@ msgstr ""
msgid "We would like to inform you that your subscription GitLab Enterprise Edition %{plan_name} is nearing its user limit. You have %{active_user_count} active users, which is almost at the user limit of %{maximum_user_count}."
msgstr ""
-msgid "We'll continuously validate your pipeline configuration. The validation results will appear here."
-msgstr ""
-
msgid "We'll use this to help surface the right features and information to you."
msgstr ""
diff --git a/spec/frontend/ci/pipeline_editor/components/header/validation_segment_spec.js b/spec/frontend/ci/pipeline_editor/components/header/validation_segment_spec.js
index 0853a6f4ca4..a107a626c6d 100644
--- a/spec/frontend/ci/pipeline_editor/components/header/validation_segment_spec.js
+++ b/spec/frontend/ci/pipeline_editor/components/header/validation_segment_spec.js
@@ -1,11 +1,10 @@
import VueApollo from 'vue-apollo';
-import { GlIcon } from '@gitlab/ui';
-import { shallowMount } from '@vue/test-utils';
+import { GlIcon, GlLink, GlSprintf } from '@gitlab/ui';
import Vue from 'vue';
import { escape } from 'lodash';
-import { extendedWrapper } from 'helpers/vue_test_utils_helper';
-import createMockApollo from 'helpers/mock_apollo_helper';
import { sprintf } from '~/locale';
+import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
+import createMockApollo from 'helpers/mock_apollo_helper';
import ValidationSegment, {
i18n,
} from '~/ci/pipeline_editor/components/header/validation_segment.vue';
@@ -20,8 +19,8 @@ import {
} from '~/ci/pipeline_editor/constants';
import {
mergeUnwrappedCiConfig,
+ mockCiTroubleshootingPath,
mockCiYml,
- mockLintUnavailableHelpPagePath,
mockYmlHelpPagePath,
} from '../../mock_data';
@@ -43,29 +42,27 @@ describe('Validation segment component', () => {
},
});
- wrapper = extendedWrapper(
- shallowMount(ValidationSegment, {
- apolloProvider: mockApollo,
- provide: {
- ymlHelpPagePath: mockYmlHelpPagePath,
- lintUnavailableHelpPagePath: mockLintUnavailableHelpPagePath,
- },
- propsData: {
- ciConfig: mergeUnwrappedCiConfig(),
- ciFileContent: mockCiYml,
- ...props,
- },
- }),
- );
+ wrapper = shallowMountExtended(ValidationSegment, {
+ apolloProvider: mockApollo,
+ provide: {
+ ymlHelpPagePath: mockYmlHelpPagePath,
+ ciTroubleshootingPath: mockCiTroubleshootingPath,
+ },
+ propsData: {
+ ciConfig: mergeUnwrappedCiConfig(),
+ ciFileContent: mockCiYml,
+ ...props,
+ },
+ stubs: {
+ GlSprintf,
+ },
+ });
};
const findIcon = () => wrapper.findComponent(GlIcon);
- const findLearnMoreLink = () => wrapper.findByTestId('learnMoreLink');
- const findValidationMsg = () => wrapper.findByTestId('validationMsg');
-
- afterEach(() => {
- wrapper.destroy();
- });
+ const findHelpLink = () => wrapper.findComponent(GlLink);
+ const findValidationMsg = () => wrapper.findComponent(GlSprintf);
+ const findValidationSegment = () => wrapper.findByTestId('validation-segment');
it('shows the loading state', () => {
createComponent({ appStatus: EDITOR_APP_STATUS_LOADING });
@@ -82,8 +79,12 @@ describe('Validation segment component', () => {
expect(findIcon().props('name')).toBe('check');
});
+ it('does not render a link', () => {
+ expect(findHelpLink().exists()).toBe(false);
+ });
+
it('shows a message for empty state', () => {
- expect(findValidationMsg().text()).toBe(i18n.empty);
+ expect(findValidationSegment().text()).toBe(i18n.empty);
});
});
@@ -97,12 +98,15 @@ describe('Validation segment component', () => {
});
it('shows a message for valid state', () => {
- expect(findValidationMsg().text()).toContain(i18n.valid);
+ expect(findValidationSegment().text()).toBe(
+ sprintf(i18n.valid, { linkStart: '', linkEnd: '' }),
+ );
});
it('shows the learn more link', () => {
- expect(findLearnMoreLink().attributes('href')).toBe(mockYmlHelpPagePath);
- expect(findLearnMoreLink().text()).toBe(i18n.learnMore);
+ expect(findValidationMsg().exists()).toBe(true);
+ expect(findValidationMsg().text()).toBe('Learn more');
+ expect(findHelpLink().attributes('href')).toBe(mockYmlHelpPagePath);
});
});
@@ -117,13 +121,16 @@ describe('Validation segment component', () => {
expect(findIcon().props('name')).toBe('warning-solid');
});
- it('has message for invalid state', () => {
- expect(findValidationMsg().text()).toBe(i18n.invalid);
+ it('shows a message for invalid state', () => {
+ expect(findValidationSegment().text()).toBe(
+ sprintf(i18n.invalid, { linkStart: '', linkEnd: '' }),
+ );
});
it('shows the learn more link', () => {
- expect(findLearnMoreLink().attributes('href')).toBe(mockYmlHelpPagePath);
- expect(findLearnMoreLink().text()).toBe('Learn more');
+ expect(findValidationMsg().exists()).toBe(true);
+ expect(findValidationMsg().text()).toBe('Learn more');
+ expect(findHelpLink().attributes('href')).toBe(mockYmlHelpPagePath);
});
describe('with multiple errors', () => {
@@ -140,11 +147,16 @@ describe('Validation segment component', () => {
},
});
});
+
+ it('shows the learn more link', () => {
+ expect(findValidationMsg().exists()).toBe(true);
+ expect(findValidationMsg().text()).toBe('Learn more');
+ expect(findHelpLink().attributes('href')).toBe(mockYmlHelpPagePath);
+ });
+
it('shows an invalid state with an error', () => {
- // Test the error is shown _and_ the string matches
- expect(findValidationMsg().text()).toContain(firstError);
- expect(findValidationMsg().text()).toBe(
- sprintf(i18n.invalidWithReason, { reason: firstError }),
+ expect(findValidationSegment().text()).toBe(
+ sprintf(i18n.invalidWithReason, { reason: firstError, linkStart: '', linkEnd: '' }),
);
});
});
@@ -163,10 +175,8 @@ describe('Validation segment component', () => {
});
});
it('shows an invalid state with an error while preventing XSS', () => {
- const { innerHTML } = findValidationMsg().element;
-
- expect(innerHTML).not.toContain(evilError);
- expect(innerHTML).toContain(escape(evilError));
+ expect(findValidationSegment().html()).not.toContain(evilError);
+ expect(findValidationSegment().html()).toContain(escape(evilError));
});
});
});
@@ -182,16 +192,18 @@ describe('Validation segment component', () => {
});
it('show a message that the service is unavailable', () => {
- expect(findValidationMsg().text()).toBe(i18n.unavailableValidation);
+ expect(findValidationSegment().text()).toBe(
+ sprintf(i18n.unavailableValidation, { linkStart: '', linkEnd: '' }),
+ );
});
it('shows the time-out icon', () => {
expect(findIcon().props('name')).toBe('time-out');
});
- it('shows the learn more link', () => {
- expect(findLearnMoreLink().attributes('href')).toBe(mockLintUnavailableHelpPagePath);
- expect(findLearnMoreLink().text()).toBe(i18n.learnMore);
+ it('shows the link to ci troubleshooting', () => {
+ expect(findValidationMsg().exists()).toBe(true);
+ expect(findHelpLink().attributes('href')).toBe(mockCiTroubleshootingPath);
});
});
});
diff --git a/spec/frontend/ci/pipeline_editor/mock_data.js b/spec/frontend/ci/pipeline_editor/mock_data.js
index 93208090d70..ecfc477184b 100644
--- a/spec/frontend/ci/pipeline_editor/mock_data.js
+++ b/spec/frontend/ci/pipeline_editor/mock_data.js
@@ -12,7 +12,7 @@ export const mockCommitSha = 'aabbccdd';
export const mockCommitNextSha = 'eeffgghh';
export const mockIncludesHelpPagePath = '/-/includes/help';
export const mockLintHelpPagePath = '/-/lint-help';
-export const mockLintUnavailableHelpPagePath = '/-/pipeline-editor/troubleshoot';
+export const mockCiTroubleshootingPath = '/-/pipeline-editor/troubleshoot';
export const mockSimulatePipelineHelpPagePath = '/-/simulate-pipeline-help';
export const mockYmlHelpPagePath = '/-/yml-help';
export const mockCommitMessage = 'My commit message';
diff --git a/spec/frontend/ci/pipeline_editor/pipeline_editor_app_spec.js b/spec/frontend/ci/pipeline_editor/pipeline_editor_app_spec.js
index 5855b805fc9..eadf1f0a404 100644
--- a/spec/frontend/ci/pipeline_editor/pipeline_editor_app_spec.js
+++ b/spec/frontend/ci/pipeline_editor/pipeline_editor_app_spec.js
@@ -1,4 +1,4 @@
-import { GlAlert, GlButton, GlLoadingIcon } from '@gitlab/ui';
+import { GlAlert, GlButton, GlLoadingIcon, GlSprintf } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils';
import VueApollo from 'vue-apollo';
import createMockApollo from 'helpers/mock_apollo_helper';
@@ -358,7 +358,9 @@ describe('Pipeline editor app component', () => {
});
it('shows that the lint service is down', () => {
- expect(findValidationSegment().text()).toContain(
+ const validationMessage = findValidationSegment().findComponent(GlSprintf);
+
+ expect(validationMessage.attributes('message')).toContain(
validationSegmenti18n.unavailableValidation,
);
});
diff --git a/spec/helpers/ci/pipeline_editor_helper_spec.rb b/spec/helpers/ci/pipeline_editor_helper_spec.rb
index c9aac63a883..1a0f2e10a20 100644
--- a/spec/helpers/ci/pipeline_editor_helper_spec.rb
+++ b/spec/helpers/ci/pipeline_editor_helper_spec.rb
@@ -29,12 +29,12 @@ RSpec.describe Ci::PipelineEditorHelper do
"ci-examples-help-page-path" => help_page_path('ci/examples/index'),
"ci-help-page-path" => help_page_path('ci/index'),
"ci-lint-path" => project_ci_lint_path(project),
+ "ci-troubleshooting-path" => help_page_path('ci/troubleshooting', anchor: 'common-cicd-issues'),
"default-branch" => project.default_branch_or_main,
"empty-state-illustration-path" => 'illustrations/empty.svg',
"initial-branch-name" => nil,
"includes-help-page-path" => help_page_path('ci/yaml/includes'),
"lint-help-page-path" => help_page_path('ci/lint', anchor: 'check-cicd-syntax'),
- "lint-unavailable-help-page-path" => help_page_path('ci/pipeline_editor/index', anchor: 'configuration-validation-currently-not-available-message'),
"needs-help-page-path" => help_page_path('ci/yaml/index', anchor: 'needs'),
"new-merge-request-path" => '/mock/project/-/merge_requests/new',
"pipeline-page-path" => project_pipelines_path(project),
diff --git a/spec/models/protected_branch_spec.rb b/spec/models/protected_branch_spec.rb
index 71e22f848cc..c99c92e6c19 100644
--- a/spec/models/protected_branch_spec.rb
+++ b/spec/models/protected_branch_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe ProtectedBranch do
+RSpec.describe ProtectedBranch, feature_category: :source_code_management do
subject { build_stubbed(:protected_branch) }
describe 'Associations' do
@@ -214,85 +214,52 @@ RSpec.describe ProtectedBranch do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:protected_branch) { create(:protected_branch, project: project, name: "“jawn”") }
- let(:rely_on_new_cache) { true }
-
- shared_examples_for 'hash based cache implementation' do
- it 'calls only hash based cache implementation' do
- expect_next_instance_of(ProtectedBranches::CacheService) do |instance|
- expect(instance).to receive(:fetch).with('missing-branch', anything).and_call_original
- end
-
- expect(Rails.cache).not_to receive(:fetch)
-
- described_class.protected?(project, 'missing-branch')
- end
- end
-
before do
- stub_feature_flags(rely_on_protected_branches_cache: rely_on_new_cache)
allow(described_class).to receive(:matching).and_call_original
# the original call works and warms the cache
described_class.protected?(project, protected_branch.name)
end
- context 'Dry-run: true (rely_on_protected_branches_cache is off, new hash-based is used)' do
- let(:rely_on_new_cache) { false }
+ it 'correctly invalidates a cache' do
+ expect(described_class).to receive(:matching).with(protected_branch.name, protected_refs: anything).exactly(3).times.and_call_original
- it 'recalculates a fresh value every time in order to check the cache is not returning stale data' do
- expect(described_class).to receive(:matching).with(protected_branch.name, protected_refs: anything).twice
+ create_params = { name: 'bar', merge_access_levels_attributes: [{ access_level: Gitlab::Access::DEVELOPER }] }
+ branch = ProtectedBranches::CreateService.new(project, project.owner, create_params).execute
+ expect(described_class.protected?(project, protected_branch.name)).to eq(true)
- 2.times { described_class.protected?(project, protected_branch.name) }
- end
+ ProtectedBranches::UpdateService.new(project, project.owner, name: 'ber').execute(branch)
+ expect(described_class.protected?(project, protected_branch.name)).to eq(true)
- it_behaves_like 'hash based cache implementation'
+ ProtectedBranches::DestroyService.new(project, project.owner).execute(branch)
+ expect(described_class.protected?(project, protected_branch.name)).to eq(true)
end
- context 'Dry-run: false (rely_on_protected_branches_cache is enabled, new hash-based cache is used)' do
- let(:rely_on_new_cache) { true }
-
- it 'correctly invalidates a cache' do
- expect(described_class).to receive(:matching).with(protected_branch.name, protected_refs: anything).exactly(3).times.and_call_original
-
- create_params = { name: 'bar', merge_access_levels_attributes: [{ access_level: Gitlab::Access::DEVELOPER }] }
- branch = ProtectedBranches::CreateService.new(project, project.owner, create_params).execute
- expect(described_class.protected?(project, protected_branch.name)).to eq(true)
+ context 'when project is updated' do
+ it 'does not invalidate a cache' do
+ expect(described_class).not_to receive(:matching).with(protected_branch.name, protected_refs: anything)
- ProtectedBranches::UpdateService.new(project, project.owner, name: 'ber').execute(branch)
- expect(described_class.protected?(project, protected_branch.name)).to eq(true)
+ project.touch
- ProtectedBranches::DestroyService.new(project, project.owner).execute(branch)
- expect(described_class.protected?(project, protected_branch.name)).to eq(true)
- end
-
- it_behaves_like 'hash based cache implementation'
-
- context 'when project is updated' do
- it 'does not invalidate a cache' do
- expect(described_class).not_to receive(:matching).with(protected_branch.name, protected_refs: anything)
-
- project.touch
-
- described_class.protected?(project, protected_branch.name)
- end
+ described_class.protected?(project, protected_branch.name)
end
+ end
- context 'when other project protected branch is updated' do
- it 'does not invalidate the current project cache' do
- expect(described_class).not_to receive(:matching).with(protected_branch.name, protected_refs: anything)
+ context 'when other project protected branch is updated' do
+ it 'does not invalidate the current project cache' do
+ expect(described_class).not_to receive(:matching).with(protected_branch.name, protected_refs: anything)
- another_project = create(:project)
- ProtectedBranches::CreateService.new(another_project, another_project.owner, name: 'bar').execute
+ another_project = create(:project)
+ ProtectedBranches::CreateService.new(another_project, another_project.owner, name: 'bar').execute
- described_class.protected?(project, protected_branch.name)
- end
+ described_class.protected?(project, protected_branch.name)
end
+ end
- it 'correctly uses the cached version' do
- expect(described_class).not_to receive(:matching)
+ it 'correctly uses the cached version' do
+ expect(described_class).not_to receive(:matching)
- expect(described_class.protected?(project, protected_branch.name)).to eq(true)
- end
+ expect(described_class.protected?(project, protected_branch.name)).to eq(true)
end
end
end
diff --git a/workhorse/go.mod b/workhorse/go.mod
index a14b3fd51be..eb1b58f97a6 100644
--- a/workhorse/go.mod
+++ b/workhorse/go.mod
@@ -7,7 +7,7 @@ require (
github.com/BurntSushi/toml v1.2.1
github.com/FZambia/sentinel v1.1.1
github.com/alecthomas/chroma/v2 v2.5.0
- github.com/aws/aws-sdk-go v1.44.205
+ github.com/aws/aws-sdk-go v1.44.206
github.com/disintegration/imaging v1.6.2
github.com/getsentry/raven-go v0.2.0
github.com/golang-jwt/jwt/v4 v4.5.0
diff --git a/workhorse/go.sum b/workhorse/go.sum
index dfd6f45f5a6..9dd8e0cf468 100644
--- a/workhorse/go.sum
+++ b/workhorse/go.sum
@@ -544,8 +544,8 @@ github.com/aws/aws-sdk-go v1.43.11/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4
github.com/aws/aws-sdk-go v1.43.31/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go v1.44.128/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
github.com/aws/aws-sdk-go v1.44.151/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
-github.com/aws/aws-sdk-go v1.44.205 h1:q23NJXgLPIuBMn4zaluWWz57HPP5z7Ut8ZtK1D3N9bs=
-github.com/aws/aws-sdk-go v1.44.205/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
+github.com/aws/aws-sdk-go v1.44.206 h1:xC7O40wdnKH4A95KdYt+smXl9hig1vu9b3mFxAxUoak=
+github.com/aws/aws-sdk-go v1.44.206/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/aws/aws-sdk-go-v2 v1.17.1 h1:02c72fDJr87N8RAC2s3Qu0YuvMRZKNZJ9F+lAehCazk=
github.com/aws/aws-sdk-go-v2 v1.17.1/go.mod h1:JLnGeGONAyi2lWXI1p0PCIOIy333JMVK1U7Hf0aRFLw=