Commit cf300aef authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents c3a917c4 b7beeeb2
# frozen_string_literal: true
module Types
class Namespace::SharedRunnersSettingEnum < BaseEnum
graphql_name 'SharedRunnersSetting'
::Namespace::SHARED_RUNNERS_SETTINGS.each do |type|
value type.upcase,
description: "Sharing of runners is #{type.tr('_', ' ')}.",
value: type
end
end
end
......@@ -42,6 +42,11 @@ module Types
null: true,
description: 'The package settings for the namespace.'
field :shared_runners_setting,
Types::Namespace::SharedRunnersSettingEnum,
null: true,
description: "Shared runners availability for the namespace and its descendants."
def root_storage_statistics
Gitlab::Graphql::Loaders::BatchRootStorageStatisticsLoader.new(object.id).find
end
......
{
"type": "object",
"description": "Histogram (buckets 1 to 100) of projects with at least 1 enabled integration"
"description": "Histogram (buckets 1 to 100) of projects with at least 1 enabled integration",
"propertyNames": {
"pattern": "^[1-9][0-9]?0?$"
}
......
{
"type": "object",
"required": ["duration", "failures"],
"required": ["duration_s", "failures"],
"properties": {
"duration": { "type": "number", "description": "The time it took to collect topology data" },
"duration_s": { "type": "number", "description": "The time it took to collect topology data" },
"failures": { "type": "array", "description": "The information about failed queries" },
"application_requests_per_hour": { "type": "number", "description": "The number of requests to the web application per hour" },
"nodes": {
......
---
# Suggestion: gitlab.Wordy
#
# Suggests shorter versions of wordy phrases.
#
# For a list of all options, see https://docs.errata.ai/vale/styles
extends: substitution
message: 'Be concise: "%s" is less wordy than "%s".'
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html
level: suggestion
ignorecase: true
swap:
in order to: to
......@@ -31,16 +31,27 @@ These features can be enabled and disabled to allow or disallow users to use
them. It can be done by GitLab administrators with access to GitLab Rails
console.
When you disable a feature flag, the feature is hidden from users and all of the functionality is turned off.
For example, data is not recorded and services do not run.
If you used a certain feature and identified a bug, a misbehavior, or an
error, it's very important that you [**provide feedback**](https://gitlab.com/gitlab-org/gitlab/-/issues/new?issue[title]=Docs%20-%20feature%20flag%20feedback%3A%20Feature%20Name&issue[description]=Describe%20the%20problem%20you%27ve%20encountered.%0A%0A%3C!--%20Don%27t%20edit%20below%20this%20line%20--%3E%0A%0A%2Flabel%20~%22docs%5C-comments%22%20) to GitLab as soon
as possible so we can improve or fix it while behind a flag. When you upgrade
GitLab to an earlier version, the feature flag status may change.
WARNING:
Features deployed behind feature flags may not be ready for
production use. However, disabling features behind flags that were deployed
enabled by default may also present a risk. If they're enabled, we recommend
you leave them as-is.
## Risks when enabling features still in development
Features that are disabled by default may change or be removed without notice in a future version of GitLab.
Data corruption, stability degradation, or performance degradation might occur if
you enable a feature that's disabled by default. Problems caused by using a default
disabled feature aren't covered by GitLab support, unless you were directed by GitLab
to enable the feature.
## Risks when disabling released features
In most cases, the feature flag code is removed in a future version of GitLab.
If and when that occurs, from that point onward you can't keep the feature in a disabled state.
## How to enable and disable features behind flags
......
......@@ -491,7 +491,7 @@ A runner's registration fails if it exceeds the limit for the scope determined b
> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-job-log-limits). **(FREE SELF)**
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../user/feature_flags.md#risks-when-enabling-features-still-in-development).
[risks when enabling features still in development](../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
The job log file size limit is 100 megabytes by default. Any job that exceeds this value is dropped.
......
......@@ -13,7 +13,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-custom-emoji-api). **(FREE SELF)**
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../../user/feature_flags.md#risks-when-enabling-features-still-in-development).
[risks when enabling features still in development](../../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
To use custom emoji in comments and descriptions, you can add them to a group using the GraphQL API.
......
......@@ -9434,6 +9434,7 @@ four standard [pagination arguments](#connection-pagination-arguments):
| <a id="grouprequiretwofactorauthentication"></a>`requireTwoFactorAuthentication` | [`Boolean`](#boolean) | Indicates if all users in this group are required to set up two-factor authentication. |
| <a id="grouprootstoragestatistics"></a>`rootStorageStatistics` | [`RootStorageStatistics`](#rootstoragestatistics) | Aggregated storage statistics of the namespace. Only available for root namespaces. |
| <a id="groupsharewithgrouplock"></a>`shareWithGroupLock` | [`Boolean`](#boolean) | Indicates if sharing a project with another group within this group is prevented. |
| <a id="groupsharedrunnerssetting"></a>`sharedRunnersSetting` | [`SharedRunnersSetting`](#sharedrunnerssetting) | Shared runners availability for the namespace and its descendants. |
| <a id="groupstats"></a>`stats` | [`GroupStats`](#groupstats) | Group statistics. |
| <a id="groupstoragesizelimit"></a>`storageSizeLimit` | [`Float`](#float) | Total storage limit of the root namespace in bytes. |
| <a id="groupsubgroupcreationlevel"></a>`subgroupCreationLevel` | [`String`](#string) | The permission level required to create subgroups within the group. |
......@@ -11092,6 +11093,7 @@ Contains statistics about a milestone.
| <a id="namespacerepositorysizeexcessprojectcount"></a>`repositorySizeExcessProjectCount` | [`Int!`](#int) | Number of projects in the root namespace where the repository size exceeds the limit. |
| <a id="namespacerequestaccessenabled"></a>`requestAccessEnabled` | [`Boolean`](#boolean) | Indicates if users can request access to namespace. |
| <a id="namespacerootstoragestatistics"></a>`rootStorageStatistics` | [`RootStorageStatistics`](#rootstoragestatistics) | Aggregated storage statistics of the namespace. Only available for root namespaces. |
| <a id="namespacesharedrunnerssetting"></a>`sharedRunnersSetting` | [`SharedRunnersSetting`](#sharedrunnerssetting) | Shared runners availability for the namespace and its descendants. |
| <a id="namespacestoragesizelimit"></a>`storageSizeLimit` | [`Float`](#float) | Total storage limit of the root namespace in bytes. |
| <a id="namespacetemporarystorageincreaseendson"></a>`temporaryStorageIncreaseEndsOn` | [`Time`](#time) | Date until the temporary storage increase is active. |
| <a id="namespacetotalrepositorysize"></a>`totalRepositorySize` | [`Float`](#float) | Total repository size of all projects in the root namespace in bytes. |
......@@ -15367,6 +15369,14 @@ State of a Sentry error.
| <a id="servicetypewebex_teams_service"></a>`WEBEX_TEAMS_SERVICE` | WebexTeamsService type. |
| <a id="servicetypeyoutrack_service"></a>`YOUTRACK_SERVICE` | YoutrackService type. |
### `SharedRunnersSetting`
| Value | Description |
| ----- | ----------- |
| <a id="sharedrunnerssettingdisabled_and_unoverridable"></a>`DISABLED_AND_UNOVERRIDABLE` | Sharing of runners is disabled and unoverridable. |
| <a id="sharedrunnerssettingdisabled_with_override"></a>`DISABLED_WITH_OVERRIDE` | Sharing of runners is disabled with override. |
| <a id="sharedrunnerssettingenabled"></a>`ENABLED` | Sharing of runners is enabled. |
### `SnippetBlobActionEnum`
Type of a snippet blob input action.
......
......@@ -14,7 +14,7 @@ type: concepts, howto
> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](../ci/environments/protected_environments.md#enable-or-disable-group-level-protected-environments). **(FREE SELF)**
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../user/feature_flags.md#risks-when-enabling-features-still-in-development).
[risks when enabling features still in development](../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
Read more about [group-level protected environments](../ci/environments/protected_environments.md#group-level-protected-environments),
......
......@@ -254,7 +254,7 @@ tries to steal tokens from other jobs.
> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-ci-job-token-scope-limit). **(FREE SELF)**
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../user/feature_flags.md#risks-when-enabling-features-still-in-development).
[risks when enabling features still in development](../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
You can limit the access scope of a project's CI/CD job token to increase the
......
......@@ -163,7 +163,7 @@ For more information, see [Deployment safety](deployment_safety.md).
> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-group-level-protected-environments). **(FREE SELF)**
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../../user/feature_flags.md#risks-when-enabling-features-still-in-development).
[risks when enabling features still in development](../../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
Typically, large enterprise organizations have an explicit permission boundary
......
......@@ -362,7 +362,7 @@ you visualize the entire pipeline, including all cross-project inter-dependencie
> - To disable in GitLab self-managed instances, ask a GitLab administrator to [disable it](#enable-or-disable-job-dependency-view). **(FREE SELF)**
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../../user/feature_flags.md#risks-when-enabling-features-still-in-development).
[risks when enabling features still in development](../../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
You can arrange jobs in the pipeline graph based on their [`needs`](../yaml/index.md#needs)
......
......@@ -474,7 +474,7 @@ Use local includes instead of symbolic links.
> - For GitLab self-managed instances, GitLab administrators can opt to disable it. **(CORE ONLY)**
There can be
[risks when disabling released features](../../user/feature_flags.md#risks-when-disabling-released-features).
[risks when disabling released features](../../administration/feature_flags.md#risks-when-disabling-released-features).
Refer to this feature's version history for more details.
You can use wildcard paths (`*` and `**`) with `include:local`.
......
......@@ -175,7 +175,7 @@ Do not use Latin abbreviations. Use **that is** instead. ([Vale](../testing.md#v
## in order to
Do not use. Use **to** instead.
Do not use. Use **to** instead. ([Vale](../testing.md#vale) rule: [`Wordy.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/Wordy.yml))
## issue
......@@ -337,7 +337,7 @@ Use instead of **sub-group**.
## that
Do not use. For example:
Do not use. For example:
- Avoid: The file that you save...
- Use instead: The file you save...
......
......@@ -28,6 +28,7 @@ are very appreciative of the work done by translators and proofreaders!
- Huang Tao - [GitLab](https://gitlab.com/htve), [CrowdIn](https://crowdin.com/profile/htve)
- Victor Wu - [GitLab](https://gitlab.com/victorwuky), [CrowdIn](https://crowdin.com/profile/victorwu)
- Xiaogang Wen - [GitLab](https://gitlab.com/xiaogang_gitlab), [CrowdIn](https://crowdin.com/profile/xiaogang_gitlab)
- Shuang Zhang - [GitLab](https://gitlab.com/tonygodspeed92), [CrowdIn](https://crowdin.com/profile/tonygodspeed92)
- Chinese Traditional 繁體中文
- Weizhe Ding - [GitLab](https://gitlab.com/d.weizhe), [CrowdIn](https://crowdin.com/profile/d.weizhe)
- Yi-Jyun Pan - [GitLab](https://gitlab.com/pan93412), [CrowdIn](https://crowdin.com/profile/pan93412)
......
This diff is collapsed.
......@@ -13,7 +13,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-batched-background-migrations). **(FREE SELF)**
There can be [risks when disabling released features](../../../user/feature_flags.md#risks-when-disabling-released-features).
There can be [risks when disabling released features](../../../administration/feature_flags.md#risks-when-disabling-released-features).
Refer to this feature's version history for more details.
To update database tables in batches, GitLab can use batched background migrations. These migrations
......@@ -54,7 +54,7 @@ Feature.disable(:execute_batched_migrations_on_schedule)
> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-automatic-batch-size-optimization). **(FREE SELF)**
There can be [risks when disabling released features](../../../user/feature_flags.md#risks-when-disabling-released-features).
There can be [risks when disabling released features](../../../administration/feature_flags.md#risks-when-disabling-released-features).
Refer to this feature's version history for more details.
To maximize throughput of batched background migrations (in terms of the number of tuples updated per time unit), batch sizes are automatically adjusted based on how long the previous batches took to complete.
......
......@@ -125,7 +125,7 @@ WARNING:
This feature might not be available to you. Check the **version history** note above for details.
There can be
[risks when disabling released features](../../../user/feature_flags.md#risks-when-disabling-released-features).
[risks when disabling released features](../../../administration/feature_flags.md#risks-when-disabling-released-features).
Refer to this feature's version history for more details.
To enable Dependency Scanning in a project, you can create a merge request
......
......@@ -20,21 +20,13 @@ may be unavailable to you.
In this case, you'll see a warning like this in the feature documentation:
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](#risks-when-enabling-features-still-in-development).
[risks when enabling features still in development](../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
In the version history note, you'll find information on the state of the
feature flag, including whether the feature is on ("enabled by default") or
off ("disabled by default") for self-managed GitLab instances and for users of
GitLab.com. To see the full notes:
1. Click the three-dots icon (ellipsis) to expand version history notes:
![Version history note with FF information](img/version_history_notes_collapsed_v13_2.png)
1. Read the version history information:
![Version history note with FF information](img/feature_flags_history_note_info_v13_2.png)
GitLab.com.
If you're a user of a GitLab self-managed instance and you want to try to use a
disabled feature, you can ask a [GitLab administrator to enable it](../administration/feature_flags.md),
......@@ -42,17 +34,3 @@ although changing a feature's default state isn't recommended.
If you're a GitLab.com user and the feature is disabled, be aware that GitLab may
be working on the feature for potential release in the future.
## Risks when enabling features still in development
Features that are disabled by default may change or be removed without notice in a future version of GitLab.
Data corruption, stability degradation, or performance degradation might occur if
you enable a feature that's disabled by default. Problems caused by using a default
disabled feature aren't covered by GitLab support, unless you were directed by GitLab
to enable the feature.
## Risks when disabling released features
In most cases, the feature flag code is removed in a future version of GitLab.
If and when that occurs, from that point onward you can't keep the feature in a disabled state.
......@@ -11,8 +11,9 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - [Deployed behind a feature flag](../../feature_flags.md), disabled by default.
> - Enabled on GitLab.com.
WARNING:
This feature is [under construction](https://gitlab.com/groups/gitlab-org/-/epics/2771), and migrates only some of the group data. Refer to the following information for the list of what's included in the migration.
NOTE:
The importer migrates **only** the group data listed on this page. To leave feedback on this
feature, see [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/284495).
Using GitLab Group Migration, you can migrate existing top-level groups from GitLab.com or a self-managed instance. Groups can be migrated to a target instance, as a top-level group, or as a subgroup of any existing top-level group.
......
......@@ -41,7 +41,7 @@ In GitLab, iterations are similar to milestones, with a few differences:
> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-iteration-cadences). **(PREMIUM SELF)**
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../../feature_flags.md#risks-when-enabling-features-still-in-development).
[risks when enabling features still in development](../../../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
Iteration cadences automate some common iteration tasks. They can be used to
......
......@@ -233,7 +233,7 @@ and vice versa.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-graphql-based-issue-boards). **(FREE SELF)**
There can be
[risks when disabling released features](../feature_flags.md#risks-when-disabling-released-features).
[risks when disabling released features](../../administration/feature_flags.md#risks-when-disabling-released-features).
Refer to this feature's version history for more details.
Using GraphQL-based boards gives you these
......@@ -345,7 +345,7 @@ As in other list types, click the trash icon to remove a list.
> - For GitLab self-managed instances, GitLab administrators can opt to disable the feature flags: [`board_new_list`](#enable-or-disable-new-add-list-form) and [`iteration_board_lists`](#enable-or-disable-iteration-lists-in-boards). **(PREMIUM SELF)**
There can be
[risks when disabling released features](../feature_flags.md#risks-when-disabling-released-features).
[risks when disabling released features](../../administration/feature_flags.md#risks-when-disabling-released-features).
Refer to this feature's version history for more details.
You're also able to create lists of an iteration.
......@@ -629,7 +629,7 @@ and the target list.
> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-multi-selecting-issue-cards). **(FREE SELF)**
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../feature_flags.md#risks-when-enabling-features-still-in-development).
[risks when enabling features still in development](../../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
You can select multiple issue cards, then drag the group to another position within the list, or to
......
......@@ -140,7 +140,7 @@ Feature.disable(:local_file_reviews)
> - To use in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-merge-request-conflicts-in-diff). **(FREE SELF)**
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../../feature_flags.md#risks-when-enabling-features-still-in-development).
[risks when enabling features still in development](../../../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
To avoid displaying the changes that are already on target branch in the diff,
......
......@@ -42,7 +42,7 @@ Previously merged commits can be added, but they can't be removed due to
[this bug](https://gitlab.com/gitlab-org/gitlab/-/issues/325538).
This in-development feature might not be available for your use. There can be
[risks when enabling features still in development](../../feature_flags.md#risks-when-enabling-features-still-in-development).
[risks when enabling features still in development](../../../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
Refer to this feature's version history for more details.
When reviewing a merge request, it helps to have more context about the changes
......
......@@ -11,7 +11,6 @@ RSpec.describe 'Every metric definition' do
geo_node_usage
license_add_ons
testing_total_unique_counts
topology
user_auth_by_provider
).freeze
end
......@@ -19,7 +18,7 @@ RSpec.describe 'Every metric definition' do
let(:usage_ping_key_paths) do
parse_usage_ping_keys(usage_ping)
.flatten
.reject { |v| v =~ Regexp.union(ignored_usage_ping_key_patterns)}
.reject { |v| v =~ Regexp.union(ignored_usage_ping_key_patterns) }
.sort
end
......@@ -29,7 +28,6 @@ RSpec.describe 'Every metric definition' do
geo_node_usage
mock_ci
mock_monitoring
projects_with_enabled_alert_integrations_histogram
user_auth_by_provider
user_dast_scans
user_sast_scans
......@@ -38,22 +36,27 @@ RSpec.describe 'Every metric definition' do
user_secret_detection_scans
user_coverage_fuzzing_scans
user_api_fuzzing_scans
topology
).freeze
end
let(:metric_files_key_paths) do
Gitlab::Usage::MetricDefinition
.definitions
.reject { |k, v| v.status == 'removed' || v.key_path =~ Regexp.union(ignored_metric_files_key_patterns)}
.reject { |k, v| v.status == 'removed' || v.key_path =~ Regexp.union(ignored_metric_files_key_patterns) }
.keys
.sort
end
let(:metric_files_with_schema) do
Gitlab::Usage::MetricDefinition
.definitions
.select { |k, v| v.respond_to?(:value_json_schema) }
end
# Recursively traverse nested Hash of a generated Usage Ping to return an Array of key paths
# in the dotted format used in metric definition YAML files, e.g.: 'count.category.metric_name'
def parse_usage_ping_keys(object, key_path = [])
if object.is_a? Hash
if object.is_a?(Hash) && !object_with_schema?(key_path.join('.'))
object.each_with_object([]) do |(key, value), result|
result.append parse_usage_ping_keys(value, key_path + [key])
end
......@@ -62,6 +65,10 @@ RSpec.describe 'Every metric definition' do
end
end
def object_with_schema?(key_path)
metric_files_with_schema.key?(key_path)
end
before do
allow(Gitlab::UsageData).to receive_messages(count: -1, distinct_count: -1, estimate_batch_distinct_count: -1, sum: -1, alt_usage_data: -1)
allow(Gitlab::Geo).to receive(:enabled?).and_return(true)
......@@ -73,4 +80,14 @@ RSpec.describe 'Every metric definition' do
it 'is included in the Usage Ping hash structure' do
expect(metric_files_key_paths).to match_array(usage_ping_key_paths)
end
context 'with value json schema' do
it 'has a valid structure', :aggregate_failures do
metric_files_with_schema.each do |key_path, metric|
structure = usage_ping.dig(*key_path.split('.').map(&:to_sym))
expect(structure).to match_metric_definition_schema(metric.value_json_schema)
end
end
end
end
......@@ -114,6 +114,10 @@ module Gitlab
attributes[method] || super
end
def respond_to_missing?(method, *args)
attributes[method].present? || super
end
def skip_validation?
!!attributes[:skip_validation] || @skip_validation || SKIP_VALIDATION_STATUSES.include?(attributes[:status])
end
......
......@@ -6,7 +6,7 @@ module Gitlab
module Instrumentations
class CollectedDataCategoriesMetric < GenericMetric
value do
::ServicePing::PermitDataCategoriesService.new.execute
::ServicePing::PermitDataCategoriesService.new.execute.to_a
end
end
end
......
......@@ -18,7 +18,7 @@ RSpec.describe GitlabSchema.types['Group'] do
two_factor_grace_period auto_devops_enabled emails_disabled
mentions_disabled parent boards milestones group_members
merge_requests container_repositories container_repositories_count
packages
packages shared_runners_setting
]
expect(described_class).to include_graphql_fields(*expected_fields)
......
......@@ -8,7 +8,7 @@ RSpec.describe GitlabSchema.types['Namespace'] do
it 'has the expected fields' do
expected_fields = %w[
id name path full_name full_path description description_html visibility
lfs_enabled request_access_enabled projects root_storage_statistics
lfs_enabled request_access_enabled projects root_storage_statistics shared_runners_setting
]
expect(described_class).to include_graphql_fields(*expected_fields)
......
......@@ -78,6 +78,7 @@ RSpec.describe 'getting group information' do
expect(graphql_data['group']['parentId']).to eq(group1.parent_id)
expect(graphql_data['group']['issues']['nodes'].count).to eq(1)
expect(graphql_data['group']['issues']['nodes'][0]['iid']).to eq(issue.iid.to_s)
expect(graphql_data['group']['sharedRunnersSetting']).to eq(group1.shared_runners_setting.upcase)
end
it "does not return a non existing group" do
......
......@@ -45,6 +45,17 @@ RSpec::Matchers.define :match_response_schema do |schema, dir: nil, **options|
end
end
RSpec::Matchers.define :match_metric_definition_schema do |path, dir: nil, **options|
match do |data|
schema_path = Pathname.new(Rails.root.join(dir.to_s, path).to_s)
validator = SchemaPath.validator(schema_path)
data = data.stringify_keys if data.is_a? Hash
validator.valid?(data)
end
end
RSpec::Matchers.define :match_snowplow_schema do |schema, dir: nil, **options|
match do |data|
schema_path = Pathname.new(Rails.root.join(dir.to_s, 'spec', "fixtures/product_intelligence/#{schema}.json").to_s)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment