Skip to content
Snippets Groups Projects
Commit c36152ff authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 286fe610
No related branches found
No related tags found
No related merge requests found
Showing
with 192 additions and 369 deletions
Loading
Loading
@@ -20,7 +20,7 @@ NOTE: **Scalable app deployment with GitLab and Google Cloud Platform**
Using the GitLab project Kubernetes integration, you can:
 
- Use [Review Apps](../../../ci/review_apps/index.md).
- Run [pipelines](../../../ci/pipelines.md).
- Run [pipelines](../../../ci/pipelines/index.md).
- [Deploy](#deploying-to-a-kubernetes-cluster) your applications.
- Detect and [monitor Kubernetes](#kubernetes-monitoring).
- Use it with [Auto DevOps](#auto-devops).
Loading
Loading
Loading
Loading
@@ -102,5 +102,5 @@ back to both GitLab and GitHub when completed.
 
NOTE: **Note:**
If you don't commit very often to your project, you may want to use
[scheduled pipelines](../pipelines/schedules.md) to run the job on a regular
[scheduled pipelines](../../../ci/pipelines/schedules.md) to run the job on a regular
basis.
Loading
Loading
@@ -66,15 +66,15 @@ When you create a project in GitLab, you'll have access to a large number of
- [Auto Deploy](../../topics/autodevops/index.md#auto-deploy): Configure GitLab CI/CD
to automatically set up your app's deployment
- [Enable and disable GitLab CI](../../ci/enable_or_disable_ci.md)
- [Pipelines](../../ci/pipelines.md): Configure and visualize
- [Pipelines](../../ci/pipelines/index.md): Configure and visualize
your GitLab CI/CD pipelines from the UI
- [Scheduled Pipelines](pipelines/schedules.md): Schedule a pipeline
- [Scheduled Pipelines](../../ci/pipelines/schedules.md): Schedule a pipeline
to start at a chosen time
- [Pipeline Graphs](../../ci/pipelines.md#visualizing-pipelines): View your
- [Pipeline Graphs](../../ci/pipelines/index.md#visualizing-pipelines): View your
entire pipeline from the UI
- [Job artifacts](pipelines/job_artifacts.md): Define,
- [Job artifacts](../../ci/pipelines/job_artifacts.md): Define,
browse, and download job artifacts
- [Pipeline settings](pipelines/settings.md): Set up Git strategy (choose the default way your repository is fetched from GitLab in a job),
- [Pipeline settings](../../ci/pipelines/settings.md): Set up Git strategy (choose the default way your repository is fetched from GitLab in a job),
timeout (defines the maximum amount of time in minutes that a job is able run), custom path for `.gitlab-ci.yml`, test coverage parsing, pipeline's visibility, and much more
- [Kubernetes cluster integration](clusters/index.md): Connecting your GitLab project
with a Kubernetes cluster
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ Code Quality:
- Uses [Code Climate Engines](https://codeclimate.com), which are
free and open source. Code Quality doesn't require a Code Climate
subscription.
- Runs in [pipelines](../../../ci/pipelines.md) using a Docker image built in the
- Runs in [pipelines](../../../ci/pipelines/index.md) using a Docker image built in the
[GitLab Code
Quality](https://gitlab.com/gitlab-org/security-products/codequality) project using [default Code Climate configurations](https://gitlab.com/gitlab-org/security-products/codequality/-/tree/master/codeclimate_defaults).
- Can make use of a [template](#example-configuration).
Loading
Loading
Loading
Loading
@@ -94,14 +94,14 @@ or link to useful information directly in the merge request page:
| [Accessibility Testing](accessibility_testing.md) | Automatically report A11y violations for changed pages in merge requests |
| [Browser Performance Testing](browser_performance_testing.md) **(PREMIUM)** | Quickly determine the performance impact of pending code changes. |
| [Code Quality](code_quality.md) **(STARTER)** | Analyze your source code quality using the [Code Climate](https://codeclimate.com/) analyzer and show the Code Climate report right in the merge request widget area. |
| [Display arbitrary job artifacts](../../../ci/yaml/README.md#artifactsexpose_as) | Configure CI pipelines with the `artifacts:expose_as` parameter to directly link to selected [artifacts](../pipelines/job_artifacts.md) in merge requests. |
| [Display arbitrary job artifacts](../../../ci/yaml/README.md#artifactsexpose_as) | Configure CI pipelines with the `artifacts:expose_as` parameter to directly link to selected [artifacts](../../../ci/pipelines/job_artifacts.md) in merge requests. |
| [GitLab CI/CD](../../../ci/README.md) | Build, test, and deploy your code in a per-branch basis with built-in CI/CD. |
| [JUnit test reports](../../../ci/junit_test_reports.md) | Configure your CI jobs to use JUnit test reports, and let GitLab display a report on the merge request so that it’s easier and faster to identify the failure without having to check the entire job log. |
| [License Compliance](../../compliance/license_compliance/index.md) **(ULTIMATE)** | Manage the licenses of your dependencies. |
| [Metrics Reports](../../../ci/metrics_reports.md) **(PREMIUM)** | Display the Metrics Report on the merge request so that it's fast and easy to identify changes to important metrics. |
| [Multi-Project pipelines](../../../ci/multi_project_pipelines.md) **(PREMIUM)** | When you set up GitLab CI/CD across multiple projects, you can visualize the entire pipeline, including all cross-project interdependencies. |
| [Pipelines for merge requests](../../../ci/merge_request_pipelines/index.md) | Customize a specific pipeline structure for merge requests in order to speed the cycle up by running only important jobs. |
| [Pipeline Graphs](../../../ci/pipelines.md#visualizing-pipelines) | View the status of pipelines within the merge request, including the deployment process. |
| [Pipeline Graphs](../../../ci/pipelines/index.md#visualizing-pipelines) | View the status of pipelines within the merge request, including the deployment process. |
 
### Security Reports **(ULTIMATE)**
 
Loading
Loading
Loading
Loading
@@ -120,7 +120,7 @@ be disabled. If the pipeline fails to deploy, the deployment info will be hidden
 
![Merge request pipeline](img/merge_request_pipeline.png)
 
For more information, [read about pipelines](../../../ci/pipelines.md).
For more information, [read about pipelines](../../../ci/pipelines/index.md).
 
### Merge when pipeline succeeds (MWPS)
 
Loading
Loading
Loading
Loading
@@ -2,4 +2,4 @@
redirect_to: '../../../ci/pipelines/job_artifacts.md'
---
 
This document was moved to [pipelines/job_artifacts.md](../../../ci/pipelines/job_artifacts.md).
This document was moved to [another location](../../../ci/pipelines/job_artifacts.md).
---
type: reference, howto
redirect_to: '../../../ci/pipelines/settings.md'
---
 
# Pipelines settings
To reach the pipelines settings navigate to your project's
**Settings > CI/CD**.
The following settings can be configured per project.
<i class="fa fa-youtube-play youtube" aria-hidden="true"></i>
For an overview, watch the video [GitLab CI Pipeline, Artifacts, and Environments](https://www.youtube.com/watch?v=PCKDICEe10s).
Watch also [GitLab CI pipeline tutorial for beginners](https://www.youtube.com/watch?v=Jav4vbUrqII).
## Git strategy
With Git strategy, you can choose the default way your repository is fetched
from GitLab in a job.
There are two options. Using:
- `git clone`, which is slower since it clones the repository from scratch
for every job, ensuring that the local working copy is always pristine.
- `git fetch`, which is faster as it re-uses the local working copy (falling
back to clone if it doesn't exist).
The default Git strategy can be overridden by the [GIT_STRATEGY variable](../../../ci/yaml/README.md#git-strategy)
in `.gitlab-ci.yml`.
## Git shallow clone
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/28919) in GitLab 12.0.
NOTE: **Note**:
As of GitLab 12.0, newly created projects will automatically have a default
`git depth` value of `50`.
It is possible to limit the number of changes that GitLab CI/CD will fetch when cloning
a repository. Setting a limit to `git depth` can speed up Pipelines execution. Maximum
allowed value is `1000`.
To disable shallow clone and make GitLab CI/CD fetch all branches and tags each time,
keep the value empty or set to `0`.
This value can also be [overridden by `GIT_DEPTH`](../../../ci/large_repositories/index.md#shallow-cloning) variable in `.gitlab-ci.yml` file.
## Timeout
Timeout defines the maximum amount of time in minutes that a job is able run.
This is configurable under your project's **Settings > CI/CD > General pipelines settings**.
The default value is 60 minutes. Decrease the time limit if you want to impose
a hard limit on your jobs' running time or increase it otherwise. In any case,
if the job surpasses the threshold, it is marked as failed.
### Timeout overriding on Runner level
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/17221) in GitLab 10.7.
Project defined timeout (either specific timeout set by user or the default
60 minutes timeout) may be [overridden on Runner level](../../../ci/runners/README.md#setting-maximum-job-timeout-for-a-runner).
## Maximum artifacts size **(CORE ONLY)**
For information about setting a maximum artifact size for a project, see
[Maximum artifacts size](../../admin_area/settings/continuous_integration.md#maximum-artifacts-size-core-only).
## Custom CI configuration path
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/12509) in GitLab 9.4.
> - [Support for external `.gitlab-ci.yml` locations](https://gitlab.com/gitlab-org/gitlab/issues/14376) introduced in GitLab 12.6.
By default we look for the `.gitlab-ci.yml` file in the project's root
directory. If needed, you can specify an alternate path and file name, including locations outside the project.
To customize the path:
1. Go to the project's **Settings > CI / CD**.
1. Expand the **General pipelines** section.
1. Provide a value in the **Custom CI configuration path** field.
1. Click **Save changes**.
If the CI configuration is stored within the repository in a non-default
location, the path must be relative to the root directory. Examples of valid
paths and file names include:
- `.gitlab-ci.yml` (default)
- `.my-custom-file.yml`
- `my/path/.gitlab-ci.yml`
- `my/path/.my-custom-file.yml`
If the CI configuration will be hosted on an external site, the URL link must end with `.yml`:
- `http://example.com/generate/ci/config.yml`
If the CI configuration will be hosted in a different project within GitLab, the path must be relative
to the root directory in the other project, with the group and project name added to the end:
- `.gitlab-ci.yml@mygroup/another-project`
- `my/path/.my-custom-file.yml@mygroup/another-project`
Hosting the configuration file in a separate project allows stricter control of the
configuration file. For example:
- Create a public project to host the configuration file.
- Give write permissions on the project only to users who are allowed to edit the file.
Other users and projects will be able to access the configuration file without being
able to edit it.
## Test coverage parsing
If you use test coverage in your code, GitLab can capture its output in the
job log using a regular expression. In the pipelines settings, search for the
"Test coverage parsing" section.
![Pipelines settings test coverage](img/pipelines_settings_test_coverage.png)
Leave blank if you want to disable it or enter a ruby regular expression. You
can use <https://rubular.com> to test your regex.
If the pipeline succeeds, the coverage is shown in the merge request widget and
in the jobs table.
![MR widget coverage](img/pipelines_test_coverage_mr_widget.png)
![Build status coverage](img/pipelines_test_coverage_build.png)
A few examples of known coverage tools for a variety of languages can be found
in the pipelines settings page.
### Removing color codes
Some test coverage tools output with ANSI color codes that won't be
parsed correctly by the regular expression and will cause coverage
parsing to fail.
If your coverage tool doesn't provide an option to disable color
codes in the output, you can pipe the output of the coverage tool through a
small one line script that will strip the color codes off.
For example:
```shell
lein cloverage | perl -pe 's/\e\[?.*?[\@-~]//g'
```
## Visibility of pipelines
Pipeline visibility is determined by:
- Your current [user access level](../../permissions.md).
- The **Public pipelines** project setting under your project's **Settings > CI/CD > General pipelines**.
NOTE: **Note:**
If the project visibility is set to **Private**, the [**Public pipelines** setting will have no effect](../../../ci/enable_or_disable_ci.md#per-project-user-setting).
This also determines the visibility of these related features:
- Job output logs
- Job artifacts
- The [pipeline security dashboard](../../application_security/security_dashboard/index.md#pipeline-security-dashboard) **(ULTIMATE)**
If **Public pipelines** is enabled (default):
- For **public** projects, anyone can view the pipelines and related features.
- For **internal** projects, any logged in user can view the pipelines
and related features.
- For **private** projects, any project member (guest or higher) can view the pipelines
and related features.
If **Public pipelines** is disabled:
- For **public** projects, anyone can view the pipelines, but only members
(reporter or higher) can access the related features.
- For **internal** projects, any logged in user can view the pipelines.
However, only members (reporter or higher) can access the job related features.
- For **private** projects, only project members (reporter or higher)
can view the pipelines or access the related features.
## Auto-cancel pending pipelines
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/9362) in GitLab 9.1.
If you want all pending non-HEAD pipelines on branches to auto-cancel each time
a new pipeline is created, such as after a Git push or manually from the UI,
you can enable this in the project settings:
1. Go to **{settings}** **Settings > CI / CD**.
1. Expand **General Pipelines**.
1. Check the **Auto-cancel redundant, pending pipelines** checkbox.
1. Click **Save changes**.
## Skip older, pending deployment jobs
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/25276) in GitLab 12.9.
Your project may have multiple concurrent deployment jobs that are
scheduled to run within the same time frame.
This can lead to a situation where an older deployment job runs after a
newer one, which may not be what you want.
To avoid this scenario:
1. Go to **{settings}** **Settings > CI / CD**.
1. Expand **General pipelines**.
1. Check the **Skip older, pending deployment jobs** checkbox.
1. Click **Save changes**.
The pending deployment jobs will be skipped.
## Pipeline Badges
In the pipelines settings page you can find pipeline status and test coverage
badges for your project. The latest successful pipeline will be used to read
the pipeline status and test coverage values.
Visit the pipelines settings page in your project to see the exact link to
your badges, as well as ways to embed the badge image in your HTML or Markdown
pages.
![Pipelines badges](img/pipelines_settings_badges.png)
### Pipeline status badge
Depending on the status of your job, a badge can have the following values:
- pending
- running
- passed
- failed
- skipped
- canceled
- unknown
You can access a pipeline status badge image using the following link:
```text
https://example.gitlab.com/<namespace>/<project>/badges/<branch>/pipeline.svg
```
### Test coverage report badge
GitLab makes it possible to define the regular expression for [coverage report](#test-coverage-parsing),
that each job log will be matched against. This means that each job in the
pipeline can have the test coverage percentage value defined.
The test coverage badge can be accessed using following link:
```text
https://example.gitlab.com/<namespace>/<project>/badges/<branch>/coverage.svg
```
If you would like to get the coverage report from a specific job, you can add
the `job=coverage_job_name` parameter to the URL. For example, the following
Markdown code will embed the test coverage report badge of the `coverage` job
into your `README.md`:
```markdown
![coverage](https://gitlab.com/gitlab-org/gitlab-foss/badges/master/coverage.svg?job=coverage)
```
### Badge styles
Pipeline badges can be rendered in different styles by adding the `style=style_name` parameter to the URL. Currently two styles are available:
#### Flat (default)
```text
https://example.gitlab.com/<namespace>/<project>/badges/<branch>/coverage.svg?style=flat
```
![Badge flat style](https://gitlab.com/gitlab-org/gitlab-foss/badges/master/coverage.svg?job=coverage&style=flat)
#### Flat square
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/30120) in GitLab 11.8.
```text
https://example.gitlab.com/<namespace>/<project>/badges/<branch>/coverage.svg?style=flat-square
```
![Badge flat square style](https://gitlab.com/gitlab-org/gitlab-foss/badges/master/coverage.svg?job=coverage&style=flat-square)
## Environment Variables
[Environment variables](../../../ci/variables/README.md#gitlab-cicd-environment-variables) can be set in an environment to be available to a runner.
## Deploy Keys
With Deploy Keys, GitLab allows you to import SSH public keys. You can then have
read only or read/write access to your project from the machines the keys were generated from.
SSH keys added to your project settings will be used for continuous integration,
staging, or production servers.
<!-- ## Troubleshooting
Include any troubleshooting steps that you can foresee. If you know beforehand what issues
one might have when setting this up, or when something is changed, or on upgrading, it's
important to describe those, too. Think of things that may go wrong and include them here.
This is important to minimize requests for support, and to avoid doc comments with
questions that you know someone might ask.
Each scenario can be a third-level heading, e.g. `### Getting error message X`.
If you have none to add when creating a doc, leave this section in place
but commented out to help encourage others to add to it in the future. -->
This document was moved to [another location](../../../ci/pipelines/settings.md).
Loading
Loading
@@ -187,7 +187,7 @@ Additionally, direct pushes to the protected branch are denied if a rule is matc
The permission to merge or push to protected branches is used to define if a user can
run CI/CD pipelines and execute actions on jobs that are related to those branches.
 
See [Security on protected branches](../../ci/pipelines.md#security-on-protected-branches)
See [Security on protected branches](../../ci/pipelines/index.md#security-on-protected-branches)
for details about the pipelines security model.
 
## Changelog
Loading
Loading
Loading
Loading
@@ -18,6 +18,7 @@ module Gitlab
self.table_name = 'epics'
 
belongs_to :author, class_name: "User"
belongs_to :project
belongs_to :group
 
def self.user_mention_model
Loading
Loading
Loading
Loading
@@ -136,6 +136,12 @@ module Gitlab
data = []
 
record.in_batches(of: @batch_size) do |batch| # rubocop:disable Cop/InBatches
# order each batch by it's primary key to ensure
# consistent and predictable ordering of each exported relation
# as additional `WHERE` clauses can impact the order in which data is being
# returned by database when no `ORDER` is specified
batch = batch.reorder(batch.klass.primary_key)
if Feature.enabled?(:export_fast_serialize_with_raw_json, default_enabled: true)
data.append(JSONBatchRelation.new(batch, options, preloads[key]).tap(&:raw_json))
else
Loading
Loading
Loading
Loading
@@ -106,13 +106,18 @@ msgid_plural "%d contributions"
msgstr[0] ""
msgstr[1] ""
 
msgid "%d error"
msgid_plural "%d errors"
msgstr[0] ""
msgstr[1] ""
msgid "%d exporter"
msgid_plural "%d exporters"
msgstr[0] ""
msgstr[1] ""
 
msgid "%d failed/error test result"
msgid_plural "%d failed/error test results"
msgid "%d failed"
msgid_plural "%d failed"
msgstr[0] ""
msgstr[1] ""
 
Loading
Loading
@@ -1679,9 +1684,6 @@ msgstr ""
msgid "Allow users to request access (if visibility is public or internal)"
msgstr ""
 
msgid "Allow variables to run on protected branches and tags."
msgstr ""
msgid "Allowed email domain restriction only permitted for top-level groups"
msgstr ""
 
Loading
Loading
@@ -3710,6 +3712,9 @@ msgstr ""
msgid "Choose which shards you wish to synchronize to this secondary node."
msgstr ""
 
msgid "Choose which status most accurately reflects the current state of this issue:"
msgstr ""
msgid "CiStatusLabel|canceled"
msgstr ""
 
Loading
Loading
@@ -3788,7 +3793,7 @@ msgstr ""
msgid "CiVariables|Cannot use Masked Variable with current value"
msgstr ""
 
msgid "CiVariables|Environment Scope"
msgid "CiVariables|Environments"
msgstr ""
 
msgid "CiVariables|Input variable key"
Loading
Loading
@@ -5556,6 +5561,9 @@ msgstr ""
msgid "Copy commit SHA"
msgstr ""
 
msgid "Copy environment"
msgstr ""
msgid "Copy evidence SHA"
msgstr ""
 
Loading
Loading
@@ -5568,6 +5576,9 @@ msgstr ""
msgid "Copy impersonation token"
msgstr ""
 
msgid "Copy key"
msgstr ""
msgid "Copy labels and milestone from %{source_issuable_reference}."
msgstr ""
 
Loading
Loading
@@ -5592,6 +5603,9 @@ msgstr ""
msgid "Copy trigger token"
msgstr ""
 
msgid "Copy value"
msgstr ""
msgid "Could not add admins as members"
msgstr ""
 
Loading
Loading
@@ -6362,6 +6376,9 @@ msgstr ""
msgid "Delete this attachment"
msgstr ""
 
msgid "Delete variable"
msgstr ""
msgid "DeleteProject|Failed to remove project repository. Please try again or contact administrator."
msgstr ""
 
Loading
Loading
@@ -7958,6 +7975,9 @@ msgstr ""
msgid "Error occurred when toggling the notification subscription"
msgstr ""
 
msgid "Error occurred while updating the issue status"
msgstr ""
msgid "Error occurred while updating the issue weight"
msgstr ""
 
Loading
Loading
@@ -8252,6 +8272,9 @@ msgstr ""
msgid "Export this project with all its related data in order to move your project to a new GitLab instance. Once the export is finished, you can import the file from the \"New Project\" page."
msgstr ""
 
msgid "Export variable to pipelines running on protected branches and tags only."
msgstr ""
msgid "External Classification Policy Authorization"
msgstr ""
 
Loading
Loading
@@ -8822,6 +8845,9 @@ msgstr ""
msgid "Fixed:"
msgstr ""
 
msgid "Flags"
msgstr ""
msgid "FlowdockService|Flowdock Git source token"
msgstr ""
 
Loading
Loading
@@ -16578,7 +16604,7 @@ msgstr ""
msgid "Reporting"
msgstr ""
 
msgid "Reports|%{failedString} and %{resolvedString}"
msgid "Reports|%{combinedString} and %{resolvedString}"
msgstr ""
 
msgid "Reports|Actions"
Loading
Loading
@@ -16717,6 +16743,9 @@ msgid_plural "Requires %d more approvals."
msgstr[0] ""
msgstr[1] ""
 
msgid "Requires values to meet regular expression requirements."
msgstr ""
msgid "Resend confirmation email"
msgstr ""
 
Loading
Loading
@@ -19849,9 +19878,6 @@ msgstr ""
msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6."
msgstr ""
 
msgid "There are currently no variables, add a variable with the Add Variable button below."
msgstr ""
msgid "There are no GPG keys associated with this account."
msgstr ""
 
Loading
Loading
@@ -19906,6 +19932,9 @@ msgstr ""
msgid "There are no projects shared with this group yet"
msgstr ""
 
msgid "There are no variables yet."
msgstr ""
msgid "There is a limit of %{ci_project_subscriptions_limit} subscriptions from or to a project."
msgstr ""
 
Loading
Loading
@@ -20425,6 +20454,9 @@ msgstr ""
msgid "This user will be the author of all events in the activity feed that are the result of an update, like new branches being created or new commits being pushed to existing branches. Upon creation or when reassigning you can only assign yourself to be the mirror user."
msgstr ""
 
msgid "This variable can not be masked"
msgstr ""
msgid "This will help us personalize your onboarding experience."
msgstr ""
 
Loading
Loading
@@ -21362,9 +21394,6 @@ msgstr ""
msgid "Update"
msgstr ""
 
msgid "Update Variable"
msgstr ""
msgid "Update all"
msgstr ""
 
Loading
Loading
@@ -21383,6 +21412,9 @@ msgstr ""
msgid "Update now"
msgstr ""
 
msgid "Update variable"
msgstr ""
msgid "Update your bookmarked URLs as filtered/sorted branches URL has been changed."
msgstr ""
 
Loading
Loading
@@ -21992,13 +22024,13 @@ msgstr ""
msgid "Value Stream Analytics gives an overview of how much time it takes to go from idea to production in your project."
msgstr ""
 
msgid "Variable"
msgid "Var"
msgstr ""
 
msgid "Variables"
msgid "Variable will be masked in job logs."
msgstr ""
 
msgid "Variables will be masked in job logs. Requires values to meet regular expression requirements."
msgid "Variables"
msgstr ""
 
msgid "Various container registry settings."
Loading
Loading
# frozen_string_literal: true
require_relative '../../migration_helpers'
module RuboCop
module Cop
module Migration
# Cop that prevents usage of `with_lock_retries` within the `change` method.
class WithLockRetriesWithChange < RuboCop::Cop::Cop
include MigrationHelpers
MSG = '`with_lock_retries` cannot be used within `change` so you must manually define ' \
'the `up` and `down` methods in your migration class and use `with_lock_retries` in both methods'.freeze
def on_send(node)
return unless in_migration?(node)
return unless node.children[1] == :with_lock_retries
node.each_ancestor(:def) do |def_node|
add_offense(def_node, location: :name) if method_name(def_node) == :change
end
end
def method_name(node)
node.children.first
end
end
end
end
end
Loading
Loading
@@ -60,6 +60,7 @@ describe 'Database schema' do
oauth_access_grants: %w[resource_owner_id application_id],
oauth_access_tokens: %w[resource_owner_id application_id],
oauth_applications: %w[owner_id],
open_project_tracker_data: %w[closed_status_id],
project_group_links: %w[group_id],
project_statistics: %w[namespace_id],
projects: %w[creator_id namespace_id ci_id mirror_user_id],
Loading
Loading
Loading
Loading
@@ -585,10 +585,10 @@ describe 'Merge request > User sees merge widget', :js do
within(".js-reports-container") do
click_button 'Expand'
 
expect(page).to have_content('Test summary contained 1 failed/error test result out of 2 total tests')
expect(page).to have_content('Test summary contained 1 failed out of 2 total tests')
within(".js-report-section-container") do
expect(page).to have_content('rspec found no changed test results out of 1 total test')
expect(page).to have_content('junit found 1 failed/error test result out of 1 total test')
expect(page).to have_content('junit found 1 failed out of 1 total test')
expect(page).to have_content('New')
expect(page).to have_content('addTest')
end
Loading
Loading
@@ -630,9 +630,9 @@ describe 'Merge request > User sees merge widget', :js do
within(".js-reports-container") do
click_button 'Expand'
 
expect(page).to have_content('Test summary contained 1 failed/error test result out of 2 total tests')
expect(page).to have_content('Test summary contained 1 failed out of 2 total tests')
within(".js-report-section-container") do
expect(page).to have_content('rspec found 1 failed/error test result out of 1 total test')
expect(page).to have_content('rspec found 1 failed out of 1 total test')
expect(page).to have_content('junit found no changed test results out of 1 total test')
expect(page).not_to have_content('New')
expect(page).to have_content('Test#sum when a is 1 and b is 3 returns summary')
Loading
Loading
@@ -718,10 +718,10 @@ describe 'Merge request > User sees merge widget', :js do
within(".js-reports-container") do
click_button 'Expand'
 
expect(page).to have_content('Test summary contained 1 failed/error test result out of 2 total tests')
expect(page).to have_content('Test summary contained 1 error out of 2 total tests')
within(".js-report-section-container") do
expect(page).to have_content('rspec found no changed test results out of 1 total test')
expect(page).to have_content('junit found 1 failed/error test result out of 1 total test')
expect(page).to have_content('junit found 1 error out of 1 total test')
expect(page).to have_content('New')
expect(page).to have_content('addTest')
end
Loading
Loading
@@ -762,9 +762,9 @@ describe 'Merge request > User sees merge widget', :js do
within(".js-reports-container") do
click_button 'Expand'
 
expect(page).to have_content('Test summary contained 1 failed/error test result out of 2 total tests')
expect(page).to have_content('Test summary contained 1 error out of 2 total tests')
within(".js-report-section-container") do
expect(page).to have_content('rspec found 1 failed/error test result out of 1 total test')
expect(page).to have_content('rspec found 1 error out of 1 total test')
expect(page).to have_content('junit found no changed test results out of 1 total test')
expect(page).not_to have_content('New')
expect(page).to have_content('Test#sum when a is 4 and b is 4 returns summary')
Loading
Loading
@@ -857,10 +857,10 @@ describe 'Merge request > User sees merge widget', :js do
within(".js-reports-container") do
click_button 'Expand'
 
expect(page).to have_content('Test summary contained 20 failed/error test results out of 20 total tests')
expect(page).to have_content('Test summary contained 20 failed out of 20 total tests')
within(".js-report-section-container") do
expect(page).to have_content('rspec found 10 failed/error test results out of 10 total tests')
expect(page).to have_content('junit found 10 failed/error test results out of 10 total tests')
expect(page).to have_content('rspec found 10 failed out of 10 total tests')
expect(page).to have_content('junit found 10 failed out of 10 total tests')
 
expect(page).to have_content('Test#sum when a is 1 and b is 3 returns summary', count: 2)
end
Loading
Loading
Loading
Loading
@@ -35,10 +35,6 @@ describe('Ci variable modal', () => {
expect(findModal().props('actionPrimary').attributes.disabled).toBeTruthy();
});
 
it('masked checkbox is disabled when value does not meet regex requirements', () => {
expect(wrapper.find({ ref: 'masked-ci-variable' }).attributes('disabled')).toBeTruthy();
});
describe('Adding a new variable', () => {
beforeEach(() => {
const [variable] = mockData.mockVariables;
Loading
Loading
@@ -49,13 +45,6 @@ describe('Ci variable modal', () => {
expect(findModal().props('actionPrimary').attributes.disabled).toBeFalsy();
});
 
it('masked checkbox is enabled when value meets regex requirements', () => {
store.state.maskableRegex = '^[a-zA-Z0-9_+=/@:-]{8,}$';
return wrapper.vm.$nextTick(() => {
expect(wrapper.find({ ref: 'masked-ci-variable' }).attributes('disabled')).toBeFalsy();
});
});
it('Add variable button dispatches addVariable action', () => {
findModal().vm.$emit('ok');
expect(store.dispatch).toHaveBeenCalledWith('addVariable');
Loading
Loading
@@ -74,7 +63,7 @@ describe('Ci variable modal', () => {
});
 
it('button text is Update variable when updating', () => {
expect(wrapper.vm.modalActionText).toBe('Update Variable');
expect(wrapper.vm.modalActionText).toBe('Update variable');
});
 
it('Update variable button dispatches updateVariable with correct variable', () => {
Loading
Loading
@@ -89,5 +78,10 @@ describe('Ci variable modal', () => {
findModal().vm.$emit('hidden');
expect(store.dispatch).toHaveBeenCalledWith('resetEditing');
});
it('dispatches deleteVariable with correct variable to delete', () => {
findModal().vm.$emit('secondary');
expect(store.dispatch).toHaveBeenCalledWith('deleteVariable', mockData.mockVariables[0]);
});
});
});
import { shallowMount } from '@vue/test-utils';
import { GlButton } from '@gitlab/ui';
import CiVariablePopover from '~/ci_variable_list/components/ci_variable_popover.vue';
import mockData from '../services/mock_data';
describe('Ci Variable Popover', () => {
let wrapper;
const defaultProps = {
target: 'ci-variable-value-22',
value: mockData.mockPemCert,
tooltipText: 'Copy value',
};
const createComponent = (props = defaultProps) => {
wrapper = shallowMount(CiVariablePopover, {
propsData: { ...props },
});
};
const findButton = () => wrapper.find(GlButton);
beforeEach(() => {
createComponent();
});
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
it('displays max count plus ... when character count is over 95', () => {
expect(wrapper.text()).toHaveLength(98);
});
it('copies full value to clipboard', () => {
expect(findButton().attributes('data-clipboard-text')).toEqual(mockData.mockPemCert);
});
it('displays full value when count is less than max count', () => {
createComponent({
target: 'ci-variable-value-22',
value: 'test_variable_value',
tooltipText: 'Copy value',
});
expect(wrapper.text()).toEqual('test_variable_value');
});
});
Loading
Loading
@@ -17,12 +17,12 @@ describe('Ci variable table', () => {
store.state.isGroup = true;
jest.spyOn(store, 'dispatch').mockImplementation();
wrapper = mount(CiVariableTable, {
attachToDocument: true,
localVue,
store,
});
};
 
const findDeleteButton = () => wrapper.find({ ref: 'delete-ci-variable' });
const findRevealButton = () => wrapper.find({ ref: 'secret-value-reveal-button' });
const findEditButton = () => wrapper.find({ ref: 'edit-ci-variable' });
const findEmptyVariablesPlaceholder = () => wrapper.find({ ref: 'empty-variables' });
Loading
Loading
@@ -71,11 +71,6 @@ describe('Ci variable table', () => {
store.state.variables = mockData.mockVariables;
});
 
it('dispatches deleteVariable with correct variable to delete', () => {
findDeleteButton().trigger('click');
expect(store.dispatch).toHaveBeenCalledWith('deleteVariable', mockData.mockVariables[0]);
});
it('reveals secret values when button is clicked', () => {
findRevealButton().trigger('click');
expect(store.dispatch).toHaveBeenCalledWith('toggleValues', false);
Loading
Loading
Loading
Loading
@@ -6,8 +6,9 @@ export default {
key: 'test_var',
masked: false,
protected: false,
secret_value: 'test_val',
value: 'test_val',
variable_type: 'Variable',
variable_type: 'Var',
},
],
 
Loading
Loading
@@ -18,6 +19,7 @@ export default {
key: 'test_var',
masked: false,
protected: false,
secret_value: 'test_val',
value: 'test_val',
variable_type: 'env_var',
},
Loading
Loading
@@ -27,6 +29,7 @@ export default {
key: 'test_var_2',
masked: false,
protected: false,
secret_value: 'test_val_2',
value: 'test_val_2',
variable_type: 'file',
},
Loading
Loading
@@ -34,20 +37,22 @@ export default {
 
mockVariablesDisplay: [
{
environment_scope: 'All environments',
environment_scope: 'All',
id: 113,
key: 'test_var',
masked: false,
protected: false,
secret_value: 'test_val',
value: 'test_val',
variable_type: 'Variable',
variable_type: 'Var',
},
{
environment_scope: 'All environments',
environment_scope: 'All',
id: 114,
key: 'test_var_2',
masked: false,
protected: false,
secret_value: 'test_val_2',
value: 'test_val_2',
variable_type: 'File',
},
Loading
Loading
@@ -69,4 +74,18 @@ export default {
state: 'available',
},
],
mockPemCert: `-----BEGIN CERTIFICATE REQUEST-----
MIIB9TCCAWACAQAwgbgxGTAXBgNVBAoMEFF1b1ZhZGlzIExpbWl0ZWQxHDAaBgNV
BAsME0RvY3VtZW50IERlcGFydG1lbnQxOTA3BgNVBAMMMFdoeSBhcmUgeW91IGRl
Y29kaW5nIG1lPyAgVGhpcyBpcyBvbmx5IGEgdGVzdCEhITERMA8GA1UEBwwISGFt
aWx0b24xETAPBgNVBAgMCFBlbWJyb2tlMQswCQYDVQQGEwJCTTEPMA0GCSqGSIb3
DQEJARYAMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCJ9WRanG/fUvcfKiGl
EL4aRLjGt537mZ28UU9/3eiJeJznNSOuNLnF+hmabAu7H0LT4K7EdqfF+XUZW/2j
RKRYcvOUDGF9A7OjW7UfKk1In3+6QDCi7X34RE161jqoaJjrm/T18TOKcgkkhRzE
apQnIDm0Ea/HVzX/PiSOGuertwIDAQABMAsGCSqGSIb3DQEBBQOBgQBzMJdAV4QP
Awel8LzGx5uMOshezF/KfP67wJ93UW+N7zXY6AwPgoLj4Kjw+WtU684JL8Dtr9FX
ozakE+8p06BpxegR4BR3FMHf6p+0jQxUEAkAyb/mVgm66TyghDGC6/YkiKoZptXQ
98TwDIK/39WEB/V607As+KoYazQG8drorw==
-----END CERTIFICATE REQUEST-----`,
};
Loading
Loading
@@ -48,12 +48,12 @@ describe('CI variable list mutations', () => {
describe('CLEAR_MODAL', () => {
it('should clear modal state ', () => {
const modalState = {
variable_type: 'Variable',
variable_type: 'Var',
key: '',
secret_value: '',
protected: false,
masked: false,
environment_scope: 'All environments',
environment_scope: 'All',
};
 
mutations[types.CLEAR_MODAL](stateCopy);
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment