From cbcd6ba6a97b5cb4e6a0e44679c53120390ea6f3 Mon Sep 17 00:00:00 2001 From: Roy Zwambag Date: Wed, 10 Dec 2025 12:11:01 +0100 Subject: [PATCH] Rename duo_self_hosted to duo_self_hosted_dap --- .../duo_seat_utilization_info_card.vue | 10 ++-- ee/app/assets/javascripts/constants/duo.js | 6 +-- ee/app/models/gitlab_subscriptions/add_on.rb | 6 +-- .../gitlab_subscriptions/add_on_purchase.rb | 3 +- ...{duo_self_hosted.rb => self_hosted_dap.rb} | 4 +- .../self_managed/provision_services/duo.rb | 2 +- ...{duo_self_hosted.rb => self_hosted_dap.rb} | 4 +- .../gitlab_subscriptions/add_on_purchases.rb | 4 +- .../factories/gitlab_subscriptions/add_ons.rb | 6 +-- .../duo_seat_utilization_info_card_spec.js | 6 +-- ee/spec/helpers/projects_helper_spec.rb | 2 +- ee/spec/models/ee/user_spec.rb | 4 +- .../add_on_purchase_spec.rb | 41 +++++++++------- .../gitlab_subscriptions/add_on_spec.rb | 6 +-- ...hosted_spec.rb => self_hosted_dap_spec.rb} | 8 ++-- .../provision_services/duo_spec.rb | 20 ++++---- ...hosted_spec.rb => self_hosted_dap_spec.rb} | 48 +++++++++---------- locale/gitlab.pot | 4 +- 18 files changed, 95 insertions(+), 89 deletions(-) rename ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/{duo_self_hosted.rb => self_hosted_dap.rb} (79%) rename ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/{duo_self_hosted.rb => self_hosted_dap.rb} (82%) rename ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/{duo_self_hosted_spec.rb => self_hosted_dap_spec.rb} (75%) rename ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/{duo_self_hosted_spec.rb => self_hosted_dap_spec.rb} (77%) diff --git a/ee/app/assets/javascripts/ai/settings/components/duo_seat_utilization_info_card.vue b/ee/app/assets/javascripts/ai/settings/components/duo_seat_utilization_info_card.vue index ee67f8706662b5..c38b22caa5a0c8 100644 --- a/ee/app/assets/javascripts/ai/settings/components/duo_seat_utilization_info_card.vue +++ b/ee/app/assets/javascripts/ai/settings/components/duo_seat_utilization_info_card.vue @@ -2,7 +2,7 @@ import { GlCard, GlButton, GlIcon } from '@gitlab/ui'; import { s__, __ } from '~/locale'; import UsageStatistics from 'ee/usage_quotas/components/usage_statistics.vue'; -import { DUO_PRO, DUO_SELF_HOSTED, DUO_IDENTIFIERS, DUO_TITLES } from 'ee/constants/duo'; +import { DUO_PRO, SELF_HOSTED_DAP, DUO_IDENTIFIERS, DUO_TITLES } from 'ee/constants/duo'; import { InternalEvents } from '~/tracking'; import { formatDate } from '~/lib/utils/datetime_utility'; @@ -54,10 +54,10 @@ export default { return DUO_TITLES[this.activeDuoTier]; }, showPurchaseSeatsButton() { - // Hide the button for instances with the Duo Self-Hosted add-on, + // Hide the button for instances with the Self-Hosted Duo Agent Platform add-on, // since self-service purchase of it is currently not supported. See: // https://gitlab.com/gitlab-org/gitlab/-/issues/548390 - return this.activeDuoTier === DUO_PRO && !this.hasDuoSelfHostedAddOn; + return this.activeDuoTier === DUO_PRO && !this.hasSelfHostedDapAddOn; }, duoSeatUtilizationDescription() { return this.sprintf(this.$options.i18n.duoSeatUtilizationDescriptionText, { @@ -76,8 +76,8 @@ export default { this.formatSubscriptionDate(this.duoAddOnEndDate), ); }, - hasDuoSelfHostedAddOn() { - return this.addOnPurchases.some(({ name }) => name === DUO_SELF_HOSTED); + hasSelfHostedDapAddOn() { + return this.addOnPurchases.some(({ name }) => name === SELF_HOSTED_DAP); }, }, methods: { diff --git a/ee/app/assets/javascripts/constants/duo.js b/ee/app/assets/javascripts/constants/duo.js index 74419007ed39e6..0ce6bf5715274d 100644 --- a/ee/app/assets/javascripts/constants/duo.js +++ b/ee/app/assets/javascripts/constants/duo.js @@ -3,15 +3,15 @@ import { s__ } from '~/locale'; export const DUO_CORE = 'DUO_CORE'; export const DUO_PRO = 'CODE_SUGGESTIONS'; export const DUO_ENTERPRISE = 'DUO_ENTERPRISE'; -export const DUO_SELF_HOSTED = 'DUO_SELF_HOSTED'; +export const SELF_HOSTED_DAP = 'SELF_HOSTED_DAP'; export const DUO_AMAZON_Q = 'DUO_AMAZON_Q'; -export const DUO_IDENTIFIERS = [DUO_CORE, DUO_PRO, DUO_ENTERPRISE, DUO_SELF_HOSTED, DUO_AMAZON_Q]; +export const DUO_IDENTIFIERS = [DUO_CORE, DUO_PRO, DUO_ENTERPRISE, SELF_HOSTED_DAP, DUO_AMAZON_Q]; export const DUO_TITLES = { [DUO_CORE]: s__('CodeSuggestions|GitLab Duo Core'), [DUO_PRO]: s__('CodeSuggestions|GitLab Duo Pro'), [DUO_ENTERPRISE]: s__('CodeSuggestions|GitLab Duo Enterprise'), - [DUO_SELF_HOSTED]: s__('CodeSuggestions|GitLab Duo Self-Hosted'), + [SELF_HOSTED_DAP]: s__('CodeSuggestions|GitLab Self-Hosted Duo Agent Platform'), [DUO_AMAZON_Q]: s__('AmazonQ|GitLab Duo with Amazon Q'), }; diff --git a/ee/app/models/gitlab_subscriptions/add_on.rb b/ee/app/models/gitlab_subscriptions/add_on.rb index 2b4d9c991af821..abf044a7310107 100644 --- a/ee/app/models/gitlab_subscriptions/add_on.rb +++ b/ee/app/models/gitlab_subscriptions/add_on.rb @@ -17,10 +17,10 @@ class AddOn < ApplicationRecord duo_enterprise: 3, duo_amazon_q: 4, duo_core: 5, - duo_self_hosted: 6 + self_hosted_dap: 6 } - DUO_ADD_ONS = %i[code_suggestions duo_enterprise duo_amazon_q duo_core duo_self_hosted].freeze + DUO_ADD_ONS = %i[code_suggestions duo_enterprise duo_amazon_q duo_core self_hosted_dap].freeze SEAT_ASSIGNABLE_DUO_ADD_ONS = %w[code_suggestions duo_enterprise].freeze @@ -39,7 +39,7 @@ def self.descriptions duo_enterprise: 'Add-on for GitLab Duo Enterprise.', duo_amazon_q: 'Add-on for GitLab Duo with Amazon Q.', duo_core: 'Add-on for Gitlab Duo Core.', - duo_self_hosted: 'Add-on for GitLab Duo Self-Hosted.' + self_hosted_dap: 'Add-on for GitLab Self-Hosted Duo Agent Platform.' } end diff --git a/ee/app/models/gitlab_subscriptions/add_on_purchase.rb b/ee/app/models/gitlab_subscriptions/add_on_purchase.rb index bb18786de16a9e..d231e8d3f44979 100644 --- a/ee/app/models/gitlab_subscriptions/add_on_purchase.rb +++ b/ee/app/models/gitlab_subscriptions/add_on_purchase.rb @@ -55,7 +55,6 @@ class AddOnPurchase < ApplicationRecord scope :for_product_analytics, -> { where(subscription_add_on_id: AddOn.product_analytics.pick(:id)) } scope :for_duo_enterprise, -> { where(subscription_add_on_id: AddOn.duo_enterprise.pick(:id)) } scope :for_duo_amazon_q, -> { where(subscription_add_on_id: AddOn.duo_amazon_q.pick(:id)) } - scope :for_duo_self_hosted, -> { where(subscription_add_on_id: AddOn.duo_self_hosted.pick(:id)) } scope :for_duo_core, -> { where(subscription_add_on_id: AddOn.duo_core.select(:id)) } # this executes 2 queries to the `AddOn` table, 1 for `code_suggestions` (duo pro), and 1 for `duo_enterprise` scope :for_duo_pro_or_duo_enterprise, -> { for_gitlab_duo_pro.or(for_duo_enterprise) } @@ -108,6 +107,8 @@ class AddOnPurchase < ApplicationRecord .limit(limit) end + # TODO: Consolidate this with for_self_hosted_dap scope below + scope :for_duo_self_hosted, -> { where(subscription_add_on_id: AddOn.self_hosted_dap.pick(:id)) } # Placeholder scope for Self-hosted DAP SKU # Returns all active self-managed add-ons when feature flag is enabled # TODO: Filter by actual Self-hosted DAP add-on when provisioned by Fulfillment diff --git a/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/duo_self_hosted.rb b/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/self_hosted_dap.rb similarity index 79% rename from ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/duo_self_hosted.rb rename to ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/self_hosted_dap.rb index f65fb112d5b201..943d0f1d364060 100644 --- a/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/duo_self_hosted.rb +++ b/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/self_hosted_dap.rb @@ -4,12 +4,12 @@ module GitlabSubscriptions module AddOnPurchases module SelfManaged module LicenseAddOns - class DuoSelfHosted < Base + class SelfHostedDap < Base private override :name def name - :duo_self_hosted + :self_hosted_dap end end end diff --git a/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo.rb b/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo.rb index c3b84e4e2b9556..e29378f6c13164 100644 --- a/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo.rb +++ b/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo.rb @@ -7,7 +7,7 @@ module ProvisionServices class Duo DUO_PROVISION_SERVICES = [ DuoExclusive, - DuoSelfHosted, + SelfHostedDap, DuoCore ].freeze diff --git a/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo_self_hosted.rb b/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/self_hosted_dap.rb similarity index 82% rename from ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo_self_hosted.rb rename to ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/self_hosted_dap.rb index 2ee6db3df62dae..4bd7e6c5cffe3f 100644 --- a/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo_self_hosted.rb +++ b/ee/app/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/self_hosted_dap.rb @@ -4,7 +4,7 @@ module GitlabSubscriptions module AddOnPurchases module SelfManaged module ProvisionServices - class DuoSelfHosted < Base + class SelfHostedDap < Base private def add_on_purchase @@ -13,7 +13,7 @@ def add_on_purchase strong_memoize_attr :add_on_purchase def license_add_on - LicenseAddOns::DuoSelfHosted.new(license_restrictions) + LicenseAddOns::SelfHostedDap.new(license_restrictions) end strong_memoize_attr :license_add_on end diff --git a/ee/spec/factories/gitlab_subscriptions/add_on_purchases.rb b/ee/spec/factories/gitlab_subscriptions/add_on_purchases.rb index 1c11b0e18f2af6..f3482859b7ef9a 100644 --- a/ee/spec/factories/gitlab_subscriptions/add_on_purchases.rb +++ b/ee/spec/factories/gitlab_subscriptions/add_on_purchases.rb @@ -61,8 +61,8 @@ add_on { association(:gitlab_subscription_add_on, :duo_amazon_q) } end - trait :duo_self_hosted do - add_on { association(:gitlab_subscription_add_on, :duo_self_hosted) } + trait :self_hosted_dap do + add_on { association(:gitlab_subscription_add_on, :self_hosted_dap) } end trait :self_managed do diff --git a/ee/spec/factories/gitlab_subscriptions/add_ons.rb b/ee/spec/factories/gitlab_subscriptions/add_ons.rb index 1db78cd3c854b9..7810a4f8c05cac 100644 --- a/ee/spec/factories/gitlab_subscriptions/add_ons.rb +++ b/ee/spec/factories/gitlab_subscriptions/add_ons.rb @@ -30,9 +30,9 @@ description { GitlabSubscriptions::AddOn.descriptions[:duo_amazon_q] } end - trait :duo_self_hosted do - name { GitlabSubscriptions::AddOn.names[:duo_self_hosted] } - description { GitlabSubscriptions::AddOn.descriptions[:duo_self_hosted] } + trait :self_hosted_dap do + name { GitlabSubscriptions::AddOn.names[:self_hosted_dap] } + description { GitlabSubscriptions::AddOn.descriptions[:self_hosted_dap] } end end end diff --git a/ee/spec/frontend/ai/settings/components/duo_seat_utilization_info_card_spec.js b/ee/spec/frontend/ai/settings/components/duo_seat_utilization_info_card_spec.js index 5f1fff06ee2495..d7b059e3d43f9b 100644 --- a/ee/spec/frontend/ai/settings/components/duo_seat_utilization_info_card_spec.js +++ b/ee/spec/frontend/ai/settings/components/duo_seat_utilization_info_card_spec.js @@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils'; import { GlCard, GlIcon, GlButton } from '@gitlab/ui'; import UsageStatistics from 'ee/usage_quotas/components/usage_statistics.vue'; import DuoSeatUtilizationInfoCard from 'ee/ai/settings/components/duo_seat_utilization_info_card.vue'; -import { DUO_PRO, DUO_ENTERPRISE, DUO_SELF_HOSTED, DUO_AMAZON_Q } from 'ee/constants/duo'; +import { DUO_PRO, DUO_ENTERPRISE, SELF_HOSTED_DAP, DUO_AMAZON_Q } from 'ee/constants/duo'; import { useMockInternalEventsTracking } from 'helpers/tracking_internal_events_helper'; jest.mock('~/lib/utils/url_utility'); @@ -123,9 +123,9 @@ describe('DuoSeatUtilizationInfoCard', () => { }); }); - describe('Duo Pro add-on with Duo Self-Hosted add-on', () => { + describe('Duo Pro add-on with Self-Hosted Duo Agent Platform add-on', () => { beforeEach(() => { - wrapper = createComponent({ addOnPurchases: [{ name: DUO_SELF_HOSTED }] }); + wrapper = createComponent({ addOnPurchases: [{ name: SELF_HOSTED_DAP }] }); }); it('renders only assign seats button', () => { diff --git a/ee/spec/helpers/projects_helper_spec.rb b/ee/spec/helpers/projects_helper_spec.rb index 57f2ec20ea4c42..01b2219382855d 100644 --- a/ee/spec/helpers/projects_helper_spec.rb +++ b/ee/spec/helpers/projects_helper_spec.rb @@ -1092,7 +1092,7 @@ before do create(:gitlab_subscription_add_on_purchase, :duo_pro, :active, namespace: group) create(:gitlab_subscription_add_on_purchase, :duo_enterprise, :active, namespace: group) - create(:gitlab_subscription_add_on_purchase, :duo_self_hosted, :active, namespace: group) + create(:gitlab_subscription_add_on_purchase, :self_hosted_dap, :active, namespace: group) end it 'returns true' do diff --git a/ee/spec/models/ee/user_spec.rb b/ee/spec/models/ee/user_spec.rb index 72d18d3c2711b1..7d36177c84fd24 100644 --- a/ee/spec/models/ee/user_spec.rb +++ b/ee/spec/models/ee/user_spec.rb @@ -2337,8 +2337,8 @@ context 'on self-managed' do it { is_expected.to eq(false) } - context 'when user is assigned to a duo self-hosted seat on instance' do - let(:subscription_purchase) { create(:gitlab_subscription_add_on_purchase, :duo_self_hosted, :self_managed) } + context 'when user is assigned to a self-hosted duo agent platform seat on instance' do + let(:subscription_purchase) { create(:gitlab_subscription_add_on_purchase, :self_hosted_dap, :self_managed) } it { is_expected.to eq(true) } end diff --git a/ee/spec/models/gitlab_subscriptions/add_on_purchase_spec.rb b/ee/spec/models/gitlab_subscriptions/add_on_purchase_spec.rb index 065839375ea14c..7549598829dd5c 100644 --- a/ee/spec/models/gitlab_subscriptions/add_on_purchase_spec.rb +++ b/ee/spec/models/gitlab_subscriptions/add_on_purchase_spec.rb @@ -407,22 +407,27 @@ end describe '.for_duo_self_hosted' do - subject(:duo_self_hosted_add_on_purchases) { described_class.for_duo_self_hosted } + subject(:self_hosted_dap_add_on_purchases) { described_class.for_duo_self_hosted } - it { expect(duo_self_hosted_add_on_purchases).to be_empty } + it { expect(self_hosted_dap_add_on_purchases).to be_empty } - context 'with duo_self_hosted purchase' do - let!(:duo_self_hosted_add_on_purchase) { create(:gitlab_subscription_add_on_purchase, :duo_self_hosted) } + context 'with self_hosted_dap purchase' do + let!(:self_hosted_dap_add_on_purchase) do + create(:gitlab_subscription_add_on_purchase, :self_hosted_dap) + end - it { expect(duo_self_hosted_add_on_purchases).to eq [duo_self_hosted_add_on_purchase] } + it { expect(self_hosted_dap_add_on_purchases).to eq [self_hosted_dap_add_on_purchase] } end context 'with other purchases' do - let!(:duo_self_hosted_add_on_purchase) { create(:gitlab_subscription_add_on_purchase, :duo_self_hosted) } + let!(:self_hosted_dap_add_on_purchase) do + create(:gitlab_subscription_add_on_purchase, :self_hosted_dap) + end + let!(:duo_pro_add_on_purchase) { create(:gitlab_subscription_add_on_purchase, :duo_pro) } - it 'returns only duo_self_hosted add-on purchases' do - expect(duo_self_hosted_add_on_purchases).to eq [duo_self_hosted_add_on_purchase] + it 'returns only self_hosted_dap add-on purchases' do + expect(self_hosted_dap_add_on_purchases).to eq [self_hosted_dap_add_on_purchase] end end end @@ -464,7 +469,7 @@ let!(:duo_enterprise_add_on_purchase) { create(:gitlab_subscription_add_on_purchase, :duo_enterprise) } let!(:duo_pro_add_on_purchase) { create(:gitlab_subscription_add_on_purchase, :duo_pro) } let!(:duo_core_add_on_purchase) { create(:gitlab_subscription_add_on_purchase, :duo_core) } - let!(:duo_self_hosted_add_on_purchase) { create(:gitlab_subscription_add_on_purchase, :duo_self_hosted) } + let!(:self_hosted_dap_add_on_purchase) { create(:gitlab_subscription_add_on_purchase, :self_hosted_dap) } let!(:product_analytics_add_on_purchase) { create(:gitlab_subscription_add_on_purchase, :product_analytics) } it 'returns Duo Core, Pro and Enterprise' do @@ -481,7 +486,7 @@ let!(:duo_pro_add_on) { create(:gitlab_subscription_add_on_purchase, :duo_pro) } let!(:duo_core_add_on) { create(:gitlab_subscription_add_on_purchase, :duo_core) } let!(:duo_amazon_q_add_on) { create(:gitlab_subscription_add_on_purchase, :duo_amazon_q) } - let!(:duo_self_hosted_add_on) { create(:gitlab_subscription_add_on_purchase, :duo_self_hosted) } + let!(:self_hosted_dap_add_on) { create(:gitlab_subscription_add_on_purchase, :self_hosted_dap) } let!(:product_analytics_add_on) { create(:gitlab_subscription_add_on_purchase, :product_analytics) } it 'returns all duo add-ons' do @@ -490,7 +495,7 @@ duo_pro_add_on, duo_core_add_on, duo_amazon_q_add_on, - duo_self_hosted_add_on + self_hosted_dap_add_on ) end end @@ -635,7 +640,7 @@ let_it_be(:duo_pro_add_on) { create(:gitlab_subscription_add_on, :duo_pro) } let_it_be(:duo_enterprise_add_on) { create(:gitlab_subscription_add_on, :duo_enterprise) } let_it_be(:duo_amazon_q_add_on) { create(:gitlab_subscription_add_on, :duo_amazon_q) } - let_it_be(:duo_self_hosted_add_on) { create(:gitlab_subscription_add_on, :duo_self_hosted) } + let_it_be(:self_hosted_dap_add_on) { create(:gitlab_subscription_add_on, :self_hosted_dap) } let_it_be(:product_analytics_add_on) { create(:gitlab_subscription_add_on, :product_analytics) } let_it_be(:duo_pro_add_on_purchase_fresh) do @@ -662,10 +667,10 @@ ) end - let_it_be(:duo_self_hosted_purchase_fresh) do + let_it_be(:self_hosted_dap_purchase_fresh) do create( :gitlab_subscription_add_on_purchase, - add_on: duo_self_hosted_add_on, + add_on: self_hosted_dap_add_on, last_assigned_users_refreshed_at: 1.hour.ago ) end @@ -682,8 +687,8 @@ create(:gitlab_subscription_add_on_purchase, add_on: duo_amazon_q_add_on) end - let_it_be(:duo_self_hosted_add_on_purchase_refreshed_nil) do - create(:gitlab_subscription_add_on_purchase, add_on: duo_self_hosted_add_on) + let_it_be(:self_hosted_dap_add_on_purchase_refreshed_nil) do + create(:gitlab_subscription_add_on_purchase, add_on: self_hosted_dap_add_on) end let_it_be(:product_analytics_add_on_purchase_refreshed_nil) do @@ -722,10 +727,10 @@ ) end - let_it_be(:duo_self_hosted_add_on_purchase_stale) do + let_it_be(:self_hosted_dap_add_on_purchase_stale) do create( :gitlab_subscription_add_on_purchase, - add_on: duo_self_hosted_add_on, + add_on: self_hosted_dap_add_on, last_assigned_users_refreshed_at: 21.hours.ago ) end diff --git a/ee/spec/models/gitlab_subscriptions/add_on_spec.rb b/ee/spec/models/gitlab_subscriptions/add_on_spec.rb index d3d21adf9d9a38..6f65a54275b790 100644 --- a/ee/spec/models/gitlab_subscriptions/add_on_spec.rb +++ b/ee/spec/models/gitlab_subscriptions/add_on_spec.rb @@ -22,7 +22,7 @@ let_it_be(:duo_pro_add_on) { create(:gitlab_subscription_add_on, :duo_pro) } let_it_be(:duo_enterprise_add_on) { create(:gitlab_subscription_add_on, :duo_enterprise) } let_it_be(:duo_amazon_q_add_on) { create(:gitlab_subscription_add_on, :duo_amazon_q) } - let_it_be(:duo_self_hosted_add_on) { create(:gitlab_subscription_add_on, :duo_self_hosted) } + let_it_be(:self_hosted_dap_add_on) { create(:gitlab_subscription_add_on, :self_hosted_dap) } let_it_be(:product_analytics_add_on) { create(:gitlab_subscription_add_on, :product_analytics) } describe '.duo_add_ons' do @@ -35,7 +35,7 @@ duo_pro_add_on, duo_enterprise_add_on, duo_amazon_q_add_on, - duo_self_hosted_add_on + self_hosted_dap_add_on ) end end @@ -200,7 +200,7 @@ 'duo_enterprise' | true 'duo_amazon_q' | false 'duo_core' | false - 'duo_self_hosted' | false + 'self_hosted_dap' | false end with_them do diff --git a/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/duo_self_hosted_spec.rb b/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/self_hosted_dap_spec.rb similarity index 75% rename from ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/duo_self_hosted_spec.rb rename to ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/self_hosted_dap_spec.rb index a86e27559e03b3..80c79887fbd74b 100644 --- a/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/duo_self_hosted_spec.rb +++ b/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/license_add_ons/self_hosted_dap_spec.rb @@ -2,17 +2,17 @@ require 'spec_helper' -RSpec.describe GitlabSubscriptions::AddOnPurchases::SelfManaged::LicenseAddOns::DuoSelfHosted, +RSpec.describe GitlabSubscriptions::AddOnPurchases::SelfManaged::LicenseAddOns::SelfHostedDap, :aggregate_failures, feature_category: :"add-on_provisioning" do subject(:add_on_license) { described_class.new(restrictions) } - let_it_be(:add_on) { create(:gitlab_subscription_add_on, :duo_self_hosted) } + let_it_be(:add_on) { create(:gitlab_subscription_add_on, :self_hosted_dap) } let(:restrictions) do start_date = Date.current { add_on_products: { - "duo_self_hosted" => [ + "self_hosted_dap" => [ { "quantity" => 1, "started_on" => start_date.to_s, @@ -25,7 +25,7 @@ } end - include_examples "license add-on attributes", add_on_name: "duo_self_hosted" + include_examples "license add-on attributes", add_on_name: "self_hosted_dap" describe "#add_on" do it { expect(add_on_license.add_on).to eq add_on } diff --git a/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo_spec.rb b/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo_spec.rb index f2b59cbbe0b7ea..3883f04b5b5e46 100644 --- a/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo_spec.rb +++ b/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo_spec.rb @@ -8,8 +8,8 @@ GitlabSubscriptions::AddOnPurchases::SelfManaged::ProvisionServices::DuoExclusive end - let(:duo_self_hosted_class) do - GitlabSubscriptions::AddOnPurchases::SelfManaged::ProvisionServices::DuoSelfHosted + let(:self_hosted_dap_class) do + GitlabSubscriptions::AddOnPurchases::SelfManaged::ProvisionServices::SelfHostedDap end let(:duo_core_class) do @@ -19,7 +19,7 @@ describe '::DUO_PROVISION_SERVICES' do subject { described_class::DUO_PROVISION_SERVICES } - it { is_expected.to match_array([duo_exclusive_class, duo_self_hosted_class, duo_core_class]) } + it { is_expected.to match_array([duo_exclusive_class, self_hosted_dap_class, duo_core_class]) } end describe '#execute' do @@ -28,7 +28,7 @@ let(:duo_service_classes) do [ duo_exclusive_class, - duo_self_hosted_class, + self_hosted_dap_class, duo_core_class ] end @@ -90,24 +90,24 @@ end let(:duo_exclusive_instance) { instance_double(duo_exclusive_class) } - let(:duo_self_hosted_instance) { instance_double(duo_self_hosted_class) } + let(:self_hosted_dap_instance) { instance_double(self_hosted_dap_class) } let(:duo_core_instance) { instance_double(duo_core_class) } before do allow(duo_exclusive_class).to receive(:new).and_return(duo_exclusive_instance) - allow(duo_self_hosted_class).to receive(:new).and_return(duo_self_hosted_instance) + allow(self_hosted_dap_class).to receive(:new).and_return(self_hosted_dap_instance) allow(duo_core_class).to receive(:new).and_return(duo_core_instance) end context 'when some service responses do not contain an add-on purchase' do - let_it_be(:duo_self_hosted_add_on) { nil } + let_it_be(:self_hosted_dap_add_on) { nil } before do allow(duo_exclusive_instance).to receive(:execute) .and_return(successful_service_response(duo_pro_add_on)) - allow(duo_self_hosted_instance).to receive(:execute) - .and_return(successful_service_response(duo_self_hosted_add_on)) + allow(self_hosted_dap_instance).to receive(:execute) + .and_return(successful_service_response(self_hosted_dap_add_on)) allow(duo_core_instance).to receive(:execute) .and_return(successful_service_response(duo_core_add_on)) @@ -128,7 +128,7 @@ allow(duo_exclusive_instance).to receive(:execute) .and_return(successful_service_response(duo_pro_add_on)) - allow(duo_self_hosted_instance).to receive(:execute) + allow(self_hosted_dap_instance).to receive(:execute) .and_return(ServiceResponse.error(message: 'an error message')) allow(duo_core_instance).to receive(:execute) diff --git a/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo_self_hosted_spec.rb b/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/self_hosted_dap_spec.rb similarity index 77% rename from ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo_self_hosted_spec.rb rename to ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/self_hosted_dap_spec.rb index bc600d7defee18..3ef50d05e200b4 100644 --- a/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/duo_self_hosted_spec.rb +++ b/ee/spec/services/gitlab_subscriptions/add_on_purchases/self_managed/provision_services/self_hosted_dap_spec.rb @@ -2,12 +2,12 @@ require 'spec_helper' -RSpec.describe GitlabSubscriptions::AddOnPurchases::SelfManaged::ProvisionServices::DuoSelfHosted, +RSpec.describe GitlabSubscriptions::AddOnPurchases::SelfManaged::ProvisionServices::SelfHostedDap, :freeze_time, feature_category: :'add-on_provisioning' do describe '#execute' do include_context 'with provision services common setup' - let_it_be(:add_on_duo_self_hosted) { create(:gitlab_subscription_add_on, :duo_self_hosted) } + let_it_be(:add_on_self_hosted_dap) { create(:gitlab_subscription_add_on, :self_hosted_dap) } let_it_be(:add_on_duo_core) { create(:gitlab_subscription_add_on, :duo_core) } let_it_be(:add_on_duo_pro) { create(:gitlab_subscription_add_on, :duo_pro) } @@ -17,24 +17,24 @@ it_behaves_like 'delegates add_on params to license_add_on' end - context 'without Duo Self-Hosted' do + context 'without Self-Hosted DAP' do let(:add_ons) { [] } - it 'does not create a Duo Self-Hosted add-on purchase' do + it 'does not create a Self-Hosted DAP add-on purchase' do expect { provision_service.execute }.not_to change { GitlabSubscriptions::AddOnPurchase.count } end end - context 'with Duo Self-Hosted' do - let(:add_ons) { %i[duo_self_hosted] } + context 'with Self-Hosted DAP' do + let(:add_ons) { %i[self_hosted_dap] } - it 'creates a new Duo Self-Hosted add-on purchase' do + it 'creates a new Self-Hosted DAP add-on purchase' do expect do provision_service.execute end.to change { GitlabSubscriptions::AddOnPurchase.count }.from(0).to(1) expect(GitlabSubscriptions::AddOnPurchase.first).to have_attributes( - subscription_add_on_id: add_on_duo_self_hosted.id, + subscription_add_on_id: add_on_self_hosted_dap.id, quantity: quantity, started_at: started_at, expires_on: started_at + 1.year, @@ -44,16 +44,16 @@ end end - context 'with existing Duo Self-Hosted' do - let(:add_ons) { %i[duo_self_hosted] } + context 'with existing Self-Hosted DAP' do + let(:add_ons) { %i[self_hosted_dap] } context 'with seat count increase' do let(:quantity) { 2 } - let!(:existing_duo_self_hosted) do + let!(:existing_self_hosted_dap) do create( :gitlab_subscription_add_on_purchase, - add_on: add_on_duo_self_hosted, + add_on: add_on_self_hosted_dap, quantity: 1, namespace: namespace ) @@ -63,7 +63,7 @@ expect { provision_service.execute }.not_to change { GitlabSubscriptions::AddOnPurchase.count } expect(GitlabSubscriptions::AddOnPurchase.first).to have_attributes( - subscription_add_on_id: add_on_duo_self_hosted.id, + subscription_add_on_id: add_on_self_hosted_dap.id, quantity: quantity, started_at: started_at, expires_on: started_at + 1.year, @@ -74,10 +74,10 @@ end context 'when expired' do - let!(:existing_duo_self_hosted) do + let!(:existing_self_hosted_dap) do create( :gitlab_subscription_add_on_purchase, - add_on: add_on_duo_self_hosted, + add_on: add_on_self_hosted_dap, quantity: quantity, started_at: 2.years.ago, expires_on: 1.year.ago, @@ -90,28 +90,28 @@ provision_service.execute end.not_to change { GitlabSubscriptions::AddOnPurchase.count } - expect(existing_duo_self_hosted.reload.started_at).to eq(started_at) - expect(existing_duo_self_hosted.expires_on).to eq(started_at + 1.year) + expect(existing_self_hosted_dap.reload.started_at).to eq(started_at) + expect(existing_self_hosted_dap.expires_on).to eq(started_at + 1.year) end end context 'with an additional add-on purchase' do - let(:add_ons) { %i[duo_self_hosted duo_amazon_q] } + let(:add_ons) { %i[self_hosted_dap duo_amazon_q] } - let!(:existing_duo_self_hosted) do + let!(:existing_self_hosted_dap) do create( :gitlab_subscription_add_on_purchase, - add_on: add_on_duo_self_hosted, + add_on: add_on_self_hosted_dap, quantity: quantity, namespace: nil ) end - it 'does not affect the Duo Self-Hosted purchase' do + it 'does not affect the Self-Hosted DAP purchase' do expect { provision_service.execute }.not_to change { GitlabSubscriptions::AddOnPurchase.count } expect(GitlabSubscriptions::AddOnPurchase.first).to have_attributes( - subscription_add_on_id: add_on_duo_self_hosted.id, + subscription_add_on_id: add_on_self_hosted_dap.id, quantity: quantity, started_at: started_at, expires_on: started_at + 1.year, @@ -151,8 +151,8 @@ ) end - context 'with additional purchase of Duo Self-Hosted' do - let(:add_ons) { %i[duo_core duo_pro duo_self_hosted] } + context 'with additional purchase of Self-Hosted DAP' do + let(:add_ons) { %i[duo_core duo_pro self_hosted_dap] } it 'does not affect the existing add-on purchases' do expect do diff --git a/locale/gitlab.pot b/locale/gitlab.pot index bb90f781b70423..869e4ef0c97180 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -16186,10 +16186,10 @@ msgstr "" msgid "CodeSuggestions|GitLab Duo Pro" msgstr "" -msgid "CodeSuggestions|GitLab Duo Self-Hosted" +msgid "CodeSuggestions|GitLab Duo should be operational." msgstr "" -msgid "CodeSuggestions|GitLab Duo should be operational." +msgid "CodeSuggestions|GitLab Self-Hosted Duo Agent Platform" msgstr "" msgid "CodeSuggestions|Helps you get up to speed quickly by explaining source code" -- GitLab