summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-06 09:08:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-06 09:08:54 +0000
commit4903f95b04db58edc1931ec917d2313c916a06b2 (patch)
tree722e74b8e49f12f8f7aebffc2fa58c9ccc126fb1
parent6367f9bd9cca41c932997c94a338556ded4ced8f (diff)
downloadgitlab-ce-4903f95b04db58edc1931ec917d2313c916a06b2.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/assets/javascripts/artifacts/components/artifacts_table_row_details.vue2
-rw-r--r--app/assets/javascripts/artifacts/components/job_artifacts_table.vue2
-rw-r--r--app/assets/javascripts/error_tracking/components/error_details.vue2
-rw-r--r--app/assets/javascripts/error_tracking/store/actions.js2
-rw-r--r--app/assets/javascripts/error_tracking/store/details/actions.js2
-rw-r--r--app/assets/javascripts/error_tracking/store/list/actions.js2
-rw-r--r--app/assets/javascripts/feature_flags/components/environments_dropdown.vue2
-rw-r--r--app/assets/javascripts/feature_flags/store/edit/actions.js2
-rw-r--r--app/assets/javascripts/incidents_settings/incidents_settings_service.js2
-rw-r--r--app/assets/javascripts/releases/components/app_index.vue2
-rw-r--r--app/assets/javascripts/releases/components/app_show.vue2
-rw-r--r--app/assets/javascripts/releases/release_notification_service.js2
-rw-r--r--app/assets/javascripts/releases/stores/modules/edit_new/actions.js2
-rw-r--r--app/assets/javascripts/repository/commits_service.js2
-rw-r--r--app/assets/javascripts/repository/components/blob_content_viewer.vue2
-rw-r--r--app/assets/javascripts/repository/components/blob_controls.vue2
-rw-r--r--app/assets/javascripts/repository/components/fork_info.vue2
-rw-r--r--app/assets/javascripts/repository/components/new_directory_modal.vue2
-rw-r--r--app/assets/javascripts/repository/components/tree_content.vue2
-rw-r--r--app/assets/javascripts/repository/components/upload_blob_modal.vue2
-rw-r--r--app/assets/javascripts/saved_replies/components/list_item.vue67
-rw-r--r--app/assets/javascripts/saved_replies/queries/delete_saved_reply.mutation.graphql5
-rw-r--r--app/controllers/users_controller.rb14
-rw-r--r--app/helpers/merge_requests_helper.rb1
-rw-r--r--app/presenters/event_presenter.rb2
-rw-r--r--app/serializers/profile/event_entity.rb125
-rw-r--r--app/serializers/profile/event_serializer.rb7
-rw-r--r--db/post_migrate/20230221093533_add_tmp_partial_index_on_vulnerability_report_types.rb15
-rw-r--r--db/post_migrate/20230222055510_remove_concurrent_index_on_token_encrypted_for_ci_builds.rb18
-rw-r--r--db/schema_migrations/202302210935331
-rw-r--r--db/schema_migrations/202302220555101
-rw-r--r--db/structure.sql2
-rw-r--r--doc/administration/geo/setup/external_database.md16
-rw-r--r--doc/administration/instance_limits.md33
-rw-r--r--doc/administration/object_storage.md80
-rw-r--r--doc/administration/operations/gitlab_sshd.md10
-rw-r--r--doc/administration/operations/moving_repositories.md16
-rw-r--r--doc/administration/packages/container_registry.md102
-rw-r--r--doc/administration/postgresql/external.md24
-rw-r--r--doc/administration/read_only_gitlab.md44
-rw-r--r--doc/administration/redis/replication_and_failover_external.md14
-rw-r--r--doc/administration/sidekiq/index.md2
-rw-r--r--doc/api/graphql/reference/index.md10
-rw-r--r--doc/architecture/blueprints/runner_tokens/index.md32
-rw-r--r--doc/development/advanced_search.md2
-rw-r--r--doc/development/audit_event_guide/index.md2
-rw-r--r--doc/development/auto_devops.md2
-rw-r--r--doc/development/backend/create_source_code_be/index.md6
-rw-r--r--doc/development/cicd/index.md2
-rw-r--r--doc/development/code_intelligence/index.md2
-rw-r--r--doc/development/contributing/style_guides.md2
-rw-r--r--doc/development/database/index.md2
-rw-r--r--doc/development/distributed_tracing.md2
-rw-r--r--doc/development/fe_guide/style/index.md2
-rw-r--r--doc/development/gemfile.md2
-rw-r--r--doc/development/gitaly.md2
-rw-r--r--doc/development/gitlab_flavored_markdown/index.md2
-rw-r--r--doc/development/gitlab_shell/index.md2
-rw-r--r--doc/development/integrations/index.md2
-rw-r--r--doc/development/integrations/jira_connect.md2
-rw-r--r--doc/development/json.md2
-rw-r--r--doc/development/kubernetes.md2
-rw-r--r--doc/development/lfs.md2
-rw-r--r--doc/development/logging.md2
-rw-r--r--doc/development/merge_request_concepts/approval_rules.md2
-rw-r--r--doc/development/packages/index.md2
-rw-r--r--doc/development/permissions.md2
-rw-r--r--doc/development/product_qualified_lead_guide/index.md2
-rw-r--r--doc/development/prometheus_metrics.md2
-rw-r--r--doc/development/python_guide/index.md2
-rw-r--r--doc/development/real_time.md2
-rw-r--r--doc/development/redis.md2
-rw-r--r--doc/development/rubocop_development_guide.md2
-rw-r--r--doc/development/sec/index.md2
-rw-r--r--doc/development/secure_coding_guidelines.md2
-rw-r--r--doc/development/service_ping/index.md2
-rw-r--r--doc/development/shell_commands.md2
-rw-r--r--doc/development/sidekiq/index.md2
-rw-r--r--doc/development/snowplow/index.md2
-rw-r--r--doc/development/uploads/index.md2
-rw-r--r--doc/development/value_stream_analytics.md2
-rw-r--r--doc/development/wikis.md2
-rw-r--r--doc/user/packages/debian_repository/index.md6
-rw-r--r--lib/gitlab/database/async_constraints/migration_helpers.rb39
-rw-r--r--lib/gitlab/database/async_constraints/postgres_async_constraint_validation.rb3
-rw-r--r--locale/gitlab.pot6
-rw-r--r--spec/features/profiles/user_deletes_saved_reply_spec.rb27
-rw-r--r--spec/features/projects/work_items/work_item_children_spec.rb (renamed from spec/features/work_items/work_item_children_spec.rb)0
-rw-r--r--spec/features/projects/work_items/work_item_spec.rb (renamed from spec/features/work_items/work_item_spec.rb)0
-rw-r--r--spec/frontend/saved_replies/components/__snapshots__/list_item_spec.js.snap31
-rw-r--r--spec/frontend/saved_replies/components/list_item_spec.js32
-rw-r--r--spec/lib/gitlab/database/async_constraints/migration_helpers_spec.rb104
-rw-r--r--spec/lib/gitlab/database/async_constraints/postgres_async_constraint_validation_spec.rb10
-rw-r--r--spec/migrations/20230221093533_add_tmp_partial_index_on_vulnerability_report_types_spec.rb22
-rw-r--r--spec/requests/users_controller_spec.rb100
-rw-r--r--spec/serializers/profile/event_entity_spec.rb149
-rw-r--r--workhorse/go.mod2
-rw-r--r--workhorse/go.sum3
98 files changed, 1019 insertions, 276 deletions
diff --git a/app/assets/javascripts/artifacts/components/artifacts_table_row_details.vue b/app/assets/javascripts/artifacts/components/artifacts_table_row_details.vue
index 4a826d0d462..b9aae4bf4e5 100644
--- a/app/assets/javascripts/artifacts/components/artifacts_table_row_details.vue
+++ b/app/assets/javascripts/artifacts/components/artifacts_table_row_details.vue
@@ -1,5 +1,5 @@
<script>
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import { DynamicScroller, DynamicScrollerItem } from 'vendor/vue-virtual-scroller';
import getJobArtifactsQuery from '../graphql/queries/get_job_artifacts.query.graphql';
import destroyArtifactMutation from '../graphql/mutations/destroy_artifact.mutation.graphql';
diff --git a/app/assets/javascripts/artifacts/components/job_artifacts_table.vue b/app/assets/javascripts/artifacts/components/job_artifacts_table.vue
index 5743ff3ec9e..a7331cc1fd3 100644
--- a/app/assets/javascripts/artifacts/components/job_artifacts_table.vue
+++ b/app/assets/javascripts/artifacts/components/job_artifacts_table.vue
@@ -9,7 +9,7 @@ import {
GlIcon,
GlPagination,
} from '@gitlab/ui';
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue';
import CiIcon from '~/vue_shared/components/ci_icon.vue';
diff --git a/app/assets/javascripts/error_tracking/components/error_details.vue b/app/assets/javascripts/error_tracking/components/error_details.vue
index b02c3cd2cba..61c0ddef639 100644
--- a/app/assets/javascripts/error_tracking/components/error_details.vue
+++ b/app/assets/javascripts/error_tracking/components/error_details.vue
@@ -13,7 +13,7 @@ import {
GlIcon,
} from '@gitlab/ui';
import { mapActions, mapGetters, mapState } from 'vuex';
-import { createAlert, VARIANT_WARNING } from '~/flash';
+import { createAlert, VARIANT_WARNING } from '~/alert';
import { __, sprintf, n__ } from '~/locale';
import Tracking from '~/tracking';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
diff --git a/app/assets/javascripts/error_tracking/store/actions.js b/app/assets/javascripts/error_tracking/store/actions.js
index 603f8611005..adbce7750fa 100644
--- a/app/assets/javascripts/error_tracking/store/actions.js
+++ b/app/assets/javascripts/error_tracking/store/actions.js
@@ -1,4 +1,4 @@
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import { visitUrl } from '~/lib/utils/url_utility';
import { __ } from '~/locale';
import service from '../services';
diff --git a/app/assets/javascripts/error_tracking/store/details/actions.js b/app/assets/javascripts/error_tracking/store/details/actions.js
index 1409399940a..89b9432c377 100644
--- a/app/assets/javascripts/error_tracking/store/details/actions.js
+++ b/app/assets/javascripts/error_tracking/store/details/actions.js
@@ -1,4 +1,4 @@
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import Poll from '~/lib/utils/poll';
import { __ } from '~/locale';
import service from '../../services';
diff --git a/app/assets/javascripts/error_tracking/store/list/actions.js b/app/assets/javascripts/error_tracking/store/list/actions.js
index f633711add3..84e4463ca21 100644
--- a/app/assets/javascripts/error_tracking/store/list/actions.js
+++ b/app/assets/javascripts/error_tracking/store/list/actions.js
@@ -1,4 +1,4 @@
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import Poll from '~/lib/utils/poll';
import { __ } from '~/locale';
import Service from '../../services';
diff --git a/app/assets/javascripts/feature_flags/components/environments_dropdown.vue b/app/assets/javascripts/feature_flags/components/environments_dropdown.vue
index ce5f7915dbf..57727cb945e 100644
--- a/app/assets/javascripts/feature_flags/components/environments_dropdown.vue
+++ b/app/assets/javascripts/feature_flags/components/environments_dropdown.vue
@@ -1,7 +1,7 @@
<script>
import { GlButton, GlSearchBoxByType } from '@gitlab/ui';
import { debounce } from 'lodash';
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import axios from '~/lib/utils/axios_utils';
import { __ } from '~/locale';
diff --git a/app/assets/javascripts/feature_flags/store/edit/actions.js b/app/assets/javascripts/feature_flags/store/edit/actions.js
index 97c22781ac5..585bb1be0c4 100644
--- a/app/assets/javascripts/feature_flags/store/edit/actions.js
+++ b/app/assets/javascripts/feature_flags/store/edit/actions.js
@@ -1,4 +1,4 @@
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import axios from '~/lib/utils/axios_utils';
import { visitUrl } from '~/lib/utils/url_utility';
import { __ } from '~/locale';
diff --git a/app/assets/javascripts/incidents_settings/incidents_settings_service.js b/app/assets/javascripts/incidents_settings/incidents_settings_service.js
index d3850114350..195544c746e 100644
--- a/app/assets/javascripts/incidents_settings/incidents_settings_service.js
+++ b/app/assets/javascripts/incidents_settings/incidents_settings_service.js
@@ -1,4 +1,4 @@
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import axios from '~/lib/utils/axios_utils';
import { refreshCurrentPage } from '~/lib/utils/url_utility';
import { ERROR_MSG } from './constants';
diff --git a/app/assets/javascripts/releases/components/app_index.vue b/app/assets/javascripts/releases/components/app_index.vue
index 9f200856db3..515d9efaefd 100644
--- a/app/assets/javascripts/releases/components/app_index.vue
+++ b/app/assets/javascripts/releases/components/app_index.vue
@@ -1,6 +1,6 @@
<script>
import { GlButton } from '@gitlab/ui';
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import { historyPushState } from '~/lib/utils/common_utils';
import { scrollUp } from '~/lib/utils/scroll_utils';
import { setUrlParams, getParameterByName } from '~/lib/utils/url_utility';
diff --git a/app/assets/javascripts/releases/components/app_show.vue b/app/assets/javascripts/releases/components/app_show.vue
index 544f2de5132..111d9e232c5 100644
--- a/app/assets/javascripts/releases/components/app_show.vue
+++ b/app/assets/javascripts/releases/components/app_show.vue
@@ -1,5 +1,5 @@
<script>
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import { s__ } from '~/locale';
import { popCreateReleaseNotification } from '~/releases/release_notification_service';
import oneReleaseQuery from '../graphql/queries/one_release.query.graphql';
diff --git a/app/assets/javascripts/releases/release_notification_service.js b/app/assets/javascripts/releases/release_notification_service.js
index a4f926d7561..775c62802d4 100644
--- a/app/assets/javascripts/releases/release_notification_service.js
+++ b/app/assets/javascripts/releases/release_notification_service.js
@@ -1,5 +1,5 @@
import { s__, sprintf } from '~/locale';
-import { createAlert, VARIANT_SUCCESS } from '~/flash';
+import { createAlert, VARIANT_SUCCESS } from '~/alert';
const createReleaseSessionKey = (projectPath) => `createRelease:${projectPath}`;
diff --git a/app/assets/javascripts/releases/stores/modules/edit_new/actions.js b/app/assets/javascripts/releases/stores/modules/edit_new/actions.js
index 42ceed81c00..a7d8825ed33 100644
--- a/app/assets/javascripts/releases/stores/modules/edit_new/actions.js
+++ b/app/assets/javascripts/releases/stores/modules/edit_new/actions.js
@@ -1,5 +1,5 @@
import { getTag } from '~/rest_api';
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import { redirectTo } from '~/lib/utils/url_utility';
import { s__ } from '~/locale';
import createReleaseMutation from '~/releases/graphql/mutations/create_release.mutation.graphql';
diff --git a/app/assets/javascripts/repository/commits_service.js b/app/assets/javascripts/repository/commits_service.js
index d029f8cf89f..e26036b5620 100644
--- a/app/assets/javascripts/repository/commits_service.js
+++ b/app/assets/javascripts/repository/commits_service.js
@@ -1,7 +1,7 @@
import axios from '~/lib/utils/axios_utils';
import { joinPaths } from '~/lib/utils/url_utility';
import { normalizeData } from 'ee_else_ce/repository/utils/commit';
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import { COMMIT_BATCH_SIZE, I18N_COMMIT_DATA_FETCH_ERROR } from './constants';
let requestedOffsets = [];
diff --git a/app/assets/javascripts/repository/components/blob_content_viewer.vue b/app/assets/javascripts/repository/components/blob_content_viewer.vue
index 101625a4b72..236351005e7 100644
--- a/app/assets/javascripts/repository/components/blob_content_viewer.vue
+++ b/app/assets/javascripts/repository/components/blob_content_viewer.vue
@@ -4,7 +4,7 @@ import { uniqueId } from 'lodash';
import BlobContent from '~/blob/components/blob_content.vue';
import BlobHeader from '~/blob/components/blob_header.vue';
import { SIMPLE_BLOB_VIEWER, RICH_BLOB_VIEWER } from '~/blob/components/constants';
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import axios from '~/lib/utils/axios_utils';
import { isLoggedIn, handleLocationHash } from '~/lib/utils/common_utils';
import { __ } from '~/locale';
diff --git a/app/assets/javascripts/repository/components/blob_controls.vue b/app/assets/javascripts/repository/components/blob_controls.vue
index 29c2c3762fc..d3e306619bf 100644
--- a/app/assets/javascripts/repository/components/blob_controls.vue
+++ b/app/assets/javascripts/repository/components/blob_controls.vue
@@ -1,7 +1,7 @@
<script>
import { GlButton } from '@gitlab/ui';
import { __ } from '~/locale';
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import getRefMixin from '~/repository/mixins/get_ref';
import initSourcegraph from '~/sourcegraph';
import ShortcutsBlob from '~/behaviors/shortcuts/shortcuts_blob';
diff --git a/app/assets/javascripts/repository/components/fork_info.vue b/app/assets/javascripts/repository/components/fork_info.vue
index 9804837b200..51a83e5df8a 100644
--- a/app/assets/javascripts/repository/components/fork_info.vue
+++ b/app/assets/javascripts/repository/components/fork_info.vue
@@ -1,7 +1,7 @@
<script>
import { GlIcon, GlLink, GlSkeletonLoader, GlSprintf } from '@gitlab/ui';
import { s__, sprintf, n__ } from '~/locale';
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import forkDetailsQuery from '../queries/fork_details.query.graphql';
export const i18n = {
diff --git a/app/assets/javascripts/repository/components/new_directory_modal.vue b/app/assets/javascripts/repository/components/new_directory_modal.vue
index b28ebe7bb1e..d9f3a30d28f 100644
--- a/app/assets/javascripts/repository/components/new_directory_modal.vue
+++ b/app/assets/javascripts/repository/components/new_directory_modal.vue
@@ -8,7 +8,7 @@ import {
GlFormTextarea,
GlToggle,
} from '@gitlab/ui';
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import axios from '~/lib/utils/axios_utils';
import { visitUrl } from '~/lib/utils/url_utility';
import { __ } from '~/locale';
diff --git a/app/assets/javascripts/repository/components/tree_content.vue b/app/assets/javascripts/repository/components/tree_content.vue
index f6d6004ba96..d597a3a78d1 100644
--- a/app/assets/javascripts/repository/components/tree_content.vue
+++ b/app/assets/javascripts/repository/components/tree_content.vue
@@ -1,6 +1,6 @@
<script>
import paginatedTreeQuery from 'shared_queries/repository/paginated_tree.query.graphql';
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import {
TREE_PAGE_SIZE,
diff --git a/app/assets/javascripts/repository/components/upload_blob_modal.vue b/app/assets/javascripts/repository/components/upload_blob_modal.vue
index 4603ea2710d..f76242f3d37 100644
--- a/app/assets/javascripts/repository/components/upload_blob_modal.vue
+++ b/app/assets/javascripts/repository/components/upload_blob_modal.vue
@@ -9,7 +9,7 @@ import {
GlButton,
GlAlert,
} from '@gitlab/ui';
-import { createAlert } from '~/flash';
+import { createAlert } from '~/alert';
import axios from '~/lib/utils/axios_utils';
import { ContentTypeMultipartFormData } from '~/lib/utils/headers';
import { numberToHumanSize } from '~/lib/utils/number_utils';
diff --git a/app/assets/javascripts/saved_replies/components/list_item.vue b/app/assets/javascripts/saved_replies/components/list_item.vue
index dfa9a405dee..774ac745925 100644
--- a/app/assets/javascripts/saved_replies/components/list_item.vue
+++ b/app/assets/javascripts/saved_replies/components/list_item.vue
@@ -1,11 +1,49 @@
<script>
+import { uniqueId } from 'lodash';
+import { GlButton, GlModal, GlModalDirective, GlSprintf, GlTooltipDirective } from '@gitlab/ui';
+import { __ } from '~/locale';
+import deleteSavedReplyMutation from '../queries/delete_saved_reply.mutation.graphql';
+
export default {
+ components: {
+ GlButton,
+ GlModal,
+ GlSprintf,
+ },
+ directives: {
+ GlModal: GlModalDirective,
+ GlTooltip: GlTooltipDirective,
+ },
props: {
reply: {
type: Object,
required: true,
},
},
+ data() {
+ return {
+ isDeleting: false,
+ modalId: uniqueId('delete-saved-reply-'),
+ };
+ },
+ methods: {
+ onDelete() {
+ this.isDeleting = true;
+
+ this.$apollo.mutate({
+ mutation: deleteSavedReplyMutation,
+ variables: {
+ id: this.reply.id,
+ },
+ update: (cache) => {
+ const cacheId = cache.identify(this.reply);
+ cache.evict({ id: cacheId });
+ },
+ });
+ },
+ },
+ actionPrimary: { text: __('Delete'), attributes: { variant: 'danger' } },
+ actionSecondary: { text: __('Cancel'), attributes: { variant: 'default' } },
};
</script>
@@ -13,7 +51,36 @@ export default {
<li class="gl-mb-5">
<div class="gl-display-flex gl-align-items-center">
<strong>{{ reply.name }}</strong>
+ <div class="gl-ml-auto">
+ <gl-button
+ v-gl-modal="modalId"
+ v-gl-tooltip
+ icon="remove"
+ :aria-label="__('Delete')"
+ :title="__('Delete')"
+ variant="danger"
+ category="secondary"
+ data-testid="saved-reply-delete-btn"
+ :loading="isDeleting"
+ />
+ </div>
</div>
<div class="gl-mt-3 gl-font-monospace">{{ reply.content }}</div>
+ <gl-modal
+ :title="__('Delete saved reply')"
+ :action-primary="$options.actionPrimary"
+ :action-secondary="$options.actionSecondary"
+ :modal-id="modalId"
+ size="sm"
+ @primary="onDelete"
+ >
+ <gl-sprintf
+ :message="__('Are you sure you want to delete %{name}? This action cannot be undone.')"
+ >
+ <template #name
+ ><strong>{{ reply.name }}</strong></template
+ >
+ </gl-sprintf>
+ </gl-modal>
</li>
</template>
diff --git a/app/assets/javascripts/saved_replies/queries/delete_saved_reply.mutation.graphql b/app/assets/javascripts/saved_replies/queries/delete_saved_reply.mutation.graphql
new file mode 100644
index 00000000000..76571ba628c
--- /dev/null
+++ b/app/assets/javascripts/saved_replies/queries/delete_saved_reply.mutation.graphql
@@ -0,0 +1,5 @@
+mutation deleteSavedReply($id: UsersSavedReplyID!) {
+ savedReplyDestroy(input: { id: $id }) {
+ errors
+ }
+}
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 58f40e10fd4..e4354eaa452 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -72,7 +72,19 @@ class UsersController < ApplicationController
format.json do
load_events
- pager_json("events/_events", @events.count, events: @events)
+
+ if Feature.enabled?(:profile_tabs_vue, current_user)
+ @events = if user.include_private_contributions?
+ @events
+ else
+ @events.select { |event| event.visible_to_user?(current_user) }
+ end
+
+ render json: ::Profile::EventSerializer.new(current_user: current_user, target_user: user)
+ .represent(@events)
+ else
+ pager_json("events/_events", @events.count, events: @events)
+ end
end
end
end
diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb
index 590659be0cb..70b40221c35 100644
--- a/app/helpers/merge_requests_helper.rb
+++ b/app/helpers/merge_requests_helper.rb
@@ -2,6 +2,7 @@
module MergeRequestsHelper
include Gitlab::Utils::StrongMemoize
+ include CompareHelper
def create_mr_button_from_event?(event)
create_mr_button?(from: event.branch_name, source_project: event.project)
diff --git a/app/presenters/event_presenter.rb b/app/presenters/event_presenter.rb
index 2f2fb1aa3ba..a098db7fbbc 100644
--- a/app/presenters/event_presenter.rb
+++ b/app/presenters/event_presenter.rb
@@ -9,7 +9,7 @@ class EventPresenter < Gitlab::View::Presenter::Delegated
@visible_to_user_cache = ActiveSupport::Cache::MemoryStore.new
end
- # Caching `visible_to_user?` method in the presenter beause it might be called multiple times.
+ # Caching `visible_to_user?` method in the presenter because it might be called multiple times.
delegator_override :visible_to_user?
def visible_to_user?(user = nil)
@visible_to_user_cache.fetch(user&.id) { super(user) }
diff --git a/app/serializers/profile/event_entity.rb b/app/serializers/profile/event_entity.rb
new file mode 100644
index 00000000000..fe90265c888
--- /dev/null
+++ b/app/serializers/profile/event_entity.rb
@@ -0,0 +1,125 @@
+# frozen_string_literal: true
+
+module Profile
+ class EventEntity < Grape::Entity
+ include ActionView::Helpers::SanitizeHelper
+ include RequestAwareEntity
+ include MarkupHelper
+ include MergeRequestsHelper
+ include EventsHelper
+
+ expose :created_at, if: ->(event) { include_private_event?(event) }
+ expose(:action, if: ->(event) { include_private_event?(event) }) { |event| event_action(event) }
+
+ expose :ref, if: ->(event) { event.visible_to_user?(current_user) && event.push_action? } do
+ expose(:type) { |event| event.ref_type } # rubocop:disable Style/SymbolProc
+ expose(:count) { |event| event.ref_count } # rubocop:disable Style/SymbolProc
+ expose(:name) { |event| event.ref_name } # rubocop:disable Style/SymbolProc
+ expose(:path) { |event| ref_path(event) }
+ end
+
+ expose :commit, if: ->(event) { event.visible_to_user?(current_user) && event.push_action? } do
+ expose(:truncated_sha) { |event| Commit.truncate_sha(event.commit_id) }
+ expose(:path) { |event| project_commit_path(event.project, event.commit_id) }
+ expose(:title) { |event| event_commit_title(event.commit_title) }
+ expose(:count) { |event| event.commits_count } # rubocop:disable Style/SymbolProc
+ expose(:create_mr_path) { |event| commit_create_mr_path(event) }
+ expose(:from_truncated_sha) { |event| commit_from(event) if event.commit_from }
+ expose(:to_truncated_sha) { |event| Commit.truncate_sha(event.commit_to) if event.commit_to }
+
+ expose :compare_path, if: ->(event) { event.push_with_commits? && event.commits_count > 1 } do |event|
+ project = event.project
+ from = event.md_ref? ? event.commit_from : project.default_branch
+ project_compare_path(project, from: from, to: event.commit_to)
+ end
+ end
+
+ expose :author, if: ->(event) { include_private_event?(event) } do
+ expose(:id) { |event| event.author.id }
+ expose(:name) { |event| event.author.name }
+ expose(:path) { |event| event.author.username }
+ end
+
+ expose :target, if: ->(event) { event.visible_to_user?(current_user) } do
+ expose :target_type
+
+ expose(:title) { |event| event.target_title } # rubocop:disable Style/SymbolProc
+ expose :target_url, if: ->(event) { event.target } do |event|
+ Gitlab::UrlBuilder.build(event.target, only_path: true)
+ end
+ expose :reference_link_text, if: ->(event) { event.target&.respond_to?(:reference_link_text) } do |event|
+ event.target.reference_link_text
+ end
+ expose :first_line_in_markdown, if: ->(event) { event.note? && event.target && event.project } do |event|
+ first_line_in_markdown(event.target, :note, 150, project: event.project)
+ end
+ expose :attachment, if: ->(event) { event.note? && event.target&.attachment } do
+ expose(:url) { |event| event.target.attachment.url }
+ end
+ end
+
+ expose :resource_parent, if: ->(event) { event.visible_to_user?(current_user) } do
+ expose(:type) { |event| resource_parent_type(event) }
+ expose(:full_name) { |event| event.resource_parent&.full_name }
+ expose(:full_path) { |event| event.resource_parent&.full_path }
+ end
+
+ private
+
+ def current_user
+ request.current_user
+ end
+
+ def target_user
+ request.target_user
+ end
+
+ def include_private_event?(event)
+ event.visible_to_user?(current_user) || target_user.include_private_contributions?
+ end
+
+ def commit_from(event)
+ if event.md_ref?
+ Commit.truncate_sha(event.commit_from)
+ else
+ event.project.default_branch
+ end
+ end
+
+ def event_action(event)
+ if event.visible_to_user?(current_user)
+ event.action
+ elsif target_user.include_private_contributions?
+ 'private'
+ end
+ end
+
+ def ref_path(event)
+ project = event.project
+ commits_link = project_commits_path(project, event.ref_name)
+ should_link = if event.tag?
+ project.repository.tag_exists?(event.ref_name)
+ else
+ project.repository.branch_exists?(event.ref_name)
+ end
+
+ should_link ? commits_link : nil
+ end
+
+ def commit_create_mr_path(event)
+ if event.new_ref? &&
+ create_mr_button_from_event?(event) &&
+ event.authored_by?(current_user)
+ create_mr_path_from_push_event(event)
+ end
+ end
+
+ def resource_parent_type(event)
+ if event.project
+ "project"
+ elsif event.group
+ "group"
+ end
+ end
+ end
+end
diff --git a/app/serializers/profile/event_serializer.rb b/app/serializers/profile/event_serializer.rb
new file mode 100644
index 00000000000..c7f23d61fe1
--- /dev/null
+++ b/app/serializers/profile/event_serializer.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+module Profile
+ class EventSerializer < BaseSerializer
+ entity Profile::EventEntity
+ end
+end
diff --git a/db/post_migrate/20230221093533_add_tmp_partial_index_on_vulnerability_report_types.rb b/db/post_migrate/20230221093533_add_tmp_partial_index_on_vulnerability_report_types.rb
new file mode 100644
index 00000000000..4800ce5ed4c
--- /dev/null
+++ b/db/post_migrate/20230221093533_add_tmp_partial_index_on_vulnerability_report_types.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class AddTmpPartialIndexOnVulnerabilityReportTypes < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99'
+ CLAUSE = 'report_type IN (7, 99)'
+
+ def up
+ # Temporary index to be removed in 15.11 https://gitlab.com/gitlab-org/gitlab/-/issues/393052
+ prepare_async_index :vulnerability_occurrences, :id, where: CLAUSE, name: INDEX_NAME
+ end
+
+ def down
+ unprepare_async_index :vulnerability_occurrences, :id, name: INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20230222055510_remove_concurrent_index_on_token_encrypted_for_ci_builds.rb b/db/post_migrate/20230222055510_remove_concurrent_index_on_token_encrypted_for_ci_builds.rb
new file mode 100644
index 00000000000..d3ed5a8fa2c
--- /dev/null
+++ b/db/post_migrate/20230222055510_remove_concurrent_index_on_token_encrypted_for_ci_builds.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RemoveConcurrentIndexOnTokenEncryptedForCiBuilds < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ TABLE_NAME = :ci_builds
+ COLUMN_NAME = :token_encrypted
+ INDEX_NAME = :index_ci_builds_on_token_encrypted
+ WHERE_STATEMENT = 'token_encrypted IS NOT NULL'
+
+ def up
+ remove_concurrent_index_by_name TABLE_NAME, name: INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index TABLE_NAME, COLUMN_NAME, name: INDEX_NAME, where: WHERE_STATEMENT, unique: true
+ end
+end
diff --git a/db/schema_migrations/20230221093533 b/db/schema_migrations/20230221093533
new file mode 100644
index 00000000000..1d9ac2c72b4
--- /dev/null
+++ b/db/schema_migrations/20230221093533
@@ -0,0 +1 @@
+6a3453275435ebad3269b81f10bc75bf3aeb92f8c9a6769743acf2af78a1dc69 \ No newline at end of file
diff --git a/db/schema_migrations/20230222055510 b/db/schema_migrations/20230222055510
new file mode 100644
index 00000000000..5abc44779d9
--- /dev/null
+++ b/db/schema_migrations/20230222055510
@@ -0,0 +1 @@
+ff8b8d5448460302449025fc79cec95d0d3ae2eb335e9f786031d39caacf631a \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index fdfe26e709b..ceddf2a82a5 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -29469,8 +29469,6 @@ CREATE INDEX index_ci_builds_on_stage_id ON ci_builds USING btree (stage_id);
CREATE INDEX index_ci_builds_on_status_and_type_and_runner_id ON ci_builds USING btree (status, type, runner_id);
-CREATE UNIQUE INDEX index_ci_builds_on_token_encrypted ON ci_builds USING btree (token_encrypted) WHERE (token_encrypted IS NOT NULL);
-
CREATE INDEX index_ci_builds_on_updated_at ON ci_builds USING btree (updated_at);
CREATE INDEX index_ci_builds_on_upstream_pipeline_id ON ci_builds USING btree (upstream_pipeline_id) WHERE (upstream_pipeline_id IS NOT NULL);
diff --git a/doc/administration/geo/setup/external_database.md b/doc/administration/geo/setup/external_database.md
index 0fefc11f078..f93ef5f5d5e 100644
--- a/doc/administration/geo/setup/external_database.md
+++ b/doc/administration/geo/setup/external_database.md
@@ -217,14 +217,14 @@ the tracking database on port 5432.
`pg_hba.conf` that is associated with your tracking database.
Remember to restart PostgreSQL afterwards for the changes to take effect:
- ```plaintext
- ##
- ## Geo Tracking Database Role
- ## - pg_hba.conf
- ##
- host all all <trusted tracking IP>/32 md5
- host all all <trusted secondary IP>/32 md5
- ```
+ ```plaintext
+ ##
+ ## Geo Tracking Database Role
+ ## - pg_hba.conf
+ ##
+ host all all <trusted tracking IP>/32 md5
+ host all all <trusted secondary IP>/32 md5
+ ```
1. SSH into a GitLab **secondary** server and login as root:
diff --git a/doc/administration/instance_limits.md b/doc/administration/instance_limits.md
index 2ba2930c6f7..1a5e5134e9b 100644
--- a/doc/administration/instance_limits.md
+++ b/doc/administration/instance_limits.md
@@ -723,22 +723,23 @@ GitLab checks these limits against runners that have been active in the last 3 m
A runner's registration fails if it exceeds the limit for the scope determined by the runner registration token.
If the limit value is set to zero, the limit is disabled.
-- GitLab SaaS subscribers have different limits defined per plan, affecting all projects using that plan.
-- Self-managed GitLab Premium and Ultimate limits are defined by a default plan that affects all projects:
-
- | Runner scope | Default value |
- |---------------------------------------------|---------------|
- | `ci_registered_group_runners` | 1000 |
- | `ci_registered_project_runners` | 1000 |
-
- To update these limits, run the following in the
- [GitLab Rails console](operations/rails_console.md#starting-a-rails-console-session):
-
- ```ruby
- # Use ci_registered_group_runners or ci_registered_project_runners
- # depending on desired scope
- Plan.default.actual_limits.update!(ci_registered_project_runners: 100)
- ```
+GitLab SaaS subscribers have different limits defined per plan, affecting all projects using that plan.
+
+Self-managed GitLab Premium and Ultimate limits are defined by a default plan that affects all projects:
+
+| Runner scope | Default value |
+|---------------------------------------------|---------------|
+| `ci_registered_group_runners` | 1000 |
+| `ci_registered_project_runners` | 1000 |
+
+To update these limits, run the following in the
+[GitLab Rails console](operations/rails_console.md#starting-a-rails-console-session):
+
+```ruby
+# Use ci_registered_group_runners or ci_registered_project_runners
+# depending on desired scope
+Plan.default.actual_limits.update!(ci_registered_project_runners: 100)
+```
### Maximum file size for job logs
diff --git a/doc/administration/object_storage.md b/doc/administration/object_storage.md
index aaa5f7b90b0..3da7ee3d692 100644
--- a/doc/administration/object_storage.md
+++ b/doc/administration/object_storage.md
@@ -116,42 +116,42 @@ The following example uses AWS S3 to enable object storage for all supported ser
1. Edit `/etc/gitlab/gitlab.rb` and add the following lines, substituting
the values you want:
- ```ruby
- # Consolidated object storage configuration
- gitlab_rails['object_store']['enabled'] = true
- gitlab_rails['object_store']['proxy_download'] = true
- gitlab_rails['object_store']['connection'] = {
- 'provider' => 'AWS',
- 'region' => 'eu-central-1',
- 'aws_access_key_id' => '<AWS_ACCESS_KEY_ID>',
- 'aws_secret_access_key' => '<AWS_SECRET_ACCESS_KEY>'
- }
- # OPTIONAL: The following lines are only needed if server side encryption is required
- gitlab_rails['object_store']['storage_options'] = {
- 'server_side_encryption' => '<AES256 or aws:kms>',
- 'server_side_encryption_kms_key_id' => '<arn:aws:kms:xxx>'
- }
- gitlab_rails['object_store']['objects']['artifacts']['bucket'] = 'gitlab-artifacts'
- gitlab_rails['object_store']['objects']['external_diffs']['bucket'] = 'gitlab-mr-diffs'
- gitlab_rails['object_store']['objects']['lfs']['bucket'] = 'gitlab-lfs'
- gitlab_rails['object_store']['objects']['uploads']['bucket'] = 'gitlab-uploads'
- gitlab_rails['object_store']['objects']['packages']['bucket'] = 'gitlab-packages'
- gitlab_rails['object_store']['objects']['dependency_proxy']['bucket'] = 'gitlab-dependency-proxy'
- gitlab_rails['object_store']['objects']['terraform_state']['bucket'] = 'gitlab-terraform-state'
- gitlab_rails['object_store']['objects']['ci_secure_files']['bucket'] = 'gitlab-ci-secure-files'
- gitlab_rails['object_store']['objects']['pages']['bucket'] = 'gitlab-pages'
- ```
-
- If you’re using [AWS IAM profiles](#using-amazon-instance-profiles), omit
- the AWS access key and secret access key/value pairs. For example:
-
- ```ruby
- gitlab_rails['object_store']['connection'] = {
- 'provider' => 'AWS',
- 'region' => 'eu-central-1',
- 'use_iam_profile' => true
- }
- ```
+ ```ruby
+ # Consolidated object storage configuration
+ gitlab_rails['object_store']['enabled'] = true
+ gitlab_rails['object_store']['proxy_download'] = true
+ gitlab_rails['object_store']['connection'] = {
+ 'provider' => 'AWS',
+ 'region' => 'eu-central-1',
+ 'aws_access_key_id' => '<AWS_ACCESS_KEY_ID>',
+ 'aws_secret_access_key' => '<AWS_SECRET_ACCESS_KEY>'
+ }
+ # OPTIONAL: The following lines are only needed if server side encryption is required
+ gitlab_rails['object_store']['storage_options'] = {
+ 'server_side_encryption' => '<AES256 or aws:kms>',
+ 'server_side_encryption_kms_key_id' => '<arn:aws:kms:xxx>'
+ }
+ gitlab_rails['object_store']['objects']['artifacts']['bucket'] = 'gitlab-artifacts'
+ gitlab_rails['object_store']['objects']['external_diffs']['bucket'] = 'gitlab-mr-diffs'
+ gitlab_rails['object_store']['objects']['lfs']['bucket'] = 'gitlab-lfs'
+ gitlab_rails['object_store']['objects']['uploads']['bucket'] = 'gitlab-uploads'
+ gitlab_rails['object_store']['objects']['packages']['bucket'] = 'gitlab-packages'
+ gitlab_rails['object_store']['objects']['dependency_proxy']['bucket'] = 'gitlab-dependency-proxy'
+ gitlab_rails['object_store']['objects']['terraform_state']['bucket'] = 'gitlab-terraform-state'
+ gitlab_rails['object_store']['objects']['ci_secure_files']['bucket'] = 'gitlab-ci-secure-files'
+ gitlab_rails['object_store']['objects']['pages']['bucket'] = 'gitlab-pages'
+ ```
+
+ If you're using [AWS IAM profiles](#using-amazon-instance-profiles), omit
+ the AWS access key and secret access key/value pairs. For example:
+
+ ```ruby
+ gitlab_rails['object_store']['connection'] = {
+ 'provider' => 'AWS',
+ 'region' => 'eu-central-1',
+ 'use_iam_profile' => true
+ }
+ ```
1. Save the file and reconfigure GitLab:
@@ -171,7 +171,7 @@ The following example uses AWS S3 to enable object storage for all supported ser
aws_secret_access_key: <AWS_SECRET_ACCESS_KEY>
```
- If you’re using [AWS IAM profiles](#using-amazon-instance-profiles), omit
+ If you're using [AWS IAM profiles](#using-amazon-instance-profiles), omit
the AWS access key and secret access key/value pairs. For example:
```yaml
@@ -293,7 +293,7 @@ The following example uses AWS S3 to enable object storage for all supported ser
gitlab_rails['object_store']['objects']['pages']['bucket'] = 'gitlab-pages'
```
- If you’re using [AWS IAM profiles](#using-amazon-instance-profiles), omit
+ If you're using [AWS IAM profiles](#using-amazon-instance-profiles), omit
the AWS access key and secret access key/value pairs. For example:
```ruby
@@ -348,7 +348,7 @@ The following example uses AWS S3 to enable object storage for all supported ser
bucket: gitlab-pages
```
- If you’re using [AWS IAM profiles](#using-amazon-instance-profiles), omit
+ If you're using [AWS IAM profiles](#using-amazon-instance-profiles), omit
the AWS access key and secret access key/value pairs. For example:
```yaml
@@ -369,7 +369,7 @@ The following example uses AWS S3 to enable object storage for all supported ser
aws_secret_access_key = "<AWS_SECRET_ACCESS_KEY>"
```
- If you’re using [AWS IAM profiles](#using-amazon-instance-profiles), omit
+ If you're using [AWS IAM profiles](#using-amazon-instance-profiles), omit
the AWS access key and secret access key/value pairs. For example:
```yaml
diff --git a/doc/administration/operations/gitlab_sshd.md b/doc/administration/operations/gitlab_sshd.md
index 7b61631fe3a..1153321267d 100644
--- a/doc/administration/operations/gitlab_sshd.md
+++ b/doc/administration/operations/gitlab_sshd.md
@@ -110,11 +110,11 @@ To enable the PROXY protocol:
1. Edit `/etc/gitlab/gitlab.rb`:
- ```ruby
- gitlab_sshd['proxy_protocol'] = true
- # # Proxy protocol policy ("use", "require", "reject", "ignore"), "use" is the default value
- gitlab_sshd['proxy_policy'] = "use"
- ```
+ ```ruby
+ gitlab_sshd['proxy_protocol'] = true
+ # # Proxy protocol policy ("use", "require", "reject", "ignore"), "use" is the default value
+ gitlab_sshd['proxy_policy'] = "use"
+ ```
1. Save the file and reconfigure GitLab:
diff --git a/doc/administration/operations/moving_repositories.md b/doc/administration/operations/moving_repositories.md
index aa0477be788..e9d829f3f08 100644
--- a/doc/administration/operations/moving_repositories.md
+++ b/doc/administration/operations/moving_repositories.md
@@ -139,14 +139,14 @@ To move all snippets by using the API:
To move all groups by using the API:
1. [Schedule repository storage moves for all groups on a storage shard](../../api/group_repository_storage_moves.md#schedule-repository-storage-moves-for-all-groups-on-a-storage-shard).
- For example:
-
- ```shell
- curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
- --header "Content-Type: application/json" \
- --data '{"source_storage_name":"<original_storage_name>","destination_storage_name":"<cluster_storage_name>"}' \
- "https://gitlab.example.com/api/v4/group_repository_storage_moves"
- ```
+ For example:
+
+ ```shell
+ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
+ --header "Content-Type: application/json" \
+ --data '{"source_storage_name":"<original_storage_name>","destination_storage_name":"<cluster_storage_name>"}' \
+ "https://gitlab.example.com/api/v4/group_repository_storage_moves"
+ ```
1. [Query the most recent repository moves](../../api/group_repository_storage_moves.md#retrieve-all-group-repository-storage-moves).
The response indicates either:
diff --git a/doc/administration/packages/container_registry.md b/doc/administration/packages/container_registry.md
index 576917a40d5..619ec2490a7 100644
--- a/doc/administration/packages/container_registry.md
+++ b/doc/administration/packages/container_registry.md
@@ -639,20 +639,20 @@ However, this behavior is undesirable for registries used by internal hosts that
1. Edit `/etc/gitlab/gitlab.rb`:
- ```ruby
- registry['storage'] = {
- 's3' => {
- 'accesskey' => 's3-access-key',
- 'secretkey' => 's3-secret-key-for-access-key',
- 'bucket' => 'your-s3-bucket',
- 'region' => 'your-s3-region',
- 'regionendpoint' => 'your-s3-regionendpoint'
- },
- 'redirect' => {
- 'disable' => true
- }
- }
- ```
+ ```ruby
+ registry['storage'] = {
+ 's3' => {
+ 'accesskey' => 's3-access-key',
+ 'secretkey' => 's3-secret-key-for-access-key',
+ 'bucket' => 'your-s3-bucket',
+ 'region' => 'your-s3-region',
+ 'regionendpoint' => 'your-s3-regionendpoint'
+ },
+ 'redirect' => {
+ 'disable' => true
+ }
+ }
+ ```
1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
@@ -660,21 +660,21 @@ However, this behavior is undesirable for registries used by internal hosts that
1. Add the `redirect` flag to your registry configuration YAML file:
- ```yaml
- storage:
- s3:
- accesskey: 'AKIAKIAKI'
- secretkey: 'secret123'
- bucket: 'gitlab-registry-bucket-AKIAKIAKI'
- region: 'your-s3-region'
- regionendpoint: 'your-s3-regionendpoint'
- redirect:
- disable: true
- cache:
- blobdescriptor: inmemory
- delete:
- enabled: true
- ```
+ ```yaml
+ storage:
+ s3:
+ accesskey: 'AKIAKIAKI'
+ secretkey: 'secret123'
+ bucket: 'gitlab-registry-bucket-AKIAKIAKI'
+ region: 'your-s3-region'
+ regionendpoint: 'your-s3-regionendpoint'
+ redirect:
+ disable: true
+ cache:
+ blobdescriptor: inmemory
+ delete:
+ enabled: true
+ ```
1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source) for the changes to take effect.
@@ -692,18 +692,18 @@ For Omnibus GitLab installations:
1. Edit `/etc/gitlab/gitlab.rb`:
- ```ruby
- registry['storage'] = {
- 's3' => {
- 'accesskey' => 's3-access-key',
- 'secretkey' => 's3-secret-key-for-access-key',
- 'bucket' => 'your-s3-bucket',
- 'region' => 'your-s3-region',
- 'regionendpoint' => 'your-s3-regionendpoint',
- 'encrypt' => true
- }
- }
- ```
+ ```ruby
+ registry['storage'] = {
+ 's3' => {
+ 'accesskey' => 's3-access-key',
+ 'secretkey' => 's3-secret-key-for-access-key',
+ 'bucket' => 'your-s3-bucket',
+ 'region' => 'your-s3-region',
+ 'regionendpoint' => 'your-s3-regionendpoint',
+ 'encrypt' => true
+ }
+ }
+ ```
1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure)
for the changes to take effect.
@@ -712,16 +712,16 @@ For installations from source:
1. Edit your registry configuration YAML file:
- ```yaml
- storage:
- s3:
- accesskey: 'AKIAKIAKI'
- secretkey: 'secret123'
- bucket: 'gitlab-registry-bucket-AKIAKIAKI'
- region: 'your-s3-region'
- regionendpoint: 'your-s3-regionendpoint'
- encrypt: true
- ```
+ ```yaml
+ storage:
+ s3:
+ accesskey: 'AKIAKIAKI'
+ secretkey: 'secret123'
+ bucket: 'gitlab-registry-bucket-AKIAKIAKI'
+ region: 'your-s3-region'
+ regionendpoint: 'your-s3-regionendpoint'
+ encrypt: true
+ ```
1. Save the file and [restart GitLab](../restart_gitlab.md#installations-from-source)
for the changes to take effect.
diff --git a/doc/administration/postgresql/external.md b/doc/administration/postgresql/external.md
index 8605ee94255..24548f690ff 100644
--- a/doc/administration/postgresql/external.md
+++ b/doc/administration/postgresql/external.md
@@ -30,18 +30,18 @@ If you use a cloud-managed service, or provide your own PostgreSQL instance:
1. Configure the GitLab application servers with the appropriate connection details
for your external PostgreSQL service in your `/etc/gitlab/gitlab.rb` file:
- ```ruby
- # Disable the bundled Omnibus provided PostgreSQL
- postgresql['enable'] = false
-
- # PostgreSQL connection details
- gitlab_rails['db_adapter'] = 'postgresql'
- gitlab_rails['db_encoding'] = 'unicode'
- gitlab_rails['db_host'] = '10.1.0.5' # IP/hostname of database server
- gitlab_rails['db_password'] = 'DB password'
- ```
-
- For more information on GitLab multi-node setups, refer to the [reference architectures](../reference_architectures/index.md).
+ ```ruby
+ # Disable the bundled Omnibus provided PostgreSQL
+ postgresql['enable'] = false
+
+ # PostgreSQL connection details
+ gitlab_rails['db_adapter'] = 'postgresql'
+ gitlab_rails['db_encoding'] = 'unicode'
+ gitlab_rails['db_host'] = '10.1.0.5' # IP/hostname of database server
+ gitlab_rails['db_password'] = 'DB password'
+ ```
+
+ For more information on GitLab multi-node setups, refer to the [reference architectures](../reference_architectures/index.md).
1. Reconfigure for the changes to take effect:
diff --git a/doc/administration/read_only_gitlab.md b/doc/administration/read_only_gitlab.md
index 3718741e2e9..3842cf0846b 100644
--- a/doc/administration/read_only_gitlab.md
+++ b/doc/administration/read_only_gitlab.md
@@ -70,28 +70,28 @@ the database is read-only:
in case things don't go as expected.
1. Enter PostgreSQL on the console as an administrator user:
- ```shell
- sudo \
- -u gitlab-psql /opt/gitlab/embedded/bin/psql \
- -h /var/opt/gitlab/postgresql gitlabhq_production
- ```
+ ```shell
+ sudo \
+ -u gitlab-psql /opt/gitlab/embedded/bin/psql \
+ -h /var/opt/gitlab/postgresql gitlabhq_production
+ ```
1. Create the `gitlab_read_only` user. The password is set to `mypassword`,
change that to your liking:
- ```sql
- -- NOTE: Use the password defined earlier
- CREATE USER gitlab_read_only WITH password 'mypassword';
- GRANT CONNECT ON DATABASE gitlabhq_production to gitlab_read_only;
- GRANT USAGE ON SCHEMA public TO gitlab_read_only;
- GRANT SELECT ON ALL TABLES IN SCHEMA public TO gitlab_read_only;
- GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO gitlab_read_only;
-
- -- Tables created by "gitlab" should be made read-only for "gitlab_read_only"
- -- automatically.
- ALTER DEFAULT PRIVILEGES FOR USER gitlab IN SCHEMA public GRANT SELECT ON TABLES TO gitlab_read_only;
- ALTER DEFAULT PRIVILEGES FOR USER gitlab IN SCHEMA public GRANT SELECT ON SEQUENCES TO gitlab_read_only;
- ```
+ ```sql
+ -- NOTE: Use the password defined earlier
+ CREATE USER gitlab_read_only WITH password 'mypassword';
+ GRANT CONNECT ON DATABASE gitlabhq_production to gitlab_read_only;
+ GRANT USAGE ON SCHEMA public TO gitlab_read_only;
+ GRANT SELECT ON ALL TABLES IN SCHEMA public TO gitlab_read_only;
+ GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO gitlab_read_only;
+
+ -- Tables created by "gitlab" should be made read-only for "gitlab_read_only"
+ -- automatically.
+ ALTER DEFAULT PRIVILEGES FOR USER gitlab IN SCHEMA public GRANT SELECT ON TABLES TO gitlab_read_only;
+ ALTER DEFAULT PRIVILEGES FOR USER gitlab IN SCHEMA public GRANT SELECT ON SEQUENCES TO gitlab_read_only;
+ ```
1. Get the hashed password of the `gitlab_read_only` user and copy the result:
@@ -101,10 +101,10 @@ the database is read-only:
1. Edit `/etc/gitlab/gitlab.rb` and add the password from the previous step:
- ```ruby
- postgresql['sql_user_password'] = 'a2e20f823772650f039284619ab6f239'
- postgresql['sql_user'] = "gitlab_read_only"
- ```
+ ```ruby
+ postgresql['sql_user_password'] = 'a2e20f823772650f039284619ab6f239'
+ postgresql['sql_user'] = "gitlab_read_only"
+ ```
1. Reconfigure GitLab and restart PostgreSQL:
diff --git a/doc/administration/redis/replication_and_failover_external.md b/doc/administration/redis/replication_and_failover_external.md
index 23c9ce33c2d..16383db6c2a 100644
--- a/doc/administration/redis/replication_and_failover_external.md
+++ b/doc/administration/redis/replication_and_failover_external.md
@@ -32,15 +32,15 @@ Note the Redis node's IP address or hostname, port, and password (if required).
1. Configure the GitLab application servers with the appropriate connection details
for your external Redis service in your `/etc/gitlab/gitlab.rb` file:
- ```ruby
- redis['enable'] = false
+ ```ruby
+ redis['enable'] = false
- gitlab_rails['redis_host'] = 'redis.example.com'
- gitlab_rails['redis_port'] = 6379
+ gitlab_rails['redis_host'] = 'redis.example.com'
+ gitlab_rails['redis_port'] = 6379
- # Required if Redis authentication is configured on the Redis node
- gitlab_rails['redis_password'] = 'Redis Password'
- ```
+ # Required if Redis authentication is configured on the Redis node
+ gitlab_rails['redis_password'] = 'Redis Password'
+ ```
1. Reconfigure for the changes to take effect:
diff --git a/doc/administration/sidekiq/index.md b/doc/administration/sidekiq/index.md
index 3e6708024f6..388596532d4 100644
--- a/doc/administration/sidekiq/index.md
+++ b/doc/administration/sidekiq/index.md
@@ -325,7 +325,7 @@ To enable LDAP with the synchronization worker for Sidekiq:
1. Edit `/etc/gitlab/gitlab.rb`:
- ```ruby
+ ```ruby
gitlab_rails['ldap_enabled'] = true
gitlab_rails['prevent_ldap_sign_in'] = false
gitlab_rails['ldap_servers'] = {
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index f6ac330f645..57d92512e8a 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -14760,6 +14760,7 @@ four standard [pagination arguments](#connection-pagination-arguments):
| Name | Type | Description |
| ---- | ---- | ----------- |
+| <a id="groupprojectscomplianceframeworkfilters"></a>`complianceFrameworkFilters` | [`ComplianceFrameworkFilters`](#complianceframeworkfilters) | Filters applied when selecting a compliance framework. |
| <a id="groupprojectshascodecoverage"></a>`hasCodeCoverage` | [`Boolean`](#boolean) | Returns only the projects which have code coverage. |
| <a id="groupprojectshasvulnerabilities"></a>`hasVulnerabilities` | [`Boolean`](#boolean) | Returns only the projects which have vulnerabilities. |
| <a id="groupprojectsids"></a>`ids` | [`[ID!]`](#id) | Filter projects by IDs. |
@@ -17080,6 +17081,7 @@ four standard [pagination arguments](#connection-pagination-arguments):
| Name | Type | Description |
| ---- | ---- | ----------- |
+| <a id="namespaceprojectscomplianceframeworkfilters"></a>`complianceFrameworkFilters` | [`ComplianceFrameworkFilters`](#complianceframeworkfilters) | Filters applied when selecting a compliance framework. |
| <a id="namespaceprojectshascodecoverage"></a>`hasCodeCoverage` | [`Boolean`](#boolean) | Returns only the projects which have code coverage. |
| <a id="namespaceprojectshasvulnerabilities"></a>`hasVulnerabilities` | [`Boolean`](#boolean) | Returns only the projects which have vulnerabilities. |
| <a id="namespaceprojectsids"></a>`ids` | [`[ID!]`](#id) | Filter projects by IDs. |
@@ -25742,6 +25744,14 @@ Attributes for defining a CI/CD variable.
| <a id="commitactionlastcommitid"></a>`lastCommitId` | [`String`](#string) | Last known file commit ID. |
| <a id="commitactionpreviouspath"></a>`previousPath` | [`String`](#string) | Original full path to the file being moved. |
+### `ComplianceFrameworkFilters`
+
+#### Arguments
+
+| Name | Type | Description |
+| ---- | ---- | ----------- |
+| <a id="complianceframeworkfiltersid"></a>`id` | [`ComplianceManagementFrameworkID`](#compliancemanagementframeworkid) | ID of the compliance framework. |
+
### `ComplianceFrameworkInput`
#### Arguments
diff --git a/doc/architecture/blueprints/runner_tokens/index.md b/doc/architecture/blueprints/runner_tokens/index.md
index 789869cdc16..8c9c8f63dae 100644
--- a/doc/architecture/blueprints/runner_tokens/index.md
+++ b/doc/architecture/blueprints/runner_tokens/index.md
@@ -379,35 +379,37 @@ scope.
| GitLab Rails app | `%15.9` | Implement the `create_runner_workflow` [feature flag](../../../administration/feature_flags.md). |
| GitLab Rails app | `%15.9` | Implement `create_{instance|group|project}_runner` permissions. |
| GitLab Rails app | `%15.9` | Rename `ci_runner_machines.machine_xid` column to `system_xid` to be consistent with `system_id` passed in APIs. |
-| GitLab Rails app | `%15.10` | Drop `ci_runner_machines.machine_xid` column. |
-| GitLab Rails app | `%15.11` | Remove the ignore rule for `ci_runner_machines.machine_xid` column. |
+| GitLab Rails app | `%15.10` | Remove the ignore rule for `ci_runner_machines.machine_xid` column. |
| GitLab Rails app | `%15.10` | Replace `ci_builds_metadata.runner_machine_id` with a new join table. |
-| GitLab Rails app | %15.11 | Drop `ci_builds_metadata.runner_machine_id` column. |
-| GitLab Rails app | %16.0 | Remove the ignore rule for `ci_builds_metadata.runner_machine_id` column. |
+| GitLab Rails app | `%15.11` | Drop `ci_builds_metadata.runner_machine_id` column. |
+| GitLab Rails app | `%16.0` | Remove the ignore rule for `ci_builds_metadata.runner_machine_id` column. |
### Stage 4 - Create runners from the UI
| Component | Milestone | Changes |
|------------------|----------:|---------|
-| GitLab Rails app | `%15.9` | Implement new GraphQL user-authenticated API to create a new runner. |
| GitLab Rails app | `%15.9` | [Add prefix to newly generated runner authentication tokens](https://gitlab.com/gitlab-org/gitlab/-/issues/383198). |
+| GitLab Rails app | `%15.9` | Add new runner field for with token that is used in registration |
+| GitLab Rails app | `%15.9` | Implement new GraphQL user-authenticated API to create a new runner. |
| GitLab Rails app | `%15.10` | Return token and runner ID information from `/runners/verify` REST endpoint. |
| GitLab Runner | `%15.10` | [Modify register command to allow new flow with glrt- prefixed authentication tokens](https://gitlab.com/gitlab-org/gitlab-runner/-/issues/29613). |
-| GitLab Rails app | `%15.10` | Implement UI to create new runner. |
-| GitLab Rails app | `%15.10` | GraphQL changes to `CiRunner` type. |
-| GitLab Rails app | `%15.10` | UI changes to runner details view (listing of platform, architecture, IP address, etc.) (?) |
-| GitLab Rails app | `%15.11` | Adapt `POST /api/v4/runners` REST endpoint to accept a request from an authorized user with a scope instead of a registration token. |
+| GitLab Rails app | `%15.11` | Define feature flag and policies for "New Runner creation workflow" for groups and projects. |
+| GitLab Rails app | `%15.11` | Update service and mutation to accept groups and projects. |
+| GitLab Rails app | `%15.11` | Implement UI to create new runner. |
+| GitLab Rails app | `%15.11` | GraphQL changes to `CiRunner` type. (?) |
+| GitLab Rails app | `%15.11` | UI changes to runner details view (listing of platform, architecture, IP address, etc.) (?) |
+| GitLab Rails app | `%15.11` | Adapt `POST /api/v4/runners` REST endpoint to accept a request from an authorized user with a scope instead of a registration token. || GitLab Rails app | `%15.9` | Implement new GraphQL user-authenticated API to create a new runner. |
### Stage 5 - Optional disabling of registration token
| Component | Milestone | Changes |
|------------------|----------:|---------|
-| GitLab Rails app | `%15.11` | Adapt `register_{group|project}_runner` permissions to take [application setting](https://gitlab.com/gitlab-org/gitlab/-/issues/386712) in consideration. |
-| GitLab Rails app | `%15.11` | Add UI to allow disabling use of registration tokens at project or group level. |
-| GitLab Rails app | `%15.11` | Introduce `:enforce_create_runner_workflow` feature flag (disabled by default) to control whether use of registration tokens is allowed. |
-| GitLab Rails app | `%15.11` | Make [`POST /api/v4/runners` endpoint](../../../api/runners.md#register-a-new-runner) permanently return `HTTP 410 Gone` if either `allow_runner_registration_token` setting or `:enforce_create_runner_workflow` feature flag disables registration tokens.<br/>A future v5 version of the API should return `HTTP 404 Not Found`. |
-| GitLab Rails app | `%15.11` | Start refusing job requests that don't include a unique ID, if either `allow_runner_registration_token` setting or `:enforce_create_runner_workflow` feature flag disables registration tokens. |
-| GitLab Rails app | `%15.11` | Hide legacy UI showing registration with a registration token, if `:enforce_create_runner_workflow` feature flag disables registration tokens. |
+| GitLab Rails app | | Adapt `register_{group|project}_runner` permissions to take [application setting](https://gitlab.com/gitlab-org/gitlab/-/issues/386712) in consideration. |
+| GitLab Rails app | | Add UI to allow disabling use of registration tokens at project or group level. |
+| GitLab Rails app | | Introduce `:enforce_create_runner_workflow` feature flag (disabled by default) to control whether use of registration tokens is allowed. |
+| GitLab Rails app | | Make [`POST /api/v4/runners` endpoint](../../../api/runners.md#register-a-new-runner) permanently return `HTTP 410 Gone` if either `allow_runner_registration_token` setting or `:enforce_create_runner_workflow` feature flag disables registration tokens.<br/>A future v5 version of the API should return `HTTP 404 Not Found`. |
+| GitLab Rails app | | Start refusing job requests that don't include a unique ID, if either `allow_runner_registration_token` setting or `:enforce_create_runner_workflow` feature flag disables registration tokens. |
+| GitLab Rails app | | Hide legacy UI showing registration with a registration token, if `:enforce_create_runner_workflow` feature flag disables registration tokens. |
### Stage 6 - Enforcement
diff --git a/doc/development/advanced_search.md b/doc/development/advanced_search.md
index d326f1fdb99..4e61098b17d 100644
--- a/doc/development/advanced_search.md
+++ b/doc/development/advanced_search.md
@@ -4,7 +4,7 @@ group: Global Search
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Advanced search development
+# Advanced search development guidelines
This page includes information about developing and working with Elasticsearch.
diff --git a/doc/development/audit_event_guide/index.md b/doc/development/audit_event_guide/index.md
index 8df5121a2f7..c7c723d1686 100644
--- a/doc/development/audit_event_guide/index.md
+++ b/doc/development/audit_event_guide/index.md
@@ -4,7 +4,7 @@ group: Compliance
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Audit Event Guide
+# Audit event development guidelines
This guide provides an overview of how Audit Events work, and how to instrument
new audit events.
diff --git a/doc/development/auto_devops.md b/doc/development/auto_devops.md
index 53033cd19ff..b2281f9c032 100644
--- a/doc/development/auto_devops.md
+++ b/doc/development/auto_devops.md
@@ -4,7 +4,7 @@ group: Configure
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Auto DevOps development guide
+# Auto DevOps development guidelines
This document provides a development guide for contributors to
[Auto DevOps](../topics/autodevops/index.md).
diff --git a/doc/development/backend/create_source_code_be/index.md b/doc/development/backend/create_source_code_be/index.md
index 77c98982210..ba0ed2a2867 100644
--- a/doc/development/backend/create_source_code_be/index.md
+++ b/doc/development/backend/create_source_code_be/index.md
@@ -4,16 +4,16 @@ group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Create: Source Code Backend
+# Create: Source Code backend
-The Create:Source Code BE team focuses on the GitLab suite of Source Code Management
+The Create: Source Code backend (BE) team focuses on the GitLab suite of Source Code Management
(SCM) tools. It is responsible for all backend aspects of the product categories
that fall under the [Source Code group](https://about.gitlab.com/handbook/product/categories/#source-code-group)
of the [Create stage](https://about.gitlab.com/handbook/product/categories/#create-stage)
of the [DevOps lifecycle](https://about.gitlab.com/handbook/product/categories/#devops-stages).
We interface with the Gitaly and Code Review teams, and work closely with the
-[Create:Source Code Frontend team](https://about.gitlab.com/handbook/engineering/development/dev/create/create-source-code-fe/). The features
+[Create: Source Code frontend team](https://about.gitlab.com/handbook/engineering/development/dev/create/create-source-code-fe/). The features
we work with are listed on the
[Features by Group Page](https://about.gitlab.com/handbook/product/categories/features/#createsource-code-group).
diff --git a/doc/development/cicd/index.md b/doc/development/cicd/index.md
index 641d0ea4f6f..2e2907feae1 100644
--- a/doc/development/cicd/index.md
+++ b/doc/development/cicd/index.md
@@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type: index, concepts, howto
---
-# CI/CD development documentation
+# CI/CD development guidelines
Development guides that are specific to CI/CD are listed here:
diff --git a/doc/development/code_intelligence/index.md b/doc/development/code_intelligence/index.md
index 107a1588e18..2034f57d995 100644
--- a/doc/development/code_intelligence/index.md
+++ b/doc/development/code_intelligence/index.md
@@ -4,7 +4,7 @@ group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Code Intelligence
+# Code intelligence development guidelines
> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/1576) in GitLab 13.1.
diff --git a/doc/development/contributing/style_guides.md b/doc/development/contributing/style_guides.md
index 28ce8e6ff4b..36b38e2e16b 100644
--- a/doc/development/contributing/style_guides.md
+++ b/doc/development/contributing/style_guides.md
@@ -5,7 +5,7 @@ group: Development
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Style guides
+# Development style guides
## Editor/IDE styling standardization
diff --git a/doc/development/database/index.md b/doc/development/database/index.md
index eaf37cd7699..2cb8509e203 100644
--- a/doc/development/database/index.md
+++ b/doc/development/database/index.md
@@ -4,7 +4,7 @@ group: Database
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Database guides
+# Database development guidelines
## Database Reviews
diff --git a/doc/development/distributed_tracing.md b/doc/development/distributed_tracing.md
index 79d0ff84713..bd9e7035290 100644
--- a/doc/development/distributed_tracing.md
+++ b/doc/development/distributed_tracing.md
@@ -4,7 +4,7 @@ group: Respond
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Distributed Tracing - development guidelines
+# Distributed tracing development guidelines
GitLab is instrumented for distributed tracing. Distributed Tracing in GitLab is currently considered **experimental**, as it has not yet been tested at scale on GitLab.com.
diff --git a/doc/development/fe_guide/style/index.md b/doc/development/fe_guide/style/index.md
index 94ed9544cf5..552b769d6f6 100644
--- a/doc/development/fe_guide/style/index.md
+++ b/doc/development/fe_guide/style/index.md
@@ -4,7 +4,7 @@ group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# GitLab development style guides
+# Frontend style guides
See below for the relevant style guides, guidelines, linting, and other information for developing GitLab.
diff --git a/doc/development/gemfile.md b/doc/development/gemfile.md
index 36ef1bcd834..bfe8b7c5205 100644
--- a/doc/development/gemfile.md
+++ b/doc/development/gemfile.md
@@ -4,7 +4,7 @@ group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Gemfile guidelines
+# Gemfile development guidelines
When adding a new entry to `Gemfile`, or upgrading an existing dependency pay
attention to the following rules.
diff --git a/doc/development/gitaly.md b/doc/development/gitaly.md
index b4f5501ccac..5b481661e7d 100644
--- a/doc/development/gitaly.md
+++ b/doc/development/gitaly.md
@@ -4,7 +4,7 @@ group: Gitaly
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Gitaly developers guide
+# Gitaly development guidelines
[Gitaly](https://gitlab.com/gitlab-org/gitaly) is a high-level Git RPC service used by GitLab Rails,
Workhorse and GitLab Shell.
diff --git a/doc/development/gitlab_flavored_markdown/index.md b/doc/development/gitlab_flavored_markdown/index.md
index f115ae9a11c..064a7ecbfa9 100644
--- a/doc/development/gitlab_flavored_markdown/index.md
+++ b/doc/development/gitlab_flavored_markdown/index.md
@@ -6,7 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
<!-- vale gitlab.GitLabFlavoredMarkdown = NO -->
-# GitLab Flavored Markdown (GLFM) developer documentation
+# GitLab Flavored Markdown (GLFM) development guidelines
This page contains the MVC for the developer documentation for GitLab Flavored Markdown (GLFM).
For the user documentation about Markdown in GitLab, refer to
diff --git a/doc/development/gitlab_shell/index.md b/doc/development/gitlab_shell/index.md
index 7097fd48cea..9dc8d8e01c5 100644
--- a/doc/development/gitlab_shell/index.md
+++ b/doc/development/gitlab_shell/index.md
@@ -4,7 +4,7 @@ group: Source Code
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
---
-# GitLab Shell
+# GitLab Shell development guidelines
[![pipeline status](https://gitlab.com/gitlab-org/gitlab-shell/badges/main/pipeline.svg)](https://gitlab.com/gitlab-org/gitlab-shell/-/pipelines?ref=main) [![coverage report](https://gitlab.com/gitlab-org/gitlab-shell/badges/main/coverage.svg)](https://gitlab.com/gitlab-org/gitlab-shell/-/pipelines?ref=main) [![Code Climate](https://codeclimate.com/github/gitlabhq/gitlab-shell.svg)](https://codeclimate.com/github/gitlabhq/gitlab-shell)
diff --git a/doc/development/integrations/index.md b/doc/development/integrations/index.md
index b9c05429bd3..6f42cb4d4fe 100644
--- a/doc/development/integrations/index.md
+++ b/doc/development/integrations/index.md
@@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
description: "GitLab's development guidelines for Integrations"
---
-# Integrations development guide
+# Integrations development guidelines
This page provides development guidelines for implementing [GitLab integrations](../../user/project/integrations/index.md),
which are part of our [main Rails project](https://gitlab.com/gitlab-org/gitlab).
diff --git a/doc/development/integrations/jira_connect.md b/doc/development/integrations/jira_connect.md
index 0b1fc8c6124..4789280c09d 100644
--- a/doc/development/integrations/jira_connect.md
+++ b/doc/development/integrations/jira_connect.md
@@ -4,7 +4,7 @@ group: Integrations
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Set up a development environment
+# Set up a Jira development environment
The following are required to install and test the app:
diff --git a/doc/development/json.md b/doc/development/json.md
index 8a2575401fb..bdb7f73ab62 100644
--- a/doc/development/json.md
+++ b/doc/development/json.md
@@ -4,7 +4,7 @@ group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# JSON Guidelines
+# JSON development guidelines
At GitLab we handle a lot of JSON data. To best ensure we remain performant
when handling large JSON encodes or decodes, we use our own JSON class
diff --git a/doc/development/kubernetes.md b/doc/development/kubernetes.md
index e44e2af4371..99737e71b22 100644
--- a/doc/development/kubernetes.md
+++ b/doc/development/kubernetes.md
@@ -4,7 +4,7 @@ group: Configure
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Kubernetes integration - development guidelines
+# Kubernetes integration development guidelines
This document provides various guidelines when developing for the GitLab
[Kubernetes integration](../user/infrastructure/clusters/index.md).
diff --git a/doc/development/lfs.md b/doc/development/lfs.md
index ec91f9f3c8b..7f44d12ed95 100644
--- a/doc/development/lfs.md
+++ b/doc/development/lfs.md
@@ -4,7 +4,7 @@ group: Source Code
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Git LFS developer information
+# Git LFS development guidelines
This page contains developer-centric information for GitLab team members. For the
user documentation, see [Git Large File Storage](../topics/git/lfs/index.md).
diff --git a/doc/development/logging.md b/doc/development/logging.md
index 538fc7ccfe1..5b9a311c704 100644
--- a/doc/development/logging.md
+++ b/doc/development/logging.md
@@ -4,7 +4,7 @@ group: Respond
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# GitLab Developers Guide to Logging
+# Logging development guidelines
[GitLab Logs](../administration/logs/index.md) play a critical role for both
administrators and GitLab team members to diagnose problems in the field.
diff --git a/doc/development/merge_request_concepts/approval_rules.md b/doc/development/merge_request_concepts/approval_rules.md
index d119644cd7c..d6000d48706 100644
--- a/doc/development/merge_request_concepts/approval_rules.md
+++ b/doc/development/merge_request_concepts/approval_rules.md
@@ -4,7 +4,7 @@ group: Code Review
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Approval Rules development guide
+# Approval rules development guidelines
This document explains the backend design and flow of all related functionality
about [merge request approval rules](../../user/project/merge_requests/approvals/index.md).
diff --git a/doc/development/packages/index.md b/doc/development/packages/index.md
index fa0e9f5d926..4f027825422 100644
--- a/doc/development/packages/index.md
+++ b/doc/development/packages/index.md
@@ -4,7 +4,7 @@ group: Package Registry
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Package and container registry documentation
+# Package and container registry development guidelines
The documentation for package and container registry development is split into two groups.
diff --git a/doc/development/permissions.md b/doc/development/permissions.md
index 6ce2b855e64..b4c8614a9fa 100644
--- a/doc/development/permissions.md
+++ b/doc/development/permissions.md
@@ -4,7 +4,7 @@ group: Authentication and Authorization
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Implementing permissions
+# Permission development guidelines
There are multiple types of permissions across GitLab, and when implementing
anything that deals with permissions, all of them should be considered.
diff --git a/doc/development/product_qualified_lead_guide/index.md b/doc/development/product_qualified_lead_guide/index.md
index c72110bc253..41237dcdff4 100644
--- a/doc/development/product_qualified_lead_guide/index.md
+++ b/doc/development/product_qualified_lead_guide/index.md
@@ -4,7 +4,7 @@ group: Acquisition
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Product Qualified Lead (PQL) development guide
+# Product Qualified Lead (PQL) development guidelines
The Product Qualified Lead (PQL) funnel connects our users with our team members. Read more about [PQL product principles](https://about.gitlab.com/handbook/product/product-principles/#product-qualified-leads-pqls).
diff --git a/doc/development/prometheus_metrics.md b/doc/development/prometheus_metrics.md
index 834a20239fc..590ac547c2d 100644
--- a/doc/development/prometheus_metrics.md
+++ b/doc/development/prometheus_metrics.md
@@ -4,7 +4,7 @@ group: Respond
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Working with Prometheus Metrics
+# Prometheus metrics development guidelines
## Adding to the library
diff --git a/doc/development/python_guide/index.md b/doc/development/python_guide/index.md
index 08d2f46c1cd..e9b52b81c0e 100644
--- a/doc/development/python_guide/index.md
+++ b/doc/development/python_guide/index.md
@@ -4,7 +4,7 @@ group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Python Development Guidelines
+# Python development guidelines
GitLab requires Python as a dependency for [reStructuredText](https://docutils.sourceforge.io/rst.html)
markup rendering.
diff --git a/doc/development/real_time.md b/doc/development/real_time.md
index 2aa48fed8eb..99d09170646 100644
--- a/doc/development/real_time.md
+++ b/doc/development/real_time.md
@@ -4,7 +4,7 @@ group: Project Management
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Real-Time Features
+# Real-time features
This guide contains instructions on how to safely roll out new real-time
features.
diff --git a/doc/development/redis.md b/doc/development/redis.md
index 68cab9ac38d..e8c781c40be 100644
--- a/doc/development/redis.md
+++ b/doc/development/redis.md
@@ -4,7 +4,7 @@ group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Redis guidelines
+# Redis development guidelines
## Redis instances
diff --git a/doc/development/rubocop_development_guide.md b/doc/development/rubocop_development_guide.md
index 10c129abaaa..fe09bfbce2c 100644
--- a/doc/development/rubocop_development_guide.md
+++ b/doc/development/rubocop_development_guide.md
@@ -5,7 +5,7 @@ group: Development
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# RuboCop rule development guide
+# RuboCop rule development guidelines
Our codebase style is defined and enforced by [RuboCop](https://github.com/rubocop-hq/rubocop).
diff --git a/doc/development/sec/index.md b/doc/development/sec/index.md
index 9d9a4752cc2..f74d31a1fb3 100644
--- a/doc/development/sec/index.md
+++ b/doc/development/sec/index.md
@@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type: index, concepts, howto
---
-# Sec section development
+# Sec section development guidelines
The Sec section is responsible for GitLab application security features, the "Sec" part of
DevSecOps. Development guides that are specific to the Sec section are listed here.
diff --git a/doc/development/secure_coding_guidelines.md b/doc/development/secure_coding_guidelines.md
index 12665acacff..259d4bf969d 100644
--- a/doc/development/secure_coding_guidelines.md
+++ b/doc/development/secure_coding_guidelines.md
@@ -5,7 +5,7 @@ group: Development
info: "See the Technical Writers assigned to Development Guidelines: https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments-to-development-guidelines"
---
-# Secure Coding Guidelines
+# Secure coding development guidelines
This document contains descriptions and guidelines for addressing security
vulnerabilities commonly identified in the GitLab codebase. They are intended
diff --git a/doc/development/service_ping/index.md b/doc/development/service_ping/index.md
index a5fc28b8d19..e938de9e253 100644
--- a/doc/development/service_ping/index.md
+++ b/doc/development/service_ping/index.md
@@ -4,7 +4,7 @@ group: Product Intelligence
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Service Ping Guide
+# Service Ping development guidelines
> - Introduced in GitLab Ultimate 11.2, more statistics.
> - In GitLab 14.1, [renamed from Usage Ping to Service Ping](https://gitlab.com/groups/gitlab-org/-/epics/5990). In 14.0 and earlier, use the Usage Ping documentation for the Rails commands appropriate to your version.
diff --git a/doc/development/shell_commands.md b/doc/development/shell_commands.md
index d78a005d76b..25f62fbcc98 100644
--- a/doc/development/shell_commands.md
+++ b/doc/development/shell_commands.md
@@ -4,7 +4,7 @@ group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Guidelines for shell commands in the GitLab codebase
+# Shell command development guidelines
This document contains guidelines for working with processes and files in the GitLab codebase.
These guidelines are meant to make your code more reliable _and_ secure.
diff --git a/doc/development/sidekiq/index.md b/doc/development/sidekiq/index.md
index 355f5a3b753..2010a21130d 100644
--- a/doc/development/sidekiq/index.md
+++ b/doc/development/sidekiq/index.md
@@ -4,7 +4,7 @@ group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Sidekiq guides
+# Sidekiq development guidelines
We use [Sidekiq](https://github.com/mperham/sidekiq) as our background
job processor. These guides are for writing jobs that works well on
diff --git a/doc/development/snowplow/index.md b/doc/development/snowplow/index.md
index 6acbd72175e..276b5913890 100644
--- a/doc/development/snowplow/index.md
+++ b/doc/development/snowplow/index.md
@@ -4,7 +4,7 @@ group: Product Intelligence
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Snowplow
+# Snowplow development guidelines
Snowplow is an enterprise-grade marketing and Product Intelligence platform that tracks how users engage with our website and application.
diff --git a/doc/development/uploads/index.md b/doc/development/uploads/index.md
index b5509f5934e..a62e8ea2d58 100644
--- a/doc/development/uploads/index.md
+++ b/doc/development/uploads/index.md
@@ -4,7 +4,7 @@ group: unassigned
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Uploads development guide
+# Uploads development guidelines
Uploads are an integral part of many GitLab features. To understand how GitLab handles uploads, this page
provides an overview of the key mechanisms for transferring files to a storage destination.
diff --git a/doc/development/value_stream_analytics.md b/doc/development/value_stream_analytics.md
index 77a32b62e32..aec8dbfc2fb 100644
--- a/doc/development/value_stream_analytics.md
+++ b/doc/development/value_stream_analytics.md
@@ -4,7 +4,7 @@ group: Optimize
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
-# Value stream analytics development guide
+# Value stream analytics development guidelines
For information on how to configure value stream analytics (VSA) in GitLab, see our [analytics documentation](../user/analytics/value_stream_analytics.md).
diff --git a/doc/development/wikis.md b/doc/development/wikis.md
index acb7ed335d3..2f97931f924 100644
--- a/doc/development/wikis.md
+++ b/doc/development/wikis.md
@@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
description: "GitLab's development guidelines for Wikis"
---
-# Wikis development guide
+# Wikis development guidelines
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/227027) in GitLab 13.5.
diff --git a/doc/user/packages/debian_repository/index.md b/doc/user/packages/debian_repository/index.md
index 3e04e105c39..5cfecc22ac5 100644
--- a/doc/user/packages/debian_repository/index.md
+++ b/doc/user/packages/debian_repository/index.md
@@ -23,6 +23,12 @@ Project and Group packages are supported.
For documentation of the specific API endpoints that Debian package manager
clients use, see the [Debian API documentation](../../../api/packages/debian.md).
+Prerequisites:
+
+- The `dpkg-deb` binary must be installed on the GitLab instance.
+ This binary is usually provided by the [`dpkg` package](https://wiki.debian.org/Teams/Dpkg/Downstream),
+ installed by default on Debian and derivatives.
+
## Enable the Debian API **(FREE SELF)**
Debian repository support is still a work in progress. It's gated behind a feature flag that's
diff --git a/lib/gitlab/database/async_constraints/migration_helpers.rb b/lib/gitlab/database/async_constraints/migration_helpers.rb
index 77ca78a4d5c..8b4d4ecea04 100644
--- a/lib/gitlab/database/async_constraints/migration_helpers.rb
+++ b/lib/gitlab/database/async_constraints/migration_helpers.rb
@@ -6,7 +6,7 @@ module Gitlab
module MigrationHelpers
# Prepares a foreign key for asynchronous validation.
#
- # Stores the FK information in the postgres_async_constraint_validations
+ # Stores the FK information in the postgres_async_foreign_key_validations
# table to be executed later.
#
def prepare_async_foreign_key_validation(table_name, column_name = nil, name: nil)
@@ -65,6 +65,43 @@ module Gitlab
end
end
+ # Prepares a check constraint for asynchronous validation.
+ #
+ # Stores the constraint information in the postgres_async_foreign_key_validations
+ # table to be executed later.
+ #
+ def prepare_async_check_constraint_validation(table_name, name:)
+ Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.require_ddl_mode!
+
+ return unless async_constraint_validation_available?
+
+ unless check_constraint_exists?(table_name, name)
+ raise missing_schema_object_message(table_name, "check constraint", name)
+ end
+
+ async_validation = PostgresAsyncConstraintValidation
+ .check_constraint_type
+ .find_or_create_by!(name: name, table_name: table_name)
+
+ Gitlab::AppLogger.info(
+ message: 'Prepared check constraint for async validation',
+ table_name: async_validation.table_name,
+ constraint_name: async_validation.name)
+
+ async_validation
+ end
+
+ def unprepare_async_check_constraint_validation(table_name, name:)
+ Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.require_ddl_mode!
+
+ return unless async_constraint_validation_available?
+
+ PostgresAsyncConstraintValidation
+ .check_constraint_type
+ .find_by(name: name, table_name: table_name)
+ .try(&:destroy!)
+ end
+
private
def async_constraint_validation_available?
diff --git a/lib/gitlab/database/async_constraints/postgres_async_constraint_validation.rb b/lib/gitlab/database/async_constraints/postgres_async_constraint_validation.rb
index 3e71deb6855..acc5dff9995 100644
--- a/lib/gitlab/database/async_constraints/postgres_async_constraint_validation.rb
+++ b/lib/gitlab/database/async_constraints/postgres_async_constraint_validation.rb
@@ -14,10 +14,11 @@ module Gitlab
validates :name, presence: true, uniqueness: { scope: :table_name }, length: { maximum: MAX_IDENTIFIER_LENGTH }
validates :table_name, presence: true, length: { maximum: MAX_IDENTIFIER_LENGTH }
- enum constraint_type: { foreign_key: 0 }
+ enum constraint_type: { foreign_key: 0, check_constraint: 1 }
scope :ordered, -> { order(attempts: :asc, id: :asc) }
scope :foreign_key_type, -> { columns_hash.key?('constraint_type') ? foreign_key : all }
+ scope :check_constraint_type, -> { check_constraint }
def self.table_available?
connection.table_exists?(table_name)
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 53b08377674..b25f604a78f 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -5349,6 +5349,9 @@ msgstr ""
msgid "Are you sure you want to delete %{name}?"
msgstr ""
+msgid "Are you sure you want to delete %{name}? This action cannot be undone."
+msgstr ""
+
msgid "Are you sure you want to delete this %{commentType}?"
msgstr ""
@@ -13586,6 +13589,9 @@ msgstr ""
msgid "Delete row"
msgstr ""
+msgid "Delete saved reply"
+msgstr ""
+
msgid "Delete selected"
msgstr ""
diff --git a/spec/features/profiles/user_deletes_saved_reply_spec.rb b/spec/features/profiles/user_deletes_saved_reply_spec.rb
new file mode 100644
index 00000000000..35bd6018ee3
--- /dev/null
+++ b/spec/features/profiles/user_deletes_saved_reply_spec.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'Profile > Saved replies > User deletes saved reply', :js,
+ feature_category: :user_profile do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:saved_reply) { create(:saved_reply, user: user) }
+
+ before do
+ sign_in(user)
+ end
+
+ it 'shows the user a list of their saved replies' do
+ visit profile_saved_replies_path
+
+ find('[data-testid="saved-reply-delete-btn"]').click
+
+ page.within('.gl-modal') do
+ click_button 'Delete'
+ end
+
+ wait_for_requests
+
+ expect(page).not_to have_content(saved_reply.name)
+ end
+end
diff --git a/spec/features/work_items/work_item_children_spec.rb b/spec/features/projects/work_items/work_item_children_spec.rb
index 43a6b2771f6..43a6b2771f6 100644
--- a/spec/features/work_items/work_item_children_spec.rb
+++ b/spec/features/projects/work_items/work_item_children_spec.rb
diff --git a/spec/features/work_items/work_item_spec.rb b/spec/features/projects/work_items/work_item_spec.rb
index 3c71a27ff82..3c71a27ff82 100644
--- a/spec/features/work_items/work_item_spec.rb
+++ b/spec/features/projects/work_items/work_item_spec.rb
diff --git a/spec/frontend/saved_replies/components/__snapshots__/list_item_spec.js.snap b/spec/frontend/saved_replies/components/__snapshots__/list_item_spec.js.snap
index 3abdfcdaf20..154ce2bd089 100644
--- a/spec/frontend/saved_replies/components/__snapshots__/list_item_spec.js.snap
+++ b/spec/frontend/saved_replies/components/__snapshots__/list_item_spec.js.snap
@@ -10,6 +10,21 @@ exports[`Saved replies list item component renders list item 1`] = `
<strong>
test
</strong>
+
+ <div
+ class="gl-ml-auto"
+ >
+ <gl-button-stub
+ aria-label="Delete"
+ buttontextclasses=""
+ category="secondary"
+ data-testid="saved-reply-delete-btn"
+ icon="remove"
+ size="medium"
+ title="Delete"
+ variant="danger"
+ />
+ </div>
</div>
<div
@@ -17,5 +32,21 @@ exports[`Saved replies list item component renders list item 1`] = `
>
/assign_reviewer
</div>
+
+ <gl-modal-stub
+ actionprimary="[object Object]"
+ actionsecondary="[object Object]"
+ arialabel=""
+ dismisslabel="Close"
+ modalclass=""
+ modalid="delete-saved-reply-2"
+ size="sm"
+ title="Delete saved reply"
+ titletag="h4"
+ >
+ <gl-sprintf-stub
+ message="Are you sure you want to delete %{name}? This action cannot be undone."
+ />
+ </gl-modal-stub>
</li>
`;
diff --git a/spec/frontend/saved_replies/components/list_item_spec.js b/spec/frontend/saved_replies/components/list_item_spec.js
index cad1000473b..1d80844f30a 100644
--- a/spec/frontend/saved_replies/components/list_item_spec.js
+++ b/spec/frontend/saved_replies/components/list_item_spec.js
@@ -1,11 +1,31 @@
+import Vue from 'vue';
+import VueApollo from 'vue-apollo';
import { shallowMount } from '@vue/test-utils';
+import { GlModal } from '@gitlab/ui';
+import createMockApollo from 'helpers/mock_apollo_helper';
+import { createMockDirective } from 'helpers/vue_mock_directive';
+import waitForPromises from 'helpers/wait_for_promises';
import ListItem from '~/saved_replies/components/list_item.vue';
+import deleteSavedReplyMutation from '~/saved_replies/queries/delete_saved_reply.mutation.graphql';
let wrapper;
+let deleteSavedReplyMutationResponse;
function createComponent(propsData = {}) {
+ Vue.use(VueApollo);
+
+ deleteSavedReplyMutationResponse = jest
+ .fn()
+ .mockResolvedValue({ data: { savedReplyDestroy: { errors: [] } } });
+
return shallowMount(ListItem, {
propsData,
+ directives: {
+ GlModal: createMockDirective('gl-modal'),
+ },
+ apolloProvider: createMockApollo([
+ [deleteSavedReplyMutation, deleteSavedReplyMutationResponse],
+ ]),
});
}
@@ -19,4 +39,16 @@ describe('Saved replies list item component', () => {
expect(wrapper.element).toMatchSnapshot();
});
+
+ describe('delete button', () => {
+ it('calls Apollo mutate', async () => {
+ wrapper = createComponent({ reply: { name: 'test', content: '/assign_reviewer', id: 1 } });
+
+ wrapper.findComponent(GlModal).vm.$emit('primary');
+
+ await waitForPromises();
+
+ expect(deleteSavedReplyMutationResponse).toHaveBeenCalledWith({ id: 1 });
+ });
+ });
});
diff --git a/spec/lib/gitlab/database/async_constraints/migration_helpers_spec.rb b/spec/lib/gitlab/database/async_constraints/migration_helpers_spec.rb
index 08d255a4bb8..4dd510499ab 100644
--- a/spec/lib/gitlab/database/async_constraints/migration_helpers_spec.rb
+++ b/spec/lib/gitlab/database/async_constraints/migration_helpers_spec.rb
@@ -10,7 +10,7 @@ RSpec.describe Gitlab::Database::AsyncConstraints::MigrationHelpers, feature_cat
let(:column_name) { 'parent_id' }
let(:fk_name) { nil }
- context 'with regular tables' do
+ context 'with async FK validation on regular tables' do
before do
allow(migration).to receive(:puts)
allow(migration.connection).to receive(:transaction_open?).and_return(false)
@@ -183,4 +183,106 @@ RSpec.describe Gitlab::Database::AsyncConstraints::MigrationHelpers, feature_cat
end
end
end
+
+ context 'with async check constraint validations' do
+ let(:table_name) { '_test_async_check_constraints' }
+ let(:check_name) { 'partitioning_constraint' }
+
+ before do
+ allow(migration).to receive(:puts)
+ allow(migration.connection).to receive(:transaction_open?).and_return(false)
+
+ connection.create_table(table_name) do |t|
+ t.integer column_name
+ end
+
+ migration.add_check_constraint(
+ table_name, "#{column_name} = 1",
+ check_name, validate: false)
+ end
+
+ describe '#prepare_async_check_constraint_validation' do
+ it 'creates the record for async validation' do
+ expect do
+ migration.prepare_async_check_constraint_validation(table_name, name: check_name)
+ end.to change { constraint_model.where(name: check_name).count }.by(1)
+
+ record = constraint_model.find_by(name: check_name)
+
+ expect(record.table_name).to eq(table_name)
+ expect(record).to be_check_constraint
+ end
+
+ context 'when the check constraint does not exist' do
+ it 'returns an error' do
+ expect do
+ migration.prepare_async_check_constraint_validation(table_name, name: 'missing')
+ end.to raise_error RuntimeError, /Could not find check constraint "missing" on table "#{table_name}"/
+ end
+ end
+
+ context 'when the record already exists' do
+ it 'does attempt to create the record' do
+ create(:postgres_async_constraint_validation,
+ table_name: table_name,
+ name: check_name,
+ constraint_type: :check_constraint)
+
+ expect do
+ migration.prepare_async_check_constraint_validation(table_name, name: check_name)
+ end.not_to change { constraint_model.where(name: check_name).count }
+ end
+ end
+
+ context 'when the async validation table does not exist' do
+ it 'does not raise an error' do
+ connection.drop_table(constraint_model.table_name)
+
+ expect(constraint_model).not_to receive(:safe_find_or_create_by!)
+
+ expect { migration.prepare_async_check_constraint_validation(table_name, name: check_name) }
+ .not_to raise_error
+ end
+ end
+ end
+
+ describe '#unprepare_async_check_constraint_validation' do
+ context 'with check constraints' do
+ before do
+ migration.prepare_async_check_constraint_validation(table_name, name: check_name)
+ end
+
+ it 'destroys the record' do
+ expect do
+ migration.unprepare_async_check_constraint_validation(table_name, name: check_name)
+ end.to change { constraint_model.where(name: check_name).count }.by(-1)
+ end
+
+ context 'when the async validation table does not exist' do
+ it 'does not raise an error' do
+ connection.drop_table(constraint_model.table_name)
+
+ expect(constraint_model).not_to receive(:find_by)
+
+ expect { migration.unprepare_async_check_constraint_validation(table_name, name: check_name) }
+ .not_to raise_error
+ end
+ end
+ end
+
+ context 'with other types of constraints' do
+ let(:constraint) { create(:postgres_async_constraint_validation, table_name: table_name, name: check_name) }
+
+ it 'does not destroy the record' do
+ constraint.update_column(:constraint_type, 99)
+
+ expect do
+ migration.unprepare_async_check_constraint_validation(table_name, name: check_name)
+ end.not_to change { constraint_model.where(name: check_name).count }
+
+ expect(constraint).to be_present
+ end
+ end
+ end
+ end
end
diff --git a/spec/lib/gitlab/database/async_constraints/postgres_async_constraint_validation_spec.rb b/spec/lib/gitlab/database/async_constraints/postgres_async_constraint_validation_spec.rb
index 7fea2eb1bcc..da9cc18f7d7 100644
--- a/spec/lib/gitlab/database/async_constraints/postgres_async_constraint_validation_spec.rb
+++ b/spec/lib/gitlab/database/async_constraints/postgres_async_constraint_validation_spec.rb
@@ -48,6 +48,16 @@ RSpec.describe Gitlab::Database::AsyncConstraints::PostgresAsyncConstraintValida
is_expected.to match_array([failed_validation, new_validation])
end
end
+
+ describe '.check_constraint_type' do
+ before do
+ new_validation.update!(constraint_type: :check_constraint)
+ end
+
+ subject { described_class.check_constraint_type }
+
+ it { is_expected.to eq([new_validation]) }
+ end
end
describe '.table_available?' do
diff --git a/spec/migrations/20230221093533_add_tmp_partial_index_on_vulnerability_report_types_spec.rb b/spec/migrations/20230221093533_add_tmp_partial_index_on_vulnerability_report_types_spec.rb
new file mode 100644
index 00000000000..cbf6b2882c4
--- /dev/null
+++ b/spec/migrations/20230221093533_add_tmp_partial_index_on_vulnerability_report_types_spec.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+require "spec_helper"
+
+require_migration!
+
+RSpec.describe AddTmpPartialIndexOnVulnerabilityReportTypes, feature_category: :vulnerability_management do
+ let(:async_index) { Gitlab::Database::AsyncIndexes::PostgresAsyncIndex }
+ let(:index_name) { described_class::INDEX_NAME }
+
+ it "schedules the index" do
+ reversible_migration do |migration|
+ migration.before -> do
+ expect(async_index.where(name: index_name).count).to be(0)
+ end
+
+ migration.after -> do
+ expect(async_index.where(name: index_name).count).to be(1)
+ end
+ end
+ end
+end
diff --git a/spec/requests/users_controller_spec.rb b/spec/requests/users_controller_spec.rb
index 11d8be24e06..75ae0c970c0 100644
--- a/spec/requests/users_controller_spec.rb
+++ b/spec/requests/users_controller_spec.rb
@@ -174,39 +174,95 @@ RSpec.describe UsersController, feature_category: :user_management do
end
context 'requested in json format' do
- let(:project) { create(:project) }
+ context 'when profile_tabs_vue feature flag is turned OFF' do
+ let(:project) { create(:project) }
- before do
- project.add_developer(user)
- Gitlab::DataBuilder::Push.build_sample(project, user)
+ before do
+ project.add_developer(user)
+ Gitlab::DataBuilder::Push.build_sample(project, user)
+ stub_feature_flags(profile_tabs_vue: false)
+ sign_in(user)
+ end
- sign_in(user)
- end
+ it 'loads events' do
+ get user_activity_url user.username, format: :json
- it 'loads events' do
- get user_activity_url user.username, format: :json
+ expect(response.media_type).to eq('application/json')
+ expect(Gitlab::Json.parse(response.body)['count']).to eq(1)
+ end
- expect(response.media_type).to eq('application/json')
- expect(Gitlab::Json.parse(response.body)['count']).to eq(1)
- end
+ it 'hides events if the user cannot read cross project' do
+ allow(Ability).to receive(:allowed?).and_call_original
+ expect(Ability).to receive(:allowed?).with(user, :read_cross_project) { false }
- it 'hides events if the user cannot read cross project' do
- allow(Ability).to receive(:allowed?).and_call_original
- expect(Ability).to receive(:allowed?).with(user, :read_cross_project) { false }
+ get user_activity_url user.username, format: :json
- get user_activity_url user.username, format: :json
+ expect(response.media_type).to eq('application/json')
+ expect(Gitlab::Json.parse(response.body)['count']).to eq(0)
+ end
- expect(response.media_type).to eq('application/json')
- expect(Gitlab::Json.parse(response.body)['count']).to eq(0)
+ it 'hides events if the user has a private profile' do
+ Gitlab::DataBuilder::Push.build_sample(project, private_user)
+
+ get user_activity_url private_user.username, format: :json
+
+ expect(response.media_type).to eq('application/json')
+ expect(Gitlab::Json.parse(response.body)['count']).to eq(0)
+ end
end
- it 'hides events if the user has a private profile' do
- Gitlab::DataBuilder::Push.build_sample(project, private_user)
+ context 'when profile_tabs_vue feature flag is turned ON' do
+ let(:project) { create(:project) }
- get user_activity_url private_user.username, format: :json
+ before do
+ project.add_developer(user)
+ Gitlab::DataBuilder::Push.build_sample(project, user)
+ stub_feature_flags(profile_tabs_vue: true)
+ sign_in(user)
+ end
- expect(response.media_type).to eq('application/json')
- expect(Gitlab::Json.parse(response.body)['count']).to eq(0)
+ it 'loads events' do
+ get user_activity_url user.username, format: :json
+
+ expect(response.media_type).to eq('application/json')
+ expect(Gitlab::Json.parse(response.body).count).to eq(1)
+ end
+
+ it 'hides events if the user cannot read cross project' do
+ allow(Ability).to receive(:allowed?).and_call_original
+ expect(Ability).to receive(:allowed?).with(user, :read_cross_project) { false }
+
+ get user_activity_url user.username, format: :json
+
+ expect(response.media_type).to eq('application/json')
+ expect(Gitlab::Json.parse(response.body).count).to eq(0)
+ end
+
+ it 'hides events if the user has a private profile' do
+ Gitlab::DataBuilder::Push.build_sample(project, private_user)
+
+ get user_activity_url private_user.username, format: :json
+
+ expect(response.media_type).to eq('application/json')
+ expect(Gitlab::Json.parse(response.body).count).to eq(0)
+ end
+
+ it 'hides events if the user has a private profile' do
+ project = create(:project, :private)
+ private_event_user = create(:user, include_private_contributions: true)
+ push_data = Gitlab::DataBuilder::Push.build_sample(project, private_event_user)
+ EventCreateService.new.push(project, private_event_user, push_data)
+
+ get user_activity_url private_event_user.username, format: :json
+
+ response_body = Gitlab::Json.parse(response.body)
+ event = response_body.first
+ expect(response.media_type).to eq('application/json')
+ expect(response_body.count).to eq(1)
+ expect(event).to include('created_at', 'author', 'action')
+ expect(event['action']).to eq('private')
+ expect(event).not_to include('ref', 'commit', 'target', 'resource_parent')
+ end
end
end
end
diff --git a/spec/serializers/profile/event_entity_spec.rb b/spec/serializers/profile/event_entity_spec.rb
new file mode 100644
index 00000000000..1551fc76466
--- /dev/null
+++ b/spec/serializers/profile/event_entity_spec.rb
@@ -0,0 +1,149 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Profile::EventEntity, feature_category: :user_profile do
+ let_it_be(:group) { create(:group) } # rubocop:disable RSpec/FactoryBot/AvoidCreate
+ let_it_be(:project) { build(:project_empty_repo, group: group) }
+ let_it_be(:user) { create(:user) } # rubocop:disable RSpec/FactoryBot/AvoidCreate
+ let_it_be(:merge_request) { create(:merge_request, source_project: project, target_project: project) } # rubocop:disable RSpec/FactoryBot/AvoidCreate
+
+ let(:target_user) { user }
+ let(:event) { build(:event, :merged, author: user, project: project, target: merge_request) }
+ let(:request) { double(described_class, current_user: user, target_user: target_user) } # rubocop:disable RSpec/VerifiedDoubles
+ let(:entity) { described_class.new(event, request: request) }
+
+ subject { entity.as_json }
+
+ before do
+ group.add_maintainer(user)
+ end
+
+ it 'exposes fields', :aggregate_failures do
+ expect(subject[:created_at]).to eq(event.created_at)
+ expect(subject[:action]).to eq(event.action)
+ expect(subject[:author][:id]).to eq(target_user.id)
+ expect(subject[:author][:name]).to eq(target_user.name)
+ expect(subject[:author][:path]).to eq(target_user.username)
+ end
+
+ context 'for push events' do
+ let_it_be(:commit_from) { Gitlab::Git::BLANK_SHA }
+ let_it_be(:commit_title) { 'My commit' }
+ let(:event) { build(:push_event, project: project, author: target_user) }
+
+ it 'exposes ref fields' do
+ build(:push_event_payload, event: event, ref_count: 3)
+
+ expect(subject[:ref][:type]).to eq(event.ref_type)
+ expect(subject[:ref][:count]).to eq(event.ref_count)
+ expect(subject[:ref][:name]).to eq(event.ref_name)
+ expect(subject[:ref][:path]).to be_nil
+ end
+
+ shared_examples 'returns ref path' do
+ specify do
+ expect(subject[:ref][:path]).to be_present
+ end
+ end
+
+ context 'with tag' do
+ before do
+ allow(project.repository).to receive(:tag_exists?).and_return(true)
+ build(:push_event_payload, event: event, ref_type: :tag)
+ end
+
+ it_behaves_like 'returns ref path'
+ end
+
+ context 'with branch' do
+ before do
+ allow(project.repository).to receive(:branch_exists?).and_return(true)
+ build(:push_event_payload, event: event, ref_type: :branch)
+ end
+
+ it_behaves_like 'returns ref path'
+ end
+
+ it 'exposes commit fields' do
+ build(:push_event_payload, event: event, commit_title: commit_title, commit_from: commit_from, commit_count: 2)
+
+ compare_path = "/#{group.path}/#{project.path}/-/compare/#{commit_from}...#{event.commit_to}"
+ expect(subject[:commit][:compare_path]).to eq(compare_path)
+ expect(event.commit_id).to include(subject[:commit][:truncated_sha])
+ expect(subject[:commit][:path]).to be_present
+ expect(subject[:commit][:title]).to eq(commit_title)
+ expect(subject[:commit][:count]).to eq(2)
+ expect(commit_from).to include(subject[:commit][:from_truncated_sha])
+ expect(event.commit_to).to include(subject[:commit][:to_truncated_sha])
+ expect(subject[:commit][:create_mr_path]).to be_nil
+ end
+
+ it 'exposes create_mr_path' do
+ allow(project).to receive(:default_branch).and_return('main')
+ allow(project.repository).to receive(:branch_exists?).and_return(true)
+ build(:push_event_payload, event: event, action: :created, commit_from: commit_from, commit_count: 2)
+
+ new_mr_path = "/#{group.path}/#{project.path}/-/merge_requests/new?" \
+ "merge_request%5Bsource_branch%5D=#{event.branch_name}"
+ expect(subject[:commit][:create_mr_path]).to eq(new_mr_path)
+ end
+ end
+
+ context 'with target' do
+ let_it_be(:note) { build(:note_on_merge_request, :with_attachment, noteable: merge_request, project: project) }
+
+ context 'when target does not responds to :reference_link_text' do
+ let(:event) { build(:event, :commented, project: project, target: note, author: target_user) }
+
+ it 'exposes target fields' do
+ expect(subject[:target]).not_to include(:reference_link_text)
+ expect(subject[:target][:target_type]).to eq(note.class.to_s)
+ expect(subject[:target][:target_url]).to be_present
+ expect(subject[:target][:title]).to eq(note.title)
+ expect(subject[:target][:first_line_in_markdown]).to be_present
+ expect(subject[:target][:attachment][:url]).to eq(note.attachment.url)
+ end
+ end
+
+ context 'when target responds to :reference_link_text' do
+ it 'exposes reference_link_text' do
+ expect(subject[:target][:reference_link_text]).to eq(merge_request.reference_link_text)
+ end
+ end
+ end
+
+ context 'with resource parent' do
+ it 'exposes resource parent fields' do
+ resource_parent = event.resource_parent
+
+ expect(subject[:resource_parent][:type]).to eq('project')
+ expect(subject[:resource_parent][:full_name]).to eq(resource_parent.full_name)
+ expect(subject[:resource_parent][:full_path]).to eq(resource_parent.full_path)
+ end
+ end
+
+ context 'for private events' do
+ let(:event) { build(:event, :merged, author: target_user) }
+
+ context 'when include_private_contributions? is true' do
+ let(:target_user) { build(:user, include_private_contributions: true) }
+
+ it 'exposes only created_at, action, and author', :aggregate_failures do
+ expect(subject[:created_at]).to eq(event.created_at)
+ expect(subject[:action]).to eq('private')
+ expect(subject[:author][:id]).to eq(target_user.id)
+ expect(subject[:author][:name]).to eq(target_user.name)
+ expect(subject[:author][:path]).to eq(target_user.username)
+
+ is_expected.not_to include(:ref, :commit, :target, :resource_parent)
+ end
+ end
+
+ context 'when include_private_contributions? is false' do
+ let(:target_user) { build(:user, include_private_contributions: false) }
+
+ it { is_expected.to be_empty }
+ end
+ end
+end
diff --git a/workhorse/go.mod b/workhorse/go.mod
index 6d0af2c69fe..a4d9a17e64c 100644
--- a/workhorse/go.mod
+++ b/workhorse/go.mod
@@ -25,7 +25,7 @@ require (
github.com/sebest/xff v0.0.0-20210106013422-671bd2870b3a
github.com/sirupsen/logrus v1.9.0
github.com/smartystreets/goconvey v1.7.2
- github.com/stretchr/testify v1.8.1
+ github.com/stretchr/testify v1.8.2
gitlab.com/gitlab-org/gitaly/v15 v15.9.1
gitlab.com/gitlab-org/golang-archive-zip v0.1.1
gitlab.com/gitlab-org/labkit v1.17.0
diff --git a/workhorse/go.sum b/workhorse/go.sum
index 2773a57eeed..bb3d4dad400 100644
--- a/workhorse/go.sum
+++ b/workhorse/go.sum
@@ -1782,8 +1782,9 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=