Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-08-10 06:10:51 +00:00
parent aaae73ac95
commit f626c31492
64 changed files with 225 additions and 298 deletions

View File

@ -3,25 +3,6 @@
Layout/HashAlignment:
Exclude:
- 'app/finders/releases/group_releases_finder.rb'
- 'app/graphql/mutations/award_emojis/toggle.rb'
- 'app/graphql/mutations/design_management/move.rb'
- 'app/graphql/mutations/issues/set_severity.rb'
- 'app/graphql/mutations/security/ci_configuration/base_security_analyzer.rb'
- 'app/graphql/types/alert_management/domain_filter_enum.rb'
- 'app/graphql/types/ci/group_variable_type.rb'
- 'app/graphql/types/ci/instance_variable_type.rb'
- 'app/graphql/types/ci/manual_variable_type.rb'
- 'app/graphql/types/ci/project_variable_type.rb'
- 'app/graphql/types/ci/variable_interface.rb'
- 'app/graphql/types/packages/package_base_type.rb'
- 'app/graphql/types/permission_types/group_enum.rb'
- 'app/graphql/types/upload_type.rb'
- 'app/graphql/types/work_items/widget_interface.rb'
- 'app/graphql/types/work_items/widgets/assignees_type.rb'
- 'app/graphql/types/work_items/widgets/description_type.rb'
- 'app/graphql/types/work_items/widgets/hierarchy_type.rb'
- 'app/graphql/types/work_items/widgets/labels_type.rb'
- 'app/graphql/types/work_items/widgets/start_and_due_date_type.rb'
- 'app/models/issue.rb'
- 'app/models/work_item.rb'
- 'app/services/issuable/import_csv/base_service.rb'
@ -39,7 +20,6 @@ Layout/HashAlignment:
- 'db/post_migrate/20220801150028_add_partial_trigram_index_for_issue_description.rb'
- 'ee/app/controllers/ee/search_controller.rb'
- 'ee/app/controllers/groups/analytics/ci_cd_analytics_controller.rb'
- 'ee/app/controllers/groups/saml_group_links_controller.rb'
- 'ee/app/graphql/ee/types/board_list_type.rb'
- 'ee/app/graphql/ee/types/board_type.rb'
- 'ee/app/graphql/ee/types/ci/runner_type.rb'

View File

@ -93,7 +93,7 @@ export default {
icon-name="list-task"
class="gl-mx-2 gl-display-none gl-sm-display-inline"
editor-command="toggleTaskList"
:label="__('Add a task list')"
:label="__('Add a checklist')"
@execute="trackToolbarControlExecution"
/>
<toolbar-image-button

View File

@ -302,7 +302,9 @@ export default {
if (taskRegexMatches) {
$tasks.text(this.taskStatus);
$tasksShort.text(
`${taskRegexMatches[1]}/${taskRegexMatches[2]} task${taskRegexMatches[2] > 1 ? 's' : ''}`,
`${taskRegexMatches[1]}/${taskRegexMatches[2]} checklist item${
taskRegexMatches[2] > 1 ? 's' : ''
}`,
);
} else {
$tasks.text('');

View File

@ -314,7 +314,7 @@ export default {
v-if="!restrictedToolBarItems.includes('task-list')"
:prepend="true"
tag="- [ ] "
:button-title="__('Add a task list')"
:button-title="__('Add a checklist')"
icon="list-task"
/>
<toolbar-button

View File

@ -118,8 +118,8 @@ export default {
return sprintf(
n__(
'%{completedCount} of %{count} task completed',
'%{completedCount} of %{count} tasks completed',
'%{completedCount} of %{count} checklist item completed',
'%{completedCount} of %{count} checklist items completed',
count,
),
{ completedCount, count },

View File

@ -81,8 +81,8 @@ export default {
return sprintf(
n__(
'%{completedCount} of %{count} task completed',
'%{completedCount} of %{count} tasks completed',
'%{completedCount} of %{count} checklist item completed',
'%{completedCount} of %{count} checklist items completed',
count,
),
{ completedCount, count },

View File

@ -5,7 +5,8 @@ module Mutations
class Toggle < Base
graphql_name 'AwardEmojiToggle'
field :toggled_on, GraphQL::Types::Boolean, null: false,
field :toggled_on, GraphQL::Types::Boolean,
null: false,
description: 'Indicates the status of the emoji. ' \
'True if the toggle awarded the emoji, and false if the toggle removed the emoji.'

View File

@ -7,17 +7,21 @@ module Mutations
DesignID = ::Types::GlobalIDType[::DesignManagement::Design]
argument :id, DesignID, required: true, as: :current_design,
description: "ID of the design to move."
argument :id, DesignID,
required: true, as: :current_design,
description: "ID of the design to move."
argument :previous, DesignID, required: false, as: :previous_design,
description: "ID of the immediately preceding design."
argument :previous, DesignID,
required: false, as: :previous_design,
description: "ID of the immediately preceding design."
argument :next, DesignID, required: false, as: :next_design,
description: "ID of the immediately following design."
argument :next, DesignID,
required: false, as: :next_design,
description: "ID of the immediately following design."
field :design_collection, Types::DesignManagement::DesignCollectionType, null: true,
description: "Current state of the collection."
field :design_collection, Types::DesignManagement::DesignCollectionType,
null: true,
description: "Current state of the collection."
def resolve(**args)
service = ::DesignManagement::MoveDesignsService.new(current_user, parameters(**args))

View File

@ -5,8 +5,9 @@ module Mutations
class SetSeverity < Base
graphql_name 'IssueSetSeverity'
argument :severity, Types::IssuableSeverityEnum, required: true,
description: 'Set the incident severity level.'
argument :severity, Types::IssuableSeverityEnum,
required: true,
description: 'Set the incident severity level.'
authorize :admin_issue

View File

@ -7,16 +7,16 @@ module Mutations
include FindsProject
argument :project_path, GraphQL::Types::ID,
required: true,
description: 'Full path of the project.'
required: true,
description: 'Full path of the project.'
field :success_path, GraphQL::Types::String,
null: true,
description: 'Redirect path to use when the response is successful.'
null: true,
description: 'Redirect path to use when the response is successful.'
field :branch, GraphQL::Types::String,
null: true,
description: 'Branch that has the new/modified `.gitlab-ci.yml` file.'
null: true,
description: 'Branch that has the new/modified `.gitlab-ci.yml` file.'
authorize :push_code

View File

@ -7,11 +7,12 @@ module Types
description 'Filters the alerts based on given domain'
value 'operations', description: 'Alerts for operations domain.'
value 'threat_monitoring', description: 'Alerts for threat monitoring domain.',
deprecated: {
reason: 'Network policies are deprecated and will be removed in GitLab 16.0',
milestone: '15.0'
}
value 'threat_monitoring',
description: 'Alerts for threat monitoring domain.',
deprecated: {
reason: 'Network policies are deprecated and will be removed in GitLab 16.0',
milestone: '15.0'
}
end
end
end

View File

@ -9,14 +9,17 @@ module Types
implements(VariableInterface)
field :environment_scope, GraphQL::Types::String, null: true,
field :environment_scope, GraphQL::Types::String,
null: true,
description: 'Scope defining the environments that can use the variable.'
field :protected, GraphQL::Types::Boolean, null: true,
description: 'Indicates whether the variable is protected.'
field :protected, GraphQL::Types::Boolean,
null: true,
description: 'Indicates whether the variable is protected.'
field :masked, GraphQL::Types::Boolean, null: true,
description: 'Indicates whether the variable is masked.'
field :masked, GraphQL::Types::Boolean,
null: true,
description: 'Indicates whether the variable is masked.'
end
end
end

View File

@ -9,18 +9,21 @@ module Types
implements(VariableInterface)
field :environment_scope, GraphQL::Types::String, null: true,
deprecated: {
reason: 'No longer used, only available for GroupVariableType and ProjectVariableType',
milestone: '15.3'
},
description: 'Scope defining the environments that can use the variable.'
field :environment_scope, GraphQL::Types::String,
null: true,
deprecated: {
reason: 'No longer used, only available for GroupVariableType and ProjectVariableType',
milestone: '15.3'
},
description: 'Scope defining the environments that can use the variable.'
field :protected, GraphQL::Types::Boolean, null: true,
description: 'Indicates whether the variable is protected.'
field :protected, GraphQL::Types::Boolean,
null: true,
description: 'Indicates whether the variable is protected.'
field :masked, GraphQL::Types::Boolean, null: true,
description: 'Indicates whether the variable is masked.'
field :masked, GraphQL::Types::Boolean,
null: true,
description: 'Indicates whether the variable is masked.'
def environment_scope
nil

View File

@ -9,12 +9,13 @@ module Types
implements(VariableInterface)
field :environment_scope, GraphQL::Types::String, null: true,
deprecated: {
reason: 'No longer used, only available for GroupVariableType and ProjectVariableType',
milestone: '15.3'
},
description: 'Scope defining the environments that can use the variable.'
field :environment_scope, GraphQL::Types::String,
null: true,
deprecated: {
reason: 'No longer used, only available for GroupVariableType and ProjectVariableType',
milestone: '15.3'
},
description: 'Scope defining the environments that can use the variable.'
def environment_scope
nil

View File

@ -9,14 +9,17 @@ module Types
implements(VariableInterface)
field :environment_scope, GraphQL::Types::String, null: true,
description: 'Scope defining the environments that can use the variable.'
field :environment_scope, GraphQL::Types::String,
null: true,
description: 'Scope defining the environments that can use the variable.'
field :protected, GraphQL::Types::Boolean, null: true,
description: 'Indicates whether the variable is protected.'
field :protected, GraphQL::Types::Boolean,
null: true,
description: 'Indicates whether the variable is protected.'
field :masked, GraphQL::Types::Boolean, null: true,
description: 'Indicates whether the variable is masked.'
field :masked, GraphQL::Types::Boolean,
null: true,
description: 'Indicates whether the variable is masked.'
end
end
end

View File

@ -7,19 +7,24 @@ module Types
graphql_name 'CiVariable'
field :id, GraphQL::Types::ID, null: false,
field :id, GraphQL::Types::ID,
null: false,
description: 'ID of the variable.'
field :key, GraphQL::Types::String, null: true,
field :key, GraphQL::Types::String,
null: true,
description: 'Name of the variable.'
field :value, GraphQL::Types::String, null: true,
field :value, GraphQL::Types::String,
null: true,
description: 'Value of the variable.'
field :variable_type, ::Types::Ci::VariableTypeEnum, null: true,
description: 'Type of the variable.'
field :variable_type, ::Types::Ci::VariableTypeEnum,
null: true,
description: 'Type of the variable.'
field :raw, GraphQL::Types::Boolean, null: true,
field :raw, GraphQL::Types::Boolean,
null: true,
description: 'Indicates whether the variable is raw.'
end
end

View File

@ -10,12 +10,12 @@ module Types
authorize :read_package
field :id, ::Types::GlobalIDType[::Packages::Package], null: false,
description: 'ID of the package.'
field :id, ::Types::GlobalIDType[::Packages::Package], null: false, description: 'ID of the package.'
field :can_destroy, GraphQL::Types::Boolean, null: false, description: 'Whether the user can destroy the package.'
field :created_at, Types::TimeType, null: false, description: 'Date of creation.'
field :metadata, Types::Packages::MetadataType, null: true,
field :metadata, Types::Packages::MetadataType,
null: true,
description: 'Package metadata.'
field :name, GraphQL::Types::String, null: false, description: 'Name of the package.'
field :package_type, Types::Packages::PackageTypeEnum, null: false, description: 'Package type.'

View File

@ -7,7 +7,8 @@ module Types
description 'User permission on groups'
value 'CREATE_PROJECTS', value: :create_projects, description: 'Groups where the user can create projects.'
value 'TRANSFER_PROJECTS', value: :transfer_projects,
value 'TRANSFER_PROJECTS',
value: :transfer_projects,
description: 'Groups where the user can transfer projects to.'
end
end

View File

@ -6,11 +6,14 @@ module Types
authorize :read_upload
field :id, Types::GlobalIDType[::Upload], null: false,
description: 'Global ID of the upload.'
field :path, GraphQL::Types::String, null: false,
description: 'Path of the upload.'
field :size, GraphQL::Types::Int, null: false,
description: 'Size of the upload in bytes.'
field :id, Types::GlobalIDType[::Upload],
null: false,
description: 'Global ID of the upload.'
field :path, GraphQL::Types::String,
null: false,
description: 'Path of the upload.'
field :size, GraphQL::Types::Int,
null: false,
description: 'Size of the upload in bytes.'
end
end

View File

@ -7,8 +7,9 @@ module Types
graphql_name 'WorkItemWidget'
field :type, ::Types::WorkItems::WidgetTypeEnum, null: true,
description: 'Widget type.'
field :type, ::Types::WorkItems::WidgetTypeEnum,
null: true,
description: 'Widget type.'
ORPHAN_TYPES = [
::Types::WorkItems::Widgets::DescriptionType,

View File

@ -12,14 +12,17 @@ module Types
implements Types::WorkItems::WidgetInterface
field :assignees, Types::UserType.connection_type, null: true,
description: 'Assignees of the work item.'
field :assignees, Types::UserType.connection_type,
null: true,
description: 'Assignees of the work item.'
field :allows_multiple_assignees, GraphQL::Types::Boolean, null: true, method: :allows_multiple_assignees?,
description: 'Indicates whether multiple assignees are allowed.'
field :allows_multiple_assignees, GraphQL::Types::Boolean,
null: true, method: :allows_multiple_assignees?,
description: 'Indicates whether multiple assignees are allowed.'
field :can_invite_members, GraphQL::Types::Boolean, null: false, resolver_method: :can_invite_members?,
description: 'Indicates whether the current user can invite members to the work item\'s project.'
field :can_invite_members, GraphQL::Types::Boolean,
null: false, resolver_method: :can_invite_members?,
description: 'Indicates whether the current user can invite members to the work item\'s project.'
def can_invite_members?
Ability.allowed?(current_user, :admin_project_member, object.work_item.project)

View File

@ -12,8 +12,9 @@ module Types
implements Types::WorkItems::WidgetInterface
field :description, GraphQL::Types::String, null: true,
description: 'Description of the work item.'
field :description, GraphQL::Types::String,
null: true,
description: 'Description of the work item.'
markdown_field :description_html, null: true do |resolved_object|
resolved_object.work_item

View File

@ -12,13 +12,13 @@ module Types
implements Types::WorkItems::WidgetInterface
field :parent, ::Types::WorkItemType, null: true,
description: 'Parent work item.',
complexity: 5
field :parent, ::Types::WorkItemType,
null: true, complexity: 5,
description: 'Parent work item.'
field :children, ::Types::WorkItemType.connection_type, null: true,
description: 'Child work items.',
complexity: 5
field :children, ::Types::WorkItemType.connection_type,
null: true, complexity: 5,
description: 'Child work items.'
def children
object.children.inc_relations_for_permission_check

View File

@ -12,11 +12,14 @@ module Types
implements Types::WorkItems::WidgetInterface
field :labels, Types::LabelType.connection_type, null: true,
description: 'Labels assigned to the work item.'
field :labels, Types::LabelType.connection_type,
null: true,
description: 'Labels assigned to the work item.'
field :allows_scoped_labels, GraphQL::Types::Boolean, null: true, method: :allows_scoped_labels?,
description: 'Indicates whether a scoped label is allowed.'
field :allows_scoped_labels, GraphQL::Types::Boolean,
null: true,
method: :allows_scoped_labels?,
description: 'Indicates whether a scoped label is allowed.'
end
# rubocop:enable Graphql/AuthorizeTypes
end

View File

@ -12,10 +12,12 @@ module Types
implements Types::WorkItems::WidgetInterface
field :due_date, Types::DateType, null: true,
description: 'Due date of the work item.'
field :start_date, Types::DateType, null: true,
description: 'Start date of the work item.'
field :due_date, Types::DateType,
null: true,
description: 'Due date of the work item.'
field :start_date, Types::DateType,
null: true,
description: 'Start date of the work item.'
end
# rubocop:enable Graphql/AuthorizeTypes
end

View File

@ -59,7 +59,7 @@ module Taskable
end
# Return a string that describes the current state of this Taskable's task
# list items, e.g. "12 of 20 tasks completed"
# list items, e.g. "12 of 20 checklist items completed"
def task_status(short: false)
return '' if description.blank?
@ -70,7 +70,7 @@ module Taskable
end
sum = tasks.summary
"#{sum.complete_count}#{prep}#{sum.item_count} #{'task'.pluralize(sum.item_count)}#{completed}"
"#{sum.complete_count}#{prep}#{sum.item_count} #{'checklist item'.pluralize(sum.item_count)}#{completed}"
end
# Return a short string that describes the current state of this Taskable's

View File

@ -22,7 +22,7 @@
= markdown_toolbar_button({ icon: "list-bulleted", data: { "md-tag" => "- ", "md-prepend" => true }, title: _("Add a bullet list") })
= markdown_toolbar_button({ icon: "list-numbered", data: { "md-tag" => "1. ", "md-prepend" => true }, title: _("Add a numbered list") })
= markdown_toolbar_button({ icon: "list-task", data: { "md-tag" => "- [ ] ", "md-prepend" => true }, title: _("Add a task list") })
= markdown_toolbar_button({ icon: "list-task", data: { "md-tag" => "- [ ] ", "md-prepend" => true }, title: _("Add a checklist") })
= markdown_toolbar_button({ icon: "details-block",
data: { "md-tag" => "<details><summary>Click to expand</summary>\n{text}\n</details>", "md-prepend" => true, "md-select" => "Click to expand" },
title: _("Add a collapsible section") })

View File

@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/366412
milestone: '15.3'
type: development
group: group::pipeline authoring
default_enabled: false
default_enabled: true

View File

@ -185,8 +185,8 @@ successfully, you must replicate their data using some other means.
|Feature | Replicated (added in GitLab version) | Verified (added in GitLab version) | GitLab-managed object storage replication (added in GitLab version) | GitLab-managed object storage verification (added in GitLab version) | Notes |
|:--------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------|:---------------------------------------------------------------------------|:--------------------------------------------------------------------|:----------------------------------------------------------------|:------|
|[Application data in PostgreSQL](../../postgresql/index.md) | **Yes** (10.2) | **Yes** (10.2) | N/A | N/A | |
|[Project repository](../../../user/project/repository/) | **Yes** (10.2) | **Yes** (10.7) | N/A | N/A | |
|[Project wiki repository](../../../user/project/wiki/) | **Yes** (10.2) | **Yes** (10.7) | N/A | N/A | |
|[Project repository](../../../user/project/repository/index.md) | **Yes** (10.2) | **Yes** (10.7) | N/A | N/A | |
|[Project wiki repository](../../../user/project/wiki/index.md) | **Yes** (10.2) | **Yes** (10.7) | N/A | N/A | |
|[Group wiki repository](../../../user/project/wiki/group.md) | [**Yes** (13.10)](https://gitlab.com/gitlab-org/gitlab/-/issues/208147) | No | N/A | N/A | Behind feature flag `geo_group_wiki_repository_replication`, enabled by default. |
|[Uploads](../../uploads.md) | **Yes** (10.2) | **Yes** (14.6) | [**Yes** (15.1)](https://gitlab.com/groups/gitlab-org/-/epics/5551) | [No](object_storage.md#verification-of-files-in-object-storage) | Replication is behind the feature flag `geo_upload_replication`, enabled by default. Verification was behind the feature flag `geo_upload_verification`, removed in 14.8. |
|[LFS objects](../../lfs/index.md) | **Yes** (10.2) | **Yes** (14.6) | [**Yes** (15.1)](https://gitlab.com/groups/gitlab-org/-/epics/5551) | [No](object_storage.md#verification-of-files-in-object-storage) | GitLab versions 11.11.x and 12.0.x are affected by [a bug that prevents any new LFS objects from replicating](https://gitlab.com/gitlab-org/gitlab/-/issues/32696).<br /><br />Replication is behind the feature flag `geo_lfs_object_replication`, enabled by default. Verification was behind the feature flag `geo_lfs_object_verification`, removed in 14.7. |

View File

@ -24,6 +24,17 @@ as GitLab to ensure full compatibility:
1. On the left sidebar, select **Overview > Gitaly Servers**.
1. Confirm all Gitaly servers indicate that they are up to date.
### Find storage resource details
You can run the following commands in a [Rails console](../operations/rails_console.md#starting-a-rails-console-session)
to determine the available and used space on a Gitaly storage:
```ruby
Gitlab::GitalyClient::ServerService.new("default").storage_disk_statistics
# For Gitaly Cluster
Gitlab::GitalyClient::ServerService.new("<storage name>").disk_statistics
```
### Use `gitaly-debug`
The `gitaly-debug` command provides "production debugging" tools for Gitaly and Git
@ -360,17 +371,6 @@ push, which causes a significant delay.
If Git pushes are too slow when Dynatrace is enabled, disable Dynatrace.
### Find storage resource details
You can run the following commands in a [Rails conosole](../operations/rails_console.md#starting-a-rails-console-session) to determine the available and used space on a
Gitaly storage:
```ruby
Gitlab::GitalyClient::ServerService.new("default").storage_disk_statistics
# For Gitaly Cluster
Gitlab::GitalyClient::ServerService.new("<storage name>").disk_statistics
```
## Troubleshoot Praefect (Gitaly Cluster)
The following sections provide possible solutions to Gitaly Cluster errors.

View File

@ -1433,28 +1433,6 @@ Prints the metrics saved in `conversational_development_index_metrics`.
rake gitlab:usage_data:generate_and_send
```
## Kubernetes integration
Find cluster:
```ruby
cluster = Clusters::Cluster.find(1)
cluster = Clusters::Cluster.find_by(name: 'cluster_name')
```
Delete cluster without associated resources:
```ruby
# Find users with the administrator access
user = User.find_by(username: 'admin_user')
# Find the cluster with the ID
cluster = Clusters::Cluster.find(1)
# Delete the cluster
Clusters::DestroyService.new(user).execute(cluster)
```
## Elasticsearch
### Configuration attributes

View File

@ -10,7 +10,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/229463) in GitLab 13.5.
> - Moved to GitLab Premium in 13.9.
Resource iteration events keep track of what happens to GitLab [issues](../user/project/issues/).
Resource iteration events keep track of what happens to GitLab [issues](../user/project/issues/index.md).
Use them to track which iteration was set, who did it, and when it happened.

View File

@ -9,7 +9,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/31720) in GitLab 13.1.
Resource [milestone](../user/project/milestones/index.md) events keep track of what happens to
GitLab [issues](../user/project/issues/) and [merge requests](../user/project/merge_requests/).
GitLab [issues](../user/project/issues/index.md) and [merge requests](../user/project/merge_requests/index.md).
Use them to track which milestone was added or removed, who did it, and when it happened.

View File

@ -8,8 +8,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35210/) in GitLab 13.2.
Resource state events keep track of what happens to GitLab [issues](../user/project/issues/) and
[merge requests](../user/project/merge_requests/).
Resource state events keep track of what happens to GitLab [issues](../user/project/issues/index.md) and
[merge requests](../user/project/merge_requests/index.md).
Use them to track which state was set, who did it, and when it happened.

View File

@ -8,7 +8,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32542) in GitLab 13.2.
Resource weight events keep track of what happens to GitLab [issues](../user/project/issues/).
Resource weight events keep track of what happens to GitLab [issues](../user/project/issues/index.md).
Use them to track which weight was set, who did it, and when it happened.

View File

@ -281,7 +281,7 @@ with the GraphQL API.
### GraphQL - Single vulnerability
Use [`Query.vulnerability`](graphql/reference/#queryvulnerability).
Use [`Query.vulnerability`](graphql/reference/index.md#queryvulnerability).
```graphql
{
@ -337,7 +337,7 @@ Example response:
### GraphQL - Confirm vulnerability
Use [`Mutation.vulnerabilityConfirm`](graphql/reference/#mutationvulnerabilityconfirm).
Use [`Mutation.vulnerabilityConfirm`](graphql/reference/index.md#mutationvulnerabilityconfirm).
```graphql
mutation {
@ -367,7 +367,7 @@ Example response:
### GraphQL - Resolve vulnerability
Use [`Mutation.vulnerabilityResolve`](graphql/reference/#mutationvulnerabilityresolve).
Use [`Mutation.vulnerabilityResolve`](graphql/reference/index.md#mutationvulnerabilityresolve).
```graphql
mutation {
@ -397,7 +397,7 @@ Example response:
### GraphQL - Dismiss vulnerability
Use [`Mutation.vulnerabilityDismiss`](graphql/reference/#mutationvulnerabilitydismiss).
Use [`Mutation.vulnerabilityDismiss`](graphql/reference/index.md#mutationvulnerabilitydismiss).
```graphql
mutation {
@ -427,7 +427,7 @@ Example response:
### GraphQL - Revert vulnerability to detected state
Use [`Mutation.vulnerabilityRevertToDetected`](graphql/reference/#mutationvulnerabilityreverttodetected).
Use [`Mutation.vulnerabilityRevertToDetected`](graphql/reference/index.md#mutationvulnerabilityreverttodetected).
```graphql
mutation {

View File

@ -148,7 +148,7 @@ with the GraphQL API.
### GraphQL - Project vulnerabilities
Use [`Project.vulnerabilities`](graphql/reference/#projectvulnerabilities).
Use [`Project.vulnerabilities`](graphql/reference/index.md#projectvulnerabilities).
```graphql
{

View File

@ -3318,7 +3318,7 @@ In this example, both jobs have the same behavior.
##### `rules:changes:compare_to`
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/293645) in GitLab 15.3 [with a flag](../../administration/feature_flags.md) named `ci_rules_changes_compare`. Disabled by default.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/293645) in GitLab 15.3 [with a flag](../../administration/feature_flags.md) named `ci_rules_changes_compare`. Enabled by default.
Use `rules:changes:compare_to` to specify which ref to compare against for changes to the files
listed under [`rules:changes:paths`](#ruleschangespaths).

View File

@ -51,15 +51,12 @@ The default timeout for Jest is set in
If your test exceeds that time, it fails.
If you cannot improve the performance of the tests, you can increase the timeout
for a specific test using
[`setTestTimeout`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/frontend/__helpers__/timeout.js).
for a specific test using [`jest.setTimeout`](https://jestjs.io/docs/27.x/jest-object#jestsettimeouttimeout)
```javascript
import { setTestTimeout } from 'helpers/timeout';
describe('Component', () => {
it('does something amazing', () => {
setTestTimeout(500);
jest.setTimeout(500);
// ...
});
});

View File

@ -46,3 +46,27 @@ To remove the Kubernetes cluster integration:
1. Go to your cluster details page.
1. Select the **Advanced Settings** tab.
1. Select either **Remove integration** or **Remove integration and resources**.
### Remove clusters by using the Rails console **(FREE SELF)**
[Start a Rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session).
To find a cluster:
``` ruby
cluster = Clusters::Cluster.find(1)
cluster = Clusters::Cluster.find_by(name: 'cluster_name')
```
To delete a cluster but not the associated resources:
```ruby
# Find users who have administrator access
user = User.find_by(username: 'admin_user')
# Find the cluster with the ID
cluster = Clusters::Cluster.find(1)
# Delete the cluster
Clusters::DestroyService.new(user).execute(cluster)
```

View File

@ -169,6 +169,7 @@ module.exports = (path, options = {}) => {
resolver: './jest_resolver.js',
setupFilesAfterEnv: [`<rootDir>/${path}/test_setup.js`, 'jest-canvas-mock'],
restoreMocks: true,
slowTestThreshold: process.env.CI ? 6000 : 500,
transform: {
'^.+\\.(gql|graphql)$': 'jest-transform-graphql',
'^.+_worker\\.js$': './spec/frontend/__helpers__/web_worker_transformer.js',

View File

@ -511,8 +511,8 @@ msgstr ""
msgid "%{completedCount} completed weight"
msgstr ""
msgid "%{completedCount} of %{count} task completed"
msgid_plural "%{completedCount} of %{count} tasks completed"
msgid "%{completedCount} of %{count} checklist item completed"
msgid_plural "%{completedCount} of %{count} checklist items completed"
msgstr[0] ""
msgstr[1] ""
@ -2130,6 +2130,9 @@ msgstr ""
msgid "Add a bullet list"
msgstr ""
msgid "Add a checklist"
msgstr ""
msgid "Add a collapsible section"
msgstr ""
@ -2169,9 +2172,6 @@ msgstr ""
msgid "Add a table"
msgstr ""
msgid "Add a task list"
msgstr ""
msgid "Add a title..."
msgstr ""

View File

@ -1,6 +1,5 @@
import fs from 'fs';
import jsYaml from 'js-yaml';
import { setTestTimeout } from 'jest/__helpers__/timeout';
import { renderHtmlAndJsonForAllExamples } from 'jest/content_editor/render_html_and_json_for_all_examples';
/* eslint-disable no-undef */
@ -24,7 +23,7 @@ jest.mock('~/emoji');
// This script should be invoked via jest with the a command similar to the following:
// yarn jest --testMatch '**/render_wysiwyg_html_and_json.js' ./scripts/lib/glfm/render_wysiwyg_html_and_json.js
it('serializes html to prosemirror json', async () => {
setTestTimeout(20000);
jest.setTimeout(20000);
const inputMarkdownTempfilePath = process.env.INPUT_MARKDOWN_YML_PATH;
expect(inputMarkdownTempfilePath).not.toBeUndefined();

View File

@ -89,7 +89,7 @@ RSpec.describe 'Task Lists', :js do
it 'provides a summary on Issues#index' do
visit project_issues_path(project)
expect(page).to have_content("2 of 6 tasks completed")
expect(page).to have_content("2 of 6 checklist items completed")
end
end
@ -108,7 +108,7 @@ RSpec.describe 'Task Lists', :js do
it 'provides a summary on Issues#index' do
visit project_issues_path(project)
expect(page).to have_content("0 of 1 task completed")
expect(page).to have_content("0 of 1 checklist item completed")
end
end
@ -127,7 +127,7 @@ RSpec.describe 'Task Lists', :js do
it 'provides a summary on Issues#index' do
visit project_issues_path(project)
expect(page).to have_content("1 of 1 task completed")
expect(page).to have_content("1 of 1 checklist item completed")
end
end
end
@ -253,7 +253,7 @@ RSpec.describe 'Task Lists', :js do
it 'provides a summary on MergeRequests#index' do
visit project_merge_requests_path(project)
expect(page).to have_content("2 of 6 tasks completed")
expect(page).to have_content("2 of 6 checklist items completed")
end
end
@ -278,7 +278,7 @@ RSpec.describe 'Task Lists', :js do
it 'provides a summary on MergeRequests#index' do
visit project_merge_requests_path(project)
expect(page).to have_content("0 of 1 task completed")
expect(page).to have_content("0 of 1 checklist item completed")
end
end
@ -297,7 +297,7 @@ RSpec.describe 'Task Lists', :js do
it 'provides a summary on MergeRequests#index' do
visit project_merge_requests_path(project)
expect(page).to have_content("1 of 1 task completed")
expect(page).to have_content("1 of 1 checklist item completed")
end
end
end

View File

@ -1,59 +0,0 @@
const NS_PER_SEC = 1e9;
const NS_PER_MS = 1e6;
const IS_DEBUGGING = process.execArgv.join(' ').includes('--inspect-brk');
let testTimeoutNS;
export const setTestTimeout = (newTimeoutMS) => {
const newTimeoutNS = newTimeoutMS * NS_PER_MS;
// never accept a smaller timeout than the default
if (newTimeoutNS < testTimeoutNS) {
return;
}
testTimeoutNS = newTimeoutNS;
jest.setTimeout(newTimeoutMS);
};
// Allows slow tests to set their own timeout.
// Useful for tests with jQuery, which is very slow in big DOMs.
let temporaryTimeoutNS = null;
export const setTestTimeoutOnce = (newTimeoutMS) => {
const newTimeoutNS = newTimeoutMS * NS_PER_MS;
// never accept a smaller timeout than the default
if (newTimeoutNS < testTimeoutNS) {
return;
}
temporaryTimeoutNS = newTimeoutNS;
};
export const initializeTestTimeout = (defaultTimeoutMS) => {
setTestTimeout(defaultTimeoutMS);
let testStartTime;
// https://github.com/facebook/jest/issues/6947
beforeEach(() => {
testStartTime = process.hrtime();
});
afterEach(() => {
let timeoutNS = testTimeoutNS;
if (Number.isFinite(temporaryTimeoutNS)) {
timeoutNS = temporaryTimeoutNS;
temporaryTimeoutNS = null;
}
const [seconds, remainingNs] = process.hrtime(testStartTime);
const elapsedNS = seconds * NS_PER_SEC + remainingNs;
// Disable the timeout error when debugging. It is meaningless because
// debugging always takes longer than the test timeout.
if (elapsedNS > timeoutNS && !IS_DEBUGGING) {
throw new Error(
`Test took too long (${elapsedNS / NS_PER_MS}ms > ${timeoutNS / NS_PER_MS}ms)!`,
);
}
});
};

View File

@ -1,7 +1,6 @@
import MockAdapter from 'axios-mock-adapter';
import { loadHTMLFixture, resetHTMLFixture } from 'helpers/fixtures';
import { useMockLocationHelper } from 'helpers/mock_window_location_helper';
import { setTestTimeout } from 'helpers/timeout';
import Clusters from '~/clusters/clusters_bundle';
import axios from '~/lib/utils/axios_utils';
import initProjectSelectDropdown from '~/project_select';
@ -12,8 +11,6 @@ jest.mock('~/project_select');
useMockLocationHelper();
describe('Clusters', () => {
setTestTimeout(1000);
let cluster;
let mock;

View File

@ -32,7 +32,7 @@ describe('content_editor/components/top_toolbar', () => {
${'link'} | ${{}}
${'bullet-list'} | ${{ contentType: 'bulletList', iconName: 'list-bulleted', label: 'Add a bullet list', editorCommand: 'toggleBulletList' }}
${'ordered-list'} | ${{ contentType: 'orderedList', iconName: 'list-numbered', label: 'Add a numbered list', editorCommand: 'toggleOrderedList' }}
${'task-list'} | ${{ contentType: 'taskList', iconName: 'list-task', label: 'Add a task list', editorCommand: 'toggleTaskList' }}
${'task-list'} | ${{ contentType: 'taskList', iconName: 'list-task', label: 'Add a checklist', editorCommand: 'toggleTaskList' }}
${'image'} | ${{}}
${'table'} | ${{}}
${'more'} | ${{}}

View File

@ -2,7 +2,6 @@ import fs from 'fs';
import jsYaml from 'js-yaml';
import { memoize } from 'lodash';
import { createContentEditor } from '~/content_editor';
import { setTestTimeoutOnce } from 'helpers/timeout';
const getFocusedMarkdownExamples = memoize(
() => process.env.FOCUSED_MARKDOWN_EXAMPLES?.split(',') || [],
@ -76,9 +75,6 @@ export const describeMarkdownProcessing = (description, markdownYamlPath) => {
}
it(exampleName, async () => {
if (name === 'frontmatter_toml') {
setTestTimeoutOnce(2000);
}
await testSerializesHtmlToMarkdownForElement(example);
});
});

View File

@ -249,7 +249,7 @@ describe('Description component', () => {
await nextTick();
expect(document.querySelector('.issuable-meta #task_status_short').textContent.trim()).toBe(
'1/1 task',
'1/1 checklist item',
);
});

View File

@ -9,7 +9,6 @@ import { mount, shallowMount } from '@vue/test-utils';
import timezoneMock from 'timezone-mock';
import { nextTick } from 'vue';
import { TEST_HOST } from 'helpers/test_constants';
import { setTestTimeout } from 'helpers/timeout';
import { shallowWrapperContainsSlotText } from 'helpers/vue_test_utils_helper';
import TimeSeries from '~/monitoring/components/charts/time_series.vue';
import { panelTypes, chartHeight } from '~/monitoring/constants';
@ -59,10 +58,6 @@ describe('Time series component', () => {
});
};
beforeEach(() => {
setTestTimeout(1000);
});
afterEach(() => {
wrapper.destroy();
});

View File

@ -3,7 +3,6 @@ import { shallowMount } from '@vue/test-utils';
import AxiosMockAdapter from 'axios-mock-adapter';
import Vuex from 'vuex';
import { nextTick } from 'vue';
import { setTestTimeout } from 'helpers/timeout';
import axios from '~/lib/utils/axios_utils';
import MonitorAnomalyChart from '~/monitoring/components/charts/anomaly.vue';
@ -72,8 +71,6 @@ describe('Dashboard Panel', () => {
};
beforeEach(() => {
setTestTimeout(1000);
store = createStore();
state = store.state.monitoringDashboard;

View File

@ -4,7 +4,6 @@ import $ from 'jquery';
import { nextTick } from 'vue';
import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures';
import setWindowLocation from 'helpers/set_window_location_helper';
import { setTestTimeout } from 'helpers/timeout';
import waitForPromises from 'helpers/wait_for_promises';
import DraftNote from '~/batch_comments/components/draft_note.vue';
import batchComments from '~/batch_comments/stores/modules/batch_comments';
@ -19,8 +18,6 @@ import '~/behaviors/markdown/render_gfm';
import OrderedLayout from '~/vue_shared/components/ordered_layout.vue';
import * as mockData from '../mock_data';
setTestTimeout(1000);
const TYPE_COMMENT_FORM = 'comment-form';
const TYPE_NOTES_LIST = 'notes-list';

View File

@ -7,7 +7,6 @@ import { loadHTMLFixture, resetHTMLFixture } from 'helpers/fixtures';
import { createSpyObj } from 'helpers/jest_helpers';
import { TEST_HOST } from 'helpers/test_constants';
import waitForPromises from 'helpers/wait_for_promises';
import { setTestTimeoutOnce } from 'helpers/timeout';
import axios from '~/lib/utils/axios_utils';
import * as urlUtility from '~/lib/utils/url_utility';
@ -48,7 +47,6 @@ describe.skip('Old Notes (~/deprecated_notes.js)', () => {
// random failures.
// It seems that running tests in parallel increases failure rate.
jest.setTimeout(4000);
setTestTimeoutOnce(4000);
});
afterEach(async () => {

View File

@ -123,7 +123,7 @@ describe('packages_list_row', () => {
findDeleteDropdown().vm.$emit('click');
await nextTick();
expect(wrapper.emitted('packageToDelete')).toBeTruthy();
expect(wrapper.emitted('packageToDelete')).toHaveLength(1);
expect(wrapper.emitted('packageToDelete')[0]).toEqual([packageWithoutTags]);
});
});

View File

@ -2,9 +2,6 @@
// eslint-disable-next-line no-restricted-syntax
import { setImmediate } from 'timers';
import 'helpers/shared_test_setup';
import { initializeTestTimeout } from 'helpers/timeout';
initializeTestTimeout(process.env.CI ? 6000 : 500);
afterEach(() =>
// give Promises a bit more time so they fail the right test

View File

@ -137,7 +137,7 @@ describe('MRWidgetAutoMergeEnabled', () => {
await waitForPromises();
expect(wrapper.vm.isCancellingAutoMerge).toBeTruthy();
expect(wrapper.vm.isCancellingAutoMerge).toBe(true);
if (mergeRequestWidgetGraphql) {
expect(eventHub.$emit).toHaveBeenCalledWith('MRWidgetUpdateRequested');
} else {

View File

@ -124,13 +124,13 @@ describe('MrWidgetOptions', () => {
it('should return true when hasCI is true', () => {
wrapper.vm.mr.hasCI = true;
expect(wrapper.vm.shouldRenderPipelines).toBeTruthy();
expect(wrapper.vm.shouldRenderPipelines).toBe(true);
});
it('should return false when hasCI is false', () => {
wrapper.vm.mr.hasCI = false;
expect(wrapper.vm.shouldRenderPipelines).toBeFalsy();
expect(wrapper.vm.shouldRenderPipelines).toBe(false);
});
});
@ -303,7 +303,7 @@ describe('MrWidgetOptions', () => {
expect(wrapper.vm.service.checkStatus).toHaveBeenCalled();
expect(wrapper.vm.mr.setData).toHaveBeenCalled();
expect(wrapper.vm.handleNotification).toHaveBeenCalledWith(mockData);
expect(isCbExecuted).toBeTruthy();
expect(isCbExecuted).toBe(true);
});
});
});

View File

@ -53,7 +53,7 @@ describe('Markdown field header component', () => {
'Add a link (⌘K)',
'Add a bullet list',
'Add a numbered list',
'Add a task list',
'Add a checklist',
'Add a collapsible section',
'Add a table',
'Go full screen',

View File

@ -349,7 +349,7 @@ describe('IssuableItem', () => {
wrapper = createComponent();
const taskStatus = wrapper.find('[data-testid="task-status"]');
const expected = `${mockIssuable.taskCompletionStatus.completedCount} of ${mockIssuable.taskCompletionStatus.count} tasks completed`;
const expected = `${mockIssuable.taskCompletionStatus.completedCount} of ${mockIssuable.taskCompletionStatus.count} checklist items completed`;
expect(taskStatus.text()).toBe(expected);
});

View File

@ -125,7 +125,7 @@ describe('IssuableHeader', () => {
createComponent();
expect(findTaskStatusEl().exists()).toBe(true);
expect(findTaskStatusEl().text()).toContain('0 of 5 tasks completed');
expect(findTaskStatusEl().text()).toContain('0 of 5 checklist items completed');
});
it('does not render task status text when tasks count is 0', () => {

View File

@ -1,6 +1,5 @@
import { nextTick } from 'vue';
import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures';
import { setTestTimeout } from 'helpers/timeout';
import waitForPromises from 'helpers/wait_for_promises';
import { waitForText } from 'helpers/wait_for_text';
import { useOverclockTimers } from 'test_helpers/utils/overclock_timers';
@ -17,9 +16,6 @@ describe('WebIDE', () => {
beforeEach(() => {
stubPerformanceWebAPI();
// For some reason these tests were timing out in CI.
// We will investigate in https://gitlab.com/gitlab-org/gitlab/-/issues/298714
setTestTimeout(20000);
setHTMLFixture('<div class="webide-container"></div>');
container = document.querySelector('.webide-container');
});

View File

@ -1,7 +1,3 @@
import { initializeTestTimeout } from 'helpers/timeout';
initializeTestTimeout(process.env.CI ? 20000 : 7000);
beforeEach(() => {
window.gon = {
api_version: 'v4',

View File

@ -299,7 +299,7 @@ RSpec.describe IssuablesHelper do
initialTitleText: issue.title,
initialDescriptionHtml: '<p dir="auto">issue text</p>',
initialDescriptionText: 'issue text',
initialTaskStatus: '0 of 0 tasks completed',
initialTaskStatus: '0 of 0 checklist items completed',
issueType: 'issue',
iid: issue.iid.to_s,
isHidden: false

View File

@ -18,9 +18,9 @@ RSpec.shared_examples 'a Taskable' do
it 'returns the correct task status' do
expect(subject.task_status).to match('2 of')
expect(subject.task_status).to match('5 tasks completed')
expect(subject.task_status).to match('5 checklist items completed')
expect(subject.task_status_short).to match('2/')
expect(subject.task_status_short).to match('5 tasks')
expect(subject.task_status_short).to match('5 checklist items')
end
describe '#tasks?' do
@ -53,9 +53,9 @@ RSpec.shared_examples 'a Taskable' do
it 'returns the correct task status' do
expect(subject.task_status).to match('3 of')
expect(subject.task_status).to match('9 tasks completed')
expect(subject.task_status).to match('9 checklist items completed')
expect(subject.task_status_short).to match('3/')
expect(subject.task_status_short).to match('9 tasks')
expect(subject.task_status_short).to match('9 checklist items')
end
end
@ -68,9 +68,9 @@ RSpec.shared_examples 'a Taskable' do
it 'returns the correct task status' do
expect(subject.task_status).to match('0 of')
expect(subject.task_status).to match('1 task completed')
expect(subject.task_status).to match('1 checklist item completed')
expect(subject.task_status_short).to match('0/')
expect(subject.task_status_short).to match('1 task')
expect(subject.task_status_short).to match('1 checklist item')
end
end
@ -87,9 +87,9 @@ RSpec.shared_examples 'a Taskable' do
it 'returns the correct task status' do
expect(subject.task_status).to match('0 of')
expect(subject.task_status).to match('0 tasks completed')
expect(subject.task_status).to match('0 checklist items completed')
expect(subject.task_status_short).to match('0/')
expect(subject.task_status_short).to match('0 task')
expect(subject.task_status_short).to match('0 checklist items')
end
end
@ -102,9 +102,9 @@ RSpec.shared_examples 'a Taskable' do
it 'returns the correct task status' do
expect(subject.task_status).to match('1 of')
expect(subject.task_status).to match('1 task completed')
expect(subject.task_status).to match('1 checklist item completed')
expect(subject.task_status_short).to match('1/')
expect(subject.task_status_short).to match('1 task')
expect(subject.task_status_short).to match('1 checklist item')
end
end
@ -123,9 +123,9 @@ RSpec.shared_examples 'a Taskable' do
it 'returns the correct task status' do
expect(subject.task_status).to match('2 of')
expect(subject.task_status).to match('4 tasks completed')
expect(subject.task_status).to match('4 checklist items completed')
expect(subject.task_status_short).to match('2/')
expect(subject.task_status_short).to match('4 tasks')
expect(subject.task_status_short).to match('4 checklist items')
end
end
end