Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-01-24 15:10:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-01-24 15:10:54 +0300
commit4d3bbc4990ead10831a087cece3ccdd25dc4f0b4 (patch)
treed6daa91eaae8318b7b26bc1b9bfbbb8f7a295da0
parent94df43c8c19e64afb29e8491b92c3d258f6814ea (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.rubocop_todo/graphql/field_definitions.yml4
-rw-r--r--.rubocop_todo/rspec/timecop_freeze.yml2
-rw-r--r--GITALY_SERVER_VERSION2
-rw-r--r--app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue7
-rw-r--r--app/assets/javascripts/boards/components/board_new_item.vue13
-rw-r--r--app/assets/javascripts/editor/extensions/source_editor_yaml_ext.js94
-rw-r--r--app/controllers/projects/design_management/designs_controller.rb1
-rw-r--r--app/graphql/types/commit_type.rb14
-rw-r--r--app/graphql/types/group_type.rb18
-rw-r--r--app/graphql/types/issue_type.rb5
-rw-r--r--app/graphql/types/label_type.rb3
-rw-r--r--app/helpers/issuables_helper.rb5
-rw-r--r--app/models/issue.rb1
-rw-r--r--app/models/pages_domain.rb4
-rw-r--r--app/services/incident_management/create_incident_label_service.rb22
-rw-r--r--app/views/admin/broadcast_messages/index.html.haml58
-rw-r--r--app/views/projects/edit.html.haml2
-rw-r--r--app/views/projects/merge_requests/show.html.haml2
-rw-r--r--app/workers/all_queues.yml12
-rw-r--r--app/workers/hashed_storage/migrator_worker.rb3
-rw-r--r--app/workers/hashed_storage/project_migrate_worker.rb3
-rw-r--r--app/workers/hashed_storage/project_rollback_worker.rb3
-rw-r--r--app/workers/hashed_storage/rollbacker_worker.rb3
-rw-r--r--config/metrics/counts_all/20210216180451_incident_labeled_issues.yml3
-rw-r--r--config/routes.rb1
-rw-r--r--doc/development/documentation/styleguide/index.md9
-rw-r--r--doc/development/documentation/styleguide/word_list.md4
-rw-r--r--doc/development/service_ping/implement.md2
-rw-r--r--doc/development/value_stream_analytics.md4
-rw-r--r--doc/user/permissions.md6
-rw-r--r--lib/gitlab/usage_data.rb1
-rw-r--r--locale/gitlab.pot9
-rw-r--r--qa/qa/specs/features/api/1_manage/migration/gitlab_migration_group_spec.rb6
-rw-r--r--qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb6
-rw-r--r--qa/qa/specs/features/api/1_manage/migration/gitlab_migration_mr_spec.rb6
-rw-r--r--qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb6
-rw-r--r--qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb9
-rw-r--r--spec/factories/labels.rb7
-rw-r--r--spec/factories/usage_data.rb8
-rw-r--r--spec/frontend/boards/components/board_new_item_spec.js34
-rw-r--r--spec/frontend/editor/source_editor_yaml_ext_spec.js102
-rw-r--r--spec/helpers/issuables_helper_spec.rb10
-rw-r--r--spec/lib/api/entities/basic_project_details_spec.rb2
-rw-r--r--spec/lib/api/helpers_spec.rb2
-rw-r--r--spec/lib/backup/gitaly_backup_spec.rb6
-rw-r--r--spec/lib/backup/gitaly_rpc_backup_spec.rb6
-rw-r--r--spec/lib/backup/repositories_spec.rb6
-rw-r--r--spec/lib/banzai/filter/references/issue_reference_filter_spec.rb2
-rw-r--r--spec/lib/banzai/object_renderer_spec.rb2
-rw-r--r--spec/lib/feature_spec.rb4
-rw-r--r--spec/lib/gitlab/ci/config/external/rules_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/5_minute_production_app_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/Jobs/build_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/Jobs/code_quality_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/Jobs/deploy_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/Jobs/sast_iac_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/Terraform/base_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/Terraform/base_latest_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/Verify/load_performance_testing_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb4
-rw-r--r--spec/lib/gitlab/ci/templates/flutter_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/kaniko_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/npm_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/terraform_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/templates/terraform_latest_gitlab_ci_yaml_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/variables/builder_spec.rb2
-rw-r--r--spec/lib/gitlab/diff/file_spec.rb6
-rw-r--r--spec/lib/gitlab/diff/position_tracer/image_strategy_spec.rb2
-rw-r--r--spec/lib/gitlab/diff/position_tracer/line_strategy_spec.rb2
-rw-r--r--spec/lib/gitlab/diff/position_tracer_spec.rb2
-rw-r--r--spec/lib/gitlab/git/wiki_spec.rb2
-rw-r--r--spec/lib/gitlab/git_access_design_spec.rb2
-rw-r--r--spec/lib/gitlab/gl_repository/identifier_spec.rb4
-rw-r--r--spec/lib/gitlab/gl_repository/repo_type_spec.rb4
-rw-r--r--spec/lib/gitlab/graphql/markdown_field_spec.rb2
-rw-r--r--spec/lib/gitlab/project_authorizations_spec.rb2
-rw-r--r--spec/lib/gitlab/usage_data_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/analytics_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/ci_cd_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/confluence_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/deployments_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/external_issue_tracker_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/external_wiki_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/hidden_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/infrastructure_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/invite_team_members_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/issues_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/merge_requests_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/monitor_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/packages_registries_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/project_information_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/repository_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/scope_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/security_compliance_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/settings_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/shimo_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/snippets_menu_spec.rb2
-rw-r--r--spec/lib/sidebars/projects/menus/wiki_menu_spec.rb2
-rw-r--r--spec/models/issue_spec.rb20
-rw-r--r--spec/models/pages_domain_spec.rb5
-rw-r--r--spec/services/incident_management/create_incident_label_service_spec.rb7
-rw-r--r--spec/services/incident_management/incidents/create_service_spec.rb17
-rw-r--r--spec/services/issues/create_service_spec.rb7
-rw-r--r--spec/support/shared_examples/services/incident_shared_examples.rb13
106 files changed, 340 insertions, 383 deletions
diff --git a/.rubocop_todo/graphql/field_definitions.yml b/.rubocop_todo/graphql/field_definitions.yml
index 35ed870fa41..e1245a53409 100644
--- a/.rubocop_todo/graphql/field_definitions.yml
+++ b/.rubocop_todo/graphql/field_definitions.yml
@@ -1,10 +1,6 @@
---
GraphQL/FieldDefinitions:
Exclude:
- - app/graphql/types/commit_type.rb
- - app/graphql/types/group_type.rb
- - app/graphql/types/issue_type.rb
- - app/graphql/types/label_type.rb
- ee/app/graphql/types/ci/code_quality_degradation_type.rb
- ee/app/graphql/types/epic_type.rb
- ee/app/graphql/types/group_release_stats_type.rb
diff --git a/.rubocop_todo/rspec/timecop_freeze.yml b/.rubocop_todo/rspec/timecop_freeze.yml
index 8deefee1164..2967793e42a 100644
--- a/.rubocop_todo/rspec/timecop_freeze.yml
+++ b/.rubocop_todo/rspec/timecop_freeze.yml
@@ -1,8 +1,6 @@
---
RSpec/TimecopFreeze:
Exclude:
- - ee/spec/lib/gitlab/analytics/cycle_analytics/data_collector_spec.rb
- - ee/spec/lib/gitlab/insights/reducers/count_per_period_reducer_spec.rb
- ee/spec/models/merge_train_spec.rb
- ee/spec/support/shared_contexts/lib/gitlab/insights/reducers/reducers_shared_contexts.rb
- qa/spec/support/repeater_spec.rb
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION
index b15c9dc5304..5fa2f11b0dc 100644
--- a/GITALY_SERVER_VERSION
+++ b/GITALY_SERVER_VERSION
@@ -1 +1 @@
-3f6bb782a56a34cca7d7c45493119dc2c457b303
+7b20a6045e8d2a25c86633461c03b13353915643
diff --git a/app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue b/app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue
index 90c9113e0e1..96584080d0f 100644
--- a/app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue
+++ b/app/assets/javascripts/add_context_commits_modal/components/add_context_commits_modal_wrapper.vue
@@ -1,5 +1,5 @@
<script>
-import { GlModal, GlTabs, GlTab, GlSearchBoxByType, GlSprintf } from '@gitlab/ui';
+import { GlModal, GlTabs, GlTab, GlSearchBoxByType, GlSprintf, GlBadge } from '@gitlab/ui';
import { mapState, mapActions } from 'vuex';
import ReviewTabContainer from '~/add_context_commits_modal/components/review_tab_container.vue';
import createFlash from '~/flash';
@@ -21,6 +21,7 @@ export default {
ReviewTabContainer,
GlSearchBoxByType,
GlSprintf,
+ GlBadge,
},
props: {
contextCommitsPath: {
@@ -239,7 +240,7 @@ export default {
<template #title>
<gl-sprintf :message="__(`Commits in %{codeStart}${targetBranch}%{codeEnd}`)">
<template #code="{ content }">
- <code>{{ content }}</code>
+ <code class="gl-ml-2">{{ content }}</code>
</template>
</gl-sprintf>
</template>
@@ -262,7 +263,7 @@ export default {
<gl-tab>
<template #title>
{{ __('Selected commits') }}
- <span class="badge badge-pill">{{ selectedCommitsCount }}</span>
+ <gl-badge size="sm" class="gl-ml-2">{{ selectedCommitsCount }}</gl-badge>
</template>
<review-tab-container
:is-loading="isLoadingContextCommits"
diff --git a/app/assets/javascripts/boards/components/board_new_item.vue b/app/assets/javascripts/boards/components/board_new_item.vue
index 44574de17d7..600917683cd 100644
--- a/app/assets/javascripts/boards/components/board_new_item.vue
+++ b/app/assets/javascripts/boards/components/board_new_item.vue
@@ -43,6 +43,12 @@ export default {
// eslint-disable-next-line @gitlab/require-i18n-strings
return `${this.list.id}-title`;
},
+ isIssueTitleEmpty() {
+ return this.title.trim() === '';
+ },
+ isCreatingIssueDisabled() {
+ return this.isIssueTitleEmpty || this.disableSubmit;
+ },
},
methods: {
handleFormCancel() {
@@ -54,7 +60,7 @@ export default {
eventHub.$emit(`scroll-board-list-${this.list.id}`);
this.$emit('form-submit', {
- title,
+ title: title.trim(),
list,
});
},
@@ -69,7 +75,7 @@ export default {
<label :for="inputFieldId" class="gl-font-weight-bold">{{ __('Title') }}</label>
<gl-form-input
:id="inputFieldId"
- v-model.trim="title"
+ v-model="title"
:autofocus="true"
autocomplete="off"
type="text"
@@ -78,7 +84,8 @@ export default {
<slot></slot>
<div class="gl-clearfix gl-mt-4">
<gl-button
- :disabled="!title || disableSubmit"
+ data-testid="create-button"
+ :disabled="isCreatingIssueDisabled"
class="gl-float-left js-no-auto-disable"
variant="confirm"
type="submit"
diff --git a/app/assets/javascripts/editor/extensions/source_editor_yaml_ext.js b/app/assets/javascripts/editor/extensions/source_editor_yaml_ext.js
index 05ce617ca7c..2fba02f212b 100644
--- a/app/assets/javascripts/editor/extensions/source_editor_yaml_ext.js
+++ b/app/assets/javascripts/editor/extensions/source_editor_yaml_ext.js
@@ -20,33 +20,6 @@ export class YamlEditorExtension {
}
/**
- * Extends the source editor with capabilities for yaml files.
- *
- * @param {module:source_editor_instance~EditorInstance} instance - The Source Editor instance
- * @param {YamlEditorExtensionOptions} setupOptions
- */
- onSetup(instance, setupOptions = {}) {
- const { enableComments = false, highlightPath = null, model = null } = setupOptions;
- this.enableComments = enableComments;
- this.highlightPath = highlightPath;
- this.model = model;
-
- if (model) {
- this.initFromModel(instance, model);
- }
-
- instance.onDidChangeModelContent(() => instance.onUpdate());
- }
-
- initFromModel(instance, model) {
- const doc = new Document(model);
- if (this.enableComments) {
- YamlEditorExtension.transformComments(doc);
- }
- instance.setValue(doc.toString());
- }
-
- /**
* @private
* This wraps long comments to a maximum line length of 80 chars.
*
@@ -164,10 +137,10 @@ export class YamlEditorExtension {
if (!path) throw Error(`No path provided.`);
const blob = instance.getValue();
const doc = parseDocument(blob);
- const pathArray = toPath(path);
+ const pathArray = Array.isArray(path) ? path : toPath(path);
if (!doc.getIn(pathArray)) {
- throw Error(`The node ${path} could not be found inside the document.`);
+ return [null, null];
}
const parentNode = doc.getIn(pathArray.slice(0, pathArray.length - 1));
@@ -190,6 +163,33 @@ export class YamlEditorExtension {
return [startLine, endLine];
}
+ /**
+ * Extends the source editor with capabilities for yaml files.
+ *
+ * @param {module:source_editor_instance~EditorInstance} instance - The Source Editor instance
+ * @param {YamlEditorExtensionOptions} setupOptions
+ */
+ onSetup(instance, setupOptions = {}) {
+ const { enableComments = false, highlightPath = null, model = null } = setupOptions;
+ this.enableComments = enableComments;
+ this.highlightPath = highlightPath;
+ this.model = model;
+
+ if (model) {
+ this.initFromModel(instance, model);
+ }
+
+ instance.onDidChangeModelContent(() => instance.onUpdate());
+ }
+
+ initFromModel(instance, model) {
+ const doc = new Document(model);
+ if (this.enableComments) {
+ YamlEditorExtension.transformComments(doc);
+ }
+ instance.setValue(doc.toString());
+ }
+
setDoc(instance, doc) {
if (this.enableComments) {
YamlEditorExtension.transformComments(doc);
@@ -202,18 +202,31 @@ export class YamlEditorExtension {
}
}
- highlight(instance, path) {
+ highlight(instance, path, keepOnNotFound = false) {
// IMPORTANT
// removeHighlight and highlightLines both come from
// SourceEditorExtension. So it has to be installed prior to this extension
if (this.highlightPath === path) return;
- if (!path) {
+
+ if (!path || !path.length) {
instance.removeHighlights();
- } else {
- const res = YamlEditorExtension.locate(instance, path);
- instance.highlightLines(res);
+ this.highlightPath = null;
+ return;
}
- this.highlightPath = path || null;
+
+ const [startLine, endLine] = YamlEditorExtension.locate(instance, path);
+
+ if (startLine === null) {
+ // Path could not be found.
+ if (!keepOnNotFound) {
+ instance.removeHighlights();
+ this.highlightPath = null;
+ }
+ return;
+ }
+
+ instance.highlightLines([startLine, endLine]);
+ this.highlightPath = path;
}
provides() {
@@ -283,18 +296,23 @@ export class YamlEditorExtension {
* Add a line highlight style to the node specified by the path.
*
* @param {module:source_editor_instance~EditorInstance} instance - The Source Editor instance
- * @param {string|null|false} path A path to a node of the Editor's value,
+ * @param {string|(string|number)[]|null|false} path A path to a node
+ * of the Editor's
+ * value,
* e.g. `"foo.bar[0]"`. If the value is falsy, this will remove all
* highlights.
+ * @param {boolean} [keepOnNotFound=false] If the passed path cannot
+ * be located, keep the previous highlight state
*/
- highlight: (instance, path) => this.highlight(instance, path),
+ highlight: (instance, path, keepOnNotFound) => this.highlight(instance, path, keepOnNotFound),
/**
* Return the line numbers of a certain node identified by `path` within
* the yaml.
*
* @param {module:source_editor_instance~EditorInstance} instance - The Source Editor instance
- * @param {string} path A path to a node, eg. `foo.bar[0]`
+ * @param {string|(string|number)[]} path A path to a node, eg.
+ * `foo.bar[0]`
* @returns {number[]} Array following the schema `[firstLine, lastLine]`
* (both inclusive)
*
diff --git a/app/controllers/projects/design_management/designs_controller.rb b/app/controllers/projects/design_management/designs_controller.rb
index 550d8578396..2aa48249c0e 100644
--- a/app/controllers/projects/design_management/designs_controller.rb
+++ b/app/controllers/projects/design_management/designs_controller.rb
@@ -4,6 +4,7 @@ class Projects::DesignManagement::DesignsController < Projects::ApplicationContr
before_action :authorize_read_design!
feature_category :design_management
+ urgency :low
private
diff --git a/app/graphql/types/commit_type.rb b/app/graphql/types/commit_type.rb
index 2584e15ff0b..8bc00359ccb 100644
--- a/app/graphql/types/commit_type.rb
+++ b/app/graphql/types/commit_type.rb
@@ -10,33 +10,37 @@ module Types
field :id, type: GraphQL::Types::ID, null: false,
description: 'ID (global ID) of the commit.'
+
field :sha, type: GraphQL::Types::String, null: false,
description: 'SHA1 ID of the commit.'
+
field :short_id, type: GraphQL::Types::String, null: false,
description: 'Short SHA1 ID of the commit.'
field :title, type: GraphQL::Types::String, null: true, calls_gitaly: true,
description: 'Title of the commit message.'
- markdown_field :title_html, null: true
field :full_title, type: GraphQL::Types::String, null: true, calls_gitaly: true,
description: 'Full title of the commit message.'
- markdown_field :full_title_html, null: true
field :description, type: GraphQL::Types::String, null: true,
description: 'Description of the commit message.'
- markdown_field :description_html, null: true
field :message, type: GraphQL::Types::String, null: true,
description: 'Raw commit message.'
+
field :authored_date, type: Types::TimeType, null: true,
description: 'Timestamp of when the commit was authored.'
+
field :web_url, type: GraphQL::Types::String, null: false,
description: 'Web URL of the commit.'
+
field :web_path, type: GraphQL::Types::String, null: false,
description: 'Web path of the commit.'
+
field :signature_html, type: GraphQL::Types::String, null: true, calls_gitaly: true,
description: 'Rendered HTML of the commit signature.'
+
field :author_name, type: GraphQL::Types::String, null: true,
description: 'Commit authors name.'
field :author_email, type: GraphQL::Types::String, null: true,
@@ -53,6 +57,10 @@ module Types
description: 'Pipelines of the commit ordered latest first.',
resolver: Resolvers::CommitPipelinesResolver
+ markdown_field :title_html, null: true
+ markdown_field :full_title_html, null: true
+ markdown_field :description_html, null: true
+
def author_gravatar
GravatarService.new.execute(object.author_email, 40)
end
diff --git a/app/graphql/types/group_type.rb b/app/graphql/types/group_type.rb
index 04ab66f8e93..5f63aa20953 100644
--- a/app/graphql/types/group_type.rb
+++ b/app/graphql/types/group_type.rb
@@ -176,15 +176,6 @@ module Types
null: true,
description: 'Dependency proxy TTL policy for the group.'
- def label(title:)
- BatchLoader::GraphQL.for(title).batch(key: group) do |titles, loader, args|
- LabelsFinder
- .new(current_user, group: args[:key], title: titles)
- .execute
- .each { |label| loader.call(label.title, label) }
- end
- end
-
field :labels,
Types::LabelType.connection_type,
null: true,
@@ -221,6 +212,15 @@ module Types
description: 'Work item types available to the group.',
feature_flag: :work_items
+ def label(title:)
+ BatchLoader::GraphQL.for(title).batch(key: group) do |titles, loader, args|
+ LabelsFinder
+ .new(current_user, group: args[:key], title: titles)
+ .execute
+ .each { |label| loader.call(label.title, label) }
+ end
+ end
+
def avatar_url
object.avatar_url(only_path: false)
end
diff --git a/app/graphql/types/issue_type.rb b/app/graphql/types/issue_type.rb
index 46fe91feae4..76046ea9954 100644
--- a/app/graphql/types/issue_type.rb
+++ b/app/graphql/types/issue_type.rb
@@ -21,10 +21,8 @@ module Types
description: "Internal ID of the issue."
field :title, GraphQL::Types::String, null: false,
description: 'Title of the issue.'
- markdown_field :title_html, null: true
field :description, GraphQL::Types::String, null: true,
description: 'Description of the issue.'
- markdown_field :description_html, null: true
field :state, IssueStateEnum, null: false,
description: 'State of the issue.'
@@ -143,6 +141,9 @@ module Types
field :escalation_status, Types::IncidentManagement::EscalationStatusEnum, null: true,
description: 'Escalation status of the issue.'
+ markdown_field :title_html, null: true
+ markdown_field :description_html, null: true
+
def author
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.author_id).find
end
diff --git a/app/graphql/types/label_type.rb b/app/graphql/types/label_type.rb
index bb2d561014e..5a10bcfee74 100644
--- a/app/graphql/types/label_type.rb
+++ b/app/graphql/types/label_type.rb
@@ -12,7 +12,6 @@ module Types
description: 'Label ID.'
field :description, GraphQL::Types::String, null: true,
description: 'Description of the label (Markdown rendered as HTML for caching).'
- markdown_field :description_html, null: true
field :title, GraphQL::Types::String, null: false,
description: 'Content of the label.'
field :color, GraphQL::Types::String, null: false,
@@ -23,5 +22,7 @@ module Types
description: 'When this label was created.'
field :updated_at, Types::TimeType, null: false,
description: 'When this label was last updated.'
+
+ markdown_field :description_html, null: true
end
end
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb
index 53a7487741e..ec1f8ca5f00 100644
--- a/app/helpers/issuables_helper.rb
+++ b/app/helpers/issuables_helper.rb
@@ -201,10 +201,7 @@ module IssuablesHelper
count = issuables_count_for_state(issuable_type, state)
if count != -1
- html << " " << content_tag(:span,
- format_count(issuable_type, count, Gitlab::IssuablesCountForState::THRESHOLD),
- class: 'badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex'
- )
+ html << " " << gl_badge_tag(format_count(issuable_type, count, Gitlab::IssuablesCountForState::THRESHOLD), { variant: :muted, size: :sm }, { class: "gl-tab-counter-badge gl-display-none gl-sm-display-inline-flex" })
end
html.html_safe
diff --git a/app/models/issue.rb b/app/models/issue.rb
index c14dcd93861..0e11e1bb900 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -121,7 +121,6 @@ class Issue < ApplicationRecord
scope :preload_associated_models, -> { preload(:assignees, :labels, project: :namespace) }
scope :with_web_entity_associations, -> { preload(:author, project: [:project_feature, :route, namespace: :route]) }
scope :preload_awardable, -> { preload(:award_emoji) }
- scope :with_label_attributes, ->(label_attributes) { joins(:labels).where(labels: label_attributes) }
scope :with_alert_management_alerts, -> { joins(:alert_management_alert) }
scope :with_prometheus_alert_events, -> { joins(:issues_prometheus_alert_events) }
scope :with_self_managed_prometheus_alert_events, -> { joins(:issues_self_managed_prometheus_alert_events) }
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb
index c21027455b1..2804588be85 100644
--- a/app/models/pages_domain.rb
+++ b/app/models/pages_domain.rb
@@ -245,8 +245,8 @@ class PagesDomain < ApplicationRecord
def validate_pages_domain
return unless domain
- if domain.downcase.ends_with?(Settings.pages.host.downcase)
- self.errors.add(:domain, "*.#{Settings.pages.host} is restricted. Please compare our documentation at https://docs.gitlab.com/ee/administration/pages/#advanced-configuration against your configuration.")
+ if domain.downcase.ends_with?(".#{Settings.pages.host.downcase}") || domain.casecmp(Settings.pages.host) == 0
+ self.errors.add(:domain, "#{Settings.pages.host} and its subdomains cannot be used as custom pages domains. Please compare our documentation at https://docs.gitlab.com/ee/administration/pages/#advanced-configuration against your configuration.")
end
end
diff --git a/app/services/incident_management/create_incident_label_service.rb b/app/services/incident_management/create_incident_label_service.rb
deleted file mode 100644
index 595f5df184f..00000000000
--- a/app/services/incident_management/create_incident_label_service.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-# frozen_string_literal: true
-
-module IncidentManagement
- class CreateIncidentLabelService < BaseService
- LABEL_PROPERTIES = {
- title: 'incident',
- color: '#CC0033',
- description: <<~DESCRIPTION.chomp
- Denotes a disruption to IT services and \
- the associated issues require immediate attention
- DESCRIPTION
- }.freeze
-
- def execute
- label = Labels::FindOrCreateService
- .new(current_user, project, **LABEL_PROPERTIES)
- .execute(skip_authorization: true)
-
- ServiceResponse.success(payload: { label: label })
- end
- end
-end
diff --git a/app/views/admin/broadcast_messages/index.html.haml b/app/views/admin/broadcast_messages/index.html.haml
index 9dce33bf037..3f07bea7840 100644
--- a/app/views/admin/broadcast_messages/index.html.haml
+++ b/app/views/admin/broadcast_messages/index.html.haml
@@ -11,33 +11,33 @@
%br.clearfix
- if @broadcast_messages.any?
- %table.table.table-responsive
- %thead
- %tr
- %th= _('Status')
- %th= _('Preview')
- %th= _('Starts')
- %th= _('Ends')
- %th= _(' Target Path')
- %th= _(' Type')
- %th &nbsp;
- %tbody
- - @broadcast_messages.each do |message|
+ .table-responsive
+ %table.table.b-table.gl-table
+ %thead
%tr
- %td
- = broadcast_message_status(message)
- %td
- = broadcast_message(message, preview: true)
- %td
- = message.starts_at
- %td
- = message.ends_at
- %td
- = message.target_path
- %td
- = message.broadcast_type.capitalize
- %td.gl-white-space-nowrap.gl-display-flex
- = link_to sprite_icon('pencil-square', css_class: 'gl-icon'), edit_admin_broadcast_message_path(message), title: _('Edit'), class: 'btn btn-icon gl-button'
- = link_to sprite_icon('remove', css_class: 'gl-icon'), admin_broadcast_message_path(message), method: :delete, remote: true, title: _('Remove'), class: 'js-remove-tr btn btn-icon gl-button btn-danger ml-2'
-
- = paginate @broadcast_messages, theme: 'gitlab'
+ %th= _('Status')
+ %th= _('Preview')
+ %th= _('Starts')
+ %th= _('Ends')
+ %th= _(' Target Path')
+ %th= _(' Type')
+ %th &nbsp;
+ %tbody
+ - @broadcast_messages.each do |message|
+ %tr
+ %td
+ = broadcast_message_status(message)
+ %td
+ = broadcast_message(message, preview: true)
+ %td
+ = message.starts_at
+ %td
+ = message.ends_at
+ %td
+ = message.target_path
+ %td
+ = message.broadcast_type.capitalize
+ %td.gl-white-space-nowrap
+ = link_to sprite_icon('pencil-square', css_class: 'gl-icon'), edit_admin_broadcast_message_path(message), title: _('Edit'), class: 'btn btn-icon gl-button'
+ = link_to sprite_icon('remove', css_class: 'gl-icon'), admin_broadcast_message_path(message), method: :delete, remote: true, title: _('Remove'), class: 'js-remove-tr btn btn-icon gl-button btn-danger ml-2'
+ = paginate @broadcast_messages, theme: 'gitlab'
diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml
index aa9a3ea61f7..cc9f4e54a89 100644
--- a/app/views/projects/edit.html.haml
+++ b/app/views/projects/edit.html.haml
@@ -62,7 +62,7 @@
.settings-header
%h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only= _('Advanced')
%button.btn.gl-button.btn-default.js-settings-toggle{ type: 'button' }= expanded ? _('Collapse') : _('Expand')
- %p= _('Housekeeping, export, path, transfer, remove, archive.')
+ %p= s_('ProjectSettings|Housekeeping, export, archive, change path, transfer, and delete.')
.settings-content
.sub-section
diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml
index a0e78b7570a..a7667d03138 100644
--- a/app/views/projects/merge_requests/show.html.haml
+++ b/app/views/projects/merge_requests/show.html.haml
@@ -49,8 +49,6 @@
= render "projects/merge_requests/tabs/pane", id: "notes", class: "notes voting_notes" do
.row
%section.col-md-12
- -# haml-lint:disable InlineJavaScript
- %script.js-notes-data{ type: "application/json" }= initial_notes_data(true).to_json.html_safe
.issuable-discussion.js-vue-notes-event
- if @merge_request.description.present?
.detail-page-description
diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml
index 14fa6599073..8f5bcfcd20f 100644
--- a/app/workers/all_queues.yml
+++ b/app/workers/all_queues.yml
@@ -1100,8 +1100,7 @@
:resource_boundary: :unknown
:weight: 1
:idempotent:
- :tags:
- - :needs_own_queue
+ :tags: []
- :name: hashed_storage:hashed_storage_project_migrate
:worker_name: HashedStorage::ProjectMigrateWorker
:feature_category: :source_code_management
@@ -1110,8 +1109,7 @@
:resource_boundary: :unknown
:weight: 1
:idempotent:
- :tags:
- - :needs_own_queue
+ :tags: []
- :name: hashed_storage:hashed_storage_project_rollback
:worker_name: HashedStorage::ProjectRollbackWorker
:feature_category: :source_code_management
@@ -1120,8 +1118,7 @@
:resource_boundary: :unknown
:weight: 1
:idempotent:
- :tags:
- - :needs_own_queue
+ :tags: []
- :name: hashed_storage:hashed_storage_rollbacker
:worker_name: HashedStorage::RollbackerWorker
:feature_category: :source_code_management
@@ -1130,8 +1127,7 @@
:resource_boundary: :unknown
:weight: 1
:idempotent:
- :tags:
- - :needs_own_queue
+ :tags: []
- :name: incident_management:incident_management_add_severity_system_note
:worker_name: IncidentManagement::AddSeveritySystemNoteWorker
:feature_category: :incident_management
diff --git a/app/workers/hashed_storage/migrator_worker.rb b/app/workers/hashed_storage/migrator_worker.rb
index 03019ae3131..5f90b8f1009 100644
--- a/app/workers/hashed_storage/migrator_worker.rb
+++ b/app/workers/hashed_storage/migrator_worker.rb
@@ -11,9 +11,6 @@ module HashedStorage
queue_namespace :hashed_storage
feature_category :source_code_management
- # https://gitlab.com/gitlab-org/gitlab/-/issues/340629
- tags :needs_own_queue
-
# @param [Integer] start initial ID of the batch
# @param [Integer] finish last ID of the batch
def perform(start, finish)
diff --git a/app/workers/hashed_storage/project_migrate_worker.rb b/app/workers/hashed_storage/project_migrate_worker.rb
index 460aac3f2f2..01e2d6307de 100644
--- a/app/workers/hashed_storage/project_migrate_worker.rb
+++ b/app/workers/hashed_storage/project_migrate_worker.rb
@@ -11,9 +11,6 @@ module HashedStorage
queue_namespace :hashed_storage
loggable_arguments 1
- # https://gitlab.com/gitlab-org/gitlab/-/issues/340629
- tags :needs_own_queue
-
attr_reader :project_id
def perform(project_id, old_disk_path = nil)
diff --git a/app/workers/hashed_storage/project_rollback_worker.rb b/app/workers/hashed_storage/project_rollback_worker.rb
index 91ea3dd9189..2ec323248ab 100644
--- a/app/workers/hashed_storage/project_rollback_worker.rb
+++ b/app/workers/hashed_storage/project_rollback_worker.rb
@@ -11,9 +11,6 @@ module HashedStorage
queue_namespace :hashed_storage
loggable_arguments 1
- # https://gitlab.com/gitlab-org/gitlab/-/issues/340629
- tags :needs_own_queue
-
attr_reader :project_id
def perform(project_id, old_disk_path = nil)
diff --git a/app/workers/hashed_storage/rollbacker_worker.rb b/app/workers/hashed_storage/rollbacker_worker.rb
index d6a16b4d083..c6c4990d799 100644
--- a/app/workers/hashed_storage/rollbacker_worker.rb
+++ b/app/workers/hashed_storage/rollbacker_worker.rb
@@ -11,9 +11,6 @@ module HashedStorage
queue_namespace :hashed_storage
feature_category :source_code_management
- # https://gitlab.com/gitlab-org/gitlab/-/issues/340629
- tags :needs_own_queue
-
# @param [Integer] start initial ID of the batch
# @param [Integer] finish last ID of the batch
def perform(start, finish)
diff --git a/config/metrics/counts_all/20210216180451_incident_labeled_issues.yml b/config/metrics/counts_all/20210216180451_incident_labeled_issues.yml
index cc38c8e75ad..635dcd57168 100644
--- a/config/metrics/counts_all/20210216180451_incident_labeled_issues.yml
+++ b/config/metrics/counts_all/20210216180451_incident_labeled_issues.yml
@@ -7,7 +7,7 @@ product_stage: monitor
product_group: group::monitor
product_category: incident_management
value_type: number
-status: active
+status: removed
time_frame: all
data_source: database
distribution:
@@ -19,3 +19,4 @@ tier:
- ultimate
performance_indicator_type: []
milestone: "<13.9"
+milestone_removed: "14.8"
diff --git a/config/routes.rb b/config/routes.rb
index 5d20d070c20..a57795bea0c 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -170,7 +170,6 @@ Rails.application.routes.draw do
Gitlab.ee do
draw :security
draw :smartcard
- draw :username
draw :trial
draw :trial_registration
draw :country
diff --git a/doc/development/documentation/styleguide/index.md b/doc/development/documentation/styleguide/index.md
index 1d9d1528784..c4dd7132dff 100644
--- a/doc/development/documentation/styleguide/index.md
+++ b/doc/development/documentation/styleguide/index.md
@@ -320,10 +320,11 @@ create an issue or an MR to propose a change to the user interface text.
#### Feature names
- Feature names are typically lowercase.
-- Some features are capitalized, typically nouns that name GitLab-specific
- capabilities or tools.
-
-See the [word list](word_list.md) for details.
+- Some features require title case, typically nouns that name GitLab-specific capabilities or tools. Features requiring
+ title case should be:
+ - Added as a proper name to markdownlint [configuration](https://gitlab.com/gitlab-org/gitlab/-/blob/master/.markdownlint.yml),
+ so that it can be consistently applied across all documentation.
+ - Added to the [word list](word_list.md).
If the term is not in the word list, ask a GitLab Technical Writer for advice.
diff --git a/doc/development/documentation/styleguide/word_list.md b/doc/development/documentation/styleguide/word_list.md
index dc3dcba0c95..2e6e591e4ec 100644
--- a/doc/development/documentation/styleguide/word_list.md
+++ b/doc/development/documentation/styleguide/word_list.md
@@ -883,10 +883,6 @@ Instead of:
Do not use **utilize**. Use **use** instead. It's more succinct and easier for non-native English speakers to understand.
([Vale](../testing.md#vale) rule: [`SubstitutionSuggestions.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/SubstitutionSuggestions.yml))
-## Value Stream Analytics
-
-Use title case for **Value Stream Analytics**.
-
## via
Do not use Latin abbreviations. Use **with**, **through**, or **by using** instead. ([Vale](../testing.md#vale) rule: [`LatinTerms.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/LatinTerms.yml))
diff --git a/doc/development/service_ping/implement.md b/doc/development/service_ping/implement.md
index c32789740c3..3a1e4c6d87b 100644
--- a/doc/development/service_ping/implement.md
+++ b/doc/development/service_ping/implement.md
@@ -793,6 +793,8 @@ The Service Ping JSON payload for GitLab.com is shared in the
You may also use the [Service Ping QA dashboard](https://app.periscopedata.com/app/gitlab/632033/Usage-Ping-QA) to check how well your metric performs.
The dashboard allows filtering by GitLab version, by "Self-managed" and "SaaS", and shows you how many failures have occurred for each metric. Whenever you notice a high failure rate, you can re-optimize your metric.
+Use [Metrics Dictionary](https://metrics.gitlab.com/) [copy query to clipboard feature](https://www.youtube.com/watch?v=n4o65ivta48&list=PL05JrBw4t0Krg3mbR6chU7pXtMt_es6Pb) to get a query ready to run in Sisense for a specific metric.
+
## Set up and test Service Ping locally
To set up Service Ping locally, you must:
diff --git a/doc/development/value_stream_analytics.md b/doc/development/value_stream_analytics.md
index 6b2442f1c32..0d545fa8e3f 100644
--- a/doc/development/value_stream_analytics.md
+++ b/doc/development/value_stream_analytics.md
@@ -4,11 +4,11 @@ group: Optimize
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---
-# Value Stream Analytics development guide
+# Value stream analytics development guide
Value stream analytics calculates the time between two arbitrary events recorded on domain objects and provides aggregated statistics about the duration.
-For information on how to configure Value Stream Analytics in GitLab, see our [analytics documentation](../user/analytics/value_stream_analytics.md).
+For information on how to configure value stream analytics in GitLab, see our [analytics documentation](../user/analytics/value_stream_analytics.md).
## Stage
diff --git a/doc/user/permissions.md b/doc/user/permissions.md
index 4ab9f9d6c74..9dd8d6d432b 100644
--- a/doc/user/permissions.md
+++ b/doc/user/permissions.md
@@ -259,9 +259,9 @@ Maintainers and Developers from pushing to a protected branch. Read through the
[protected branches](project/protected_branches.md)
to learn more.
-### Value Stream Analytics permissions
+### Value stream analytics permissions
-Find the current permissions on the Value Stream Analytics dashboard, as described in
+Find the current permissions on the value stream analytics dashboard, as described in
[related documentation](analytics/value_stream_analytics.md#permissions).
### Issue board permissions
@@ -306,7 +306,7 @@ The following table lists group permissions available for each role:
| View Insights **(ULTIMATE)** | ✓ | ✓ | ✓ | ✓ | ✓ |
| View Insights charts **(ULTIMATE)** | ✓ | ✓ | ✓ | ✓ | ✓ |
| View Issue analytics **(PREMIUM)** | ✓ | ✓ | ✓ | ✓ | ✓ |
-| View Value Stream analytics | ✓ | ✓ | ✓ | ✓ | ✓ |
+| View value stream analytics | ✓ | ✓ | ✓ | ✓ | ✓ |
| Create/edit group epic **(PREMIUM)** | | ✓ | ✓ | ✓ | ✓ |
| Create/edit/delete epic boards **(PREMIUM)** | | ✓ | ✓ | ✓ | ✓ |
| Manage group labels | | ✓ | ✓ | ✓ | ✓ |
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index adf920d8b52..42e67543342 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -131,7 +131,6 @@ module Gitlab
issues_created_manually_from_alerts: issues_created_manually_from_alerts,
incident_issues: count(::Issue.incident, start: minimum_id(Issue), finish: maximum_id(Issue)),
alert_bot_incident_issues: count(::Issue.authored(::User.alert_bot), start: minimum_id(Issue), finish: maximum_id(Issue)),
- incident_labeled_issues: count(::Issue.with_label_attributes(::IncidentManagement::CreateIncidentLabelService::LABEL_PROPERTIES), start: minimum_id(Issue), finish: maximum_id(Issue)),
keys: count(Key),
label_lists: count(List.label),
lfs_objects: count(LfsObject),
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 7a5af14a1ba..86a969f9a69 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -3815,9 +3815,6 @@ msgstr ""
msgid "An error occurred while fetching this tab."
msgstr ""
-msgid "An error occurred while generating a username. Please try again."
-msgstr ""
-
msgid "An error occurred while getting autocomplete data. Please refresh the page and try again."
msgstr ""
@@ -17751,9 +17748,6 @@ msgstr ""
msgid "Housekeeping successfully started"
msgstr ""
-msgid "Housekeeping, export, path, transfer, remove, archive."
-msgstr ""
-
msgid "How do I configure Akismet?"
msgstr ""
@@ -28057,6 +28051,9 @@ msgstr ""
msgid "ProjectSettings|Highlight the usage of hidden unicode characters. These have innocent uses for right-to-left languages, but can also be used in potential exploits."
msgstr ""
+msgid "ProjectSettings|Housekeeping, export, archive, change path, transfer, and delete."
+msgstr ""
+
msgid "ProjectSettings|If merge trains are enabled, merging is only possible if the branch can be rebased without conflicts."
msgstr ""
diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_group_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_group_spec.rb
index a6655471591..847b9b7ff71 100644
--- a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_group_spec.rb
+++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_group_spec.rb
@@ -1,7 +1,11 @@
# frozen_string_literal: true
module QA
- RSpec.describe 'Manage', :requires_admin do
+ RSpec.describe 'Manage', :requires_admin, quarantine: {
+ only: { subdomain: :staging },
+ type: :investigating,
+ issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/350965'
+ } do
describe 'Gitlab migration' do
let(:import_wait_duration) { { max_duration: 300, sleep_interval: 2 } }
let(:admin_api_client) { Runtime::API::Client.as_admin }
diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb
index 7a9ad3a852d..0715fa8ba37 100644
--- a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb
+++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_issue_spec.rb
@@ -4,11 +4,7 @@ require_relative 'gitlab_project_migration_common'
module QA
RSpec.describe 'Manage', :requires_admin do
- describe 'Gitlab migration', quarantine: {
- only: { job: 'praefect' },
- type: :investigating,
- issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/348999'
- } do
+ describe 'Gitlab migration' do
include_context 'with gitlab project migration'
context 'with project issues' do
diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_mr_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_mr_spec.rb
index 34e56f31f7f..e7972575228 100644
--- a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_mr_spec.rb
+++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_mr_spec.rb
@@ -4,11 +4,7 @@ require_relative 'gitlab_project_migration_common'
module QA
RSpec.describe 'Manage', :requires_admin do
- describe 'Gitlab migration', quarantine: {
- only: { job: 'praefect' },
- type: :investigating,
- issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/348999'
- } do
+ describe 'Gitlab migration' do
include_context 'with gitlab project migration'
context 'with merge request' do
diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb
index a0c758c99e6..07ae8ae1372 100644
--- a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb
+++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_project_spec.rb
@@ -4,11 +4,7 @@ require_relative 'gitlab_project_migration_common'
module QA
RSpec.describe 'Manage', :requires_admin do
- describe 'Gitlab migration', quarantine: {
- only: { job: 'praefect' },
- type: :investigating,
- issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/348999'
- } do
+ describe 'Gitlab migration' do
include_context 'with gitlab project migration'
context 'with uninitialized project' do
diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb
index 827ebc1f5e2..0abc21531a6 100644
--- a/qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb
+++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb
@@ -1,7 +1,14 @@
# frozen_string_literal: true
module QA
- RSpec.shared_context 'with gitlab project migration' do
+ RSpec.shared_context 'with gitlab project migration', quarantine: {
+ only: { job: 'praefect', subdomain: :staging },
+ type: :investigating,
+ issue: [
+ 'https://gitlab.com/gitlab-org/gitlab/-/issues/348999',
+ 'https://gitlab.com/gitlab-org/gitlab/-/issues/350965'
+ ]
+ } do
let(:source_project_with_readme) { false }
let(:import_wait_duration) { { max_duration: 300, sleep_interval: 2 } }
let(:admin_api_client) { Runtime::API::Client.as_admin }
diff --git a/spec/factories/labels.rb b/spec/factories/labels.rb
index f0cef41db69..250c92c0038 100644
--- a/spec/factories/labels.rb
+++ b/spec/factories/labels.rb
@@ -18,13 +18,6 @@ FactoryBot.define do
title { "#{prefix}::#{generate(:label_title)}" }
end
- trait :incident do
- properties = IncidentManagement::CreateIncidentLabelService::LABEL_PROPERTIES
- title { properties.fetch(:title) }
- description { properties.fetch(:description) }
- color { properties.fetch(:color) }
- end
-
factory :label, traits: [:base_label], class: 'ProjectLabel' do
project
diff --git a/spec/factories/usage_data.rb b/spec/factories/usage_data.rb
index f00d1f8b808..86799af1719 100644
--- a/spec/factories/usage_data.rb
+++ b/spec/factories/usage_data.rb
@@ -58,14 +58,6 @@ FactoryBot.define do
# Tracing
create(:project_tracing_setting, project: projects[0])
- # Incident Labeled Issues
- incident_label = create(:label, :incident, project: projects[0])
- create(:labeled_issue, project: projects[0], labels: [incident_label])
- incident_label_scoped_to_project = create(:label, :incident, project: projects[1])
- incident_label_scoped_to_group = create(:group_label, :incident, group: group)
- create(:labeled_issue, project: projects[1], labels: [incident_label_scoped_to_project])
- create(:labeled_issue, project: projects[1], labels: [incident_label_scoped_to_group])
-
# Alert Issues
create(:alert_management_alert, issue: issues[0], project: projects[0])
create(:alert_management_alert, issue: alert_bot_issues[0], project: projects[0])
diff --git a/spec/frontend/boards/components/board_new_item_spec.js b/spec/frontend/boards/components/board_new_item_spec.js
index 0151d9c1c14..ef83fc925bd 100644
--- a/spec/frontend/boards/components/board_new_item_spec.js
+++ b/spec/frontend/boards/components/board_new_item_spec.js
@@ -39,6 +39,27 @@ describe('BoardNewItem', () => {
});
describe('template', () => {
+ describe('when the user provides a valid input', () => {
+ it('finds an enabled create button', async () => {
+ expect(wrapper.findByTestId('create-button').props('disabled')).toBe(true);
+
+ wrapper.find(GlFormInput).vm.$emit('input', 'hello');
+ await wrapper.vm.$nextTick();
+
+ expect(wrapper.findByTestId('create-button').props('disabled')).toBe(false);
+ });
+ });
+
+ describe('when the user types in a string with only spaces', () => {
+ it('disables the Create Issue button', async () => {
+ wrapper.find(GlFormInput).vm.$emit('input', ' ');
+
+ await wrapper.vm.$nextTick();
+
+ expect(wrapper.findByTestId('create-button').props('disabled')).toBe(true);
+ });
+ });
+
it('renders gl-form component', () => {
expect(wrapper.findComponent(GlForm).exists()).toBe(true);
});
@@ -80,6 +101,19 @@ describe('BoardNewItem', () => {
]);
});
+ it('emits `form-submit` event with trimmed title', async () => {
+ titleInput().setValue(' Foo ');
+
+ await glForm().trigger('submit');
+
+ expect(wrapper.emitted('form-submit')[0]).toEqual([
+ {
+ title: 'Foo',
+ list: mockList,
+ },
+ ]);
+ });
+
it('emits `scroll-board-list-` event with list.id on eventHub when `submit` is triggered on gl-form', async () => {
jest.spyOn(eventHub, '$emit').mockImplementation();
await glForm().trigger('submit');
diff --git a/spec/frontend/editor/source_editor_yaml_ext_spec.js b/spec/frontend/editor/source_editor_yaml_ext_spec.js
index a861d9c7a45..b603b0e3a98 100644
--- a/spec/frontend/editor/source_editor_yaml_ext_spec.js
+++ b/spec/frontend/editor/source_editor_yaml_ext_spec.js
@@ -353,58 +353,78 @@ foo:
});
describe('highlight', () => {
- const highlightPathOnSetup = 'abc';
const value = `foo:
bar:
- baz
- boo
- abc: def
+abc: def
`;
let instance;
let highlightLinesSpy;
let removeHighlightsSpy;
- beforeEach(() => {
- instance = getEditorInstanceWithExtension({ highlightPath: highlightPathOnSetup }, { value });
- highlightLinesSpy = jest.fn();
- removeHighlightsSpy = jest.fn();
- spyOnApi(baseExtension, {
- highlightLines: highlightLinesSpy,
- removeHighlights: removeHighlightsSpy,
- });
- });
-
afterEach(() => {
jest.clearAllMocks();
});
- it('saves the highlighted path in highlightPath', () => {
- const path = 'foo.bar';
- instance.highlight(path);
- expect(yamlExtension.obj.highlightPath).toEqual(path);
- });
-
- it('calls highlightLines with a number of lines', () => {
- const path = 'foo.bar';
- instance.highlight(path);
- expect(highlightLinesSpy).toHaveBeenCalledWith(instance, [2, 4]);
- });
-
- it('calls removeHighlights if path is null', () => {
- instance.highlight(null);
- expect(removeHighlightsSpy).toHaveBeenCalledWith(instance);
- expect(highlightLinesSpy).not.toHaveBeenCalled();
- expect(yamlExtension.obj.highlightPath).toBeNull();
- });
-
- it('throws an error if path is invalid and does not change the highlighted path', () => {
- expect(() => instance.highlight('invalidPath[0]')).toThrow(
- 'The node invalidPath[0] could not be found inside the document.',
- );
- expect(yamlExtension.obj.highlightPath).toEqual(highlightPathOnSetup);
- expect(highlightLinesSpy).not.toHaveBeenCalled();
- expect(removeHighlightsSpy).not.toHaveBeenCalled();
- });
+ it.each`
+ highlightPathOnSetup | path | keepOnNotFound | expectHighlightLinesToBeCalled | withLines | expectRemoveHighlightsToBeCalled | storedHighlightPath
+ ${null} | ${undefined} | ${false} | ${false} | ${undefined} | ${true} | ${null}
+ ${'abc'} | ${'abc'} | ${undefined} | ${false} | ${undefined} | ${false} | ${'abc'}
+ ${null} | ${null} | ${false} | ${false} | ${undefined} | ${false} | ${null}
+ ${null} | ${''} | ${false} | ${false} | ${undefined} | ${true} | ${null}
+ ${null} | ${''} | ${true} | ${false} | ${undefined} | ${true} | ${null}
+ ${'abc'} | ${''} | ${false} | ${false} | ${undefined} | ${true} | ${null}
+ ${'abc'} | ${'foo.bar'} | ${false} | ${true} | ${[2, 4]} | ${false} | ${'foo.bar'}
+ ${'abc'} | ${['foo', 'bar']} | ${false} | ${true} | ${[2, 4]} | ${false} | ${['foo', 'bar']}
+ ${'abc'} | ${'invalid'} | ${true} | ${false} | ${undefined} | ${false} | ${'abc'}
+ ${'abc'} | ${'invalid'} | ${false} | ${false} | ${undefined} | ${true} | ${null}
+ ${'abc'} | ${'invalid'} | ${undefined} | ${false} | ${undefined} | ${true} | ${null}
+ ${'abc'} | ${['invalid']} | ${undefined} | ${false} | ${undefined} | ${true} | ${null}
+ ${'abc'} | ${['invalid']} | ${true} | ${false} | ${undefined} | ${false} | ${'abc'}
+ ${'abc'} | ${[]} | ${true} | ${false} | ${undefined} | ${true} | ${null}
+ ${'abc'} | ${[]} | ${false} | ${false} | ${undefined} | ${true} | ${null}
+ `(
+ 'returns correct result for highlightPathOnSetup=$highlightPathOnSetup, path=$path' +
+ ' and keepOnNotFound=$keepOnNotFound',
+ ({
+ highlightPathOnSetup,
+ path,
+ keepOnNotFound,
+ expectHighlightLinesToBeCalled,
+ withLines,
+ expectRemoveHighlightsToBeCalled,
+ storedHighlightPath,
+ }) => {
+ instance = getEditorInstanceWithExtension(
+ { highlightPath: highlightPathOnSetup },
+ { value },
+ );
+
+ highlightLinesSpy = jest.fn();
+ removeHighlightsSpy = jest.fn();
+ spyOnApi(baseExtension, {
+ highlightLines: highlightLinesSpy,
+ removeHighlights: removeHighlightsSpy,
+ });
+
+ instance.highlight(path, keepOnNotFound);
+
+ if (expectHighlightLinesToBeCalled) {
+ expect(highlightLinesSpy).toHaveBeenCalledWith(instance, withLines);
+ } else {
+ expect(highlightLinesSpy).not.toHaveBeenCalled();
+ }
+
+ if (expectRemoveHighlightsToBeCalled) {
+ expect(removeHighlightsSpy).toHaveBeenCalled();
+ } else {
+ expect(removeHighlightsSpy).not.toHaveBeenCalled();
+ }
+
+ expect(yamlExtension.obj.highlightPath).toEqual(storedHighlightPath);
+ },
+ );
});
describe('locate', () => {
@@ -446,10 +466,10 @@ foo:
expect(instance.locate(path)).toEqual(expected);
});
- it('throws an error if a path cannot be found inside the yaml', () => {
+ it('returns [null, null] if a path cannot be found inside the yaml', () => {
const path = 'baz[8]';
const instance = getEditorInstanceWithExtension(options);
- expect(() => instance.locate(path)).toThrow();
+ expect(instance.locate(path)).toEqual([null, null]);
});
it('returns the expected line numbers for a path to an array entry inside the yaml', () => {
diff --git a/spec/helpers/issuables_helper_spec.rb b/spec/helpers/issuables_helper_spec.rb
index fa19395ebc7..ed50a4daae8 100644
--- a/spec/helpers/issuables_helper_spec.rb
+++ b/spec/helpers/issuables_helper_spec.rb
@@ -133,13 +133,13 @@ RSpec.describe IssuablesHelper do
it 'returns navigation with badges' do
expect(helper.issuables_state_counter_text(:issues, :opened, true))
- .to eq('<span>Open</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex">42</span>')
+ .to eq('<span>Open</span> <span class="gl-badge badge badge-pill badge-muted sm gl-tab-counter-badge gl-display-none gl-sm-display-inline-flex">42</span>')
expect(helper.issuables_state_counter_text(:issues, :closed, true))
- .to eq('<span>Closed</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex">42</span>')
+ .to eq('<span>Closed</span> <span class="gl-badge badge badge-pill badge-muted sm gl-tab-counter-badge gl-display-none gl-sm-display-inline-flex">42</span>')
expect(helper.issuables_state_counter_text(:merge_requests, :merged, true))
- .to eq('<span>Merged</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex">42</span>')
+ .to eq('<span>Merged</span> <span class="gl-badge badge badge-pill badge-muted sm gl-tab-counter-badge gl-display-none gl-sm-display-inline-flex">42</span>')
expect(helper.issuables_state_counter_text(:merge_requests, :all, true))
- .to eq('<span>All</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex">42</span>')
+ .to eq('<span>All</span> <span class="gl-badge badge badge-pill badge-muted sm gl-tab-counter-badge gl-display-none gl-sm-display-inline-flex">42</span>')
end
end
@@ -171,7 +171,7 @@ RSpec.describe IssuablesHelper do
it 'returns truncated count' do
expect(helper.issuables_state_counter_text(:issues, :opened, true))
- .to eq('<span>Open</span> <span class="badge badge-muted badge-pill gl-badge gl-tab-counter-badge sm gl-display-none gl-sm-display-inline-flex">1.1k</span>')
+ .to eq('<span>Open</span> <span class="gl-badge badge badge-pill badge-muted sm gl-tab-counter-badge gl-display-none gl-sm-display-inline-flex">1.1k</span>')
end
end
end
diff --git a/spec/lib/api/entities/basic_project_details_spec.rb b/spec/lib/api/entities/basic_project_details_spec.rb
index dc7c4fdce4e..8419eb0a932 100644
--- a/spec/lib/api/entities/basic_project_details_spec.rb
+++ b/spec/lib/api/entities/basic_project_details_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe API::Entities::BasicProjectDetails do
let_it_be(:project) { create(:project) }
- let(:current_user) { project.owner }
+ let(:current_user) { project.first_owner }
subject(:output) { described_class.new(project, current_user: current_user).as_json }
diff --git a/spec/lib/api/helpers_spec.rb b/spec/lib/api/helpers_spec.rb
index 2277bd78e86..d81f39f3a55 100644
--- a/spec/lib/api/helpers_spec.rb
+++ b/spec/lib/api/helpers_spec.rb
@@ -160,7 +160,7 @@ RSpec.describe API::Helpers do
describe '#find_project!' do
let_it_be(:project) { create(:project) }
- let(:user) { project.owner}
+ let(:user) { project.first_owner}
before do
allow(subject).to receive(:current_user).and_return(user)
diff --git a/spec/lib/backup/gitaly_backup_spec.rb b/spec/lib/backup/gitaly_backup_spec.rb
index cd0d984fbdb..6bf4f833c1f 100644
--- a/spec/lib/backup/gitaly_backup_spec.rb
+++ b/spec/lib/backup/gitaly_backup_spec.rb
@@ -38,7 +38,7 @@ RSpec.describe Backup::GitalyBackup do
create(:wiki_page, container: project)
create(:design, :with_file, issue: create(:issue, project: project))
project_snippet = create(:project_snippet, :repository, project: project)
- personal_snippet = create(:personal_snippet, :repository, author: project.owner)
+ personal_snippet = create(:personal_snippet, :repository, author: project.first_owner)
expect(Open3).to receive(:popen2).with(expected_env, anything, 'create', '-path', anything).and_call_original
@@ -122,8 +122,8 @@ RSpec.describe Backup::GitalyBackup do
context 'restore' do
let_it_be(:project) { create(:project, :repository) }
- let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) }
- let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) }
+ let_it_be(:personal_snippet) { create(:personal_snippet, author: project.first_owner) }
+ let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.first_owner) }
def copy_bundle_to_backup_path(bundle_name, destination)
FileUtils.mkdir_p(File.join(Gitlab.config.backup.path, 'repositories', File.dirname(destination)))
diff --git a/spec/lib/backup/gitaly_rpc_backup_spec.rb b/spec/lib/backup/gitaly_rpc_backup_spec.rb
index 14f9d27ca6e..4829d51ac9d 100644
--- a/spec/lib/backup/gitaly_rpc_backup_spec.rb
+++ b/spec/lib/backup/gitaly_rpc_backup_spec.rb
@@ -25,7 +25,7 @@ RSpec.describe Backup::GitalyRpcBackup do
create(:wiki_page, container: project)
create(:design, :with_file, issue: create(:issue, project: project))
project_snippet = create(:project_snippet, :repository, project: project)
- personal_snippet = create(:personal_snippet, :repository, author: project.owner)
+ personal_snippet = create(:personal_snippet, :repository, author: project.first_owner)
subject.start(:create)
subject.enqueue(project, Gitlab::GlRepository::PROJECT)
@@ -75,8 +75,8 @@ RSpec.describe Backup::GitalyRpcBackup do
context 'restore' do
let_it_be(:project) { create(:project, :repository) }
- let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) }
- let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) }
+ let_it_be(:personal_snippet) { create(:personal_snippet, author: project.first_owner) }
+ let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.first_owner) }
def copy_bundle_to_backup_path(bundle_name, destination)
FileUtils.mkdir_p(File.join(Gitlab.config.backup.path, 'repositories', File.dirname(destination)))
diff --git a/spec/lib/backup/repositories_spec.rb b/spec/lib/backup/repositories_spec.rb
index f3830da344b..b06f2237211 100644
--- a/spec/lib/backup/repositories_spec.rb
+++ b/spec/lib/backup/repositories_spec.rb
@@ -15,7 +15,7 @@ RSpec.describe Backup::Repositories do
RSpec.shared_examples 'creates repository bundles' do
it 'calls enqueue for each repository type', :aggregate_failures do
project_snippet = create(:project_snippet, :repository, project: project)
- personal_snippet = create(:personal_snippet, :repository, author: project.owner)
+ personal_snippet = create(:personal_snippet, :repository, author: project.first_owner)
subject.dump(max_concurrency: 1, max_storage_concurrency: 1)
@@ -172,8 +172,8 @@ RSpec.describe Backup::Repositories do
describe '#restore' do
let_it_be(:project) { create(:project) }
- let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) }
- let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) }
+ let_it_be(:personal_snippet) { create(:personal_snippet, author: project.first_owner) }
+ let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.first_owner) }
it 'calls enqueue for each repository type', :aggregate_failures do
subject.restore
diff --git a/spec/lib/banzai/filter/references/issue_reference_filter_spec.rb b/spec/lib/banzai/filter/references/issue_reference_filter_spec.rb
index b3523a25116..c493cb77c98 100644
--- a/spec/lib/banzai/filter/references/issue_reference_filter_spec.rb
+++ b/spec/lib/banzai/filter/references/issue_reference_filter_spec.rb
@@ -515,7 +515,7 @@ RSpec.describe Banzai::Filter::References::IssueReferenceFilter do
enable_design_management(enabled)
end
- let(:current_user) { project.owner }
+ let(:current_user) { project.first_owner }
let(:enabled) { true }
let(:matches) { Issue.link_reference_pattern.match(input_text) }
let(:extras) { subject.object_link_text_extras(issue, matches) }
diff --git a/spec/lib/banzai/object_renderer_spec.rb b/spec/lib/banzai/object_renderer_spec.rb
index e64ab5dfce3..8f69480c65f 100644
--- a/spec/lib/banzai/object_renderer_spec.rb
+++ b/spec/lib/banzai/object_renderer_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Banzai::ObjectRenderer do
let(:project) { create(:project, :repository) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:renderer) do
described_class.new(
default_project: project,
diff --git a/spec/lib/feature_spec.rb b/spec/lib/feature_spec.rb
index 8c546390201..5080d21d564 100644
--- a/spec/lib/feature_spec.rb
+++ b/spec/lib/feature_spec.rb
@@ -728,13 +728,13 @@ RSpec.describe Feature, stub_feature_flags: false do
describe '#targets' do
let(:project) { create(:project) }
let(:group) { create(:group) }
- let(:user_name) { project.owner.username }
+ let(:user_name) { project.first_owner.username }
subject { described_class.new(user: user_name, project: project.full_path, group: group.full_path) }
it 'returns all found targets' do
expect(subject.targets).to be_an(Array)
- expect(subject.targets).to eq([project.owner, project, group])
+ expect(subject.targets).to eq([project.first_owner, project, group])
end
end
end
diff --git a/spec/lib/gitlab/ci/config/external/rules_spec.rb b/spec/lib/gitlab/ci/config/external/rules_spec.rb
index 091bd3b07e6..e2bb55f3854 100644
--- a/spec/lib/gitlab/ci/config/external/rules_spec.rb
+++ b/spec/lib/gitlab/ci/config/external/rules_spec.rb
@@ -45,7 +45,7 @@ RSpec.describe Gitlab::Ci::Config::External::Rules do
let(:context) { double(project: project, sha: project.repository.tree.sha, top_level_worktree_paths: ['Dockerfile']) }
before do
- project.repository.create_file(project.owner, 'Dockerfile', "commit", message: 'test', branch_name: "master")
+ project.repository.create_file(project.first_owner, 'Dockerfile', "commit", message: 'test', branch_name: "master")
end
it { is_expected.to eq(true) }
diff --git a/spec/lib/gitlab/ci/templates/5_minute_production_app_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/5_minute_production_app_ci_yaml_spec.rb
index f8df2266689..8204b104832 100644
--- a/spec/lib/gitlab/ci/templates/5_minute_production_app_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/5_minute_production_app_ci_yaml_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe '5-Minute-Production-App.gitlab-ci.yml' do
describe 'the created pipeline' do
let_it_be(:project) { create(:project, :auto_devops, :custom_repo, files: { 'README.md' => '' }) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:default_branch) { 'master' }
let(:pipeline_branch) { default_branch }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
diff --git a/spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb
index ca6f6872f89..27de8324206 100644
--- a/spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/AWS/deploy_ecs_gitlab_ci_yaml_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe 'Deploy-ECS.gitlab-ci.yml' do
let(:default_branch) { project.default_branch_or_main }
let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :auto_devops, :custom_repo, files: { 'README.md' => '' }) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
diff --git a/spec/lib/gitlab/ci/templates/Jobs/build_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Jobs/build_gitlab_ci_yaml_spec.rb
index bd701aec8fc..21052f03cb8 100644
--- a/spec/lib/gitlab/ci/templates/Jobs/build_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/Jobs/build_gitlab_ci_yaml_spec.rb
@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/Build.gitlab-ci.yml' do
describe 'the created pipeline' do
let_it_be(:project) { create(:project, :repository) }
- let_it_be(:user) { project.owner }
+ let_it_be(:user) { project.first_owner }
let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch }
diff --git a/spec/lib/gitlab/ci/templates/Jobs/code_quality_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Jobs/code_quality_gitlab_ci_yaml_spec.rb
index 64243f2d205..d88d9782021 100644
--- a/spec/lib/gitlab/ci/templates/Jobs/code_quality_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/Jobs/code_quality_gitlab_ci_yaml_spec.rb
@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/Code-Quality.gitlab-ci.yml' do
describe 'the created pipeline' do
let_it_be(:project) { create(:project, :repository) }
- let_it_be(:user) { project.owner }
+ let_it_be(:user) { project.first_owner }
let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch }
diff --git a/spec/lib/gitlab/ci/templates/Jobs/deploy_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Jobs/deploy_gitlab_ci_yaml_spec.rb
index 789f694b4b4..bcc99b78805 100644
--- a/spec/lib/gitlab/ci/templates/Jobs/deploy_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/Jobs/deploy_gitlab_ci_yaml_spec.rb
@@ -29,7 +29,7 @@ RSpec.describe 'Jobs/Deploy.gitlab-ci.yml' do
describe 'the created pipeline' do
let_it_be(:project, refind: true) { create(:project, :repository) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_ref) }
diff --git a/spec/lib/gitlab/ci/templates/Jobs/sast_iac_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Jobs/sast_iac_gitlab_ci_yaml_spec.rb
index b9256ece78b..0f97bc06a4e 100644
--- a/spec/lib/gitlab/ci/templates/Jobs/sast_iac_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/Jobs/sast_iac_gitlab_ci_yaml_spec.rb
@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/SAST-IaC.latest.gitlab-ci.yml' do
describe 'the created pipeline' do
let_it_be(:project) { create(:project, :repository) }
- let_it_be(:user) { project.owner }
+ let_it_be(:user) { project.first_owner }
let(:default_branch) { 'main' }
let(:pipeline_ref) { default_branch }
diff --git a/spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb
index db9d7496251..a92a8397e96 100644
--- a/spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/Jobs/test_gitlab_ci_yaml_spec.rb
@@ -7,7 +7,7 @@ RSpec.describe 'Jobs/Test.gitlab-ci.yml' do
describe 'the created pipeline' do
let_it_be(:project) { create(:project, :repository) }
- let_it_be(:user) { project.owner }
+ let_it_be(:user) { project.first_owner }
let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch }
diff --git a/spec/lib/gitlab/ci/templates/Terraform/base_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Terraform/base_gitlab_ci_yaml_spec.rb
index 4685d843ce0..5e9224cebd9 100644
--- a/spec/lib/gitlab/ci/templates/Terraform/base_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/Terraform/base_gitlab_ci_yaml_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe 'Terraform/Base.gitlab-ci.yml' do
let(:default_branch) { 'master' }
let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
diff --git a/spec/lib/gitlab/ci/templates/Terraform/base_latest_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Terraform/base_latest_gitlab_ci_yaml_spec.rb
index e35f2eabe8e..0ab81f97f20 100644
--- a/spec/lib/gitlab/ci/templates/Terraform/base_latest_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/Terraform/base_latest_gitlab_ci_yaml_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe 'Terraform/Base.latest.gitlab-ci.yml' do
let(:default_branch) { 'master' }
let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
diff --git a/spec/lib/gitlab/ci/templates/Verify/load_performance_testing_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/Verify/load_performance_testing_gitlab_ci_yaml_spec.rb
index 004261bc617..d6c7cd32f79 100644
--- a/spec/lib/gitlab/ci/templates/Verify/load_performance_testing_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/Verify/load_performance_testing_gitlab_ci_yaml_spec.rb
@@ -20,7 +20,7 @@ RSpec.describe 'Verify/Load-Performance-Testing.gitlab-ci.yml' do
describe 'the created pipeline' do
let(:project) { create(:project, :repository) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:default_branch) { 'master' }
let(:pipeline_ref) { default_branch }
diff --git a/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb
index 64ef6ecd7f8..6a4be1fa072 100644
--- a/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb
@@ -15,7 +15,7 @@ RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do
describe 'the created pipeline' do
let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :auto_devops, :custom_repo, files: { 'README.md' => '' }) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
@@ -276,7 +276,7 @@ RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do
with_them do
let(:project) { create(:project, :custom_repo, files: files) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: default_branch ) }
let(:pipeline) { service.execute(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
diff --git a/spec/lib/gitlab/ci/templates/flutter_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/flutter_gitlab_ci_yaml_spec.rb
index 3d97b47473d..de94eec09fe 100644
--- a/spec/lib/gitlab/ci/templates/flutter_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/flutter_gitlab_ci_yaml_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe 'Flutter.gitlab-ci.yml' do
describe 'the created pipeline' do
let(:pipeline_branch) { 'master' }
let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
diff --git a/spec/lib/gitlab/ci/templates/kaniko_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/kaniko_gitlab_ci_yaml_spec.rb
index c7dbbea4622..ebf52e6d65a 100644
--- a/spec/lib/gitlab/ci/templates/kaniko_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/kaniko_gitlab_ci_yaml_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe 'Kaniko.gitlab-ci.yml' do
describe 'the created pipeline' do
let(:pipeline_branch) { 'master' }
let(:project) { create(:project, :custom_repo, files: { 'Dockerfile' => 'FROM alpine:latest' }) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
diff --git a/spec/lib/gitlab/ci/templates/npm_spec.rb b/spec/lib/gitlab/ci/templates/npm_spec.rb
index ea954690133..d86a3a67823 100644
--- a/spec/lib/gitlab/ci/templates/npm_spec.rb
+++ b/spec/lib/gitlab/ci/templates/npm_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe 'npm.gitlab-ci.yml' do
let(:repo_files) { { 'package.json' => '{}', 'README.md' => '' } }
let(:modified_files) { %w[package.json] }
let(:project) { create(:project, :custom_repo, files: repo_files) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:pipeline_branch) { project.default_branch }
let(:pipeline_tag) { 'v1.2.1' }
let(:pipeline_ref) { pipeline_branch }
diff --git a/spec/lib/gitlab/ci/templates/terraform_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/terraform_gitlab_ci_yaml_spec.rb
index 936cd6ac8aa..346ab9f7af7 100644
--- a/spec/lib/gitlab/ci/templates/terraform_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/terraform_gitlab_ci_yaml_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe 'Terraform.gitlab-ci.yml' do
let(:default_branch) { project.default_branch_or_main }
let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
diff --git a/spec/lib/gitlab/ci/templates/terraform_latest_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/terraform_latest_gitlab_ci_yaml_spec.rb
index fd5d5d6af7f..6c06403adff 100644
--- a/spec/lib/gitlab/ci/templates/terraform_latest_gitlab_ci_yaml_spec.rb
+++ b/spec/lib/gitlab/ci/templates/terraform_latest_gitlab_ci_yaml_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe 'Terraform.latest.gitlab-ci.yml' do
let(:default_branch) { project.default_branch_or_main }
let(:pipeline_branch) { default_branch }
let(:project) { create(:project, :custom_repo, files: { 'README.md' => '' }) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:service) { Ci::CreatePipelineService.new(project, user, ref: pipeline_branch ) }
let(:pipeline) { service.execute!(:push).payload }
let(:build_names) { pipeline.builds.pluck(:name) }
diff --git a/spec/lib/gitlab/ci/variables/builder_spec.rb b/spec/lib/gitlab/ci/variables/builder_spec.rb
index 8a87cbe45c1..3ad147585dd 100644
--- a/spec/lib/gitlab/ci/variables/builder_spec.rb
+++ b/spec/lib/gitlab/ci/variables/builder_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Gitlab::Ci::Variables::Builder do
let_it_be(:project) { create(:project, :repository) }
let_it_be(:pipeline) { create(:ci_pipeline, project: project) }
- let_it_be(:user) { project.owner }
+ let_it_be(:user) { project.first_owner }
let_it_be(:job) do
create(:ci_build,
pipeline: pipeline,
diff --git a/spec/lib/gitlab/diff/file_spec.rb b/spec/lib/gitlab/diff/file_spec.rb
index 45a49a36fe2..7c1a8f4c3c8 100644
--- a/spec/lib/gitlab/diff/file_spec.rb
+++ b/spec/lib/gitlab/diff/file_spec.rb
@@ -13,7 +13,7 @@ RSpec.describe Gitlab::Diff::File do
def create_file(file_name, content)
Files::CreateService.new(
project,
- project.owner,
+ project.first_owner,
commit_message: 'Update',
start_branch: branch_name,
branch_name: branch_name,
@@ -27,7 +27,7 @@ RSpec.describe Gitlab::Diff::File do
def update_file(file_name, content)
Files::UpdateService.new(
project,
- project.owner,
+ project.first_owner,
commit_message: 'Update',
start_branch: branch_name,
branch_name: branch_name,
@@ -41,7 +41,7 @@ RSpec.describe Gitlab::Diff::File do
def delete_file(file_name)
Files::DeleteService.new(
project,
- project.owner,
+ project.first_owner,
commit_message: 'Update',
start_branch: branch_name,
branch_name: branch_name,
diff --git a/spec/lib/gitlab/diff/position_tracer/image_strategy_spec.rb b/spec/lib/gitlab/diff/position_tracer/image_strategy_spec.rb
index 7dceb64b776..1414056ad6a 100644
--- a/spec/lib/gitlab/diff/position_tracer/image_strategy_spec.rb
+++ b/spec/lib/gitlab/diff/position_tracer/image_strategy_spec.rb
@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Diff::PositionTracer::ImageStrategy do
include PositionTracerHelpers
let(:project) { create(:project, :repository) }
- let(:current_user) { project.owner }
+ let(:current_user) { project.first_owner }
let(:file_name) { 'test-file' }
let(:new_file_name) { "#{file_name}-new" }
let(:second_file_name) { "#{file_name}-2" }
diff --git a/spec/lib/gitlab/diff/position_tracer/line_strategy_spec.rb b/spec/lib/gitlab/diff/position_tracer/line_strategy_spec.rb
index c46f476899e..ea56a87dec2 100644
--- a/spec/lib/gitlab/diff/position_tracer/line_strategy_spec.rb
+++ b/spec/lib/gitlab/diff/position_tracer/line_strategy_spec.rb
@@ -55,7 +55,7 @@ RSpec.describe Gitlab::Diff::PositionTracer::LineStrategy, :clean_gitlab_redis_c
include PositionTracerHelpers
let(:project) { create(:project, :repository) }
- let(:current_user) { project.owner }
+ let(:current_user) { project.first_owner }
let(:repository) { project.repository }
let(:file_name) { "test-file" }
let(:new_file_name) { "#{file_name}-new" }
diff --git a/spec/lib/gitlab/diff/position_tracer_spec.rb b/spec/lib/gitlab/diff/position_tracer_spec.rb
index fc649812b0a..9b0ea892f91 100644
--- a/spec/lib/gitlab/diff/position_tracer_spec.rb
+++ b/spec/lib/gitlab/diff/position_tracer_spec.rb
@@ -52,7 +52,7 @@ RSpec.describe Gitlab::Diff::PositionTracer do
describe 'diffs methods' do
let(:project) { create(:project, :repository) }
- let(:current_user) { project.owner }
+ let(:current_user) { project.first_owner }
let(:old_diff_refs) do
diff_refs(
diff --git a/spec/lib/gitlab/git/wiki_spec.rb b/spec/lib/gitlab/git/wiki_spec.rb
index eb7deb08063..ee0c0e2708e 100644
--- a/spec/lib/gitlab/git/wiki_spec.rb
+++ b/spec/lib/gitlab/git/wiki_spec.rb
@@ -6,7 +6,7 @@ RSpec.describe Gitlab::Git::Wiki do
using RSpec::Parameterized::TableSyntax
let(:project) { create(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:project_wiki) { ProjectWiki.new(project, user) }
subject(:wiki) { project_wiki.wiki }
diff --git a/spec/lib/gitlab/git_access_design_spec.rb b/spec/lib/gitlab/git_access_design_spec.rb
index 9fd1f2dcb0c..c90d9802300 100644
--- a/spec/lib/gitlab/git_access_design_spec.rb
+++ b/spec/lib/gitlab/git_access_design_spec.rb
@@ -5,7 +5,7 @@ RSpec.describe Gitlab::GitAccessDesign do
include DesignManagementTestHelpers
let_it_be(:project) { create(:project) }
- let_it_be(:user) { project.owner }
+ let_it_be(:user) { project.first_owner }
let(:protocol) { 'web' }
let(:actor) { user }
diff --git a/spec/lib/gitlab/gl_repository/identifier_spec.rb b/spec/lib/gitlab/gl_repository/identifier_spec.rb
index e0622e30e7a..0a8559dd800 100644
--- a/spec/lib/gitlab/gl_repository/identifier_spec.rb
+++ b/spec/lib/gitlab/gl_repository/identifier_spec.rb
@@ -4,8 +4,8 @@ require 'spec_helper'
RSpec.describe Gitlab::GlRepository::Identifier do
let_it_be(:project) { create(:project) }
- let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) }
- let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) }
+ let_it_be(:personal_snippet) { create(:personal_snippet, author: project.first_owner) }
+ let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.first_owner) }
describe 'project repository' do
it_behaves_like 'parsing gl_repository identifier' do
diff --git a/spec/lib/gitlab/gl_repository/repo_type_spec.rb b/spec/lib/gitlab/gl_repository/repo_type_spec.rb
index 71a4c693f9d..0ec94563cbb 100644
--- a/spec/lib/gitlab/gl_repository/repo_type_spec.rb
+++ b/spec/lib/gitlab/gl_repository/repo_type_spec.rb
@@ -3,8 +3,8 @@ require 'spec_helper'
RSpec.describe Gitlab::GlRepository::RepoType do
let_it_be(:project) { create(:project) }
- let_it_be(:personal_snippet) { create(:personal_snippet, author: project.owner) }
- let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.owner) }
+ let_it_be(:personal_snippet) { create(:personal_snippet, author: project.first_owner) }
+ let_it_be(:project_snippet) { create(:project_snippet, project: project, author: project.first_owner) }
let(:project_path) { project.repository.full_path }
let(:wiki_path) { project.wiki.repository.full_path }
diff --git a/spec/lib/gitlab/graphql/markdown_field_spec.rb b/spec/lib/gitlab/graphql/markdown_field_spec.rb
index a3fb0bbbed8..c2253811e91 100644
--- a/spec/lib/gitlab/graphql/markdown_field_spec.rb
+++ b/spec/lib/gitlab/graphql/markdown_field_spec.rb
@@ -73,7 +73,7 @@ RSpec.describe Gitlab::Graphql::MarkdownField do
end
it 'shows the reference to users that are allowed to see it' do
- context = GraphQL::Query::Context.new(query: query, values: { current_user: project.owner }, object: nil)
+ context = GraphQL::Query::Context.new(query: query, values: { current_user: project.first_owner }, object: nil)
type_instance = type_class.authorized_new(note, context)
expect(field.to_graphql.resolve(type_instance, {}, context)).to include(issue_path(issue))
diff --git a/spec/lib/gitlab/project_authorizations_spec.rb b/spec/lib/gitlab/project_authorizations_spec.rb
index 16066934194..517a2e3e335 100644
--- a/spec/lib/gitlab/project_authorizations_spec.rb
+++ b/spec/lib/gitlab/project_authorizations_spec.rb
@@ -334,7 +334,7 @@ RSpec.describe Gitlab::ProjectAuthorizations do
let(:common_id) { non_existing_record_id }
let!(:group) { create(:group, id: common_id) }
let!(:unrelated_project) { create(:project, id: common_id) }
- let(:user) { unrelated_project.owner }
+ let(:user) { unrelated_project.first_owner }
it 'does not have access to group and its projects' do
mapping = map_access_levels(authorizations)
diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb
index 427e8e67090..725a571e385 100644
--- a/spec/lib/gitlab/usage_data_spec.rb
+++ b/spec/lib/gitlab/usage_data_spec.rb
@@ -556,8 +556,6 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect(count_data[:issues_created_from_alerts]).to eq(3)
expect(count_data[:issues_created_manually_from_alerts]).to eq(1)
expect(count_data[:alert_bot_incident_issues]).to eq(4)
- expect(count_data[:incident_labeled_issues]).to eq(3)
-
expect(count_data[:clusters_enabled]).to eq(6)
expect(count_data[:project_clusters_enabled]).to eq(4)
expect(count_data[:group_clusters_enabled]).to eq(1)
diff --git a/spec/lib/sidebars/projects/menus/analytics_menu_spec.rb b/spec/lib/sidebars/projects/menus/analytics_menu_spec.rb
index 6f2ca719bc9..25a65015847 100644
--- a/spec/lib/sidebars/projects/menus/analytics_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/analytics_menu_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe Sidebars::Projects::Menus::AnalyticsMenu do
create(:user).tap { |u| project.add_guest(u) }
end
- let(:owner) { project.owner }
+ let(:owner) { project.first_owner }
let(:current_user) { owner }
let(:context) { Sidebars::Projects::Context.new(current_user: current_user, container: project, current_ref: project.repository.root_ref) }
diff --git a/spec/lib/sidebars/projects/menus/ci_cd_menu_spec.rb b/spec/lib/sidebars/projects/menus/ci_cd_menu_spec.rb
index dee2716e4c2..2ceb9dcada9 100644
--- a/spec/lib/sidebars/projects/menus/ci_cd_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/ci_cd_menu_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::CiCdMenu do
let(:project) { build(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:can_view_pipeline_editor) { true }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, current_ref: 'master', can_view_pipeline_editor: can_view_pipeline_editor) }
diff --git a/spec/lib/sidebars/projects/menus/confluence_menu_spec.rb b/spec/lib/sidebars/projects/menus/confluence_menu_spec.rb
index e3ae3add4fd..836c6d26c6c 100644
--- a/spec/lib/sidebars/projects/menus/confluence_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/confluence_menu_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ConfluenceMenu do
let_it_be_with_refind(:project) { create(:project, has_external_wiki: true) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) }
diff --git a/spec/lib/sidebars/projects/menus/deployments_menu_spec.rb b/spec/lib/sidebars/projects/menus/deployments_menu_spec.rb
index 3149c316c63..56eb082e101 100644
--- a/spec/lib/sidebars/projects/menus/deployments_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/deployments_menu_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::DeploymentsMenu do
let_it_be(:project) { create(:project, :repository) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
describe '#render?' do
diff --git a/spec/lib/sidebars/projects/menus/external_issue_tracker_menu_spec.rb b/spec/lib/sidebars/projects/menus/external_issue_tracker_menu_spec.rb
index 0585eb2254c..2033d40897e 100644
--- a/spec/lib/sidebars/projects/menus/external_issue_tracker_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/external_issue_tracker_menu_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ExternalIssueTrackerMenu do
let(:project) { build(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:jira_issues_integration_active) { false }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, jira_issues_integration: jira_issues_integration_active) }
diff --git a/spec/lib/sidebars/projects/menus/external_wiki_menu_spec.rb b/spec/lib/sidebars/projects/menus/external_wiki_menu_spec.rb
index a8f4b039b8c..9cf2d19f85c 100644
--- a/spec/lib/sidebars/projects/menus/external_wiki_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/external_wiki_menu_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ExternalWikiMenu do
let(:project) { build(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) }
diff --git a/spec/lib/sidebars/projects/menus/hidden_menu_spec.rb b/spec/lib/sidebars/projects/menus/hidden_menu_spec.rb
index 44013898721..e64b0de9c62 100644
--- a/spec/lib/sidebars/projects/menus/hidden_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/hidden_menu_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::HiddenMenu do
let_it_be(:project) { create(:project, :repository) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, current_ref: project.repository.root_ref) }
describe '#render?' do
diff --git a/spec/lib/sidebars/projects/menus/infrastructure_menu_spec.rb b/spec/lib/sidebars/projects/menus/infrastructure_menu_spec.rb
index 55281171634..0e415ec6014 100644
--- a/spec/lib/sidebars/projects/menus/infrastructure_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/infrastructure_menu_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::InfrastructureMenu do
let(:project) { build(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, show_cluster_hint: false) }
describe '#render?' do
diff --git a/spec/lib/sidebars/projects/menus/invite_team_members_menu_spec.rb b/spec/lib/sidebars/projects/menus/invite_team_members_menu_spec.rb
index df9b260d211..9838aa8c3e3 100644
--- a/spec/lib/sidebars/projects/menus/invite_team_members_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/invite_team_members_menu_spec.rb
@@ -11,7 +11,7 @@ RSpec.describe Sidebars::Projects::Menus::InviteTeamMembersMenu do
subject(:invite_menu) { described_class.new(context) }
context 'when the project is viewed by an owner of the group' do
- let(:owner) { project.owner }
+ let(:owner) { project.first_owner }
describe '#render?' do
it 'renders the Invite team members link' do
diff --git a/spec/lib/sidebars/projects/menus/issues_menu_spec.rb b/spec/lib/sidebars/projects/menus/issues_menu_spec.rb
index e5d486bbe8f..4c0016a77a1 100644
--- a/spec/lib/sidebars/projects/menus/issues_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/issues_menu_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::IssuesMenu do
let(:project) { build(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) }
diff --git a/spec/lib/sidebars/projects/menus/merge_requests_menu_spec.rb b/spec/lib/sidebars/projects/menus/merge_requests_menu_spec.rb
index cef303fb068..45c49500e46 100644
--- a/spec/lib/sidebars/projects/menus/merge_requests_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/merge_requests_menu_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::MergeRequestsMenu do
let_it_be(:project) { create(:project, :repository) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) }
diff --git a/spec/lib/sidebars/projects/menus/monitor_menu_spec.rb b/spec/lib/sidebars/projects/menus/monitor_menu_spec.rb
index 77efe99aaa9..e8c6fb790c3 100644
--- a/spec/lib/sidebars/projects/menus/monitor_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/monitor_menu_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::MonitorMenu do
let_it_be_with_refind(:project) { create(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:show_cluster_hint) { true }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, show_cluster_hint: show_cluster_hint) }
diff --git a/spec/lib/sidebars/projects/menus/packages_registries_menu_spec.rb b/spec/lib/sidebars/projects/menus/packages_registries_menu_spec.rb
index d6807451a25..afe0b2a8951 100644
--- a/spec/lib/sidebars/projects/menus/packages_registries_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/packages_registries_menu_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::PackagesRegistriesMenu do
let_it_be(:project) { create(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) }
diff --git a/spec/lib/sidebars/projects/menus/project_information_menu_spec.rb b/spec/lib/sidebars/projects/menus/project_information_menu_spec.rb
index 7e8d0ab0518..7ff06ac229e 100644
--- a/spec/lib/sidebars/projects/menus/project_information_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/project_information_menu_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ProjectInformationMenu do
let_it_be_with_reload(:project) { create(:project, :repository) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
describe '#container_html_options' do
diff --git a/spec/lib/sidebars/projects/menus/repository_menu_spec.rb b/spec/lib/sidebars/projects/menus/repository_menu_spec.rb
index 554a4e3f532..fc181947e60 100644
--- a/spec/lib/sidebars/projects/menus/repository_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/repository_menu_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::RepositoryMenu do
let_it_be(:project) { create(:project, :repository) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, current_ref: 'master') }
subject { described_class.new(context) }
diff --git a/spec/lib/sidebars/projects/menus/scope_menu_spec.rb b/spec/lib/sidebars/projects/menus/scope_menu_spec.rb
index 980ab2f7c71..4e87f3b8ead 100644
--- a/spec/lib/sidebars/projects/menus/scope_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/scope_menu_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ScopeMenu do
let(:project) { build(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
describe '#container_html_options' do
diff --git a/spec/lib/sidebars/projects/menus/security_compliance_menu_spec.rb b/spec/lib/sidebars/projects/menus/security_compliance_menu_spec.rb
index 6e84beeb274..41158bd58dc 100644
--- a/spec/lib/sidebars/projects/menus/security_compliance_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/security_compliance_menu_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::SecurityComplianceMenu do
let_it_be(:project) { create(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:show_promotions) { true }
let(:show_discover_project_security) { true }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project, show_promotions: show_promotions, show_discover_project_security: show_discover_project_security) }
diff --git a/spec/lib/sidebars/projects/menus/settings_menu_spec.rb b/spec/lib/sidebars/projects/menus/settings_menu_spec.rb
index 1e5d41dfec4..d6136dddf40 100644
--- a/spec/lib/sidebars/projects/menus/settings_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/settings_menu_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::SettingsMenu do
let_it_be(:project) { create(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) }
diff --git a/spec/lib/sidebars/projects/menus/shimo_menu_spec.rb b/spec/lib/sidebars/projects/menus/shimo_menu_spec.rb
index 534267a329e..e74647894fa 100644
--- a/spec/lib/sidebars/projects/menus/shimo_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/shimo_menu_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::ShimoMenu do
let_it_be_with_reload(:project) { create(:project) }
- let(:context) { Sidebars::Projects::Context.new(current_user: project.owner, container: project) }
+ let(:context) { Sidebars::Projects::Context.new(current_user: project.first_owner, container: project) }
subject(:shimo_menu) { described_class.new(context) }
diff --git a/spec/lib/sidebars/projects/menus/snippets_menu_spec.rb b/spec/lib/sidebars/projects/menus/snippets_menu_spec.rb
index af219e4a742..04b8c128e3d 100644
--- a/spec/lib/sidebars/projects/menus/snippets_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/snippets_menu_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::SnippetsMenu do
let(:project) { build(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) }
diff --git a/spec/lib/sidebars/projects/menus/wiki_menu_spec.rb b/spec/lib/sidebars/projects/menus/wiki_menu_spec.rb
index 41447ee24a9..362da3e7b50 100644
--- a/spec/lib/sidebars/projects/menus/wiki_menu_spec.rb
+++ b/spec/lib/sidebars/projects/menus/wiki_menu_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe Sidebars::Projects::Menus::WikiMenu do
let(:project) { build(:project) }
- let(:user) { project.owner }
+ let(:user) { project.first_owner }
let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) }
subject { described_class.new(context) }
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb
index c105f6c3439..b91b299467d 100644
--- a/spec/models/issue_spec.rb
+++ b/spec/models/issue_spec.rb
@@ -1431,26 +1431,6 @@ RSpec.describe Issue do
end
end
- describe '.with_label_attributes' do
- subject { described_class.with_label_attributes(label_attributes) }
-
- let(:label_attributes) { { title: 'hello world', description: 'hi' } }
-
- it 'gets issues with given label attributes' do
- label = create(:label, **label_attributes)
- labeled_issue = create(:labeled_issue, project: label.project, labels: [label])
-
- expect(subject).to include(labeled_issue)
- end
-
- it 'excludes issues without given label attributes' do
- label = create(:label, title: 'GitLab', description: 'tanuki')
- labeled_issue = create(:labeled_issue, project: label.project, labels: [label])
-
- expect(subject).not_to include(labeled_issue)
- end
- end
-
describe 'banzai_render_context' do
let(:project) { build(:project_empty_repo) }
let(:issue) { build :issue, project: project }
diff --git a/spec/models/pages_domain_spec.rb b/spec/models/pages_domain_spec.rb
index 0735bf25690..2ebc9864d9b 100644
--- a/spec/models/pages_domain_spec.rb
+++ b/spec/models/pages_domain_spec.rb
@@ -36,9 +36,12 @@ RSpec.describe PagesDomain do
'123.456.789' => true,
'0x12345.com' => true,
'0123123' => true,
- '_foo.com' => false,
+ 'a-reserved.com' => true,
+ 'a.b-reserved.com' => true,
'reserved.com' => false,
+ '_foo.com' => false,
'a.reserved.com' => false,
+ 'a.b.reserved.com' => false,
nil => false
}.each do |value, validity|
context "domain #{value.inspect} validity" do
diff --git a/spec/services/incident_management/create_incident_label_service_spec.rb b/spec/services/incident_management/create_incident_label_service_spec.rb
deleted file mode 100644
index 441cddf1d2e..00000000000
--- a/spec/services/incident_management/create_incident_label_service_spec.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe IncidentManagement::CreateIncidentLabelService do
- it_behaves_like 'incident management label service'
-end
diff --git a/spec/services/incident_management/incidents/create_service_spec.rb b/spec/services/incident_management/incidents/create_service_spec.rb
index 47ce9d01f66..862b7de4ec8 100644
--- a/spec/services/incident_management/incidents/create_service_spec.rb
+++ b/spec/services/incident_management/incidents/create_service_spec.rb
@@ -14,7 +14,6 @@ RSpec.describe IncidentManagement::Incidents::CreateService do
context 'when incident has title and description' do
let(:title) { 'Incident title' }
let(:new_issue) { Issue.last! }
- let(:label_title) { attributes_for(:label, :incident)[:title] }
it 'responds with success' do
expect(create_incident).to be_success
@@ -38,8 +37,6 @@ RSpec.describe IncidentManagement::Incidents::CreateService do
end
let(:issue) { new_issue }
-
- include_examples 'does not have incident label'
end
context 'with default severity' do
@@ -69,20 +66,6 @@ RSpec.describe IncidentManagement::Incidents::CreateService do
end
end
end
-
- context 'when incident label does not exists' do
- it 'does not create incident label' do
- expect { create_incident }.to not_change { project.labels.where(title: label_title).count }
- end
- end
-
- context 'when incident label already exists' do
- let!(:label) { create(:label, project: project, title: label_title) }
-
- it 'does not create new labels' do
- expect { create_incident }.not_to change(Label, :count)
- end
- end
end
context 'when incident has no title' do
diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb
index b0dd3b9eff1..4494c1acaf7 100644
--- a/spec/services/issues/create_service_spec.rb
+++ b/spec/services/issues/create_service_spec.rb
@@ -100,7 +100,6 @@ RSpec.describe Issues::CreateService do
end
let(:current_user) { user }
- let(:incident_label_attributes) { attributes_for(:label, :incident) }
subject { issue }
@@ -114,12 +113,6 @@ RSpec.describe Issues::CreateService do
end
it_behaves_like 'incident issue'
- it_behaves_like 'does not have incident label'
-
- it 'does not create an incident label' do
- expect { subject }
- .to not_change { Label.where(incident_label_attributes).count }
- end
it 'calls IncidentManagement::Incidents::CreateEscalationStatusService' do
expect_next(::IncidentManagement::IssuableEscalationStatuses::CreateService, a_kind_of(Issue))
diff --git a/spec/support/shared_examples/services/incident_shared_examples.rb b/spec/support/shared_examples/services/incident_shared_examples.rb
index 36b0acf5a51..cc26cf87322 100644
--- a/spec/support/shared_examples/services/incident_shared_examples.rb
+++ b/spec/support/shared_examples/services/incident_shared_examples.rb
@@ -28,28 +28,15 @@ end
#
# include_examples 'not an incident issue'
RSpec.shared_examples 'not an incident issue' do
- let(:label_properties) { attributes_for(:label, :incident) }
-
it 'has not incident as issue type' do
expect(issue.issue_type).not_to eq('incident')
expect(issue.work_item_type.base_type).not_to eq('incident')
end
-
- it_behaves_like 'does not have incident label'
-end
-
-RSpec.shared_examples 'does not have incident label' do
- let(:label_properties) { attributes_for(:label, :incident) }
-
- it 'has not an incident label' do
- expect(issue.labels).not_to include(have_attributes(label_properties))
- end
end
# This shared example is to test the execution of incident management label services
# For example:
# - IncidentManagement::CreateIncidentSlaExceededLabelService
-# - IncidentManagement::CreateIncidentLabelService
# It doesn't require any defined variables