Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-01-27 00:07:50 +00:00
parent e04b8c1e60
commit 431b84710e
65 changed files with 882 additions and 160 deletions

View File

@ -1564,7 +1564,6 @@ RSpec/ContextWording:
- 'spec/lib/api/entities/application_setting_spec.rb'
- 'spec/lib/api/entities/basic_project_details_spec.rb'
- 'spec/lib/api/entities/clusters/agent_authorization_spec.rb'
- 'spec/lib/api/entities/merge_request_basic_spec.rb'
- 'spec/lib/api/entities/nuget/dependency_group_spec.rb'
- 'spec/lib/api/entities/user_spec.rb'
- 'spec/lib/api/every_api_endpoint_spec.rb'

View File

@ -1 +1 @@
15.8.0
15.9.0-rc1

View File

@ -323,6 +323,7 @@ export default {
>
<deployment
:deployment="upcomingDeployment"
:visible="visible"
:class="{ 'gl-ml-7': inFolder }"
class="gl-pl-4"
>

View File

@ -0,0 +1,18 @@
import { s__ } from '~/locale';
export const DEFAULT_ITEM_LENGTH = 10;
export const MAX_ITEM_LENGTH = 100;
const header = s__('GlobalSearch|Language');
const scopes = {
BLOBS: 'blobs',
};
const filterParam = 'language';
export const languageFilterData = {
header,
scopes,
filterParam,
};

View File

@ -6,7 +6,13 @@ import { logError } from '~/lib/logger';
import { __ } from '~/locale';
import { GROUPS_LOCAL_STORAGE_KEY, PROJECTS_LOCAL_STORAGE_KEY, SIDEBAR_PARAMS } from './constants';
import * as types from './mutation_types';
import { loadDataFromLS, setFrequentItemToLS, mergeById, isSidebarDirty } from './utils';
import {
loadDataFromLS,
setFrequentItemToLS,
mergeById,
isSidebarDirty,
getAggregationsUrl,
} from './utils';
export const fetchGroups = ({ commit }, search) => {
commit(types.REQUEST_GROUPS);
@ -95,7 +101,7 @@ export const setQuery = ({ state, commit }, { key, value }) => {
};
export const applyQuery = ({ state }) => {
visitUrl(setUrlParams({ ...state.query, page: null }));
visitUrl(setUrlParams({ ...state.query, page: null }, window.location.href, false, true));
};
export const resetQuery = ({ state }) => {
@ -117,3 +123,16 @@ export const fetchSidebarCount = ({ commit, state }) => {
});
return Promise.all(promises);
};
export const fetchLanguageAggregation = ({ commit }) => {
commit(types.REQUEST_AGGREGATIONS);
return axios
.get(getAggregationsUrl())
.then(({ data }) => {
commit(types.RECEIVE_AGGREGATIONS_SUCCESS, data);
})
.catch((e) => {
logError(e);
commit(types.RECEIVE_AGGREGATIONS_ERROR);
});
};

View File

@ -1,5 +1,6 @@
import { stateFilterData } from '~/search/sidebar/constants/state_filter_data';
import { confidentialFilterData } from '~/search/sidebar/constants/confidential_filter_data';
import { languageFilterData } from '~/search/sidebar/constants/language_filter_data';
export const MAX_FREQUENT_ITEMS = 5;
@ -9,6 +10,10 @@ export const GROUPS_LOCAL_STORAGE_KEY = 'global-search-frequent-groups';
export const PROJECTS_LOCAL_STORAGE_KEY = 'global-search-frequent-projects';
export const SIDEBAR_PARAMS = [stateFilterData.filterParam, confidentialFilterData.filterParam];
export const SIDEBAR_PARAMS = [
stateFilterData.filterParam,
confidentialFilterData.filterParam,
languageFilterData.filterParam,
];
export const NUMBER_FORMATING_OPTIONS = { notation: 'compact', compactDisplay: 'short' };

View File

@ -1,3 +1,4 @@
import { languageFilterData } from '~/search/sidebar/constants/language_filter_data';
import { GROUPS_LOCAL_STORAGE_KEY, PROJECTS_LOCAL_STORAGE_KEY } from './constants';
export const frequentGroups = (state) => {
@ -7,3 +8,11 @@ export const frequentGroups = (state) => {
export const frequentProjects = (state) => {
return state.frequentItems[PROJECTS_LOCAL_STORAGE_KEY];
};
export const langugageAggregationBuckets = (state) => {
return (
state.aggregations.data.find(
(aggregation) => aggregation.name === languageFilterData.filterParam,
)?.buckets || []
);
};

View File

@ -11,3 +11,7 @@ export const SET_SIDEBAR_DIRTY = 'SET_SIDEBAR_DIRTY';
export const LOAD_FREQUENT_ITEMS = 'LOAD_FREQUENT_ITEMS';
export const RECEIVE_NAVIGATION_COUNT = 'RECEIVE_NAVIGATION_COUNT';
export const REQUEST_AGGREGATIONS = 'REQUEST_AGGREGATIONS';
export const RECEIVE_AGGREGATIONS_SUCCESS = 'RECEIVE_AGGREGATIONS_SUCCESS';
export const RECEIVE_AGGREGATIONS_ERROR = 'RECEIVE_AGGREGATIONS_ERROR';

View File

@ -36,4 +36,13 @@ export default {
const item = { ...state.navigation[key], count };
state.navigation = { ...state.navigation, [key]: item };
},
[types.REQUEST_AGGREGATIONS](state) {
state.aggregations = { fetching: true, error: false, data: [] };
},
[types.RECEIVE_AGGREGATIONS_SUCCESS](state, data) {
state.aggregations = { fetching: false, error: false, data: [...data] };
},
[types.RECEIVE_AGGREGATIONS_ERROR](state) {
state.aggregations = { fetching: false, error: true, data: [] };
},
};

View File

@ -14,5 +14,11 @@ const createState = ({ query, navigation }) => ({
},
sidebarDirty: false,
navigation,
aggregations: {
error: false,
fetching: false,
data: [],
},
});
export default createState;

View File

@ -81,7 +81,7 @@ export default {
</gl-intersection-observer>
</div>
</div>
<div v-if="isLoggedIn" class="gl-display-flex gl-justify-content-end">
<div v-if="isLoggedIn" class="gl-display-flex gl-justify-content-end gl-p-5">
<form v-if="permissions.canDecline" method="post" :action="paths.decline">
<gl-button type="submit">{{ $options.i18n.decline }}</gl-button>
<input :value="$options.csrf.token" type="hidden" name="authenticity_token" />

View File

@ -8,7 +8,11 @@
}
.terms-fade {
background: linear-gradient(0deg, $white 0%, rgba($white, 0.5) 100%);
background: linear-gradient(rgba($white, 0), $white);
.gl-dark & {
background: linear-gradient(rgba($gray-900, 0), $gray-900);
}
}
.content {

View File

@ -163,6 +163,7 @@ module VerifiesWithEmail
end
def require_email_verification_enabled?(user)
Feature.enabled?(:require_email_verification, user)
Feature.enabled?(:require_email_verification, user) &&
Feature.disabled?(:skip_require_email_verification, user, type: :ops)
end
end

View File

@ -65,9 +65,9 @@ module Types
field :tags,
[Types::DeploymentTagType],
description: 'Git tags that contain this deployment. ' \
'This field can only be resolved for one deployment in any single request.',
'This field can only be resolved for two deployments in any single request.',
calls_gitaly: true do
extension ::Gitlab::Graphql::Limit::FieldCallCount, limit: 1
extension ::Gitlab::Graphql::Limit::FieldCallCount, limit: 2
end
end
end

View File

@ -213,9 +213,9 @@ module Types
field :security_auto_fix, GraphQL::Types::Boolean, null: true,
description: 'Indicates if the merge request is created by @GitLab-Security-Bot.'
field :squash, GraphQL::Types::Boolean, null: false,
description: 'Indicates if squash on merge is enabled.'
description: 'Indicates if the merge request is set to be squashed when merged. [Project settings](https://docs.gitlab.com/ee/user/project/merge_requests/squash_and_merge.html#configure-squash-options-for-a-project) may override this value. Use `squash_on_merge` instead to take project squash options into account.'
field :squash_on_merge, GraphQL::Types::Boolean, null: false, method: :squash_on_merge?,
description: 'Indicates if squash on merge is enabled.'
description: 'Indicates if the merge request will be squashed when merged.'
field :timelogs, Types::TimelogType.connection_type, null: false,
description: 'Timelogs on the merge request.'

View File

@ -10,6 +10,10 @@ module RegistrationsHelper
qa_selector: 'new_user_username_field'
}
end
def arkose_labs_challenge_enabled?
false
end
end
RegistrationsHelper.prepend_mod_with('RegistrationsHelper')

View File

@ -45,8 +45,9 @@ module RequireEmailVerification
private
def override_devise_lockable?
strong_memoize(:override_devise_lockable) do
Feature.enabled?(:require_email_verification, self) && !two_factor_enabled?
end
Feature.enabled?(:require_email_verification, self) &&
!two_factor_enabled? &&
Feature.disabled?(:skip_require_email_verification, self, type: :ops)
end
strong_memoize_attr :override_devise_lockable?
end

View File

@ -72,7 +72,9 @@ class Todo < ApplicationRecord
scope :for_type, -> (type) { where(target_type: type) }
scope :for_target, -> (id) { where(target_id: id) }
scope :for_commit, -> (id) { where(commit_id: id) }
scope :with_entity_associations, -> { preload(:target, :author, :note, group: :route, project: [:route, { namespace: [:route, :owner] }]) }
scope :with_entity_associations, -> do
preload(:target, :author, :note, group: :route, project: [:route, { namespace: [:route, :owner] }, :project_setting])
end
scope :joins_issue_and_assignees, -> { left_joins(issue: :assignees) }
scope :for_internal_notes, -> { joins(:note).where(note: { confidential: true }) }

View File

@ -66,7 +66,7 @@
= render_if_exists 'devise/shared/phone_verification', form: f
%div
- if Feature.enabled?(:arkose_labs_signup_challenge)
- if arkose_labs_challenge_enabled?
= render_if_exists 'devise/registrations/arkose_labs'
- elsif show_recaptcha_sign_up?
= recaptcha_tags nonce: content_security_policy_nonce

View File

@ -0,0 +1,8 @@
---
name: use_primary_and_secondary_stores_for_rate_limiting
introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106123"
rollout_issue_url: "https://gitlab.com/gitlab-org/gitlab/-/issues/385681"
milestone: '15.9'
type: development
group: group::scalability
default_enabled: false

View File

@ -0,0 +1,8 @@
---
name: use_primary_store_as_default_for_rate_limiting
introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106123"
rollout_issue_url: "https://gitlab.com/gitlab-org/gitlab/-/issues/385681"
milestone: '15.9'
type: development
group: group::scalability
default_enabled: false

View File

@ -1,8 +1,8 @@
---
name: arkose_labs_signup_challenge
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95560
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/370932
milestone: '15.4'
type: development
name: skip_require_email_verification
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/110010
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/389235
milestone: '15.9'
type: ops
group: group::anti-abuse
default_enabled: false

View File

@ -1216,6 +1216,9 @@ NOTE:
Gitaly Cluster provides the benefits of fault tolerance, but comes with additional complexity of setup and management. Review the existing [technical limitations and considerations before deploying Gitaly Cluster](../gitaly/index.md#before-deploying-gitaly-cluster).
For implementations with sharded Gitaly, use the same Gitaly specs. Follow the [separate Gitaly documentation](../gitaly/configure_gitaly.md) instead of this section.
NOTE:
For guidance on how to migrate existing repositories from NFS to Gitaly Cluster, [follow the main documentation](../gitaly/index.md#migrate-to-gitaly-cluster).
NOTE:
Gitaly has been designed and tested with repositories of varying sizes that follow best practices.
However, large repositories or monorepos not following these practices can significantly
@ -1756,7 +1759,10 @@ To configure Praefect with TLS:
Sidekiq requires connection to the [Redis](#configure-redis),
[PostgreSQL](#configure-postgresql) and [Gitaly](#configure-gitaly) instances.
Because you must use [Object storage](#configure-the-object-storage) instead of NFS for data objects, the following
It also requires a connection to [Object Storage](#configure-the-object-storage) as recommended.
NOTE:
[Because it's recommended to use Object storage](../object_storage.md) instead of NFS for data objects, the following
examples include the Object storage configuration.
- `10.6.0.101`: Sidekiq 1
@ -1925,7 +1931,13 @@ run [multiple Sidekiq processes](../sidekiq/extra_sidekiq_processes.md).
## Configure GitLab Rails
This section describes how to configure the GitLab application (Rails) component.
Because you must use [Object storage](#configure-the-object-storage) instead of NFS for data objects, the following
Rails requires connections to the [Redis](#configure-redis),
[PostgreSQL](#configure-postgresql) and [Gitaly](#configure-gitaly) instances.
It also requires a connection to [Object Storage](#configure-the-object-storage) as recommended.
NOTE:
[Because it's recommended to use Object storage](../object_storage.md) instead of NFS for data objects, the following
examples include the Object storage configuration.
The following IPs will be used as an example:
@ -2065,6 +2077,10 @@ On each node perform the following:
1. Copy the `/etc/gitlab/gitlab-secrets.json` file from the first Omnibus node you configured and add or replace
the file of the same name on this server. If this is the first Omnibus node you are configuring then you can skip this step.
1. Copy the SSH host keys (all in the name format `/etc/ssh/ssh_host_*_key*`) from the first Omnibus node you configured and
add or replace the files of the same name on this server. This ensures host mismatch errors aren't thrown
for your users as they hit the load balanced Rails nodes. If this is the first Omnibus node you are configuring,
then you can skip this step.
1. To ensure database migrations are only run during reconfigure and not automatically on upgrade, run:
```shell
@ -2200,16 +2216,10 @@ To configure the Monitoring node:
## Configure the object storage
GitLab supports using an object storage service for holding numerous types of data.
GitLab has been tested on a number of object storage providers:
- [Amazon S3](https://aws.amazon.com/s3/)
- [Google Cloud Storage](https://cloud.google.com/storage)
- [Digital Ocean Spaces](https://www.digitalocean.com/products/spaces)
- [Oracle Cloud Infrastructure](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/s3compatibleapi.htm)
- [OpenStack Swift (S3 compatibility mode)](https://docs.openstack.org/swift/latest/s3_compat.html)
- MinIO. We have [a guide to deploying this](https://docs.gitlab.com/charts/advanced/external-object-storage/minio.html) within our Helm Chart documentation.
GitLab supports using an [object storage](../object_storage.md) service for holding numerous types of data.
It's recommended over [NFS](../nfs.md) for data objects and in general it's better
in larger setups as object storage is typically much more performant, reliable,
and scalable.
There are two ways of specifying object storage configuration in GitLab:

View File

@ -1236,6 +1236,9 @@ NOTE:
Gitaly Cluster provides the benefits of fault tolerance, but comes with additional complexity of setup and management. Review the existing [technical limitations and considerations before deploying Gitaly Cluster](../gitaly/index.md#before-deploying-gitaly-cluster).
For implementations with sharded Gitaly, use the same Gitaly specs. Follow the [separate Gitaly documentation](../gitaly/configure_gitaly.md) instead of this section.
NOTE:
For guidance on how to migrate existing repositories from NFS to Gitaly Cluster, [follow the main documentation](../gitaly/index.md#migrate-to-gitaly-cluster).
NOTE:
Gitaly has been designed and tested with repositories of varying sizes that follow best practices.
However, large repositories or monorepos not following these practices can significantly
@ -1774,7 +1777,10 @@ To configure Praefect with TLS:
Sidekiq requires connection to the [Redis](#configure-redis),
[PostgreSQL](#configure-postgresql) and [Gitaly](#configure-gitaly) instances.
Because you must use [Object storage](#configure-the-object-storage) instead of NFS for data objects, the following
It also requires a connection to [Object Storage](#configure-the-object-storage) as recommended.
NOTE:
[Because it's recommended to use Object storage](../object_storage.md) instead of NFS for data objects, the following
examples include the Object storage configuration.
- `10.6.0.101`: Sidekiq 1
@ -1943,7 +1949,13 @@ run [multiple Sidekiq processes](../sidekiq/extra_sidekiq_processes.md).
## Configure GitLab Rails
This section describes how to configure the GitLab application (Rails) component.
Because you must use [Object storage](#configure-the-object-storage) instead of NFS for data objects, the following
Rails requires connections to the [Redis](#configure-redis),
[PostgreSQL](#configure-postgresql) and [Gitaly](#configure-gitaly) instances.
It also requires a connection to [Object Storage](#configure-the-object-storage) as recommended.
NOTE:
[Because it's recommended to use Object storage](../object_storage.md) instead of NFS for data objects, the following
examples include the Object storage configuration.
The following IPs will be used as an example:
@ -2085,6 +2097,10 @@ On each node perform the following:
1. Copy the `/etc/gitlab/gitlab-secrets.json` file from the first Omnibus node you configured and add or replace
the file of the same name on this server. If this is the first Omnibus node you are configuring then you can skip this step.
1. Copy the SSH host keys (all in the name format `/etc/ssh/ssh_host_*_key*`) from the first Omnibus node you configured and
add or replace the files of the same name on this server. This ensures host mismatch errors aren't thrown
for your users as they hit the load balanced Rails nodes. If this is the first Omnibus node you are configuring,
then you can skip this step.
1. To ensure database migrations are only run during reconfigure and not automatically on upgrade, run:
```shell
@ -2219,16 +2235,10 @@ To configure the Monitoring node:
## Configure the object storage
GitLab supports using an object storage service for holding numerous types of data.
GitLab has been tested on a number of object storage providers:
- [Amazon S3](https://aws.amazon.com/s3/)
- [Google Cloud Storage](https://cloud.google.com/storage)
- [Digital Ocean Spaces](https://www.digitalocean.com/products/spaces)
- [Oracle Cloud Infrastructure](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/s3compatibleapi.htm)
- [OpenStack Swift (S3 compatibility mode)](https://docs.openstack.org/swift/latest/s3_compat.html)
- MinIO. We have [a guide to deploying this](https://docs.gitlab.com/charts/advanced/external-object-storage/minio.html) within our Helm Chart documentation.
GitLab supports using an [object storage](../object_storage.md) service for holding numerous types of data.
It's recommended over [NFS](../nfs.md) for data objects and in general it's better
in larger setups as object storage is typically much more performant, reliable,
and scalable.
There are two ways of specifying object storage configuration in GitLab:

View File

@ -924,17 +924,10 @@ running [Prometheus](../monitoring/prometheus/index.md) and
## Configure the object storage
GitLab supports using an object storage service for holding numerous types of data.
GitLab has been tested on a number of object storage providers:
- [Amazon S3](https://aws.amazon.com/s3/)
- [Google Cloud Storage](https://cloud.google.com/storage)
- [Digital Ocean Spaces](https://www.digitalocean.com/products/spaces)
- [Oracle Cloud Infrastructure](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/s3compatibleapi.htm)
- [OpenStack Swift (S3 compatibility mode)](https://docs.openstack.org/swift/latest/s3_compat.html)
- [Azure Blob storage](https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction)
- MinIO. We have [a guide to deploying this](https://docs.gitlab.com/charts/advanced/external-object-storage/minio.html) within our Helm Chart documentation.
GitLab supports using an [object storage](../object_storage.md) service for holding numerous types of data.
It's recommended over [NFS](../nfs.md) for data objects and in general it's better
in larger setups as object storage is typically much more performant, reliable,
and scalable.
There are two ways of specifying object storage configuration in GitLab:

View File

@ -1171,6 +1171,9 @@ NOTE:
Gitaly Cluster provides the benefits of fault tolerance, but comes with additional complexity of setup and management. Review the existing [technical limitations and considerations before deploying Gitaly Cluster](../gitaly/index.md#before-deploying-gitaly-cluster).
For implementations with sharded Gitaly, use the same Gitaly specs. Follow the [separate Gitaly documentation](../gitaly/configure_gitaly.md) instead of this section.
NOTE:
For guidance on how to migrate existing repositories from NFS to Gitaly Cluster, [follow the main documentation](../gitaly/index.md#migrate-to-gitaly-cluster).
NOTE:
Gitaly has been designed and tested with repositories of varying sizes that follow best practices.
However, large repositories or monorepos not following these practices can significantly
@ -1708,7 +1711,10 @@ To configure Praefect with TLS:
Sidekiq requires connection to the [Redis](#configure-redis),
[PostgreSQL](#configure-postgresql) and [Gitaly](#configure-gitaly) instances.
Because you must use [Object storage](#configure-the-object-storage) instead of NFS for data objects, the following
It also requires a connection to [Object Storage](#configure-the-object-storage) as recommended.
NOTE:
[Because it's recommended to use Object storage](../object_storage.md) instead of NFS for data objects, the following
examples include the Object storage configuration.
The following IPs will be used as an example:
@ -1876,7 +1882,13 @@ run [multiple Sidekiq processes](../sidekiq/extra_sidekiq_processes.md).
## Configure GitLab Rails
This section describes how to configure the GitLab application (Rails) component.
Because you must use [Object storage](#configure-the-object-storage) instead of NFS for data objects, the following
Rails requires connections to the [Redis](#configure-redis),
[PostgreSQL](#configure-postgresql) and [Gitaly](#configure-gitaly) instances.
It also requires a connection to [Object Storage](#configure-the-object-storage) as recommended.
NOTE:
[Because it's recommended to use Object storage](../object_storage.md) instead of NFS for data objects, the following
examples include the Object storage configuration.
On each node perform the following:
@ -2016,6 +2028,10 @@ On each node perform the following:
1. Copy the `/etc/gitlab/gitlab-secrets.json` file from the first Omnibus node you configured and add or replace
the file of the same name on this server. If this is the first Omnibus node you are configuring then you can skip this step.
1. Copy the SSH host keys (all in the name format `/etc/ssh/ssh_host_*_key*`) from the first Omnibus node you configured and
add or replace the files of the same name on this server. This ensures host mismatch errors aren't thrown
for your users as they hit the load balanced Rails nodes. If this is the first Omnibus node you are configuring,
then you can skip this step.
1. To ensure database migrations are only run during reconfigure and not automatically on upgrade, run:
```shell
@ -2165,16 +2181,10 @@ running [Prometheus](../monitoring/prometheus/index.md) and
## Configure the object storage
GitLab supports using an object storage service for holding numerous types of data.
GitLab has been tested on a number of object storage providers:
- [Amazon S3](https://aws.amazon.com/s3/)
- [Google Cloud Storage](https://cloud.google.com/storage)
- [Digital Ocean Spaces](https://www.digitalocean.com/products/spaces)
- [Oracle Cloud Infrastructure](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/s3compatibleapi.htm)
- [OpenStack Swift (S3 compatibility mode)](https://docs.openstack.org/swift/latest/s3_compat.html)
- MinIO. We have [a guide to deploying this](https://docs.gitlab.com/charts/advanced/external-object-storage/minio.html) within our Helm Chart documentation.
GitLab supports using an [object storage](../object_storage.md) service for holding numerous types of data.
It's recommended over [NFS](../nfs.md) for data objects and in general it's better
in larger setups as object storage is typically much more performant, reliable,
and scalable.
There are two ways of specifying object storage configuration in GitLab:

View File

@ -1229,6 +1229,9 @@ NOTE:
Gitaly Cluster provides the benefits of fault tolerance, but comes with additional complexity of setup and management. Review the existing [technical limitations and considerations before deploying Gitaly Cluster](../gitaly/index.md#before-deploying-gitaly-cluster).
For implementations with sharded Gitaly, use the same Gitaly specs. Follow the [separate Gitaly documentation](../gitaly/configure_gitaly.md) instead of this section.
NOTE:
For guidance on how to migrate existing repositories from NFS to Gitaly Cluster, [follow the main documentation](../gitaly/index.md#migrate-to-gitaly-cluster).
NOTE:
Gitaly has been designed and tested with repositories of varying sizes that follow best practices.
However, large repositories or monorepos not following these practices can significantly
@ -1769,7 +1772,10 @@ To configure Praefect with TLS:
Sidekiq requires connection to the [Redis](#configure-redis),
[PostgreSQL](#configure-postgresql) and [Gitaly](#configure-gitaly) instances.
Because you must use [Object storage](#configure-the-object-storage) instead of NFS for data objects, the following
It also requires a connection to [Object Storage](#configure-the-object-storage) as recommended.
NOTE:
[Because it's recommended to use Object storage](../object_storage.md) instead of NFS for data objects, the following
examples include the Object storage configuration.
- `10.6.0.101`: Sidekiq 1
@ -1938,7 +1944,13 @@ run [multiple Sidekiq processes](../sidekiq/extra_sidekiq_processes.md).
## Configure GitLab Rails
This section describes how to configure the GitLab application (Rails) component.
Because you must use [Object storage](#configure-the-object-storage) instead of NFS for data objects, the following
Rails requires connections to the [Redis](#configure-redis),
[PostgreSQL](#configure-postgresql) and [Gitaly](#configure-gitaly) instances.
It also requires a connection to [Object Storage](#configure-the-object-storage) as recommended.
NOTE:
[Because it's recommended to use Object storage](../object_storage.md) instead of NFS for data objects, the following
examples include the Object storage configuration.
The following IPs will be used as an example:
@ -2221,16 +2233,10 @@ To configure the Monitoring node:
## Configure the object storage
GitLab supports using an object storage service for holding numerous types of data.
GitLab has been tested on a number of object storage providers:
- [Amazon S3](https://aws.amazon.com/s3/)
- [Google Cloud Storage](https://cloud.google.com/storage)
- [Digital Ocean Spaces](https://www.digitalocean.com/products/spaces)
- [Oracle Cloud Infrastructure](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/s3compatibleapi.htm)
- [OpenStack Swift (S3 compatibility mode)](https://docs.openstack.org/swift/latest/s3_compat.html)
- MinIO. We have [a guide to deploying this](https://docs.gitlab.com/charts/advanced/external-object-storage/minio.html) within our Helm Chart documentation.
GitLab supports using an [object storage](../object_storage.md) service for holding numerous types of data.
It's recommended over [NFS](../nfs.md) for data objects and in general it's better
in larger setups as object storage is typically much more performant, reliable,
and scalable.
There are two ways of specifying object storage configuration in GitLab:

View File

@ -1167,6 +1167,9 @@ NOTE:
Gitaly Cluster provides the benefits of fault tolerance, but comes with additional complexity of setup and management. Review the existing [technical limitations and considerations before deploying Gitaly Cluster](../gitaly/index.md#before-deploying-gitaly-cluster).
For implementations with sharded Gitaly, use the same Gitaly specs. Follow the [separate Gitaly documentation](../gitaly/configure_gitaly.md) instead of this section.
NOTE:
For guidance on how to migrate existing repositories from NFS to Gitaly Cluster, [follow the main documentation](../gitaly/index.md#migrate-to-gitaly-cluster).
NOTE:
Gitaly has been designed and tested with repositories of varying sizes that follow best practices.
However, large repositories or monorepos not following these practices can significantly
@ -1703,9 +1706,12 @@ To configure Praefect with TLS:
## Configure Sidekiq
Sidekiq requires connection to the [Redis](#configure-redis),
Sidekiq requires connections to the [Redis](#configure-redis),
[PostgreSQL](#configure-postgresql) and [Gitaly](#configure-gitaly) instances.
Because you must use [Object storage](#configure-the-object-storage) instead of NFS for data objects, the following
It also requires a connection to [Object Storage](#configure-the-object-storage) as recommended.
NOTE:
[Because it's recommended to use Object storage](../object_storage.md) instead of NFS for data objects, the following
examples include the Object storage configuration.
- `10.6.0.71`: Sidekiq 1
@ -1872,7 +1878,13 @@ run [multiple Sidekiq processes](../sidekiq/extra_sidekiq_processes.md).
## Configure GitLab Rails
This section describes how to configure the GitLab application (Rails) component.
Because you must use [Object storage](#configure-the-object-storage) instead of NFS for data objects, the following
Rails requires connections to the [Redis](#configure-redis),
[PostgreSQL](#configure-postgresql) and [Gitaly](#configure-gitaly) instances.
It also requires a connection to [Object Storage](#configure-the-object-storage) as recommended.
NOTE:
[Because it's recommended to use Object storage](../object_storage.md) instead of NFS for data objects, the following
examples include the Object storage configuration.
On each node perform the following:
@ -2015,6 +2027,10 @@ On each node perform the following:
1. Copy the `/etc/gitlab/gitlab-secrets.json` file from the first Omnibus node you configured and add or replace
the file of the same name on this server. If this is the first Omnibus node you are configuring then you can skip this step.
1. Copy the SSH host keys (all in the name format `/etc/ssh/ssh_host_*_key*`) from the first Omnibus node you configured and
add or replace the files of the same name on this server. This ensures host mismatch errors aren't thrown
for your users as they hit the load balanced Rails nodes. If this is the first Omnibus node you are configuring,
then you can skip this step.
1. To ensure database migrations are only run during reconfigure and not automatically on upgrade, run:
```shell
@ -2164,16 +2180,10 @@ running [Prometheus](../monitoring/prometheus/index.md) and
## Configure the object storage
GitLab supports using an object storage service for holding numerous types of data.
GitLab has been tested on a number of object storage providers:
- [Amazon S3](https://aws.amazon.com/s3/)
- [Google Cloud Storage](https://cloud.google.com/storage)
- [Digital Ocean Spaces](https://www.digitalocean.com/products/spaces)
- [Oracle Cloud Infrastructure](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/s3compatibleapi.htm)
- [OpenStack Swift (S3 compatibility mode)](https://docs.openstack.org/swift/latest/s3_compat.html)
- MinIO. We have [a guide to deploying this](https://docs.gitlab.com/charts/advanced/external-object-storage/minio.html) within our Helm Chart documentation.
GitLab supports using an [object storage](../object_storage.md) service for holding numerous types of data.
It's recommended over [NFS](../nfs.md) for data objects and in general it's better
in larger setups as object storage is typically much more performant, reliable,
and scalable.
There are two ways of specifying object storage configuration in GitLab:

View File

@ -12266,7 +12266,7 @@ The deployment of an environment.
| <a id="deploymentsha"></a>`sha` | [`String`](#string) | Git-SHA that the deployment ran on. |
| <a id="deploymentstatus"></a>`status` | [`DeploymentStatus`](#deploymentstatus) | Status of the deployment. |
| <a id="deploymenttag"></a>`tag` | [`Boolean`](#boolean) | True or false if the deployment ran on a Git-tag. |
| <a id="deploymenttags"></a>`tags` | [`[DeploymentTag!]`](#deploymenttag) | Git tags that contain this deployment. This field can only be resolved for one deployment in any single request. |
| <a id="deploymenttags"></a>`tags` | [`[DeploymentTag!]`](#deploymenttag) | Git tags that contain this deployment. This field can only be resolved for two deployments in any single request. |
| <a id="deploymenttriggerer"></a>`triggerer` | [`UserCore`](#usercore) | User who executed the deployment. |
| <a id="deploymentupdatedat"></a>`updatedAt` | [`Time`](#time) | When the deployment record was updated. |
| <a id="deploymentuserpermissions"></a>`userPermissions` | [`DeploymentPermissions!`](#deploymentpermissions) | Permissions for the current user on the resource. |
@ -15326,8 +15326,8 @@ Defines which user roles, users, or groups can merge into a protected branch.
| <a id="mergerequestsourcebranchprotected"></a>`sourceBranchProtected` | [`Boolean!`](#boolean) | Indicates if the source branch is protected. |
| <a id="mergerequestsourceproject"></a>`sourceProject` | [`Project`](#project) | Source project of the merge request. |
| <a id="mergerequestsourceprojectid"></a>`sourceProjectId` | [`Int`](#int) | ID of the merge request source project. |
| <a id="mergerequestsquash"></a>`squash` | [`Boolean!`](#boolean) | Indicates if squash on merge is enabled. |
| <a id="mergerequestsquashonmerge"></a>`squashOnMerge` | [`Boolean!`](#boolean) | Indicates if squash on merge is enabled. |
| <a id="mergerequestsquash"></a>`squash` | [`Boolean!`](#boolean) | Indicates if the merge request is set to be squashed when merged. [Project settings](https://docs.gitlab.com/ee/user/project/merge_requests/squash_and_merge.html#configure-squash-options-for-a-project) may override this value. Use `squash_on_merge` instead to take project squash options into account. |
| <a id="mergerequestsquashonmerge"></a>`squashOnMerge` | [`Boolean!`](#boolean) | Indicates if the merge request will be squashed when merged. |
| <a id="mergerequeststate"></a>`state` | [`MergeRequestState!`](#mergerequeststate) | State of the merge request. |
| <a id="mergerequestsubscribed"></a>`subscribed` | [`Boolean!`](#boolean) | Indicates if the currently logged in user is subscribed to this merge request. |
| <a id="mergerequestsuggestedreviewers"></a>`suggestedReviewers` **{warning-solid}** | [`SuggestedReviewersType`](#suggestedreviewerstype) | **Introduced** in 15.4. This feature is in Alpha. It can be changed or removed at any time. Suggested reviewers for merge request. Returns `null` if `suggested_reviewers` feature flag is disabled. This flag is disabled by default and only available on GitLab.com because the feature is experimental and is subject to change without notice. |

View File

@ -1284,7 +1284,8 @@ POST /projects/:id/merge_requests
| `milestone_id` | integer | **{dotted-circle}** No | The global ID of a milestone. |
| `remove_source_branch` | boolean | **{dotted-circle}** No | Flag indicating if a merge request should remove the source branch when merging. |
| `reviewer_ids` | integer array | **{dotted-circle}** No | The ID of the users added as a reviewer to the merge request. If set to `0` or left empty, no reviewers are added. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49341) in GitLab 13.8. |
| `squash` | boolean | **{dotted-circle}** No | Squash commits into a single commit when merging. |
| `squash` | boolean | no | Indicates if the merge request is set to be squashed when merged. [Project settings](../user/project/merge_requests/squash_and_merge.md#configure-squash-options-for-a-project) may override this value. Use `squash_on_merge` instead to take project squash options into account. |
| `squash_on_merge` | boolean | no | Indicates if the merge request will be squashed when merged. |
| `target_project_id` | integer | **{dotted-circle}** No | Numeric ID of the target project. |
If `approvals_before_merge` is not provided, it inherits the value from the target project. If provided, the following conditions must hold for it to take effect:
@ -1453,7 +1454,8 @@ PUT /projects/:id/merge_requests/:merge_request_iid
| `remove_labels` | string | **{dotted-circle}** No | Comma-separated label names to remove from a merge request. |
| `remove_source_branch` | boolean | **{dotted-circle}** No | Flag indicating if a merge request should remove the source branch when merging. |
| `reviewer_ids` | integer array | **{dotted-circle}** No | The ID of the users set as a reviewer to the merge request. Set the value to `0` or provide an empty value to unset all reviewers. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49341) in GitLab 13.8. |
| `squash` | boolean | **{dotted-circle}** No | Squash commits into a single commit when merging. |
| `squash` | boolean | no | Indicates if the merge request is set to be squashed when merged. [Project settings](../user/project/merge_requests/squash_and_merge.md#configure-squash-options-for-a-project) may override this value. Use `squash_on_merge` instead to take project squash options into account. |
| `squash_on_merge` | boolean | no | Indicates if the merge request will be squashed when merged. |
| `state_event` | string | **{dotted-circle}** No | New state (close/reopen). |
| `target_branch` | string | **{dotted-circle}** No | The target branch. |
| `title` | string | **{dotted-circle}** No | Title of MR. |

View File

@ -6,7 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Preventing Transient Bugs
This page will cover architectural patterns and tips for developers to follow to prevent [transient bugs.](https://about.gitlab.com/handbook/engineering/quality/issue-triage/#transient-bugs)
This page covers architectural patterns and tips for developers to follow to prevent [transient bugs.](https://about.gitlab.com/handbook/engineering/quality/issue-triage/#transient-bugs)
## Common root causes
@ -21,7 +21,7 @@ We've noticed a few root causes that come up frequently when addressing transien
### Don't rely on response order
When working with multiple requests, it's easy to assume the order of the responses will match the order in which they are triggered.
When working with multiple requests, it's easy to assume the order of the responses matches the order in which they are triggered.
That's not always the case and can cause bugs that only happen if the order is switched.

View File

@ -40,4 +40,4 @@ This dashboard displays CPU, memory, network and disk metrics for the pods in yo
[variable selector](templating_variables.md#metric_label_values-variable-type)
at the top of the dashboard to select which pod's metrics to display.
![K8s pod health dashboard](img/k8s_pod_health_dashboard_v13_3.png)
![Kubernetes pod health dashboard](img/k8s_pod_health_dashboard_v13_3.png)

View File

@ -59,7 +59,7 @@ possible, we encourage you to use all of our security scanning tools:
Turning this variable on can result in some duplicate findings, as we do not yet
de-duplicate results between Container Scanning and Dependency Scanning. For more details,
efforts to de-duplicate these findings can be tracked in
[this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/348655).
[this epic](https://gitlab.com/groups/gitlab-org/-/epics/8026).
The following table summarizes which types of dependencies each scanning tool can detect:

View File

@ -24,7 +24,7 @@ To run IaC Scanning jobs, by default, you need GitLab Runner with the
If you're using the shared runners on GitLab.com, this is enabled by default.
WARNING:
Our IaC Scanning jobs require a Linux/amd64 container type. Windows containers are not supported.
GitLab IaC Scanning analyzers don't support running on Windows or on any CPU architectures other than amd64.
WARNING:
If you use your own runners, make sure the Docker version installed
@ -269,3 +269,8 @@ be ineffective or false positives, and the findings are marked as `No longer det
- In GitLab 15.3, [secret detection in the KICS SAST IaC scanner was disabled](https://gitlab.com/gitlab-org/gitlab/-/issues/346181),
so IaC findings in the "Passwords and Secrets" family show as `No longer detected`.
### `exec /bin/sh: exec format error` message in job log
The GitLab IaC Scanning analyzer [only supports](#requirements) running on the `amd64` CPU architecture.
This message indicates that the job is being run on a different architecture, such as `arm`.

View File

@ -62,7 +62,7 @@ To run SAST jobs, by default, you need GitLab Runner with the
If you're using the shared runners on GitLab.com, this is enabled by default.
WARNING:
Our SAST jobs require a Linux/amd64 container type. Windows containers are not yet supported.
GitLab SAST analyzers don't support running on Windows or on any CPU architectures other than amd64.
WARNING:
If you use your own runners, make sure the Docker version installed
@ -788,6 +788,11 @@ If you're seeing a new error that doesn't appear to be related to [the GitLab-ma
Each [analyzer project](analyzers.md#sast-analyzers) has a `CHANGELOG.md` file listing the changes made in each available version.
### `exec /bin/sh: exec format error` message in job log
GitLab SAST analyzers [only support](#requirements) running on the `amd64` CPU architecture.
This message indicates that the job is being run on a different architecture, such as `arm`.
### `Error response from daemon: error processing tar file: docker-tar: relocation error`
This error occurs when the Docker version that runs the SAST job is `19.03.0`.

View File

@ -69,13 +69,14 @@ Different features are available in different [GitLab tiers](https://about.gitla
Prerequisites:
- GitLab Runner with the [`docker`](https://docs.gitlab.com/runner/executors/docker.html) or
- Linux-based GitLab Runner with the [`docker`](https://docs.gitlab.com/runner/executors/docker.html) or
[`kubernetes`](https://docs.gitlab.com/runner/install/kubernetes.html) executor. If you're using the
shared runners on GitLab.com, this is enabled by default.
- Windows Runners are not supported.
- CPU architectures other than amd64 are not supported.
- If you use your own runners, make sure the Docker version installed is **not** `19.03.0`. See
[troubleshooting information](../sast#error-response-from-daemon-error-processing-tar-file-docker-tar-relocation-error)
for details.
- Linux/amd64 container type. Windows containers are not supported.
- GitLab CI/CD configuration (`.gitlab-ci.yml`) must include the `test` stage.
To enable Secret Detection, either:
@ -531,3 +532,8 @@ repository's default branch is unrelated to the branch the job was triggered for
To resolve the issue, make sure to correctly [set your default branch](../../project/repository/branches/default.md#change-the-default-branch-name-for-a-project)
on your repository. You should set it to a branch that has related history with the branch you run
the `secret-detection` job on.
### `exec /bin/sh: exec format error` message in job log
The GitLab Secret Detection analyzer [only supports](#enable-secret-detection) running on the `amd64` CPU architecture.
This message indicates that the job is being run on a different architecture, such as `arm`.

View File

@ -200,7 +200,7 @@ include: # Execute individual project's configuration (if project contains .git
#### CF pipelines in Merge Requests originating in project forks
When an MR originates in a fork, the branch to be merged usually only exists in the fork.
When creating such an MR against a project with CF pipelines, the above snippet will fail with a
When creating such an MR against a project with CF pipelines, the above snippet fails with a
`Project <project-name> reference <branch-name> does not exist!` error message.
This is because in the context of the target project, `$CI_COMMIT_REF_NAME` evaluates to a non-existing branch name.

View File

@ -14,7 +14,7 @@ GitLab can also send events (for example, `issue created`) to Slack as notificat
The [Slack notifications service](slack.md) is configured separately.
NOTE:
For GitLab.com, use the [GitLab for Slack app](gitlab_slack_application.md) instead.
The Slack slash commands are only configurable on self-managed GitLab instances. For GitLab.com, use the [GitLab for Slack app](gitlab_slack_application.md) instead.
## Configure GitLab and Slack

View File

@ -153,7 +153,8 @@ Rather than attempting to push all changes at once, this workaround:
You usually export a project through [the web interface](import_export.md#export-a-project-and-its-data) or through [the API](../../../api/project_import_export.md). Exporting using these
methods can sometimes fail without giving enough information to troubleshoot. In these cases,
[open a rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session)
[open a rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session) and loop through
[all the defined exporters](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/services/projects/import_export/export_service.rb).
Execute each line individually, rather than pasting the entire block at once, so you can see any
errors each command returns.

View File

@ -91,6 +91,7 @@ module API
end
expose :squash
expose :squash_on_merge?, as: :squash_on_merge
expose :task_completion_status
expose :cannot_be_merged?, as: :has_conflicts
expose :mergeable_discussions_state?, as: :blocking_discussions_resolved

View File

@ -12,6 +12,7 @@ module Gitlab
Gitlab::Redis::Queues,
Gitlab::Redis::RateLimiting,
Gitlab::Redis::RepositoryCache,
Gitlab::Redis::ClusterRateLimiting,
Gitlab::Redis::Sessions,
Gitlab::Redis::SharedState,
Gitlab::Redis::TraceChunks

View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
module Gitlab
module Redis
class ClusterRateLimiting < ::Gitlab::Redis::Wrapper
def self.config_fallback
Cache
end
end
end
end

View File

@ -169,11 +169,15 @@ module Gitlab
end
def use_primary_and_secondary_stores?
feature_enabled?("use_primary_and_secondary_stores_for")
Feature.feature_flags_available? &&
Feature.enabled?("use_primary_and_secondary_stores_for_#{instance_name.underscore}") && # rubocop:disable Cop/FeatureFlagUsage
!same_redis_store?
end
def use_primary_store_as_default?
feature_enabled?("use_primary_store_as_default_for")
Feature.feature_flags_available? &&
Feature.enabled?("use_primary_store_as_default_for_#{instance_name.underscore}") && # rubocop:disable Cop/FeatureFlagUsage
!same_redis_store?
end
def increment_pipelined_command_error_count(command_name)
@ -213,20 +217,6 @@ module Gitlab
private
# @return [Boolean]
def feature_enabled?(prefix)
feature_table_exists? &&
Feature.enabled?("#{prefix}_#{instance_name.underscore}") && # rubocop:disable Cop/FeatureFlagUsage
!same_redis_store?
end
# @return [Boolean]
def feature_table_exists?
Feature::FlipperFeature.table_exists?
rescue StandardError
false
end
def default_store
use_primary_store_as_default? ? primary_store : secondary_store
end

View File

@ -3,13 +3,24 @@
module Gitlab
module Redis
class RateLimiting < ::Gitlab::Redis::Wrapper
# The data we store on RateLimiting used to be stored on Cache.
def self.config_fallback
Cache
end
class << self
# The data we store on RateLimiting used to be stored on Cache.
def config_fallback
Cache
end
def self.cache_store
@cache_store ||= ActiveSupport::Cache::RedisCacheStore.new(redis: pool, namespace: Cache::CACHE_NAMESPACE)
def cache_store
@cache_store ||= ActiveSupport::Cache::RedisCacheStore.new(redis: pool, namespace: Cache::CACHE_NAMESPACE)
end
private
def redis
primary_store = ::Redis.new(::Gitlab::Redis::ClusterRateLimiting.params)
secondary_store = ::Redis.new(params)
MultiStore.new(primary_store, secondary_store, name.demodulize)
end
end
end
end

View File

@ -17,7 +17,7 @@ module Gitlab
private
def trigger
"#{params[:command]} [project name or alias]"
params[:command].to_s
end
def commands

View File

@ -26,7 +26,7 @@ module Gitlab
MESSAGE
end
if text.start_with?('help')
if text && text.start_with?('help')
<<~MESSAGE
#{full_commands_message(trigger)}
@ -69,9 +69,9 @@ module Gitlab
list = @commands
.map do |command|
if command < Gitlab::SlashCommands::IncidentManagement::IncidentCommand
"#{@params[:command]} #{command.help_message}"
else
"#{trigger} #{command.help_message}"
else
"#{trigger} [project name or alias] #{command.help_message}"
end
end
.join("\n")

View File

@ -19092,6 +19092,9 @@ msgstr ""
msgid "GlobalSearch|Issues assigned to me"
msgstr ""
msgid "GlobalSearch|Language"
msgstr ""
msgid "GlobalSearch|Merge requests I've created"
msgstr ""

View File

@ -9,7 +9,7 @@ gem 'capybara', '~> 3.38.0'
gem 'capybara-screenshot', '~> 1.0.26'
gem 'rake', '~> 13', '>= 13.0.6'
gem 'rspec', '~> 3.12'
gem 'selenium-webdriver', '~> 4.7', '>= 4.7.1'
gem 'selenium-webdriver', '~> 4.8'
gem 'airborne', '~> 0.3.7', require: false # airborne is messing with rspec sandboxed mode so not requiring by default
gem 'rest-client', '~> 2.1.0'
gem 'rspec-retry', '~> 0.6.2', require: 'rspec/retry'

View File

@ -259,7 +259,7 @@ GEM
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
selenium-webdriver (4.7.1)
selenium-webdriver (4.8.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
@ -334,7 +334,7 @@ DEPENDENCIES
rspec-retry (~> 0.6.2)
rspec_junit_formatter (~> 0.6.0)
ruby-debug-ide (~> 0.7.3)
selenium-webdriver (~> 4.7, >= 4.7.1)
selenium-webdriver (~> 4.8)
slack-notifier (~> 2.4)
terminal-table (~> 3.0.2)
warning (~> 1.3)
@ -342,4 +342,4 @@ DEPENDENCIES
zeitwerk (~> 2.6, >= 2.6.6)
BUNDLED WITH
2.3.26
2.4.4

View File

@ -11,6 +11,7 @@ RSpec.describe 'Email Verification On Login', :clean_gitlab_redis_rate_limiting,
before do
stub_feature_flags(require_email_verification: require_email_verification_enabled)
stub_feature_flags(skip_require_email_verification: false)
end
shared_examples 'email verification required' do

View File

@ -192,3 +192,433 @@ export const MOCK_NAVIGATION_ACTION_MUTATION = {
type: types.RECEIVE_NAVIGATION_COUNT,
payload: { key: 'projects', count: '13' },
};
export const MOCK_AGGREGATIONS = [
{
name: 'language',
buckets: [
{ key: 'random-label-edumingos0', count: 1 },
{ key: 'random-label-rbourgourd1', count: 2 },
{ key: 'random-label-dfearnside2', count: 3 },
{ key: 'random-label-gewins3', count: 4 },
{ key: 'random-label-telverstone4', count: 5 },
{ key: 'random-label-ygerriets5', count: 6 },
{ key: 'random-label-lmoffet6', count: 7 },
{ key: 'random-label-ehinnerk7', count: 8 },
{ key: 'random-label-flanceley8', count: 9 },
{ key: 'random-label-adoyle9', count: 10 },
{ key: 'random-label-rmcgirla', count: 11 },
{ key: 'random-label-dwhellansb', count: 12 },
{ key: 'random-label-apitkethlyc', count: 13 },
{ key: 'random-label-senevoldsend', count: 14 },
{ key: 'random-label-tlardnare', count: 15 },
{ key: 'random-label-fcoilsf', count: 16 },
{ key: 'random-label-qgeckg', count: 17 },
{ key: 'random-label-rgrabenh', count: 18 },
{ key: 'random-label-lashardi', count: 19 },
{ key: 'random-label-sadamovitchj', count: 20 },
{ key: 'random-label-rlyddiardk', count: 21 },
{ key: 'random-label-jpoell', count: 22 },
{ key: 'random-label-kcharitym', count: 23 },
{ key: 'random-label-cbertenshawn', count: 24 },
{ key: 'random-label-jsturgeso', count: 25 },
{ key: 'random-label-ohouldcroftp', count: 26 },
{ key: 'random-label-rheijnenq', count: 27 },
{ key: 'random-label-snortheyr', count: 28 },
{ key: 'random-label-vpairpoints', count: 29 },
{ key: 'random-label-odavidovicit', count: 30 },
{ key: 'random-label-fmccartu', count: 31 },
{ key: 'random-label-cwansburyv', count: 32 },
{ key: 'random-label-bdimontw', count: 33 },
{ key: 'random-label-adocketx', count: 34 },
{ key: 'random-label-obavridgey', count: 35 },
{ key: 'random-label-jperezz', count: 36 },
{ key: 'random-label-gdeneve10', count: 37 },
{ key: 'random-label-rmckeand11', count: 38 },
{ key: 'random-label-kwestmerland12', count: 39 },
{ key: 'random-label-mpryer13', count: 40 },
{ key: 'random-label-rmcneil14', count: 41 },
{ key: 'random-label-ablondel15', count: 42 },
{ key: 'random-label-wbalducci16', count: 43 },
{ key: 'random-label-swigley17', count: 44 },
{ key: 'random-label-gferroni18', count: 45 },
{ key: 'random-label-icollings19', count: 46 },
{ key: 'random-label-wszymanski1a', count: 47 },
{ key: 'random-label-jelson1b', count: 48 },
{ key: 'random-label-fsambrook1c', count: 49 },
{ key: 'random-label-kconey1d', count: 50 },
{ key: 'random-label-agoodread1e', count: 51 },
{ key: 'random-label-nmewton1f', count: 52 },
{ key: 'random-label-gcodman1g', count: 53 },
{ key: 'random-label-rpoplee1h', count: 54 },
{ key: 'random-label-mhug1i', count: 55 },
{ key: 'random-label-ggowrie1j', count: 56 },
{ key: 'random-label-ctonepohl1k', count: 57 },
{ key: 'random-label-cstillman1l', count: 58 },
{ key: 'random-label-dcollyer1m', count: 59 },
{ key: 'random-label-idimelow1n', count: 60 },
{ key: 'random-label-djarley1o', count: 61 },
{ key: 'random-label-omclleese1p', count: 62 },
{ key: 'random-label-dstivers1q', count: 63 },
{ key: 'random-label-svose1r', count: 64 },
{ key: 'random-label-clanfare1s', count: 65 },
{ key: 'random-label-aport1t', count: 66 },
{ key: 'random-label-hcarlett1u', count: 67 },
{ key: 'random-label-dstillmann1v', count: 68 },
{ key: 'random-label-ncorpe1w', count: 69 },
{ key: 'random-label-mjacobsohn1x', count: 70 },
{ key: 'random-label-ycleiment1y', count: 71 },
{ key: 'random-label-owherton1z', count: 72 },
{ key: 'random-label-anowaczyk20', count: 73 },
{ key: 'random-label-rmckennan21', count: 74 },
{ key: 'random-label-cmoulding22', count: 75 },
{ key: 'random-label-sswate23', count: 76 },
{ key: 'random-label-cbarge24', count: 77 },
{ key: 'random-label-agrainger25', count: 78 },
{ key: 'random-label-ncosin26', count: 79 },
{ key: 'random-label-pkears27', count: 80 },
{ key: 'random-label-cmcarthur28', count: 81 },
{ key: 'random-label-jmantripp29', count: 82 },
{ key: 'random-label-cjekel2a', count: 83 },
{ key: 'random-label-hdilleway2b', count: 84 },
{ key: 'random-label-lbovaird2c', count: 85 },
{ key: 'random-label-mweld2d', count: 86 },
{ key: 'random-label-marnowitz2e', count: 87 },
{ key: 'random-label-nbertomieu2f', count: 88 },
{ key: 'random-label-mledward2g', count: 89 },
{ key: 'random-label-mhince2h', count: 90 },
{ key: 'random-label-baarons2i', count: 91 },
{ key: 'random-label-kfrancie2j', count: 92 },
{ key: 'random-label-ishooter2k', count: 93 },
{ key: 'random-label-glowmass2l', count: 94 },
{ key: 'random-label-rgeorgi2m', count: 95 },
{ key: 'random-label-bproby2n', count: 96 },
{ key: 'random-label-hsteffan2o', count: 97 },
{ key: 'random-label-doruane2p', count: 98 },
{ key: 'random-label-rlunny2q', count: 99 },
{ key: 'random-label-geles2r', count: 100 },
{ key: 'random-label-nmaggiore2s', count: 101 },
{ key: 'random-label-aboocock2t', count: 102 },
{ key: 'random-label-eguilbert2u', count: 103 },
{ key: 'random-label-emccutcheon2v', count: 104 },
{ key: 'random-label-hcowser2w', count: 105 },
{ key: 'random-label-dspeeding2x', count: 106 },
{ key: 'random-label-oseebright2y', count: 107 },
{ key: 'random-label-hpresdee2z', count: 108 },
{ key: 'random-label-pesseby30', count: 109 },
{ key: 'random-label-hpusey31', count: 110 },
{ key: 'random-label-dmanthorpe32', count: 111 },
{ key: 'random-label-natley33', count: 112 },
{ key: 'random-label-iferentz34', count: 113 },
{ key: 'random-label-adyble35', count: 114 },
{ key: 'random-label-dlockitt36', count: 115 },
{ key: 'random-label-acoxwell37', count: 116 },
{ key: 'random-label-amcgarvey38', count: 117 },
{ key: 'random-label-rmcgougan39', count: 118 },
{ key: 'random-label-mscole3a', count: 119 },
{ key: 'random-label-lmalim3b', count: 120 },
{ key: 'random-label-cends3c', count: 121 },
{ key: 'random-label-dmannie3d', count: 122 },
{ key: 'random-label-lgoodricke3e', count: 123 },
{ key: 'random-label-rcaghy3f', count: 124 },
{ key: 'random-label-mprozillo3g', count: 125 },
{ key: 'random-label-mcardnell3h', count: 126 },
{ key: 'random-label-gericssen3i', count: 127 },
{ key: 'random-label-fspooner3j', count: 128 },
{ key: 'random-label-achadney3k', count: 129 },
{ key: 'random-label-corchard3l', count: 130 },
{ key: 'random-label-lyerill3m', count: 131 },
{ key: 'random-label-jrusk3n', count: 132 },
{ key: 'random-label-lbonelle3o', count: 133 },
{ key: 'random-label-eduny3p', count: 134 },
{ key: 'random-label-mhutchence3q', count: 135 },
{ key: 'random-label-rmargeram3r', count: 136 },
{ key: 'random-label-smaudlin3s', count: 137 },
{ key: 'random-label-sfarrance3t', count: 138 },
{ key: 'random-label-eclendennen3u', count: 139 },
{ key: 'random-label-cyabsley3v', count: 140 },
{ key: 'random-label-ahensmans3w', count: 141 },
{ key: 'random-label-tsenchenko3x', count: 142 },
{ key: 'random-label-ryurchishin3y', count: 143 },
{ key: 'random-label-teby3z', count: 144 },
{ key: 'random-label-dvaillant40', count: 145 },
{ key: 'random-label-kpetyakov41', count: 146 },
{ key: 'random-label-cmorrison42', count: 147 },
{ key: 'random-label-ltwiddy43', count: 148 },
{ key: 'random-label-ineame44', count: 149 },
{ key: 'random-label-blucock45', count: 150 },
{ key: 'random-label-kdunsford46', count: 151 },
{ key: 'random-label-dducham47', count: 152 },
{ key: 'random-label-javramovitz48', count: 153 },
{ key: 'random-label-mascraft49', count: 154 },
{ key: 'random-label-bloughead4a', count: 155 },
{ key: 'random-label-sduckit4b', count: 156 },
{ key: 'random-label-hhardman4c', count: 157 },
{ key: 'random-label-cstaniforth4d', count: 158 },
{ key: 'random-label-jedney4e', count: 159 },
{ key: 'random-label-bobbard4f', count: 160 },
{ key: 'random-label-cgiraux4g', count: 161 },
{ key: 'random-label-tkiln4h', count: 162 },
{ key: 'random-label-jwansbury4i', count: 163 },
{ key: 'random-label-dquinlan4j', count: 164 },
{ key: 'random-label-hgindghill4k', count: 165 },
{ key: 'random-label-jjowle4l', count: 166 },
{ key: 'random-label-egambrell4m', count: 167 },
{ key: 'random-label-jmcgloughlin4n', count: 168 },
{ key: 'random-label-bbabb4o', count: 169 },
{ key: 'random-label-achuck4p', count: 170 },
{ key: 'random-label-tsyers4q', count: 171 },
{ key: 'random-label-jlandon4r', count: 172 },
{ key: 'random-label-wteather4s', count: 173 },
{ key: 'random-label-dfoskin4t', count: 174 },
{ key: 'random-label-gmorlon4u', count: 175 },
{ key: 'random-label-jseely4v', count: 176 },
{ key: 'random-label-cbrass4w', count: 177 },
{ key: 'random-label-fmanilo4x', count: 178 },
{ key: 'random-label-bfrangleton4y', count: 179 },
{ key: 'random-label-vbartkiewicz4z', count: 180 },
{ key: 'random-label-tclymer50', count: 181 },
{ key: 'random-label-pqueen51', count: 182 },
{ key: 'random-label-bpol52', count: 183 },
{ key: 'random-label-jclaeskens53', count: 184 },
{ key: 'random-label-cstranieri54', count: 185 },
{ key: 'random-label-drumbelow55', count: 186 },
{ key: 'random-label-wbrumham56', count: 187 },
{ key: 'random-label-azeal57', count: 188 },
{ key: 'random-label-msnooks58', count: 189 },
{ key: 'random-label-blapre59', count: 190 },
{ key: 'random-label-cduckers5a', count: 191 },
{ key: 'random-label-mgumary5b', count: 192 },
{ key: 'random-label-rtebbs5c', count: 193 },
{ key: 'random-label-eroe5d', count: 194 },
{ key: 'random-label-rconfait5e', count: 195 },
{ key: 'random-label-fsinderland5f', count: 196 },
{ key: 'random-label-tdallywater5g', count: 197 },
{ key: 'random-label-glindenman5h', count: 198 },
{ key: 'random-label-fbauser5i', count: 199 },
{ key: 'random-label-bdownton5j', count: 200 },
],
},
];
export const MOCK_LANGUAGE_AGGREGATIONS_BUCKETS = [
{ key: 'random-label-edumingos0', count: 1 },
{ key: 'random-label-rbourgourd1', count: 2 },
{ key: 'random-label-dfearnside2', count: 3 },
{ key: 'random-label-gewins3', count: 4 },
{ key: 'random-label-telverstone4', count: 5 },
{ key: 'random-label-ygerriets5', count: 6 },
{ key: 'random-label-lmoffet6', count: 7 },
{ key: 'random-label-ehinnerk7', count: 8 },
{ key: 'random-label-flanceley8', count: 9 },
{ key: 'random-label-adoyle9', count: 10 },
{ key: 'random-label-rmcgirla', count: 11 },
{ key: 'random-label-dwhellansb', count: 12 },
{ key: 'random-label-apitkethlyc', count: 13 },
{ key: 'random-label-senevoldsend', count: 14 },
{ key: 'random-label-tlardnare', count: 15 },
{ key: 'random-label-fcoilsf', count: 16 },
{ key: 'random-label-qgeckg', count: 17 },
{ key: 'random-label-rgrabenh', count: 18 },
{ key: 'random-label-lashardi', count: 19 },
{ key: 'random-label-sadamovitchj', count: 20 },
{ key: 'random-label-rlyddiardk', count: 21 },
{ key: 'random-label-jpoell', count: 22 },
{ key: 'random-label-kcharitym', count: 23 },
{ key: 'random-label-cbertenshawn', count: 24 },
{ key: 'random-label-jsturgeso', count: 25 },
{ key: 'random-label-ohouldcroftp', count: 26 },
{ key: 'random-label-rheijnenq', count: 27 },
{ key: 'random-label-snortheyr', count: 28 },
{ key: 'random-label-vpairpoints', count: 29 },
{ key: 'random-label-odavidovicit', count: 30 },
{ key: 'random-label-fmccartu', count: 31 },
{ key: 'random-label-cwansburyv', count: 32 },
{ key: 'random-label-bdimontw', count: 33 },
{ key: 'random-label-adocketx', count: 34 },
{ key: 'random-label-obavridgey', count: 35 },
{ key: 'random-label-jperezz', count: 36 },
{ key: 'random-label-gdeneve10', count: 37 },
{ key: 'random-label-rmckeand11', count: 38 },
{ key: 'random-label-kwestmerland12', count: 39 },
{ key: 'random-label-mpryer13', count: 40 },
{ key: 'random-label-rmcneil14', count: 41 },
{ key: 'random-label-ablondel15', count: 42 },
{ key: 'random-label-wbalducci16', count: 43 },
{ key: 'random-label-swigley17', count: 44 },
{ key: 'random-label-gferroni18', count: 45 },
{ key: 'random-label-icollings19', count: 46 },
{ key: 'random-label-wszymanski1a', count: 47 },
{ key: 'random-label-jelson1b', count: 48 },
{ key: 'random-label-fsambrook1c', count: 49 },
{ key: 'random-label-kconey1d', count: 50 },
{ key: 'random-label-agoodread1e', count: 51 },
{ key: 'random-label-nmewton1f', count: 52 },
{ key: 'random-label-gcodman1g', count: 53 },
{ key: 'random-label-rpoplee1h', count: 54 },
{ key: 'random-label-mhug1i', count: 55 },
{ key: 'random-label-ggowrie1j', count: 56 },
{ key: 'random-label-ctonepohl1k', count: 57 },
{ key: 'random-label-cstillman1l', count: 58 },
{ key: 'random-label-dcollyer1m', count: 59 },
{ key: 'random-label-idimelow1n', count: 60 },
{ key: 'random-label-djarley1o', count: 61 },
{ key: 'random-label-omclleese1p', count: 62 },
{ key: 'random-label-dstivers1q', count: 63 },
{ key: 'random-label-svose1r', count: 64 },
{ key: 'random-label-clanfare1s', count: 65 },
{ key: 'random-label-aport1t', count: 66 },
{ key: 'random-label-hcarlett1u', count: 67 },
{ key: 'random-label-dstillmann1v', count: 68 },
{ key: 'random-label-ncorpe1w', count: 69 },
{ key: 'random-label-mjacobsohn1x', count: 70 },
{ key: 'random-label-ycleiment1y', count: 71 },
{ key: 'random-label-owherton1z', count: 72 },
{ key: 'random-label-anowaczyk20', count: 73 },
{ key: 'random-label-rmckennan21', count: 74 },
{ key: 'random-label-cmoulding22', count: 75 },
{ key: 'random-label-sswate23', count: 76 },
{ key: 'random-label-cbarge24', count: 77 },
{ key: 'random-label-agrainger25', count: 78 },
{ key: 'random-label-ncosin26', count: 79 },
{ key: 'random-label-pkears27', count: 80 },
{ key: 'random-label-cmcarthur28', count: 81 },
{ key: 'random-label-jmantripp29', count: 82 },
{ key: 'random-label-cjekel2a', count: 83 },
{ key: 'random-label-hdilleway2b', count: 84 },
{ key: 'random-label-lbovaird2c', count: 85 },
{ key: 'random-label-mweld2d', count: 86 },
{ key: 'random-label-marnowitz2e', count: 87 },
{ key: 'random-label-nbertomieu2f', count: 88 },
{ key: 'random-label-mledward2g', count: 89 },
{ key: 'random-label-mhince2h', count: 90 },
{ key: 'random-label-baarons2i', count: 91 },
{ key: 'random-label-kfrancie2j', count: 92 },
{ key: 'random-label-ishooter2k', count: 93 },
{ key: 'random-label-glowmass2l', count: 94 },
{ key: 'random-label-rgeorgi2m', count: 95 },
{ key: 'random-label-bproby2n', count: 96 },
{ key: 'random-label-hsteffan2o', count: 97 },
{ key: 'random-label-doruane2p', count: 98 },
{ key: 'random-label-rlunny2q', count: 99 },
{ key: 'random-label-geles2r', count: 100 },
{ key: 'random-label-nmaggiore2s', count: 101 },
{ key: 'random-label-aboocock2t', count: 102 },
{ key: 'random-label-eguilbert2u', count: 103 },
{ key: 'random-label-emccutcheon2v', count: 104 },
{ key: 'random-label-hcowser2w', count: 105 },
{ key: 'random-label-dspeeding2x', count: 106 },
{ key: 'random-label-oseebright2y', count: 107 },
{ key: 'random-label-hpresdee2z', count: 108 },
{ key: 'random-label-pesseby30', count: 109 },
{ key: 'random-label-hpusey31', count: 110 },
{ key: 'random-label-dmanthorpe32', count: 111 },
{ key: 'random-label-natley33', count: 112 },
{ key: 'random-label-iferentz34', count: 113 },
{ key: 'random-label-adyble35', count: 114 },
{ key: 'random-label-dlockitt36', count: 115 },
{ key: 'random-label-acoxwell37', count: 116 },
{ key: 'random-label-amcgarvey38', count: 117 },
{ key: 'random-label-rmcgougan39', count: 118 },
{ key: 'random-label-mscole3a', count: 119 },
{ key: 'random-label-lmalim3b', count: 120 },
{ key: 'random-label-cends3c', count: 121 },
{ key: 'random-label-dmannie3d', count: 122 },
{ key: 'random-label-lgoodricke3e', count: 123 },
{ key: 'random-label-rcaghy3f', count: 124 },
{ key: 'random-label-mprozillo3g', count: 125 },
{ key: 'random-label-mcardnell3h', count: 126 },
{ key: 'random-label-gericssen3i', count: 127 },
{ key: 'random-label-fspooner3j', count: 128 },
{ key: 'random-label-achadney3k', count: 129 },
{ key: 'random-label-corchard3l', count: 130 },
{ key: 'random-label-lyerill3m', count: 131 },
{ key: 'random-label-jrusk3n', count: 132 },
{ key: 'random-label-lbonelle3o', count: 133 },
{ key: 'random-label-eduny3p', count: 134 },
{ key: 'random-label-mhutchence3q', count: 135 },
{ key: 'random-label-rmargeram3r', count: 136 },
{ key: 'random-label-smaudlin3s', count: 137 },
{ key: 'random-label-sfarrance3t', count: 138 },
{ key: 'random-label-eclendennen3u', count: 139 },
{ key: 'random-label-cyabsley3v', count: 140 },
{ key: 'random-label-ahensmans3w', count: 141 },
{ key: 'random-label-tsenchenko3x', count: 142 },
{ key: 'random-label-ryurchishin3y', count: 143 },
{ key: 'random-label-teby3z', count: 144 },
{ key: 'random-label-dvaillant40', count: 145 },
{ key: 'random-label-kpetyakov41', count: 146 },
{ key: 'random-label-cmorrison42', count: 147 },
{ key: 'random-label-ltwiddy43', count: 148 },
{ key: 'random-label-ineame44', count: 149 },
{ key: 'random-label-blucock45', count: 150 },
{ key: 'random-label-kdunsford46', count: 151 },
{ key: 'random-label-dducham47', count: 152 },
{ key: 'random-label-javramovitz48', count: 153 },
{ key: 'random-label-mascraft49', count: 154 },
{ key: 'random-label-bloughead4a', count: 155 },
{ key: 'random-label-sduckit4b', count: 156 },
{ key: 'random-label-hhardman4c', count: 157 },
{ key: 'random-label-cstaniforth4d', count: 158 },
{ key: 'random-label-jedney4e', count: 159 },
{ key: 'random-label-bobbard4f', count: 160 },
{ key: 'random-label-cgiraux4g', count: 161 },
{ key: 'random-label-tkiln4h', count: 162 },
{ key: 'random-label-jwansbury4i', count: 163 },
{ key: 'random-label-dquinlan4j', count: 164 },
{ key: 'random-label-hgindghill4k', count: 165 },
{ key: 'random-label-jjowle4l', count: 166 },
{ key: 'random-label-egambrell4m', count: 167 },
{ key: 'random-label-jmcgloughlin4n', count: 168 },
{ key: 'random-label-bbabb4o', count: 169 },
{ key: 'random-label-achuck4p', count: 170 },
{ key: 'random-label-tsyers4q', count: 171 },
{ key: 'random-label-jlandon4r', count: 172 },
{ key: 'random-label-wteather4s', count: 173 },
{ key: 'random-label-dfoskin4t', count: 174 },
{ key: 'random-label-gmorlon4u', count: 175 },
{ key: 'random-label-jseely4v', count: 176 },
{ key: 'random-label-cbrass4w', count: 177 },
{ key: 'random-label-fmanilo4x', count: 178 },
{ key: 'random-label-bfrangleton4y', count: 179 },
{ key: 'random-label-vbartkiewicz4z', count: 180 },
{ key: 'random-label-tclymer50', count: 181 },
{ key: 'random-label-pqueen51', count: 182 },
{ key: 'random-label-bpol52', count: 183 },
{ key: 'random-label-jclaeskens53', count: 184 },
{ key: 'random-label-cstranieri54', count: 185 },
{ key: 'random-label-drumbelow55', count: 186 },
{ key: 'random-label-wbrumham56', count: 187 },
{ key: 'random-label-azeal57', count: 188 },
{ key: 'random-label-msnooks58', count: 189 },
{ key: 'random-label-blapre59', count: 190 },
{ key: 'random-label-cduckers5a', count: 191 },
{ key: 'random-label-mgumary5b', count: 192 },
{ key: 'random-label-rtebbs5c', count: 193 },
{ key: 'random-label-eroe5d', count: 194 },
{ key: 'random-label-rconfait5e', count: 195 },
{ key: 'random-label-fsinderland5f', count: 196 },
{ key: 'random-label-tdallywater5g', count: 197 },
{ key: 'random-label-glindenman5h', count: 198 },
{ key: 'random-label-fbauser5i', count: 199 },
{ key: 'random-label-bdownton5j', count: 200 },
];
export const MOCK_RECEIVE_AGGREGATIONS_SUCCESS_MUTATION = [
{
type: types.REQUEST_AGGREGATIONS,
},
{
type: types.RECEIVE_AGGREGATIONS_SUCCESS,
payload: MOCK_AGGREGATIONS,
},
];
export const MOCK_RECEIVE_AGGREGATIONS_ERROR_MUTATION = [
{
type: types.REQUEST_AGGREGATIONS,
},
{
type: types.RECEIVE_AGGREGATIONS_ERROR,
},
];

View File

@ -27,6 +27,9 @@ import {
MOCK_NAVIGATION_DATA,
MOCK_NAVIGATION_ACTION_MUTATION,
MOCK_ENDPOINT_RESPONSE,
MOCK_RECEIVE_AGGREGATIONS_SUCCESS_MUTATION,
MOCK_RECEIVE_AGGREGATIONS_ERROR_MUTATION,
MOCK_AGGREGATIONS,
} from '../mock_data';
jest.mock('~/flash');
@ -295,4 +298,30 @@ describe('Global Search Store Actions', () => {
});
});
});
describe.each`
action | axiosMock | type | expectedMutations | errorLogs
${actions.fetchLanguageAggregation} | ${{ method: 'onGet', code: 200 }} | ${'success'} | ${MOCK_RECEIVE_AGGREGATIONS_SUCCESS_MUTATION} | ${0}
${actions.fetchLanguageAggregation} | ${{ method: 'onPut', code: 0 }} | ${'error'} | ${MOCK_RECEIVE_AGGREGATIONS_ERROR_MUTATION} | ${1}
${actions.fetchLanguageAggregation} | ${{ method: 'onGet', code: 500 }} | ${'error'} | ${MOCK_RECEIVE_AGGREGATIONS_ERROR_MUTATION} | ${1}
`('fetchLanguageAggregation', ({ action, axiosMock, type, expectedMutations, errorLogs }) => {
describe(`on ${type}`, () => {
beforeEach(() => {
if (axiosMock.method) {
mock[axiosMock.method]().reply(
axiosMock.code,
axiosMock.code === 200 ? MOCK_AGGREGATIONS : [],
);
}
});
it(`should ${type === 'error' ? 'NOT ' : ''}dispatch ${
type === 'error' ? '' : 'the correct '
}mutations`, () => {
return testAction({ action, state, expectedMutations }).then(() => {
expect(logger.logError).toHaveBeenCalledTimes(errorLogs);
});
});
});
});
});

View File

@ -1,7 +1,13 @@
import { GROUPS_LOCAL_STORAGE_KEY, PROJECTS_LOCAL_STORAGE_KEY } from '~/search/store/constants';
import * as getters from '~/search/store/getters';
import createState from '~/search/store/state';
import { MOCK_QUERY, MOCK_GROUPS, MOCK_PROJECTS } from '../mock_data';
import {
MOCK_QUERY,
MOCK_GROUPS,
MOCK_PROJECTS,
MOCK_AGGREGATIONS,
MOCK_LANGUAGE_AGGREGATIONS_BUCKETS,
} from '../mock_data';
describe('Global Search Store Getters', () => {
let state;
@ -29,4 +35,16 @@ describe('Global Search Store Getters', () => {
expect(getters.frequentProjects(state)).toStrictEqual(MOCK_PROJECTS);
});
});
describe('langugageAggregationBuckets', () => {
beforeEach(() => {
state.aggregations.data = MOCK_AGGREGATIONS;
});
it('returns the correct data', () => {
expect(getters.langugageAggregationBuckets(state)).toStrictEqual(
MOCK_LANGUAGE_AGGREGATIONS_BUCKETS,
);
});
});
});

View File

@ -8,6 +8,7 @@ import {
MOCK_NAVIGATION_DATA,
MOCK_NAVIGATION_ACTION_MUTATION,
MOCK_DATA_FOR_NAVIGATION_ACTION_MUTATION,
MOCK_AGGREGATIONS,
} from '../mock_data';
describe('Global Search Store Mutations', () => {
@ -108,4 +109,17 @@ describe('Global Search Store Mutations', () => {
);
});
});
describe.each`
mutation | data | result
${types.REQUEST_AGGREGATIONS} | ${[]} | ${{ fetching: true, error: false, data: [] }}
${types.RECEIVE_AGGREGATIONS_SUCCESS} | ${MOCK_AGGREGATIONS} | ${{ fetching: false, error: false, data: MOCK_AGGREGATIONS }}
${types.RECEIVE_AGGREGATIONS_ERROR} | ${[]} | ${{ fetching: false, error: true, data: [] }}
`('$mutation', ({ mutation, data, result }) => {
it('sets correct object content', () => {
mutations[mutation](state, data);
expect(state.aggregations).toStrictEqual(result);
});
});
});

View File

@ -8,4 +8,20 @@ RSpec.describe RegistrationsHelper do
expect(helper.signup_username_data_attributes.keys).to include(:min_length, :min_length_message, :max_length, :max_length_message, :qa_selector)
end
end
describe '#arkose_labs_challenge_enabled?' do
before do
stub_application_setting(
arkose_labs_private_api_key: nil,
arkose_labs_public_api_key: nil,
arkose_labs_namespace: nil
)
stub_env('ARKOSE_LABS_PRIVATE_KEY', nil)
stub_env('ARKOSE_LABS_PUBLIC_KEY', nil)
end
it 'is false' do
expect(helper.arkose_labs_challenge_enabled?).to eq false
end
end
end

View File

@ -4,11 +4,9 @@ require 'spec_helper'
RSpec.describe ::API::Entities::MergeRequestBasic do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :public) }
let_it_be(:merge_request) { create(:merge_request) }
let_it_be(:labels) { create_list(:label, 3) }
let_it_be(:merge_requests) { create_list(:labeled_merge_request, 10, :unique_branches, labels: labels) }
let_it_be(:entity) { described_class.new(merge_request) }
# This mimics the behavior of the `Grape::Entity` serializer
@ -16,7 +14,7 @@ RSpec.describe ::API::Entities::MergeRequestBasic do
described_class.new(obj).presented
end
subject { entity.as_json }
subject(:json) { entity.as_json }
it 'includes expected fields' do
expected_fields = %i[
@ -57,7 +55,7 @@ RSpec.describe ::API::Entities::MergeRequestBasic do
end
end
context 'reviewers' do
describe 'reviewers' do
before do
merge_request.reviewers = [user]
end
@ -68,4 +66,26 @@ RSpec.describe ::API::Entities::MergeRequestBasic do
expect(result['reviewers'][0]['username']).to eq user.username
end
end
describe 'squash' do
subject { json[:squash] }
before do
merge_request.target_project.project_setting.update!(squash_option: :never)
merge_request.update!(squash: true)
end
it { is_expected.to eq(true) }
end
describe 'squash_on_merge' do
subject { json[:squash_on_merge] }
before do
merge_request.target_project.project_setting.update!(squash_option: :never)
merge_request.update!(squash: true)
end
it { is_expected.to eq(false) }
end
end

View File

@ -19,7 +19,7 @@ RSpec.describe Gitlab::Auth::IpRateLimiter, :use_clean_rails_memory_store_cachin
before do
stub_rack_attack_setting(options)
Rack::Attack.reset!
Gitlab::Redis::RateLimiting.with(&:flushdb)
Rack::Attack.clear_configuration
Gitlab::RackAttack.configure(Rack::Attack)
end

View File

@ -0,0 +1,7 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Redis::ClusterRateLimiting, feature_category: :redis do
include_examples "redis_new_instance_shared_examples", 'cluster_rate_limiting', Gitlab::Redis::Cache
end

View File

@ -1195,7 +1195,7 @@ RSpec.describe Gitlab::Redis::MultiStore, feature_category: :redis do
context 'when FF table guard raises' do
before do
allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise
allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise(ActiveRecord::NoDatabaseError)
end
it 'multi store is disabled' do
@ -1221,7 +1221,7 @@ RSpec.describe Gitlab::Redis::MultiStore, feature_category: :redis do
context 'when FF table guard raises' do
before do
allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise
allow(Feature::FlipperFeature).to receive(:table_exists?).and_raise(ActiveRecord::NoDatabaseError)
end
it 'multi store is disabled' do

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe Gitlab::SlashCommands::Command do
RSpec.describe Gitlab::SlashCommands::Command, feature_category: :integrations do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
let(:chat_name) { double(:chat_name, user: user) }
@ -28,7 +28,7 @@ RSpec.describe Gitlab::SlashCommands::Command do
it 'displays the help message' do
expect(subject[:response_type]).to be(:ephemeral)
expect(subject[:text]).to start_with('The specified command is not valid')
expect(subject[:text]).to match('/gitlab issue show')
expect(subject[:text]).to include('/gitlab [project name or alias] issue show <id>')
end
end

View File

@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe RequireEmailVerification do
RSpec.describe RequireEmailVerification, feature_category: :insider_threat do
let_it_be(:model) do
Class.new(ApplicationRecord) do
self.table_name = 'users'
@ -15,11 +15,15 @@ RSpec.describe RequireEmailVerification do
using RSpec::Parameterized::TableSyntax
where(:feature_flag_enabled, :two_factor_enabled, :overridden) do
false | false | false
false | true | false
true | false | true
true | true | false
where(:feature_flag_enabled, :two_factor_enabled, :skipped, :overridden) do
false | false | false | false
false | false | true | false
false | true | false | false
false | true | true | false
true | false | false | true
true | false | true | false
true | true | false | false
true | true | true | false
end
with_them do
@ -29,6 +33,7 @@ RSpec.describe RequireEmailVerification do
before do
stub_feature_flags(require_email_verification: feature_flag_enabled ? instance : another_instance)
allow(instance).to receive(:two_factor_enabled?).and_return(two_factor_enabled)
stub_feature_flags(skip_require_email_verification: skipped ? instance : another_instance)
end
describe '#lock_access!' do

View File

@ -223,6 +223,7 @@ feature_category: :user_management do
context 'when the feature flag is toggled on' do
before do
stub_feature_flags(require_email_verification: user)
stub_feature_flags(skip_require_email_verification: false)
end
it_behaves_like 'verifying with email'
@ -242,6 +243,14 @@ feature_category: :user_management do
it_behaves_like 'verifying with email'
end
context 'when the skip_require_email_verification feature flag is turned on' do
before do
stub_feature_flags(skip_require_email_verification: user)
end
it_behaves_like 'not verifying with email'
end
end
end
end

View File

@ -382,7 +382,7 @@ RSpec.shared_examples 'tracking when dry-run mode is set' do
end
def reset_rack_attack
Rack::Attack.reset!
Gitlab::Redis::RateLimiting.with(&:flushdb)
Rack::Attack.clear_configuration
Gitlab::RackAttack.configure(Rack::Attack)
end

View File

@ -35,7 +35,7 @@ require (
golang.org/x/net v0.5.0
golang.org/x/oauth2 v0.2.0
golang.org/x/tools v0.2.0
google.golang.org/grpc v1.52.0
google.golang.org/grpc v1.52.3
google.golang.org/protobuf v1.28.1
honnef.co/go/tools v0.3.3
)

View File

@ -2699,8 +2699,8 @@ google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD
google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww=
google.golang.org/grpc v1.52.0 h1:kd48UiU7EHsV4rnLyOJRuP/Il/UHE7gdDAQ+SZI7nZk=
google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
google.golang.org/grpc v1.52.3 h1:pf7sOysg4LdgBqduXveGKrcEwbStiK2rtfghdzlUYDQ=
google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=