Commit de112fa0 authored by manojmj's avatar manojmj

Rename the feature `marking_project_for_deletion `

This change renames `marking_project_for_deletion `
feature to `adjourned_deletion_for_projects_and_groups `
since we’d be using the same name for both project
and group soft-deletion.
parent 819a7cbb
...@@ -704,8 +704,8 @@ if [[ -d "/builds/gitlab-examples/ci-debug-trace/.git" ]]; then ...@@ -704,8 +704,8 @@ if [[ -d "/builds/gitlab-examples/ci-debug-trace/.git" ]]; then
++ CI_SERVER_VERSION_PATCH=0 ++ CI_SERVER_VERSION_PATCH=0
++ export CI_SERVER_REVISION=f4cc00ae823 ++ export CI_SERVER_REVISION=f4cc00ae823
++ CI_SERVER_REVISION=f4cc00ae823 ++ CI_SERVER_REVISION=f4cc00ae823
++ export GITLAB_FEATURES=audit_events,burndown_charts,code_owners,contribution_analytics,description_diffs,elastic_search,export_issues,group_bulk_edit,group_burndown_charts,group_webhooks,issuable_default_templates,issue_board_focus_mode,issue_weights,jenkins_integration,ldap_group_sync,member_lock,merge_request_approvers,multiple_issue_assignees,multiple_ldap_servers,multiple_merge_request_assignees,protected_refs_for_users,push_rules,related_issues,repository_mirrors,repository_size_limit,scoped_issue_board,usage_quotas,visual_review_app,wip_limits,adjourned_deletion_for_projects_and_groups,admin_audit_log,auditor_user,batch_comments,blocking_merge_requests,board_assignee_lists,board_milestone_lists,ci_cd_projects,cluster_deployments,code_analytics,code_owner_approval_required,commit_committer_check,cross_project_pipelines,custom_file_templates,custom_file_templates_for_namespace,custom_project_templates,custom_prometheus_metrics,cycle_analytics_for_groups,db_load_balancing,default_project_deletion_protection,dependency_proxy,deploy_board,design_management,email_additional_text,extended_audit_events,external_authorization_service_api_management,feature_flags,file_locks,geo,github_project_service_integration,group_allowed_email_domains,group_project_templates,group_saml,issues_analytics,jira_dev_panel_integration,ldap_group_sync_filter,marking_project_for_deletion,merge_pipelines,merge_request_performance_metrics,merge_trains,metrics_reports,multiple_approval_rules,multiple_clusters,multiple_group_issue_boards,object_storage,operations_dashboard,packages,productivity_analytics,project_aliases,protected_environments,reject_unsigned_commits,required_ci_templates,scoped_labels,service_desk,smartcard_auth,group_timelogs,type_of_work_analytics,unprotection_restrictions,ci_project_subscriptions,cluster_health,container_scanning,dast,dependency_scanning,epics,group_ip_restriction,incident_management,insights,license_management,personal_access_token_expiration_policy,pod_logs,prometheus_alerts,pseudonymizer,report_approver_rules,sast,security_dashboard,tracing,web_ide_terminal ++ export GITLAB_FEATURES=audit_events,burndown_charts,code_owners,contribution_analytics,description_diffs,elastic_search,export_issues,group_bulk_edit,group_burndown_charts,group_webhooks,issuable_default_templates,issue_board_focus_mode,issue_weights,jenkins_integration,ldap_group_sync,member_lock,merge_request_approvers,multiple_issue_assignees,multiple_ldap_servers,multiple_merge_request_assignees,protected_refs_for_users,push_rules,related_issues,repository_mirrors,repository_size_limit,scoped_issue_board,usage_quotas,visual_review_app,wip_limits,adjourned_deletion_for_projects_and_groups,admin_audit_log,auditor_user,batch_comments,blocking_merge_requests,board_assignee_lists,board_milestone_lists,ci_cd_projects,cluster_deployments,code_analytics,code_owner_approval_required,commit_committer_check,cross_project_pipelines,custom_file_templates,custom_file_templates_for_namespace,custom_project_templates,custom_prometheus_metrics,cycle_analytics_for_groups,db_load_balancing,default_project_deletion_protection,dependency_proxy,deploy_board,design_management,email_additional_text,extended_audit_events,external_authorization_service_api_management,feature_flags,file_locks,geo,github_project_service_integration,group_allowed_email_domains,group_project_templates,group_saml,issues_analytics,jira_dev_panel_integration,ldap_group_sync_filter,merge_pipelines,merge_request_performance_metrics,merge_trains,metrics_reports,multiple_approval_rules,multiple_clusters,multiple_group_issue_boards,object_storage,operations_dashboard,packages,productivity_analytics,project_aliases,protected_environments,reject_unsigned_commits,required_ci_templates,scoped_labels,service_desk,smartcard_auth,group_timelogs,type_of_work_analytics,unprotection_restrictions,ci_project_subscriptions,cluster_health,container_scanning,dast,dependency_scanning,epics,group_ip_restriction,incident_management,insights,license_management,personal_access_token_expiration_policy,pod_logs,prometheus_alerts,pseudonymizer,report_approver_rules,sast,security_dashboard,tracing,web_ide_terminal
++ GITLAB_FEATURES=audit_events,burndown_charts,code_owners,contribution_analytics,description_diffs,elastic_search,export_issues,group_bulk_edit,group_burndown_charts,group_webhooks,issuable_default_templates,issue_board_focus_mode,issue_weights,jenkins_integration,ldap_group_sync,member_lock,merge_request_approvers,multiple_issue_assignees,multiple_ldap_servers,multiple_merge_request_assignees,protected_refs_for_users,push_rules,related_issues,repository_mirrors,repository_size_limit,scoped_issue_board,usage_quotas,visual_review_app,wip_limits,adjourned_deletion_for_projects_and_groups,admin_audit_log,auditor_user,batch_comments,blocking_merge_requests,board_assignee_lists,board_milestone_lists,ci_cd_projects,cluster_deployments,code_analytics,code_owner_approval_required,commit_committer_check,cross_project_pipelines,custom_file_templates,custom_file_templates_for_namespace,custom_project_templates,custom_prometheus_metrics,cycle_analytics_for_groups,db_load_balancing,default_project_deletion_protection,dependency_proxy,deploy_board,design_management,email_additional_text,extended_audit_events,external_authorization_service_api_management,feature_flags,file_locks,geo,github_project_service_integration,group_allowed_email_domains,group_project_templates,group_saml,issues_analytics,jira_dev_panel_integration,ldap_group_sync_filter,marking_project_for_deletion,merge_pipelines,merge_request_performance_metrics,merge_trains,metrics_reports,multiple_approval_rules,multiple_clusters,multiple_group_issue_boards,object_storage,operations_dashboard,packages,productivity_analytics,project_aliases,protected_environments,reject_unsigned_commits,required_ci_templates,scoped_labels,service_desk,smartcard_auth,group_timelogs,type_of_work_analytics,unprotection_restrictions,ci_project_subscriptions,cluster_health,container_scanning,dast,dependency_scanning,epics,group_ip_restriction,incident_management,insights,license_management,personal_access_token_expiration_policy,pod_logs,prometheus_alerts,pseudonymizer,report_approver_rules,sast,security_dashboard,tracing,web_ide_terminal ++ GITLAB_FEATURES=audit_events,burndown_charts,code_owners,contribution_analytics,description_diffs,elastic_search,export_issues,group_bulk_edit,group_burndown_charts,group_webhooks,issuable_default_templates,issue_board_focus_mode,issue_weights,jenkins_integration,ldap_group_sync,member_lock,merge_request_approvers,multiple_issue_assignees,multiple_ldap_servers,multiple_merge_request_assignees,protected_refs_for_users,push_rules,related_issues,repository_mirrors,repository_size_limit,scoped_issue_board,usage_quotas,visual_review_app,wip_limits,adjourned_deletion_for_projects_and_groups,admin_audit_log,auditor_user,batch_comments,blocking_merge_requests,board_assignee_lists,board_milestone_lists,ci_cd_projects,cluster_deployments,code_analytics,code_owner_approval_required,commit_committer_check,cross_project_pipelines,custom_file_templates,custom_file_templates_for_namespace,custom_project_templates,custom_prometheus_metrics,cycle_analytics_for_groups,db_load_balancing,default_project_deletion_protection,dependency_proxy,deploy_board,design_management,email_additional_text,extended_audit_events,external_authorization_service_api_management,feature_flags,file_locks,geo,github_project_service_integration,group_allowed_email_domains,group_project_templates,group_saml,issues_analytics,jira_dev_panel_integration,ldap_group_sync_filter,merge_pipelines,merge_request_performance_metrics,merge_trains,metrics_reports,multiple_approval_rules,multiple_clusters,multiple_group_issue_boards,object_storage,operations_dashboard,packages,productivity_analytics,project_aliases,protected_environments,reject_unsigned_commits,required_ci_templates,scoped_labels,service_desk,smartcard_auth,group_timelogs,type_of_work_analytics,unprotection_restrictions,ci_project_subscriptions,cluster_health,container_scanning,dast,dependency_scanning,epics,group_ip_restriction,incident_management,insights,license_management,personal_access_token_expiration_policy,pod_logs,prometheus_alerts,pseudonymizer,report_approver_rules,sast,security_dashboard,tracing,web_ide_terminal
++ export CI_PROJECT_ID=17893 ++ export CI_PROJECT_ID=17893
++ CI_PROJECT_ID=17893 ++ CI_PROJECT_ID=17893
++ export CI_PROJECT_NAME=ci-debug-trace ++ export CI_PROJECT_NAME=ci-debug-trace
......
...@@ -38,7 +38,7 @@ module EE ...@@ -38,7 +38,7 @@ module EE
attrs << :default_project_deletion_protection attrs << :default_project_deletion_protection
end end
if License.feature_available?(:marking_project_for_deletion) if License.feature_available?(:adjourned_deletion_for_projects_and_groups)
attrs << :deletion_adjourned_period attrs << :deletion_adjourned_period
end end
......
...@@ -126,7 +126,7 @@ module EE ...@@ -126,7 +126,7 @@ module EE
override :remove_project_message override :remove_project_message
def remove_project_message(project) def remove_project_message(project)
return super unless project.feature_available?(:marking_project_for_deletion) return super unless project.feature_available?(:adjourned_deletion_for_projects_and_groups)
date = permanent_deletion_date(Time.now.utc) date = permanent_deletion_date(Time.now.utc)
_("Removing a project places it into a read-only state until %{date}, at which point the project will be permanantly removed. Are you ABSOLUTELY sure?") % _("Removing a project places it into a read-only state until %{date}, at which point the project will be permanantly removed. Are you ABSOLUTELY sure?") %
......
...@@ -697,13 +697,13 @@ module EE ...@@ -697,13 +697,13 @@ module EE
end end
def adjourned_deletion? def adjourned_deletion?
feature_available?(:marking_project_for_deletion) && feature_available?(:adjourned_deletion_for_projects_and_groups) &&
::Gitlab::CurrentSettings.deletion_adjourned_period > 0 ::Gitlab::CurrentSettings.deletion_adjourned_period > 0
end end
def marked_for_deletion? def marked_for_deletion?
marked_for_deletion_at.present? && marked_for_deletion_at.present? &&
feature_available?(:marking_project_for_deletion) feature_available?(:adjourned_deletion_for_projects_and_groups)
end end
def ancestor_marked_for_deletion def ancestor_marked_for_deletion
......
...@@ -78,7 +78,6 @@ class License < ApplicationRecord ...@@ -78,7 +78,6 @@ class License < ApplicationRecord
issues_analytics issues_analytics
jira_dev_panel_integration jira_dev_panel_integration
ldap_group_sync_filter ldap_group_sync_filter
marking_project_for_deletion
merge_pipelines merge_pipelines
merge_request_performance_metrics merge_request_performance_metrics
merge_trains merge_trains
......
...@@ -4,7 +4,7 @@ module Projects ...@@ -4,7 +4,7 @@ module Projects
class MarkForDeletionService < BaseService class MarkForDeletionService < BaseService
def execute def execute
return success if project.marked_for_deletion_at? return success if project.marked_for_deletion_at?
return error('Cannot mark project for deletion: feature not supported') unless project.feature_available?(:marking_project_for_deletion) return error('Cannot mark project for deletion: feature not supported') unless project.feature_available?(:adjourned_deletion_for_projects_and_groups)
result = ::Projects::UpdateService.new( result = ::Projects::UpdateService.new(
project, project,
......
- return unless License.feature_available?(:marking_project_for_deletion) - return unless License.feature_available?(:adjourned_deletion_for_projects_and_groups)
- f = local_assigns.fetch(:form) - f = local_assigns.fetch(:form)
......
- return unless @project.feature_available?(:marking_project_for_deletion) - return unless @project.feature_available?(:adjourned_deletion_for_projects_and_groups)
- date = permanent_deletion_date(Time.now.utc) - date = permanent_deletion_date(Time.now.utc)
......
- return unless project.feature_available?(:marking_project_for_deletion) - return unless project.feature_available?(:adjourned_deletion_for_projects_and_groups)
- date = permanent_deletion_date(project.marked_for_deletion_at) - date = permanent_deletion_date(project.marked_for_deletion_at)
.sub-section .sub-section
......
...@@ -50,7 +50,7 @@ module EE ...@@ -50,7 +50,7 @@ module EE
expose :packages_enabled, if: ->(project, _) { project.feature_available?(:packages) } expose :packages_enabled, if: ->(project, _) { project.feature_available?(:packages) }
expose :service_desk_enabled, if: ->(project, _) { project.feature_available?(:service_desk) } expose :service_desk_enabled, if: ->(project, _) { project.feature_available?(:service_desk) }
expose :service_desk_address, if: ->(project, _) { project.feature_available?(:service_desk) } expose :service_desk_address, if: ->(project, _) { project.feature_available?(:service_desk) }
expose :marked_for_deletion_at, if: ->(project, _) { project.feature_available?(:marking_project_for_deletion) } expose :marked_for_deletion_at, if: ->(project, _) { project.feature_available?(:adjourned_deletion_for_projects_and_groups) }
end end
end end
...@@ -217,7 +217,7 @@ module EE ...@@ -217,7 +217,7 @@ module EE
expose :email_additional_text, if: ->(_instance, _opts) { ::License.feature_available?(:email_additional_text) } expose :email_additional_text, if: ->(_instance, _opts) { ::License.feature_available?(:email_additional_text) }
expose :file_template_project_id, if: ->(_instance, _opts) { ::License.feature_available?(:custom_file_templates) } expose :file_template_project_id, if: ->(_instance, _opts) { ::License.feature_available?(:custom_file_templates) }
expose :default_project_deletion_protection, if: ->(_instance, _opts) { ::License.feature_available?(:default_project_deletion_protection) } expose :default_project_deletion_protection, if: ->(_instance, _opts) { ::License.feature_available?(:default_project_deletion_protection) }
expose :deletion_adjourned_period, if: ->(_instance, _opts) { ::License.feature_available?(:marking_project_for_deletion) } expose :deletion_adjourned_period, if: ->(_instance, _opts) { ::License.feature_available?(:adjourned_deletion_for_projects_and_groups) }
expose :updating_name_disabled_for_users, if: ->(_instance, _opts) { ::License.feature_available?(:disable_name_update_for_users) } expose :updating_name_disabled_for_users, if: ->(_instance, _opts) { ::License.feature_available?(:disable_name_update_for_users) }
end end
end end
......
...@@ -12,7 +12,7 @@ module EE ...@@ -12,7 +12,7 @@ module EE
end end
post ':id/restore' do post ':id/restore' do
authorize!(:remove_project, user_project) authorize!(:remove_project, user_project)
break not_found! unless user_project.feature_available?(:marking_project_for_deletion) break not_found! unless user_project.feature_available?(:adjourned_deletion_for_projects_and_groups)
result = ::Projects::RestoreService.new(user_project, current_user).execute result = ::Projects::RestoreService.new(user_project, current_user).execute
if result[:status] == :success if result[:status] == :success
......
...@@ -27,7 +27,7 @@ module EE ...@@ -27,7 +27,7 @@ module EE
attrs = attrs.except(:default_project_deletion_protection) attrs = attrs.except(:default_project_deletion_protection)
end end
unless License.feature_available?(:marking_project_for_deletion) unless License.feature_available?(:adjourned_deletion_for_projects_and_groups)
attrs = attrs.except(:deletion_adjourned_period) attrs = attrs.except(:deletion_adjourned_period)
end end
......
...@@ -113,7 +113,7 @@ describe Admin::ApplicationSettingsController do ...@@ -113,7 +113,7 @@ describe Admin::ApplicationSettingsController do
context 'project deletion adjourned period' do context 'project deletion adjourned period' do
let(:settings) { { deletion_adjourned_period: 6 } } let(:settings) { { deletion_adjourned_period: 6 } }
let(:feature) { :marking_project_for_deletion } let(:feature) { :adjourned_deletion_for_projects_and_groups }
it_behaves_like 'settings for licensed features' it_behaves_like 'settings for licensed features'
end end
......
...@@ -406,7 +406,7 @@ describe ProjectsController do ...@@ -406,7 +406,7 @@ describe ProjectsController do
context 'feature is available' do context 'feature is available' do
before do before do
stub_licensed_features(marking_project_for_deletion: true) stub_licensed_features(adjourned_deletion_for_projects_and_groups: true)
end end
it 'marks project for deletion' do it 'marks project for deletion' do
...@@ -444,7 +444,7 @@ describe ProjectsController do ...@@ -444,7 +444,7 @@ describe ProjectsController do
context 'feature is not available' do context 'feature is not available' do
before do before do
stub_licensed_features(marking_project_for_deletion: false) stub_licensed_features(adjourned_deletion_for_projects_and_groups: false)
end end
it 'deletes project right away' do it 'deletes project right away' do
......
...@@ -2319,7 +2319,7 @@ describe Project do ...@@ -2319,7 +2319,7 @@ describe Project do
let(:project) { create(:project) } let(:project) { create(:project) }
before do before do
stub_licensed_features(marking_project_for_deletion: true) stub_licensed_features(adjourned_deletion_for_projects_and_groups: true)
end end
context 'when number of days is set to more than 0' do context 'when number of days is set to more than 0' do
...@@ -2343,7 +2343,7 @@ describe Project do ...@@ -2343,7 +2343,7 @@ describe Project do
let(:project) { create(:project) } let(:project) { create(:project) }
before do before do
stub_licensed_features(marking_project_for_deletion: false) stub_licensed_features(adjourned_deletion_for_projects_and_groups: false)
end end
context 'when number of days is set to more than 0' do context 'when number of days is set to more than 0' do
......
...@@ -182,7 +182,7 @@ describe API::Projects do ...@@ -182,7 +182,7 @@ describe API::Projects do
describe 'marked_for_deletion attribute' do describe 'marked_for_deletion attribute' do
it 'exposed when the feature is available' do it 'exposed when the feature is available' do
stub_licensed_features(marking_project_for_deletion: true) stub_licensed_features(adjourned_deletion_for_projects_and_groups: true)
get api("/projects/#{project.id}", user) get api("/projects/#{project.id}", user)
...@@ -190,7 +190,7 @@ describe API::Projects do ...@@ -190,7 +190,7 @@ describe API::Projects do
end end
it 'not exposed when the feature is not available' do it 'not exposed when the feature is not available' do
stub_licensed_features(marking_project_for_deletion: false) stub_licensed_features(adjourned_deletion_for_projects_and_groups: false)
get api("/projects/#{project.id}", user) get api("/projects/#{project.id}", user)
...@@ -675,7 +675,7 @@ describe API::Projects do ...@@ -675,7 +675,7 @@ describe API::Projects do
describe 'POST /projects/:id/restore' do describe 'POST /projects/:id/restore' do
context 'feature is available' do context 'feature is available' do
before do before do
stub_licensed_features(marking_project_for_deletion: true) stub_licensed_features(adjourned_deletion_for_projects_and_groups: true)
end end
it 'restores project' do it 'restores project' do
...@@ -701,7 +701,7 @@ describe API::Projects do ...@@ -701,7 +701,7 @@ describe API::Projects do
context 'feature is not available' do context 'feature is not available' do
before do before do
stub_licensed_features(marking_project_for_deletion: false) stub_licensed_features(adjourned_deletion_for_projects_and_groups: false)
end end
it 'returns error' do it 'returns error' do
...@@ -715,7 +715,7 @@ describe API::Projects do ...@@ -715,7 +715,7 @@ describe API::Projects do
describe 'DELETE /projects/:id' do describe 'DELETE /projects/:id' do
context 'when feature is available' do context 'when feature is available' do
before do before do
stub_licensed_features(marking_project_for_deletion: true) stub_licensed_features(adjourned_deletion_for_projects_and_groups: true)
end end
it 'marks project for deletion' do it 'marks project for deletion' do
...@@ -748,7 +748,7 @@ describe API::Projects do ...@@ -748,7 +748,7 @@ describe API::Projects do
context 'when feature is not available' do context 'when feature is not available' do
before do before do
stub_licensed_features(marking_project_for_deletion: false) stub_licensed_features(adjourned_deletion_for_projects_and_groups: false)
end end
it 'deletes project' do it 'deletes project' do
......
...@@ -145,7 +145,7 @@ describe API::Settings, 'EE Settings' do ...@@ -145,7 +145,7 @@ describe API::Settings, 'EE Settings' do
context 'deletion adjourned period' do context 'deletion adjourned period' do
let(:settings) { { deletion_adjourned_period: 5 } } let(:settings) { { deletion_adjourned_period: 5 } }
let(:feature) { :marking_project_for_deletion } let(:feature) { :adjourned_deletion_for_projects_and_groups }
it_behaves_like 'settings for licensed features' it_behaves_like 'settings for licensed features'
end end
......
...@@ -14,7 +14,7 @@ describe Projects::MarkForDeletionService do ...@@ -14,7 +14,7 @@ describe Projects::MarkForDeletionService do
context 'with soft-delete feature turned on' do context 'with soft-delete feature turned on' do
before do before do
stub_licensed_features(marking_project_for_deletion: true) stub_licensed_features(adjourned_deletion_for_projects_and_groups: true)
end end
context 'marking project for deletion' do context 'marking project for deletion' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment