Skip to content

Commit

Permalink
Remove FF (#5163)
Browse files Browse the repository at this point in the history
  • Loading branch information
amorask-bitwarden authored Jan 8, 2025
1 parent b096568 commit 481a766
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 66 deletions.
9 changes: 0 additions & 9 deletions src/Admin/AdminConsole/Controllers/OrganizationsController.cs
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 @@ -150,7 +150,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

0 comments on commit 481a766

Please sign in to comment.