From 3e85e6dcd38f6b3d502c06d9bbdf8c35282a74c5 Mon Sep 17 00:00:00 2001 From: Sheldon Led Date: Fri, 28 Nov 2025 11:08:34 -0300 Subject: [PATCH 1/8] Make display_gitlab_credits_user_data configurable in admin area --- .../_visibility_and_access.html.haml | 2 + .../visibility_and_access_controls.md | 37 +++++ .../helpers/ee/application_settings_helper.rb | 3 +- ...display_gitlab_credits_user_data.html.haml | 10 ++ .../application_settings_controller_spec.rb | 128 ++++++++++++++++++ locale/gitlab.pot | 9 ++ 6 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml diff --git a/app/views/admin/application_settings/_visibility_and_access.html.haml b/app/views/admin/application_settings/_visibility_and_access.html.haml index 8a11688ce23716..38313c997140ff 100644 --- a/app/views/admin/application_settings/_visibility_and_access.html.haml +++ b/app/views/admin/application_settings/_visibility_and_access.html.haml @@ -53,6 +53,8 @@ = render_if_exists 'admin/application_settings/globally_allowed_ips', form: f + = render_if_exists 'admin/application_settings/display_gitlab_credits_user_data', form: f + -# This is added for Jihu edition in https://jihulab.com/gitlab-cn/gitlab/-/merge_requests/1112 = render_if_exists 'admin/application_settings/disable_download_button', f: f diff --git a/doc/administration/settings/visibility_and_access_controls.md b/doc/administration/settings/visibility_and_access_controls.md index ff418bc87f7fbd..51efdf553e69c9 100644 --- a/doc/administration/settings/visibility_and_access_controls.md +++ b/doc/administration/settings/visibility_and_access_controls.md @@ -429,3 +429,40 @@ To prevent invitations: 1. Expand **Visibility and access controls**. 1. Select the **Prevent group member invitations** checkbox. 1. Select **Save changes**. + +## GitLab Credits dashboard + +{{< history >}} + +- Instance setting to allow the display of user data + [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/214538) in GitLab 18.7 + [with a flag](../feature_flags/_index.md) named `usage_billing_dev`. + Disabled by default. + +{{< /history >}} + +{{< alert type="flag" >}} + +The availability of this feature is controlled by a feature flag. +For more information, see the history. + +{{< /alert >}} + +{{< details >}} + +- Tier: Premium, Ultimate +- Offering: GitLab Self-Managed, GitLab Dedicated + +{{< /details >}} + +Prerequisites: + +- You must be an administrator. + +To enable the display of user data on the GitLab Credits dashboard: + +1. In the upper-right corner, select **Admin**. +1. Select **Settings** > **General**. +1. Expand **Visibility and access controls**. +1. For the **GitLab Credits dashboard**, select the **Display user data** checkbox. +1. Select **Save changes**. diff --git a/ee/app/helpers/ee/application_settings_helper.rb b/ee/app/helpers/ee/application_settings_helper.rb index ab88d2bd79f8e1..de3c63dbe96bb7 100644 --- a/ee/app/helpers/ee/application_settings_helper.rb +++ b/ee/app/helpers/ee/application_settings_helper.rb @@ -111,7 +111,8 @@ def visible_attributes :global_search_epics_enabled, :global_search_limited_indexing_enabled, :elastic_migration_worker_enabled, - :enforce_pipl_compliance + :enforce_pipl_compliance, + :display_gitlab_credits_user_data ].tap do |settings| settings.concat(identity_verification_attributes) settings.concat(enable_promotion_management_attributes) diff --git a/ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml b/ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml new file mode 100644 index 00000000000000..e6c80111825558 --- /dev/null +++ b/ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml @@ -0,0 +1,10 @@ +- return unless Feature.enabled?(:usage_billing_dev, :instance) +- return unless License.feature_available?(:usage_billing) +- return if ::Gitlab::Saas.feature_available?(:gitlab_com_subscriptions) + +- f = local_assigns.fetch(:form) + +.form-group + %h5= _('GitLab Credits dashboard') + = f.gitlab_ui_checkbox_component :display_gitlab_credits_user_data, _('Display user data'), + help_text: _('If selected, individual usernames and their credit usage are visible on the GitLab Credits dashboard. If your organization needs to restrict access to individual user activity for compliance or privacy reasons, clear this checkbox.') diff --git a/ee/spec/requests/admin/application_settings_controller_spec.rb b/ee/spec/requests/admin/application_settings_controller_spec.rb index 7548f95a75a176..7d59da7b17405f 100644 --- a/ee/spec/requests/admin/application_settings_controller_spec.rb +++ b/ee/spec/requests/admin/application_settings_controller_spec.rb @@ -80,5 +80,133 @@ get general_admin_application_settings_path end + + context 'for display_gitlab_credits_user_data', feature_category: :consumables_cost_management do + it 'does not show the checkbox in saas', :saas_gitlab_com_subscriptions do + stub_feature_flags(usage_billing_dev: true) + stub_licensed_features(usage_billing: true) + + get general_admin_application_settings_path + + expect(response.body).not_to include('GitLab Credits dashboard') + expect(response.body).not_to include('Display user data') + end + + it 'hides checkbox when usage_billing_dev is disabled' do + stub_feature_flags(usage_billing_dev: false) + stub_licensed_features(usage_billing: true) + + get general_admin_application_settings_path + + expect(response.body).not_to include('GitLab Credits dashboard') + expect(response.body).not_to include('Display user data') + end + + it 'hides checkbox when license does not have usage billing feature' do + stub_feature_flags(usage_billing_dev: true) + stub_licensed_features(usage_billing: false) + + get general_admin_application_settings_path + + expect(response.body).not_to include('GitLab Credits dashboard') + expect(response.body).not_to include('Display user data') + end + + it 'shows the checkbox when both feature flag and license feature are enabled' do + stub_feature_flags(usage_billing_dev: true) + stub_licensed_features(usage_billing: true) + + get general_admin_application_settings_path + + expect(response.body).to include('GitLab Credits dashboard') + expect(response.body).to include('Display user data') + end + + it 'shows checkbox as checked when setting is true' do + stub_feature_flags(usage_billing_dev: true) + stub_licensed_features(usage_billing: true) + ::Gitlab::CurrentSettings.update!(display_gitlab_credits_user_data: true) + + get general_admin_application_settings_path + + expect(response.body).to include('display_gitlab_credits_user_data') + expect(response.body) + .to include('checked="checked" name="application_setting[display_gitlab_credits_user_data]"') + end + + it 'shows checkbox as unchecked when setting is false' do + stub_feature_flags(usage_billing_dev: true) + stub_licensed_features(usage_billing: true) + ::Gitlab::CurrentSettings.update!(display_gitlab_credits_user_data: false) + + get general_admin_application_settings_path + + expect(response.body).to include('display_gitlab_credits_user_data') + expect(response.body) + .not_to include('checked="checked" name="application_setting[display_gitlab_credits_user_data]"') + end + end + end + + describe 'PATCH #update' do + before do + sign_in(admin) + end + + context 'for display_gitlab_credits_user_data', feature_category: :consumables_cost_management do + let(:params) do + { application_setting: { display_gitlab_credits_user_data: display_gitlab_credits_user_data } } + end + + context 'when updating to true' do + let(:display_gitlab_credits_user_data) { true } + + it 'updates the setting successfully' do + patch general_admin_application_settings_path, params: params + + expect(response).to have_gitlab_http_status(:redirect) + expect(::Gitlab::CurrentSettings.display_gitlab_credits_user_data).to be true + end + + it 'shows success message' do + patch general_admin_application_settings_path, params: params + + expect(flash[:notice]).to eq('Application settings saved successfully') + end + end + + context 'when updating to false' do + let(:display_gitlab_credits_user_data) { false } + + before do + ::Gitlab::CurrentSettings.update!(display_gitlab_credits_user_data: true) + end + + it 'updates the setting successfully' do + patch general_admin_application_settings_path, params: params + + expect(response).to have_gitlab_http_status(:redirect) + expect(::Gitlab::CurrentSettings.display_gitlab_credits_user_data).to be false + end + end + + context 'when updating with invalid value' do + let(:display_gitlab_credits_user_data) { nil } + + it 'does not update the setting' do + original_value = ::Gitlab::CurrentSettings.display_gitlab_credits_user_data + + patch general_admin_application_settings_path, params: params + + expect(::Gitlab::CurrentSettings.reload.display_gitlab_credits_user_data).to eq(original_value) + end + + it 'shows error message' do + patch general_admin_application_settings_path, params: params + + expect(response.body).to include('must be a boolean value') + end + end + end end end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index bd9737348a13d5..1943ee5bae5023 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -24977,6 +24977,9 @@ msgstr "" msgid "Display time tracking in issues in total hours only. %{link_start}What is time tracking?%{link_end}" msgstr "" +msgid "Display user data" +msgstr "" + msgid "Display view" msgstr "" @@ -31027,6 +31030,9 @@ msgstr "" msgid "GitLab Credits" msgstr "" +msgid "GitLab Credits dashboard" +msgstr "" + msgid "GitLab Duo" msgstr "" @@ -34819,6 +34825,9 @@ msgstr "" msgid "If everything looks okay, you can ignore this message." msgstr "" +msgid "If selected, individual usernames and their credit usage are visible on the GitLab Credits dashboard. If your organization needs to restrict access to individual user activity for compliance or privacy reasons, clear this checkbox." +msgstr "" + msgid "If selected, successful pipelines do not trigger a notification event." msgstr "" -- GitLab From 9ffb4075df97824e6648605157e6ab37827912bb Mon Sep 17 00:00:00 2001 From: Sheldon Led Date: Fri, 5 Dec 2025 09:52:20 -0300 Subject: [PATCH 2/8] Remove doc update --- .../visibility_and_access_controls.md | 37 ------------------- 1 file changed, 37 deletions(-) diff --git a/doc/administration/settings/visibility_and_access_controls.md b/doc/administration/settings/visibility_and_access_controls.md index 51efdf553e69c9..ff418bc87f7fbd 100644 --- a/doc/administration/settings/visibility_and_access_controls.md +++ b/doc/administration/settings/visibility_and_access_controls.md @@ -429,40 +429,3 @@ To prevent invitations: 1. Expand **Visibility and access controls**. 1. Select the **Prevent group member invitations** checkbox. 1. Select **Save changes**. - -## GitLab Credits dashboard - -{{< history >}} - -- Instance setting to allow the display of user data - [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/214538) in GitLab 18.7 - [with a flag](../feature_flags/_index.md) named `usage_billing_dev`. - Disabled by default. - -{{< /history >}} - -{{< alert type="flag" >}} - -The availability of this feature is controlled by a feature flag. -For more information, see the history. - -{{< /alert >}} - -{{< details >}} - -- Tier: Premium, Ultimate -- Offering: GitLab Self-Managed, GitLab Dedicated - -{{< /details >}} - -Prerequisites: - -- You must be an administrator. - -To enable the display of user data on the GitLab Credits dashboard: - -1. In the upper-right corner, select **Admin**. -1. Select **Settings** > **General**. -1. Expand **Visibility and access controls**. -1. For the **GitLab Credits dashboard**, select the **Display user data** checkbox. -1. Select **Save changes**. -- GitLab From 0e55df07d55fd52e64694208b1fc5d3a750ef677 Mon Sep 17 00:00:00 2001 From: Sheldon Led Date: Fri, 5 Dec 2025 18:52:11 -0300 Subject: [PATCH 3/8] Add usage_billing to NamespaceSettingChangesAuditor --- ee/lib/namespaces/namespace_setting_changes_auditor.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ee/lib/namespaces/namespace_setting_changes_auditor.rb b/ee/lib/namespaces/namespace_setting_changes_auditor.rb index 65014cfec5bf8f..f1145f625d6d8e 100644 --- a/ee/lib/namespaces/namespace_setting_changes_auditor.rb +++ b/ee/lib/namespaces/namespace_setting_changes_auditor.rb @@ -23,7 +23,8 @@ class NamespaceSettingChangesAuditor < ::AuditEvents::BaseChangesAuditor remove_dormant_members_period: 'remove_dormant_members_period_updated', prevent_sharing_groups_outside_hierarchy: 'prevent_sharing_groups_outside_hierarchy_updated', seat_control: 'seat_control_updated', - step_up_auth_required_oauth_provider: 'step_up_auth_required_oauth_provider_updated' + step_up_auth_required_oauth_provider: 'step_up_auth_required_oauth_provider_updated', + usage_billing: 'usage_billing_updated' }.freeze def initialize(current_user, namespace_setting, group) -- GitLab From 1364bb64be29c28c89a295262fe129bdbeca3a52 Mon Sep 17 00:00:00 2001 From: Ammar Alakkad Date: Tue, 9 Dec 2025 09:21:41 +0300 Subject: [PATCH 4/8] Prefix translations with UsageBilling namespace --- .../_display_gitlab_credits_user_data.html.haml | 4 ++-- locale/gitlab.pot | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml b/ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml index e6c80111825558..58ad4735711859 100644 --- a/ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml +++ b/ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml @@ -6,5 +6,5 @@ .form-group %h5= _('GitLab Credits dashboard') - = f.gitlab_ui_checkbox_component :display_gitlab_credits_user_data, _('Display user data'), - help_text: _('If selected, individual usernames and their credit usage are visible on the GitLab Credits dashboard. If your organization needs to restrict access to individual user activity for compliance or privacy reasons, clear this checkbox.') + = f.gitlab_ui_checkbox_component :display_gitlab_credits_user_data, s_('UsageBilling|Display user data'), + help_text: s_('UsageBilling|If selected, individual usernames and their credit usage are visible on the GitLab Credits dashboard. If your organization needs to restrict access to individual user activity for compliance or privacy reasons, clear this checkbox.') diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 1943ee5bae5023..a852d069a56eb6 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -24977,9 +24977,6 @@ msgstr "" msgid "Display time tracking in issues in total hours only. %{link_start}What is time tracking?%{link_end}" msgstr "" -msgid "Display user data" -msgstr "" - msgid "Display view" msgstr "" @@ -34825,9 +34822,6 @@ msgstr "" msgid "If everything looks okay, you can ignore this message." msgstr "" -msgid "If selected, individual usernames and their credit usage are visible on the GitLab Credits dashboard. If your organization needs to restrict access to individual user activity for compliance or privacy reasons, clear this checkbox." -msgstr "" - msgid "If selected, successful pipelines do not trigger a notification event." msgstr "" @@ -71836,6 +71830,9 @@ msgstr "" msgid "UsageBilling|Date/Time" msgstr "" +msgid "UsageBilling|Display user data" +msgstr "" + msgid "UsageBilling|Enable on-demand billing" msgstr "" @@ -71860,6 +71857,9 @@ msgstr "" msgid "UsageBilling|GitLab Credits usage" msgstr "" +msgid "UsageBilling|If selected, individual usernames and their credit usage are visible on the GitLab Credits dashboard. If your organization needs to restrict access to individual user activity for compliance or privacy reasons, clear this checkbox." +msgstr "" + msgid "UsageBilling|Included credits" msgstr "" -- GitLab From 3f49a6c39e36924cecce2460dbf6db949a4bd805 Mon Sep 17 00:00:00 2001 From: Ammar Alakkad Date: Tue, 9 Dec 2025 09:32:56 +0300 Subject: [PATCH 5/8] Fix namespace_setting_changes_auditor spec --- .../lib/namespaces/namespace_setting_changes_auditor_spec.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ee/spec/lib/namespaces/namespace_setting_changes_auditor_spec.rb b/ee/spec/lib/namespaces/namespace_setting_changes_auditor_spec.rb index dea1f4d160de54..1e54928522a304 100644 --- a/ee/spec/lib/namespaces/namespace_setting_changes_auditor_spec.rb +++ b/ee/spec/lib/namespaces/namespace_setting_changes_auditor_spec.rb @@ -130,8 +130,7 @@ web_based_commit_signing_enabled allow_enterprise_bypass_placeholder_confirmation enterprise_bypass_expires_at allow_personal_snippets lock_auto_duo_code_review_enabled auto_duo_code_review_enabled lock_duo_remote_flows_enabled duo_remote_flows_enabled lock_duo_foundational_flows_enabled - duo_foundational_flows_enabled lock_duo_sast_fp_detection_enabled duo_sast_fp_detection_enabled - usage_billing] + duo_foundational_flows_enabled lock_duo_sast_fp_detection_enabled duo_sast_fp_detection_enabled] columns_to_audit = Namespaces::NamespaceSettingChangesAuditor::EVENT_NAME_PER_COLUMN.keys.map(&:to_s) -- GitLab From c475d2576365f39a0cc217e545cd342e704907dd Mon Sep 17 00:00:00 2001 From: Ammar Alakkad Date: Wed, 10 Dec 2025 11:19:53 +0300 Subject: [PATCH 6/8] Update translation namespace --- ..._display_gitlab_credits_user_data.html.haml | 6 +++--- locale/gitlab.pot | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml b/ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml index 58ad4735711859..d1e019f7320fd7 100644 --- a/ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml +++ b/ee/app/views/admin/application_settings/_display_gitlab_credits_user_data.html.haml @@ -5,6 +5,6 @@ - f = local_assigns.fetch(:form) .form-group - %h5= _('GitLab Credits dashboard') - = f.gitlab_ui_checkbox_component :display_gitlab_credits_user_data, s_('UsageBilling|Display user data'), - help_text: s_('UsageBilling|If selected, individual usernames and their credit usage are visible on the GitLab Credits dashboard. If your organization needs to restrict access to individual user activity for compliance or privacy reasons, clear this checkbox.') + %h5= s_('AdminSettingsUsageBilling|GitLab Credits dashboard') + = f.gitlab_ui_checkbox_component :display_gitlab_credits_user_data, s_('AdminSettingsUsageBilling|Display user data'), + help_text: s_('AdminSettingsUsageBilling|If selected, individual usernames and their credit usage are visible on the GitLab Credits dashboard. If your organization needs to restrict access to individual user activity for compliance or privacy reasons, clear this checkbox.') diff --git a/locale/gitlab.pot b/locale/gitlab.pot index a852d069a56eb6..822527ebaff6d8 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -5452,6 +5452,15 @@ msgstr "" msgid "AdminSelfHostedModels|Your self-hosted model was successfully deleted." msgstr "" +msgid "AdminSettingsUsageBilling|Display user data" +msgstr "" + +msgid "AdminSettingsUsageBilling|GitLab Credits dashboard" +msgstr "" + +msgid "AdminSettingsUsageBilling|If selected, individual usernames and their credit usage are visible on the GitLab Credits dashboard. If your organization needs to restrict access to individual user activity for compliance or privacy reasons, clear this checkbox." +msgstr "" + msgid "AdminSettings|%{generate_manually_link_start}Generate%{generate_manually_link_end} Service Ping to preview and download service usage data payload." msgstr "" @@ -31027,9 +31036,6 @@ msgstr "" msgid "GitLab Credits" msgstr "" -msgid "GitLab Credits dashboard" -msgstr "" - msgid "GitLab Duo" msgstr "" @@ -71830,9 +71836,6 @@ msgstr "" msgid "UsageBilling|Date/Time" msgstr "" -msgid "UsageBilling|Display user data" -msgstr "" - msgid "UsageBilling|Enable on-demand billing" msgstr "" @@ -71857,9 +71860,6 @@ msgstr "" msgid "UsageBilling|GitLab Credits usage" msgstr "" -msgid "UsageBilling|If selected, individual usernames and their credit usage are visible on the GitLab Credits dashboard. If your organization needs to restrict access to individual user activity for compliance or privacy reasons, clear this checkbox." -msgstr "" - msgid "UsageBilling|Included credits" msgstr "" -- GitLab From 866f251ec00cdfdefe6bbd896bdffc19570a190d Mon Sep 17 00:00:00 2001 From: Ammar Alakkad Date: Wed, 10 Dec 2025 11:41:00 +0300 Subject: [PATCH 7/8] Add usage_billing_updated audit event type --- config/audit_events/types/usage_billing_updated.yml | 11 +++++++++++ doc/user/compliance/audit_event_types.md | 6 ++++++ 2 files changed, 17 insertions(+) create mode 100644 config/audit_events/types/usage_billing_updated.yml diff --git a/config/audit_events/types/usage_billing_updated.yml b/config/audit_events/types/usage_billing_updated.yml new file mode 100644 index 00000000000000..d35dcec6771985 --- /dev/null +++ b/config/audit_events/types/usage_billing_updated.yml @@ -0,0 +1,11 @@ +--- +name: usage_billing_updated +description: The event is triggered when the namespace owner changes "Display user + data" under Settings > GitLab Credits dashboard +introduced_by_issue: https://gitlab.com/gitlab-org/gitlab/-/issues/580868 +introduced_by_mr: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/214538 +feature_category: consumables_cost_management +milestone: '18.7' +saved_to_database: true +streamed: true +scope: [Instance] diff --git a/doc/user/compliance/audit_event_types.md b/doc/user/compliance/audit_event_types.md index c70c0b13670a4a..63e0c0b2f0dac4 100644 --- a/doc/user/compliance/audit_event_types.md +++ b/doc/user/compliance/audit_event_types.md @@ -229,6 +229,12 @@ Audit event types belong to the following product categories. | [`update_status_check`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/84624) | An external status check is updated | {{< yes >}} | GitLab [15.9](https://gitlab.com/gitlab-org/gitlab/-/issues/355805) | Project | | [`updated_compliance_requirement_control`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177557) | Compliance requirement control updated. | {{< yes >}} | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/512381) | Group | +### Consumables cost management + +| Type name | Event triggered when | Saved to database | Introduced in | Scope | +|:----------|:---------------------|:------------------|:--------------|:------| +| [`usage_billing_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/214538) | The event is triggered when the namespace owner changes "Display user data" under Settings > GitLab Credits dashboard | {{< yes >}} | GitLab [18.7](https://gitlab.com/gitlab-org/gitlab/-/issues/580868) | Instance | + ### Container registry | Type name | Event triggered when | Saved to database | Introduced in | Scope | -- GitLab From 4b8cb6d42325aa08d73eefba48efd5e0d59ebce9 Mon Sep 17 00:00:00 2001 From: Tyler Amos Date: Wed, 10 Dec 2025 14:08:35 -0500 Subject: [PATCH 8/8] Remove usage_billing_updated audit event changes These will be introduced in a separate MR to avoid blocking this MR. --- config/audit_events/types/usage_billing_updated.yml | 11 ----------- doc/user/compliance/audit_event_types.md | 6 ------ .../namespaces/namespace_setting_changes_auditor.rb | 3 +-- .../namespace_setting_changes_auditor_spec.rb | 3 ++- 4 files changed, 3 insertions(+), 20 deletions(-) delete mode 100644 config/audit_events/types/usage_billing_updated.yml diff --git a/config/audit_events/types/usage_billing_updated.yml b/config/audit_events/types/usage_billing_updated.yml deleted file mode 100644 index d35dcec6771985..00000000000000 --- a/config/audit_events/types/usage_billing_updated.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: usage_billing_updated -description: The event is triggered when the namespace owner changes "Display user - data" under Settings > GitLab Credits dashboard -introduced_by_issue: https://gitlab.com/gitlab-org/gitlab/-/issues/580868 -introduced_by_mr: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/214538 -feature_category: consumables_cost_management -milestone: '18.7' -saved_to_database: true -streamed: true -scope: [Instance] diff --git a/doc/user/compliance/audit_event_types.md b/doc/user/compliance/audit_event_types.md index 63e0c0b2f0dac4..c70c0b13670a4a 100644 --- a/doc/user/compliance/audit_event_types.md +++ b/doc/user/compliance/audit_event_types.md @@ -229,12 +229,6 @@ Audit event types belong to the following product categories. | [`update_status_check`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/84624) | An external status check is updated | {{< yes >}} | GitLab [15.9](https://gitlab.com/gitlab-org/gitlab/-/issues/355805) | Project | | [`updated_compliance_requirement_control`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177557) | Compliance requirement control updated. | {{< yes >}} | GitLab [17.9](https://gitlab.com/gitlab-org/gitlab/-/issues/512381) | Group | -### Consumables cost management - -| Type name | Event triggered when | Saved to database | Introduced in | Scope | -|:----------|:---------------------|:------------------|:--------------|:------| -| [`usage_billing_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/214538) | The event is triggered when the namespace owner changes "Display user data" under Settings > GitLab Credits dashboard | {{< yes >}} | GitLab [18.7](https://gitlab.com/gitlab-org/gitlab/-/issues/580868) | Instance | - ### Container registry | Type name | Event triggered when | Saved to database | Introduced in | Scope | diff --git a/ee/lib/namespaces/namespace_setting_changes_auditor.rb b/ee/lib/namespaces/namespace_setting_changes_auditor.rb index f1145f625d6d8e..65014cfec5bf8f 100644 --- a/ee/lib/namespaces/namespace_setting_changes_auditor.rb +++ b/ee/lib/namespaces/namespace_setting_changes_auditor.rb @@ -23,8 +23,7 @@ class NamespaceSettingChangesAuditor < ::AuditEvents::BaseChangesAuditor remove_dormant_members_period: 'remove_dormant_members_period_updated', prevent_sharing_groups_outside_hierarchy: 'prevent_sharing_groups_outside_hierarchy_updated', seat_control: 'seat_control_updated', - step_up_auth_required_oauth_provider: 'step_up_auth_required_oauth_provider_updated', - usage_billing: 'usage_billing_updated' + step_up_auth_required_oauth_provider: 'step_up_auth_required_oauth_provider_updated' }.freeze def initialize(current_user, namespace_setting, group) diff --git a/ee/spec/lib/namespaces/namespace_setting_changes_auditor_spec.rb b/ee/spec/lib/namespaces/namespace_setting_changes_auditor_spec.rb index 1e54928522a304..dea1f4d160de54 100644 --- a/ee/spec/lib/namespaces/namespace_setting_changes_auditor_spec.rb +++ b/ee/spec/lib/namespaces/namespace_setting_changes_auditor_spec.rb @@ -130,7 +130,8 @@ web_based_commit_signing_enabled allow_enterprise_bypass_placeholder_confirmation enterprise_bypass_expires_at allow_personal_snippets lock_auto_duo_code_review_enabled auto_duo_code_review_enabled lock_duo_remote_flows_enabled duo_remote_flows_enabled lock_duo_foundational_flows_enabled - duo_foundational_flows_enabled lock_duo_sast_fp_detection_enabled duo_sast_fp_detection_enabled] + duo_foundational_flows_enabled lock_duo_sast_fp_detection_enabled duo_sast_fp_detection_enabled + usage_billing] columns_to_audit = Namespaces::NamespaceSettingChangesAuditor::EVENT_NAME_PER_COLUMN.keys.map(&:to_s) -- GitLab