diff --git a/doc/user/admin_area/settings/usage_statistics.md b/doc/user/admin_area/settings/usage_statistics.md index 64bec01b765c3f423fcd22a5bc8bc2dfe3cba381..e952c22bf916552b9f73b06e7129b5a8bb35049b 100644 --- a/doc/user/admin_area/settings/usage_statistics.md +++ b/doc/user/admin_area/settings/usage_statistics.md @@ -52,6 +52,7 @@ tier. Users can continue to access the features in a paid tier without sharing u ### Features available in 16.0 and later +- [View description change history](../../../user/discussions/index.md#view-description-change-history). - [Maintenance mode](../../../administration/maintenance_mode/index.md). - [Configurable issue boards](../../project/issue_board.md#configurable-issue-boards). - [Coverage-guided fuzz testing](../../application_security/coverage_fuzzing/index.md). diff --git a/ee/app/models/gitlab_subscriptions/features.rb b/ee/app/models/gitlab_subscriptions/features.rb index 8c2e7884f56471f2edb1b34ffd27c2eaae0f504c..3ae84bc20701964f64fd03c3d8ce6edfe70a19ec 100644 --- a/ee/app/models/gitlab_subscriptions/features.rb +++ b/ee/app/models/gitlab_subscriptions/features.rb @@ -48,7 +48,6 @@ class Features code_owners code_review_analytics contribution_analytics - description_diffs elastic_search full_codequality_report group_activity_analytics @@ -256,6 +255,7 @@ class Features ].freeze STARTER_FEATURES_WITH_USAGE_PING = %i[ + description_diffs send_emails_from_admin_area repository_size_limit maintenance_mode diff --git a/ee/spec/requests/api/graphql/project/work_items_spec.rb b/ee/spec/requests/api/graphql/project/work_items_spec.rb index 20e9a4b75f6b97db19e788b685dd34ebe7303c64..0ddde876e76f0b9e4cc530322fdaa29d0307793c 100644 --- a/ee/spec/requests/api/graphql/project/work_items_spec.rb +++ b/ee/spec/requests/api/graphql/project/work_items_spec.rb @@ -311,6 +311,15 @@ it_behaves_like 'description change diff', description_diffs_enabled: false end + + context 'with description_diffs enabled through Registration Features' do + before do + stub_licensed_features(description_diffs: false) + stub_application_setting(usage_ping_features_enabled: true) + end + + it_behaves_like 'description change diff', description_diffs_enabled: true + end end end diff --git a/ee/spec/serializers/ee/note_entity_spec.rb b/ee/spec/serializers/ee/note_entity_spec.rb index dabfb59f5e6bc46c51a21e38cae1d2e467c86537..4667442b300eb70e87b4a841264dd853c265c4d2 100644 --- a/ee/spec/serializers/ee/note_entity_spec.rb +++ b/ee/spec/serializers/ee/note_entity_spec.rb @@ -27,6 +27,20 @@ end end + context 'when description_diffs feature is available through Registration Features' do + before do + stub_application_setting(usage_ping_features_enabled: true) + stub_licensed_features(description_diffs: false) + end + + it 'includes description versions attributes' do + expect(subject[:description_version_id]).to eq(description_version.id) + expect(subject[:description_diff_path]).to eq(description_diff_project_issue_path(issue.project, issue, description_version.id)) + expect(subject[:delete_description_version_path]).to eq(delete_description_version_project_issue_path(issue.project, issue, description_version.id)) + expect(subject[:can_delete_description_version]).to eq(true) + end + end + context 'when description_diffs license is not available' do before do stub_licensed_features(description_diffs: false) diff --git a/ee/spec/support/shared_examples/controllers/concerns/description_diff_actions_shared_examples.rb b/ee/spec/support/shared_examples/controllers/concerns/description_diff_actions_shared_examples.rb index 1830c15cd25408e63839fb6c62beaf2baa09b567..0636d73f2645e9a69398c6543a223e806a37c3fb 100644 --- a/ee/spec/support/shared_examples/controllers/concerns/description_diff_actions_shared_examples.rb +++ b/ee/spec/support/shared_examples/controllers/concerns/description_diff_actions_shared_examples.rb @@ -16,11 +16,7 @@ def delete_description_version(extra_params = {}) delete :delete_description_version, params: base_params.merge(extra_params) end - context 'when license is available' do - before do - stub_licensed_features(epics: true, description_diffs: true) - end - + shared_examples 'description diff actions' do context 'GET description_diff' do it 'returns the diff with the previous version' do expect(Gitlab::Diff::CharDiff).to receive(:new).with(version_2.description, version_3.description).and_call_original @@ -129,6 +125,23 @@ def delete_description_version(extra_params = {}) end end + context 'when license is available' do + before do + stub_licensed_features(epics: true, description_diffs: true) + end + + it_behaves_like 'description diff actions' + end + + context 'when features are available through Registration Features' do + before do + stub_application_setting(usage_ping_features_enabled: true) + stub_licensed_features(epics: true, description_diffs: false) + end + + it_behaves_like 'description diff actions' + end + context 'when license is not available' do before do stub_licensed_features(epics: true, description_diffs: false)