Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-15961] Remove FF: PM-14401-scale-msp-on-client-organization-update #5163

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Bit.Admin.Enums;
using Bit.Admin.Services;
using Bit.Admin.Utilities;
using Bit.Core;
using Bit.Core.AdminConsole.Entities;
using Bit.Core.AdminConsole.Enums.Provider;
using Bit.Core.AdminConsole.Providers.Interfaces;
Expand Down Expand Up @@ -476,14 +475,6 @@ private async Task HandlePotentialProviderSeatScalingAsync(
Organization organization,
OrganizationEditModel update)
{
var scaleMSPOnClientOrganizationUpdate =
_featureService.IsEnabled(FeatureFlagKeys.PM14401_ScaleMSPOnClientOrganizationUpdate);

if (!scaleMSPOnClientOrganizationUpdate)
{
return;
}

var provider = await _providerRepository.GetByOrganizationIdAsync(organization.Id);

// No scaling required
Expand Down
1 change: 0 additions & 1 deletion src/Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ public static class FeatureFlagKeys
public const string NewDeviceVerificationTemporaryDismiss = "new-device-temporary-dismiss";
public const string NewDeviceVerificationPermanentDismiss = "new-device-permanent-dismiss";
public const string SecurityTasks = "security-tasks";
public const string PM14401_ScaleMSPOnClientOrganizationUpdate = "PM-14401-scale-msp-on-client-organization-update";
public const string PM11360RemoveProviderExportPermission = "pm-11360-remove-provider-export-permission";
public const string DisableFreeFamiliesSponsorship = "PM-12274-disable-free-families-sponsorship";
public const string MacOsNativeCredentialSync = "macos-native-credential-sync";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
๏ปฟusing Bit.Admin.AdminConsole.Controllers;
using Bit.Admin.AdminConsole.Models;
using Bit.Core;
using Bit.Core.AdminConsole.Entities;
using Bit.Core.AdminConsole.Entities.Provider;
using Bit.Core.AdminConsole.Enums.Provider;
Expand All @@ -9,7 +8,6 @@
using Bit.Core.Billing.Services;
using Bit.Core.Enums;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Test.Common.AutoFixture;
using Bit.Test.Common.AutoFixture.Attributes;
using NSubstitute;
Expand All @@ -22,32 +20,6 @@ public class OrganizationsControllerTests
{
#region Edit (POST)

[BitAutoData]
[SutProviderCustomize]
[Theory]
public async Task Edit_ProviderSeatScaling_RequiredFFDisabled_NoOp(
SutProvider<OrganizationsController> sutProvider)
{
// Arrange
var organizationId = new Guid();
var update = new OrganizationEditModel { UseSecretsManager = false };

var organization = new Organization
{
Id = organizationId
};

sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organizationId)
.Returns(organization);

// Act
_ = await sutProvider.Sut.Edit(organizationId, update);

// Assert
await sutProvider.GetDependency<IProviderBillingService>().DidNotReceiveWithAnyArgs()
.ScaleSeats(Arg.Any<Provider>(), Arg.Any<PlanType>(), Arg.Any<int>());
}

[BitAutoData]
[SutProviderCustomize]
[Theory]
Expand All @@ -66,10 +38,6 @@ public async Task Edit_ProviderSeatScaling_NonBillableProvider_NoOp(
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organizationId)
.Returns(organization);

var featureService = sutProvider.GetDependency<IFeatureService>();

featureService.IsEnabled(FeatureFlagKeys.PM14401_ScaleMSPOnClientOrganizationUpdate).Returns(true);

var provider = new Provider { Type = ProviderType.Msp, Status = ProviderStatusType.Created };

sutProvider.GetDependency<IProviderRepository>().GetByOrganizationIdAsync(organizationId).Returns(provider);
Expand Down Expand Up @@ -101,10 +69,6 @@ public async Task Edit_ProviderSeatScaling_UnmanagedOrganization_NoOp(
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organizationId)
.Returns(organization);

var featureService = sutProvider.GetDependency<IFeatureService>();

featureService.IsEnabled(FeatureFlagKeys.PM14401_ScaleMSPOnClientOrganizationUpdate).Returns(true);

var provider = new Provider { Type = ProviderType.Msp, Status = ProviderStatusType.Billable };

sutProvider.GetDependency<IProviderRepository>().GetByOrganizationIdAsync(organizationId).Returns(provider);
Expand Down Expand Up @@ -143,10 +107,6 @@ public async Task Edit_ProviderSeatScaling_NonCBPlanType_NoOp(
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organizationId)
.Returns(organization);

var featureService = sutProvider.GetDependency<IFeatureService>();

featureService.IsEnabled(FeatureFlagKeys.PM14401_ScaleMSPOnClientOrganizationUpdate).Returns(true);

var provider = new Provider { Type = ProviderType.Msp, Status = ProviderStatusType.Billable };

sutProvider.GetDependency<IProviderRepository>().GetByOrganizationIdAsync(organizationId).Returns(provider);
Expand Down Expand Up @@ -185,10 +145,6 @@ public async Task Edit_ProviderSeatScaling_NoUpdateRequired_NoOp(
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organizationId)
.Returns(organization);

var featureService = sutProvider.GetDependency<IFeatureService>();

featureService.IsEnabled(FeatureFlagKeys.PM14401_ScaleMSPOnClientOrganizationUpdate).Returns(true);

var provider = new Provider { Type = ProviderType.Msp, Status = ProviderStatusType.Billable };

sutProvider.GetDependency<IProviderRepository>().GetByOrganizationIdAsync(organizationId).Returns(provider);
Expand Down Expand Up @@ -227,10 +183,6 @@ public async Task Edit_ProviderSeatScaling_PlanTypesUpdate_ScalesSeatsCorrectly(
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organizationId)
.Returns(organization);

var featureService = sutProvider.GetDependency<IFeatureService>();

featureService.IsEnabled(FeatureFlagKeys.PM14401_ScaleMSPOnClientOrganizationUpdate).Returns(true);

var provider = new Provider { Type = ProviderType.Msp, Status = ProviderStatusType.Billable };

sutProvider.GetDependency<IProviderRepository>().GetByOrganizationIdAsync(organizationId).Returns(provider);
Expand Down Expand Up @@ -271,10 +223,6 @@ public async Task Edit_ProviderSeatScaling_SeatsUpdate_ScalesSeatsCorrectly(
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organizationId)
.Returns(organization);

var featureService = sutProvider.GetDependency<IFeatureService>();

featureService.IsEnabled(FeatureFlagKeys.PM14401_ScaleMSPOnClientOrganizationUpdate).Returns(true);

var provider = new Provider { Type = ProviderType.Msp, Status = ProviderStatusType.Billable };

sutProvider.GetDependency<IProviderRepository>().GetByOrganizationIdAsync(organizationId).Returns(provider);
Expand Down Expand Up @@ -314,10 +262,6 @@ public async Task Edit_ProviderSeatScaling_FullUpdate_ScalesSeatsCorrectly(
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organizationId)
.Returns(organization);

var featureService = sutProvider.GetDependency<IFeatureService>();

featureService.IsEnabled(FeatureFlagKeys.PM14401_ScaleMSPOnClientOrganizationUpdate).Returns(true);

var provider = new Provider { Type = ProviderType.Msp, Status = ProviderStatusType.Billable };

sutProvider.GetDependency<IProviderRepository>().GetByOrganizationIdAsync(organizationId).Returns(provider);
Expand Down
Loading