From 52ebfa1ac32dad37acf88f4ac4263d415969a0d7 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 21 Apr 2025 21:09:59 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .eslint_todo/vue-no-unused-properties.mjs | 19 ------- .../gitlab/feature_flag_without_actor.yml | 2 - ...e_end_string_concatenation_indentation.yml | 1 - .rubocop_todo/layout/line_length.yml | 2 - .../lint/safe_navigation_consistency.yml | 1 - .rubocop_todo/lint/unused_method_argument.yml | 1 - .rubocop_todo/rails/date.yml | 1 - .rubocop_todo/rake/require.yml | 1 - .../rake/top_level_method_definition.yml | 1 - .rubocop_todo/rspec/be_eq.yml | 2 - .rubocop_todo/rspec/feature_category.yml | 2 - .rubocop_todo/style/hash_each_methods.yml | 1 - .../style/inline_disable_annotation.yml | 2 - .rubocop_todo/style/mutable_constant.yml | 1 - .../fragments/base_project.fragment.graphql | 46 ----------------- .../fragments/project.fragment.graphql | 49 ++++++++++++++++++- .../graphql/queries/projects.query.graphql | 2 +- .../graphql/queries/projects.query.graphql | 2 +- .../queries/user_projects.query.graphql | 2 +- .../project_list_item_description.stories.js | 12 ++++- .../project_list_item_description.vue | 25 +++++++++- .../project_list_item_inactive_badge.vue | 11 +++++ .../projects_list/projects_list_item.vue | 4 +- doc/development/advanced_search.md | 9 ++-- doc/development/advanced_search/tips.md | 12 +++++ locale/gitlab.pot | 9 ++-- .../project_list_item_description_spec.js | 24 +++++++-- .../project_list_item_inactive_badge_spec.js | 28 +++++++++++ .../projects_list/projects_list_item_spec.js | 4 +- 29 files changed, 169 insertions(+), 107 deletions(-) delete mode 100644 .rubocop_todo/lint/safe_navigation_consistency.yml delete mode 100644 app/assets/javascripts/graphql_shared/fragments/base_project.fragment.graphql diff --git a/.eslint_todo/vue-no-unused-properties.mjs b/.eslint_todo/vue-no-unused-properties.mjs index 1d1e8ddd48e..81f0b2cbcf8 100644 --- a/.eslint_todo/vue-no-unused-properties.mjs +++ b/.eslint_todo/vue-no-unused-properties.mjs @@ -408,25 +408,6 @@ export default { 'ee/app/assets/javascripts/roadmap/components/roadmap_filters.vue', 'ee/app/assets/javascripts/roadmap/components/roadmap_shell.vue', 'ee/app/assets/javascripts/roadmap/components/roadmap_timeline_section.vue', - 'ee/app/assets/javascripts/security_configuration/components/configuration_page_layout.vue', - 'ee/app/assets/javascripts/security_configuration/components/configuration_snippet_modal.vue', - 'ee/app/assets/javascripts/security_configuration/components/container_scanning_for_registry_feature_card.vue', - 'ee/app/assets/javascripts/security_configuration/corpus_management/components/corpus_upload_button.vue', - 'ee/app/assets/javascripts/security_configuration/dast_pre_scan_verification/components/pre_scan_verification_alert.vue', - 'ee/app/assets/javascripts/security_configuration/dast_profiles/components/base_dast_profile_form.vue', - 'ee/app/assets/javascripts/security_configuration/dast_profiles/components/dast_profiles_list.vue', - 'ee/app/assets/javascripts/security_configuration/dast_profiles/components/dast_site_profiles_list.vue', - 'ee/app/assets/javascripts/security_configuration/dast_profiles/components/dast_variables_form_group.vue', - 'ee/app/assets/javascripts/security_configuration/dast_profiles/components/dast_variables_modal.vue', - 'ee/app/assets/javascripts/security_configuration/dast_profiles/dast_profile_selector/site_profile_summary.vue', - 'ee/app/assets/javascripts/security_configuration/dast_profiles/dast_profiles_configurator/dast_profiles_configurator.vue', - 'ee/app/assets/javascripts/security_configuration/dast_profiles/dast_scanner_profiles/components/dast_scanner_profile_form.vue', - 'ee/app/assets/javascripts/security_configuration/dast_profiles/dast_site_profiles/components/dast_site_profile_form.vue', - 'ee/app/assets/javascripts/security_configuration/dast_site_validation/components/dast_site_validation_modal.vue', - 'ee/app/assets/javascripts/security_configuration/dast_site_validation/components/dast_site_validation_revoke_modal.vue', - 'ee/app/assets/javascripts/security_configuration/sast/components/app.vue', - 'ee/app/assets/javascripts/security_configuration/secret_detection/components/exclusion_delete_modal.vue', - 'ee/app/assets/javascripts/security_configuration/secret_detection/components/exclusion_form_drawer.vue', 'ee/app/assets/javascripts/security_dashboard/components/agent/agent_vulnerability_report.vue', 'ee/app/assets/javascripts/security_dashboard/components/pipeline/pipeline_vulnerability_report.vue', 'ee/app/assets/javascripts/security_dashboard/components/pipeline/vulnerability_finding_modal.vue', diff --git a/.rubocop_todo/gitlab/feature_flag_without_actor.yml b/.rubocop_todo/gitlab/feature_flag_without_actor.yml index e7e93414ec3..6b34ecab425 100644 --- a/.rubocop_todo/gitlab/feature_flag_without_actor.yml +++ b/.rubocop_todo/gitlab/feature_flag_without_actor.yml @@ -109,8 +109,6 @@ Gitlab/FeatureFlagWithoutActor: - 'ee/lib/gitlab/llm/tanuki_bot.rb' - 'ee/lib/gitlab/search/zoekt/client.rb' - 'ee/lib/gitlab/usage_data_counters/epic_activity_unique_counter.rb' - - 'ee/lib/gitlab_subscriptions/billable_users_utils.rb' - - 'ee/lib/gitlab_subscriptions/member_management/promotion_management_utils.rb' - 'ee/lib/search/zoekt/circuit_breaker.rb' - 'ee/spec/lib/gitlab/product_analytics/developments/setup_spec.rb' - 'ee/spec/models/gitlab_subscriptions/features_spec.rb' diff --git a/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml b/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml index cc68aacf900..3cb9680a461 100644 --- a/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml +++ b/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml @@ -589,7 +589,6 @@ Layout/LineEndStringConcatenationIndentation: - 'spec/support/helpers/stub_gitlab_calls.rb' - 'spec/support/matchers/have_gitlab_http_status.rb' - 'spec/support/permissions_check.rb' - - 'spec/support/rspec_run_time.rb' - 'spec/support/shared_examples/features/inviting_members_shared_examples.rb' - 'spec/support/shared_examples/features/project_upload_files_shared_examples.rb' - 'spec/support/shared_examples/features/value_streams_dashboard_shared_examples.rb' diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index bde2d040eb4..29bef23974f 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -668,7 +668,6 @@ Layout/LineLength: - 'ee/app/services/ee/groups/import_export/import_service.rb' - 'ee/app/services/ee/groups/update_service.rb' - 'ee/app/services/ee/ip_restrictions/update_service.rb' - - 'ee/app/services/ee/issuable/common_system_notes_service.rb' - 'ee/app/services/ee/issues/base_service.rb' - 'ee/app/services/ee/issues/clone_service.rb' - 'ee/app/services/ee/merge_requests/merge_base_service.rb' @@ -803,7 +802,6 @@ Layout/LineLength: - 'ee/lib/ee/api/entities/application_setting.rb' - 'ee/lib/ee/api/entities/dependency.rb' - 'ee/lib/ee/api/entities/epic.rb' - - 'ee/lib/ee/api/entities/group.rb' - 'ee/lib/ee/api/entities/member.rb' - 'ee/lib/ee/api/entities/namespace.rb' - 'ee/lib/ee/api/entities/project.rb' diff --git a/.rubocop_todo/lint/safe_navigation_consistency.yml b/.rubocop_todo/lint/safe_navigation_consistency.yml deleted file mode 100644 index 8eb302a2894..00000000000 --- a/.rubocop_todo/lint/safe_navigation_consistency.yml +++ /dev/null @@ -1 +0,0 @@ -# Empty after resolving Lint/SafeNavigationConsistency diff --git a/.rubocop_todo/lint/unused_method_argument.yml b/.rubocop_todo/lint/unused_method_argument.yml index 433485094a3..6bd9efc80db 100644 --- a/.rubocop_todo/lint/unused_method_argument.yml +++ b/.rubocop_todo/lint/unused_method_argument.yml @@ -171,7 +171,6 @@ Lint/UnusedMethodArgument: - 'app/workers/gitlab/jira_import/import_issue_worker.rb' - 'app/workers/issues/rebalancing_worker.rb' - 'app/workers/personal_access_tokens/expired_notification_worker.rb' - - 'app/workers/projects/inactive_projects_deletion_cron_worker.rb' - 'app/workers/projects/refresh_build_artifacts_size_statistics_worker.rb' - 'config/initializers/00_active_record_disable_joins.rb' - 'config/initializers/active_record_table_definition.rb' diff --git a/.rubocop_todo/rails/date.yml b/.rubocop_todo/rails/date.yml index 0f34f37d845..82c1d0457eb 100644 --- a/.rubocop_todo/rails/date.yml +++ b/.rubocop_todo/rails/date.yml @@ -91,7 +91,6 @@ Rails/Date: - 'ee/spec/requests/gitlab_subscriptions/api/internal/users_spec.rb' - 'ee/spec/requests/groups/settings/access_tokens_controller_spec.rb' - 'ee/spec/requests/projects/settings/access_tokens_controller_spec.rb' - - 'ee/spec/serializers/ee/group_child_entity_spec.rb' - 'ee/spec/services/app_sec/dast/profile_schedules/audit/update_service_spec.rb' - 'ee/spec/services/audit_event_service_spec.rb' - 'ee/spec/services/ci/minutes/additional_packs/create_service_spec.rb' diff --git a/.rubocop_todo/rake/require.yml b/.rubocop_todo/rake/require.yml index 9b4b0b9cc3b..24bb67e63fd 100644 --- a/.rubocop_todo/rake/require.yml +++ b/.rubocop_todo/rake/require.yml @@ -6,7 +6,6 @@ Rake/Require: - 'lib/tasks/contracts/pipeline_schedules.rake' - 'lib/tasks/contracts/pipelines.rake' - 'lib/tasks/gitlab/artifacts/migrate.rake' - - 'lib/tasks/gitlab/backup.rake' - 'lib/tasks/gitlab/docs/redirect.rake' - 'lib/tasks/gitlab/graphql.rake' - 'lib/tasks/gitlab/lfs/migrate.rake' diff --git a/.rubocop_todo/rake/top_level_method_definition.yml b/.rubocop_todo/rake/top_level_method_definition.yml index 966563a410e..5f044e637e0 100644 --- a/.rubocop_todo/rake/top_level_method_definition.yml +++ b/.rubocop_todo/rake/top_level_method_definition.yml @@ -17,7 +17,6 @@ Rake/TopLevelMethodDefinition: - 'lib/tasks/gettext.rake' - 'lib/tasks/gitlab/assets.rake' - 'lib/tasks/gitlab/background_migrations.rake' - - 'lib/tasks/gitlab/backup.rake' - 'lib/tasks/gitlab/cleanup.rake' - 'lib/tasks/gitlab/click_house/migration.rake' - 'lib/tasks/gitlab/container_registry.rake' diff --git a/.rubocop_todo/rspec/be_eq.yml b/.rubocop_todo/rspec/be_eq.yml index cc2c2565b9b..04713d08053 100644 --- a/.rubocop_todo/rspec/be_eq.yml +++ b/.rubocop_todo/rspec/be_eq.yml @@ -376,7 +376,6 @@ RSpec/BeEq: - 'ee/spec/requests/users/identity_verification_controller_spec.rb' - 'ee/spec/requests/users/registrations_identity_verification_controller_spec.rb' - 'ee/spec/serializers/ee/admin/abuse_report_details_entity_spec.rb' - - 'ee/spec/serializers/ee/group_child_entity_spec.rb' - 'ee/spec/serializers/ee/note_entity_spec.rb' - 'ee/spec/serializers/environment_entity_spec.rb' - 'ee/spec/serializers/epic_note_entity_spec.rb' @@ -497,7 +496,6 @@ RSpec/BeEq: - 'ee/spec/support_specs/stub_saas_features_spec.rb' - 'ee/spec/workers/app_sec/container_scanning/scan_image_worker_spec.rb' - 'ee/spec/workers/click_house/rebuild_materialized_view_cron_worker_spec.rb' - - 'ee/spec/workers/ee/projects/inactive_projects_deletion_cron_worker_spec.rb' - 'ee/spec/workers/ee/repository_check/batch_worker_spec.rb' - 'ee/spec/workers/ee/repository_check/single_repository_worker_spec.rb' - 'ee/spec/workers/elastic_remove_expired_namespace_subscriptions_from_index_cron_worker_spec.rb' diff --git a/.rubocop_todo/rspec/feature_category.yml b/.rubocop_todo/rspec/feature_category.yml index e3f889aa0e0..52b5a7d8a03 100644 --- a/.rubocop_todo/rspec/feature_category.yml +++ b/.rubocop_todo/rspec/feature_category.yml @@ -1706,7 +1706,6 @@ RSpec/FeatureCategory: - 'spec/helpers/gitlab_routing_helper_spec.rb' - 'spec/helpers/gitlab_script_tag_helper_spec.rb' - 'spec/helpers/graph_helper_spec.rb' - - 'spec/helpers/hooks_helper_spec.rb' - 'spec/helpers/icons_helper_spec.rb' - 'spec/helpers/instance_configuration_helper_spec.rb' - 'spec/helpers/invite_members_helper_spec.rb' @@ -2140,7 +2139,6 @@ RSpec/FeatureCategory: - 'spec/lib/gitlab/ci/status/bridge/waiting_for_resource_spec.rb' - 'spec/lib/gitlab/ci/status/build/action_spec.rb' - 'spec/lib/gitlab/ci/status/build/cancelable_spec.rb' - - 'spec/lib/gitlab/ci/status/build/common_spec.rb' - 'spec/lib/gitlab/ci/status/build/created_spec.rb' - 'spec/lib/gitlab/ci/status/build/erased_spec.rb' - 'spec/lib/gitlab/ci/status/build/factory_spec.rb' diff --git a/.rubocop_todo/style/hash_each_methods.yml b/.rubocop_todo/style/hash_each_methods.yml index 19a42ba794f..11f431b6d1d 100644 --- a/.rubocop_todo/style/hash_each_methods.yml +++ b/.rubocop_todo/style/hash_each_methods.yml @@ -113,7 +113,6 @@ Style/HashEachMethods: - 'spec/models/user_spec.rb' - 'spec/presenters/ci/pipeline_presenter_spec.rb' - 'spec/presenters/commit_status_presenter_spec.rb' - - 'spec/requests/api/project_templates_spec.rb' - 'spec/services/system_notes/incident_service_spec.rb' - 'spec/support/helpers/database/multiple_databases_helpers.rb' - 'spec/support/helpers/reactive_caching_helpers.rb' diff --git a/.rubocop_todo/style/inline_disable_annotation.yml b/.rubocop_todo/style/inline_disable_annotation.yml index 8c92c980842..4a34212fa8c 100644 --- a/.rubocop_todo/style/inline_disable_annotation.yml +++ b/.rubocop_todo/style/inline_disable_annotation.yml @@ -1453,7 +1453,6 @@ Style/InlineDisableAnnotation: - 'ee/lib/ee/gitlab/object_hierarchy.rb' - 'ee/lib/ee/gitlab/quick_actions/users_extractor.rb' - 'ee/lib/ee/gitlab/usage_data.rb' - - 'ee/lib/ee/users/internal.rb' - 'ee/lib/elastic/instance_proxy_util.rb' - 'ee/lib/elastic/latest/git_class_proxy.rb' - 'ee/lib/elastic/latest/note_class_proxy.rb' @@ -2034,7 +2033,6 @@ Style/InlineDisableAnnotation: - 'lib/tasks/tokens.rake' - 'lib/unnested_in_filters/dsl.rb' - 'lib/uploaded_file.rb' - - 'lib/users/internal.rb' - 'locale/unfound_translations.rb' - 'metrics_server/dependencies.rb' - 'metrics_server/metrics_server.rb' diff --git a/.rubocop_todo/style/mutable_constant.yml b/.rubocop_todo/style/mutable_constant.yml index fe608f65462..2e7bd7da588 100644 --- a/.rubocop_todo/style/mutable_constant.yml +++ b/.rubocop_todo/style/mutable_constant.yml @@ -30,7 +30,6 @@ Style/MutableConstant: - 'lib/gitlab/seeder.rb' - 'lib/gitlab/sidekiq_signals.rb' - 'lib/gitlab/web_hooks/recursion_detection/uuid.rb' - - 'lib/tasks/gitlab/backup.rake' - 'scripts/perf/gc/collect_gc_stats.rb' - 'spec/support/helpers/jira_integration_helpers.rb' - 'tooling/danger/stable_branch.rb' diff --git a/app/assets/javascripts/graphql_shared/fragments/base_project.fragment.graphql b/app/assets/javascripts/graphql_shared/fragments/base_project.fragment.graphql deleted file mode 100644 index f559b5d20da..00000000000 --- a/app/assets/javascripts/graphql_shared/fragments/base_project.fragment.graphql +++ /dev/null @@ -1,46 +0,0 @@ -#import "~/graphql_shared/fragments/ci_icon.fragment.graphql" - -fragment BaseProject on Project { - id - fullPath - archived - nameWithNamespace - webUrl - topics - forksCount - avatarUrl - starCount - visibility - openMergeRequestsCount - openIssuesCount - descriptionHtml - createdAt - updatedAt - lastActivityAt - group { - id - } - mergeRequestsAccessLevel { - stringValue - } - issuesAccessLevel { - stringValue - } - forkingAccessLevel { - stringValue - } - userPermissions { - removeProject - viewEditPage - } - maxAccessLevel { - integerValue - } - isCatalogResource - exploreCatalogPath - pipeline { - detailedStatus { - ...CiIcon - } - } -} diff --git a/app/assets/javascripts/graphql_shared/fragments/project.fragment.graphql b/app/assets/javascripts/graphql_shared/fragments/project.fragment.graphql index e607313de61..5236da3ecc3 100644 --- a/app/assets/javascripts/graphql_shared/fragments/project.fragment.graphql +++ b/app/assets/javascripts/graphql_shared/fragments/project.fragment.graphql @@ -1,5 +1,50 @@ -#import "./base_project.fragment.graphql" +#import "~/graphql_shared/fragments/ci_icon.fragment.graphql" fragment Project on Project { - ...BaseProject + id + fullPath + archived + nameWithNamespace + webUrl + topics + forksCount + avatarUrl + starCount + visibility + openMergeRequestsCount + openIssuesCount + descriptionHtml + createdAt + updatedAt + lastActivityAt + group { + id + } + mergeRequestsAccessLevel { + stringValue + } + issuesAccessLevel { + stringValue + } + forkingAccessLevel { + stringValue + } + userPermissions { + removeProject + viewEditPage + } + maxAccessLevel { + integerValue + } + isCatalogResource + exploreCatalogPath + pipeline { + id + detailedStatus { + ...CiIcon + } + } + markedForDeletionOn + isAdjournedDeletionEnabled + permanentDeletionDate } diff --git a/app/assets/javascripts/organizations/shared/graphql/queries/projects.query.graphql b/app/assets/javascripts/organizations/shared/graphql/queries/projects.query.graphql index 09160c4a4a2..e00e9a45d59 100644 --- a/app/assets/javascripts/organizations/shared/graphql/queries/projects.query.graphql +++ b/app/assets/javascripts/organizations/shared/graphql/queries/projects.query.graphql @@ -1,5 +1,5 @@ #import "~/graphql_shared/fragments/page_info.fragment.graphql" -#import "ee_else_ce/graphql_shared/fragments/project.fragment.graphql" +#import "~/graphql_shared/fragments/project.fragment.graphql" query getOrganizationProjects( $id: OrganizationsOrganizationID! diff --git a/app/assets/javascripts/projects/your_work/graphql/queries/projects.query.graphql b/app/assets/javascripts/projects/your_work/graphql/queries/projects.query.graphql index 815c834fa04..045ad2cf35e 100644 --- a/app/assets/javascripts/projects/your_work/graphql/queries/projects.query.graphql +++ b/app/assets/javascripts/projects/your_work/graphql/queries/projects.query.graphql @@ -1,5 +1,5 @@ #import "~/graphql_shared/fragments/page_info.fragment.graphql" -#import "ee_else_ce/graphql_shared/fragments/project.fragment.graphql" +#import "~/graphql_shared/fragments/project.fragment.graphql" query getYourWorkProjects( $archived: ProjectArchived = EXCLUDE diff --git a/app/assets/javascripts/projects/your_work/graphql/queries/user_projects.query.graphql b/app/assets/javascripts/projects/your_work/graphql/queries/user_projects.query.graphql index 0af14e1aaa1..8e4e7e16108 100644 --- a/app/assets/javascripts/projects/your_work/graphql/queries/user_projects.query.graphql +++ b/app/assets/javascripts/projects/your_work/graphql/queries/user_projects.query.graphql @@ -1,5 +1,5 @@ #import "~/graphql_shared/fragments/page_info.fragment.graphql" -#import "ee_else_ce/graphql_shared/fragments/project.fragment.graphql" +#import "~/graphql_shared/fragments/project.fragment.graphql" query getYourWorkUserProjects( $contributed: Boolean = false diff --git a/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_description.stories.js b/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_description.stories.js index b58bdffce47..35a75910528 100644 --- a/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_description.stories.js +++ b/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_description.stories.js @@ -1,4 +1,4 @@ -import ProjectListItemDescription from './project_list_item_description.vue'; +import ProjectListItemDescription from '~/vue_shared/components/projects_list/project_list_item_description.vue'; export default { component: ProjectListItemDescription, @@ -28,3 +28,13 @@ Default.args = { The app integrates with smart home devices and local transportation data to provide real-time suggestions for energy savings and greener commutes.

`, }, }; + +export const PendingDeletionProject = Template.bind({}); +PendingDeletionProject.args = { + ...Default.args, + project: { + ...Default.args.project, + markedForDeletionOn: '2024-12-01', + permanentDeletionDate: '2024-12-07', + }, +}; diff --git a/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_description.vue b/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_description.vue index 1d8759ac78e..ea0304fe124 100644 --- a/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_description.vue +++ b/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_description.vue @@ -1,11 +1,20 @@ diff --git a/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_inactive_badge.vue b/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_inactive_badge.vue index 96f18fd8312..2f0f5c6cfed 100644 --- a/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_inactive_badge.vue +++ b/app/assets/javascripts/vue_shared/components/projects_list/project_list_item_inactive_badge.vue @@ -5,6 +5,7 @@ import { __ } from '~/locale'; export default { name: 'ProjectListItemInactiveBadge', i18n: { + pendingDeletion: __('Pending deletion'), archived: __('Archived'), }, components: { @@ -17,7 +18,17 @@ export default { }, }, computed: { + isPendingDeletion() { + return Boolean(this.project.markedForDeletionOn); + }, inactiveBadge() { + if (this.isPendingDeletion) { + return { + variant: 'warning', + text: this.$options.i18n.pendingDeletion, + }; + } + if (this.project.archived) { return { variant: 'info', diff --git a/app/assets/javascripts/vue_shared/components/projects_list/projects_list_item.vue b/app/assets/javascripts/vue_shared/components/projects_list/projects_list_item.vue index b93d3f2762b..0b13768a005 100644 --- a/app/assets/javascripts/vue_shared/components/projects_list/projects_list_item.vue +++ b/app/assets/javascripts/vue_shared/components/projects_list/projects_list_item.vue @@ -5,9 +5,9 @@ import { renderDeleteSuccessToast, deleteParams, } from 'ee_else_ce/vue_shared/components/projects_list/utils'; -import ProjectListItemDescription from 'ee_else_ce/vue_shared/components/projects_list/project_list_item_description.vue'; +import ProjectListItemDescription from '~/vue_shared/components/projects_list/project_list_item_description.vue'; import ProjectListItemActions from 'ee_else_ce/vue_shared/components/projects_list/project_list_item_actions.vue'; -import ProjectListItemInactiveBadge from 'ee_else_ce/vue_shared/components/projects_list/project_list_item_inactive_badge.vue'; +import ProjectListItemInactiveBadge from '~/vue_shared/components/projects_list/project_list_item_inactive_badge.vue'; import { VISIBILITY_TYPE_ICON, PROJECT_VISIBILITY_TYPE } from '~/visibility_level/constants'; import { ACCESS_LEVEL_LABELS, ACCESS_LEVEL_NO_ACCESS_INTEGER } from '~/access_level/constants'; import { FEATURABLE_ENABLED } from '~/featurable/constants'; diff --git a/doc/development/advanced_search.md b/doc/development/advanced_search.md index 79663638291..5a2f4566444 100644 --- a/doc/development/advanced_search.md +++ b/doc/development/advanced_search.md @@ -1559,7 +1559,7 @@ This is not applicable yet as multiple indices functionality is not fully implem {{< /alert >}} -Currently GitLab can only handle a single version of setting. Any setting/schema changes would require reindexing everything from scratch. Since reindexing can take a long time, this can cause search functionality downtime. +Currently, GitLab can only handle a single version of setting. Any setting/schema changes would require reindexing everything from scratch. Since reindexing can take a long time, this can cause search functionality downtime. To avoid downtime, GitLab is working to support multiple indices that can function at the same time. Whenever the schema changes, the administrator @@ -1571,7 +1571,7 @@ index. This is also helpful for migrating to new servers, for example, moving to/from AWS. -Currently we are on the process of migrating to this new design. Everything is hardwired to work with one single version for now. +Currently, we are on the process of migrating to this new design. Everything is hardwired to work with one single version for now. ## Performance Monitoring @@ -1586,12 +1586,12 @@ is impacting overall performance relative to the time spent doing other things. GitLab also exports [Prometheus metrics](../administration/monitoring/prometheus/gitlab_metrics.md) for indexing queues, which can help diagnose performance bottlenecks and determine -whether or not your GitLab instance or Elasticsearch server can keep up with +whether your GitLab instance or Elasticsearch server can keep up with the volume of updates. ### Logs -All of the indexing happens in Sidekiq, so much of the relevant logs for the +All indexing happens in Sidekiq, so much of the relevant logs for the Elasticsearch integration can be found in [`sidekiq.log`](../administration/logs/_index.md#sidekiqlog). In particular, all Sidekiq workers that make requests to Elasticsearch in any way will log the @@ -1631,6 +1631,7 @@ in the cluster back the request in GitLab. - [Creating indices from scratch](advanced_search/tips.md#creating-all-indices-from-scratch-and-populating-with-local-data) - [Index data](advanced_search/tips.md#index-data) +- [Updating dependent associations in the index](advanced_search/tips.md#dependent-association-index-updates) - [Kibana](advanced_search/tips.md#kibana) - [Running tests with Elasticsearch](advanced_search/tips.md#testing) - [Testing migrations](advanced_search/tips.md#advanced-search-migrations) diff --git a/doc/development/advanced_search/tips.md b/doc/development/advanced_search/tips.md index f98550ae347..e87ab5b362b 100644 --- a/doc/development/advanced_search/tips.md +++ b/doc/development/advanced_search/tips.md @@ -100,6 +100,18 @@ Elastic::ProcessBookkeepingService.track!(*MergeRequest.all) Elastic::ProcessBookkeepingService.new.execute ``` +## Dependent association index updates + +You can use elastic_index_dependant_association to automatically update associated records in the index +when specific fields change. For example, to reindex all work items when a project's `visibility_level` changes + +```ruby + elastic_index_dependant_association :work_items, on_change: :visibility_level, depends_on_finished_migration: :add_mapping_migration +``` + +The `depends_on_finished_migration` parameter is optional and ensures the update only occurs after the specified advanced +search migration has completed (such as a migration that added the necessary field to the mapping). + ## Testing {{< alert type="warning" >}} diff --git a/locale/gitlab.pot b/locale/gitlab.pot index fc627338131..3355c035d14 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -19961,9 +19961,6 @@ msgstr "" msgid "DastProfiles|No variables found" msgstr "" -msgid "DastProfiles|Not Validated" -msgstr "" - msgid "DastProfiles|Number of workers that passive scan in parallel. Defaults to the number of available CPUs." msgstr "" @@ -20270,9 +20267,6 @@ msgstr "" msgid "DastProfiles|Validate site profile" msgstr "" -msgid "DastProfiles|Validated" -msgstr "" - msgid "DastProfiles|Validation status" msgstr "" @@ -57400,6 +57394,9 @@ msgstr "" msgid "Simulate a pipeline created for the default branch" msgstr "" +msgid "Single component can be selected for component filter to be able to filter by version." +msgstr "" + msgid "Site profile failed to delete" msgstr "" diff --git a/spec/frontend/vue_shared/components/projects_list/project_list_item_description_spec.js b/spec/frontend/vue_shared/components/projects_list/project_list_item_description_spec.js index e42869f4306..a006dd804e6 100644 --- a/spec/frontend/vue_shared/components/projects_list/project_list_item_description_spec.js +++ b/spec/frontend/vue_shared/components/projects_list/project_list_item_description_spec.js @@ -1,9 +1,9 @@ -import { GlTruncateText } from '@gitlab/ui'; +import { GlIcon, GlSprintf, GlTruncateText } from '@gitlab/ui'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import ProjectListItemDescription from '~/vue_shared/components/projects_list/project_list_item_description.vue'; import ListItemDescription from '~/vue_shared/components/resource_lists/list_item_description.vue'; -describe('ProjectListItemDescriptionCE', () => { +describe('ProjectListItemDescription', () => { let wrapper; const defaultProps = { @@ -15,11 +15,12 @@ describe('ProjectListItemDescriptionCE', () => { const createComponent = ({ props = {} } = {}) => { wrapper = shallowMountExtended(ProjectListItemDescription, { propsData: { ...defaultProps, ...props }, - stubs: { GlTruncateText }, + stubs: { GlTruncateText, GlSprintf }, }); }; const findListItemDescription = () => wrapper.findComponent(ListItemDescription); + const findGlIcon = () => wrapper.findComponent(GlIcon); describe('when project has a description but is archived', () => { it('does not render description', () => { @@ -59,4 +60,21 @@ describe('ProjectListItemDescriptionCE', () => { expect(findListItemDescription().exists()).toBe(false); }); }); + + describe('when pending deletion', () => { + it('renders correct icon and scheduled for deletion information', () => { + createComponent({ + props: { + project: { + ...defaultProps.project, + markedForDeletionOn: '2024-12-24', + permanentDeletionDate: '2024-12-31', + }, + }, + }); + + expect(findGlIcon().props('name')).toBe('calendar'); + expect(wrapper.text().replace(/\s+/g, ' ')).toBe('Scheduled for deletion on Dec 31, 2024'); + }); + }); }); diff --git a/spec/frontend/vue_shared/components/projects_list/project_list_item_inactive_badge_spec.js b/spec/frontend/vue_shared/components/projects_list/project_list_item_inactive_badge_spec.js index 2956972f32b..dc9dddd8a41 100644 --- a/spec/frontend/vue_shared/components/projects_list/project_list_item_inactive_badge_spec.js +++ b/spec/frontend/vue_shared/components/projects_list/project_list_item_inactive_badge_spec.js @@ -55,4 +55,32 @@ describe('ProjectListItemInactiveBadgeCE', () => { expect(findGlBadge().exists()).toBe(false); }); }); + + describe.each` + archived | markedForDeletionOn | variant | text + ${false} | ${null} | ${false} | ${false} + ${true} | ${null} | ${'info'} | ${'Archived'} + ${false} | ${'2024-01-01'} | ${'warning'} | ${'Pending deletion'} + ${true} | ${'2024-01-01'} | ${'warning'} | ${'Pending deletion'} + `( + 'when project.archived is $archived and project.markedForDeletionOn is $markedForDeletionOn', + ({ archived, markedForDeletionOn, variant, text }) => { + beforeEach(() => { + createComponent({ + props: { + project: { + ...project, + archived, + markedForDeletionOn, + }, + }, + }); + }); + + it('renders the badge correctly', () => { + expect(findGlBadge().exists() && findGlBadge().props('variant')).toBe(variant); + expect(findGlBadge().exists() && findGlBadge().text()).toBe(text); + }); + }, + ); }); diff --git a/spec/frontend/vue_shared/components/projects_list/projects_list_item_spec.js b/spec/frontend/vue_shared/components/projects_list/projects_list_item_spec.js index 97ac93dd4f3..d2f1675342a 100644 --- a/spec/frontend/vue_shared/components/projects_list/projects_list_item_spec.js +++ b/spec/frontend/vue_shared/components/projects_list/projects_list_item_spec.js @@ -3,9 +3,9 @@ import { GlAvatarLabeled, GlIcon, GlTooltip } from '@gitlab/ui'; import projects from 'test_fixtures/api/users/projects/get.json'; import { stubComponent } from 'helpers/stub_component'; import { mountExtended } from 'helpers/vue_test_utils_helper'; -import ProjectListItemDescription from 'ee_else_ce/vue_shared/components/projects_list/project_list_item_description.vue'; +import ProjectListItemDescription from '~/vue_shared/components/projects_list/project_list_item_description.vue'; import ProjectListItemActions from 'ee_else_ce/vue_shared/components/projects_list/project_list_item_actions.vue'; -import ProjectListItemInactiveBadge from 'ee_else_ce/vue_shared/components/projects_list/project_list_item_inactive_badge.vue'; +import ProjectListItemInactiveBadge from '~/vue_shared/components/projects_list/project_list_item_inactive_badge.vue'; import ProjectsListItem from '~/vue_shared/components/projects_list/projects_list_item.vue'; import { ACTION_EDIT, ACTION_DELETE } from '~/vue_shared/components/list_actions/constants'; import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';