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

DDLS-344 Remove Multi Client feature flag #1715

Merged
merged 15 commits into from
Nov 7, 2024
Merged
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
33 changes: 6 additions & 27 deletions .github/workflows/workflow-pull-request-path.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,35 +236,19 @@ jobs:
timeout: "900"
secrets: inherit

integration_tests_sequential_multi_flag:
name: integration tests sequential multi flag
uses: ./.github/workflows/_run-task.yml
needs:
- workflow_variables
- reset_database
- scale_services_up
with:
workspace: ${{ needs.workflow_variables.outputs.build_identifier }}
account_name: development
task_name: "integration_test_v2"
timeout: "1200"
override: "sh,./tests/Behat/run-tests.sh,--tags,@multi-feature-flag-enabled,--profile,v2-tests-browserkit"
secrets: inherit

integration_tests_1:
name: integration tests frontend 1
uses: ./.github/workflows/_run-task.yml
needs:
- workflow_variables
- reset_database
- scale_services_up
- integration_tests_sequential_multi_flag
with:
workspace: ${{ needs.workflow_variables.outputs.build_identifier }}
account_name: development
task_name: "integration_test_v2"
timeout: "1200"
override: "sh,./tests/Behat/run-tests-parallel.sh,--tags,@v2_reporting_1&&~multi-feature-flag-enabled,--profile,v2-tests-browserkit"
override: "sh,./tests/Behat/run-tests-parallel.sh,--tags,@v2_reporting_1,--profile,v2-tests-browserkit"
secrets: inherit

integration_tests_2:
Expand All @@ -274,13 +258,12 @@ jobs:
- workflow_variables
- reset_database
- scale_services_up
- integration_tests_sequential_multi_flag
with:
workspace: ${{ needs.workflow_variables.outputs.build_identifier }}
account_name: development
task_name: "integration_test_v2"
timeout: "1200"
override: "sh,./tests/Behat/run-tests-parallel.sh,--tags,@v2_reporting_2&&~multi-feature-flag-enabled,--profile,v2-tests-browserkit"
override: "sh,./tests/Behat/run-tests-parallel.sh,--tags,@v2_reporting_2,--profile,v2-tests-browserkit"
secrets: inherit

integration_tests_admin:
Expand All @@ -290,13 +273,12 @@ jobs:
- workflow_variables
- reset_database
- scale_services_up
- integration_tests_sequential_multi_flag
with:
workspace: ${{ needs.workflow_variables.outputs.build_identifier }}
account_name: development
task_name: "integration_test_v2"
timeout: "1200"
override: "sh,./tests/Behat/run-tests-parallel.sh,--tags,@v2_admin&&~multi-feature-flag-enabled,--profile,v2-tests-browserkit"
override: "sh,./tests/Behat/run-tests-parallel.sh,--tags,@v2_admin,--profile,v2-tests-browserkit"
secrets: inherit

integration_tests_sequential_1:
Expand All @@ -306,13 +288,12 @@ jobs:
- workflow_variables
- reset_database
- scale_services_up
- integration_tests_sequential_multi_flag
with:
workspace: ${{ needs.workflow_variables.outputs.build_identifier }}
account_name: development
task_name: "integration_test_v2"
timeout: "1200"
override: "sh,./tests/Behat/run-tests.sh,--tags,@v2_sequential_1&&~multi-feature-flag-enabled,--profile,v2-tests-browserkit"
override: "sh,./tests/Behat/run-tests.sh,--tags,@v2_sequential_1,--profile,v2-tests-browserkit"
secrets: inherit

integration_tests_sequential_2:
Expand All @@ -322,13 +303,12 @@ jobs:
- workflow_variables
- reset_database
- scale_services_up
- integration_tests_sequential_multi_flag
with:
workspace: ${{ needs.workflow_variables.outputs.build_identifier }}
account_name: development
task_name: "integration_test_v2"
timeout: "1200"
override: "sh,./tests/Behat/run-tests.sh,--tags,@v2_sequential_2&&~multi-feature-flag-enabled,--profile,v2-tests-browserkit"
override: "sh,./tests/Behat/run-tests.sh,--tags,@v2_sequential_2,--profile,v2-tests-browserkit"
secrets: inherit

integration_tests_sequential_3:
Expand All @@ -338,13 +318,12 @@ jobs:
- workflow_variables
- reset_database
- scale_services_up
- integration_tests_sequential_multi_flag
with:
workspace: ${{ needs.workflow_variables.outputs.build_identifier }}
account_name: development
task_name: "integration_test_v2"
timeout: "1200"
override: "sh,./tests/Behat/run-tests.sh,--tags,@v2_sequential_3&&~multi-feature-flag-enabled,--profile,v2-tests-browserkit"
override: "sh,./tests/Behat/run-tests.sh,--tags,@v2_sequential_3,--profile,v2-tests-browserkit"
secrets: inherit

scale_services_down:
Expand Down
2 changes: 0 additions & 2 deletions api/app/src/Service/ParameterStoreService.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class ParameterStoreService
{
public const FLAG_DOCUMENT_SYNC = 'document-sync';

public const FLAG_MULTI_ACCOUNTS = 'multi-accounts';

/** @var SsmClient */
private $ssmClient;

Expand Down
16 changes: 0 additions & 16 deletions api/app/tests/Behat/bootstrap/v2/Common/BaseFeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,22 +613,6 @@ public function expireDocumentFromUnSubmittedDeputyReport(string $storageReferen
$this->fixtureHelper->deleteFilesFromS3($storageReference);
}

/**
* @BeforeScenario @multi-feature-flag-enabled
*/
public function theMultiAccountFeatureFlagIsSetToTrue(): void
{
$this->parameterStoreService->putFeatureFlag(ParameterStoreService::FLAG_MULTI_ACCOUNTS, '1');
}

/**
* @AfterScenario @multi-feature-flag-enabled
*/
public function theMultiAccountFeatureFlagIsSetToFalse(): void
{
$this->parameterStoreService->putFeatureFlag(ParameterStoreService::FLAG_MULTI_ACCOUNTS, '0');
}

/**
* @BeforeScenario @lay-pfa-high-not-started-multi-client-deputy
*/
Expand Down
20 changes: 10 additions & 10 deletions api/app/tests/Behat/features-v2/acl/login/login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ Feature: Users logging into the service
Then the form should be valid


@multi-feature-flag-enabled @lay-pfa-high-not-started-multi-client-deputy
@lay-pfa-high-not-started-multi-client-deputy
Scenario: A user tries to login to the service with their non primary account
Given a Lay Deputy tries to login with their "non-primary" email address
Then they get redirected back to the log in page
And a flash message should be displayed to the user with their primary email address
When the user tries to access their clients report overview page
Then they get redirected back to the log in page

@multi-feature-flag-enabled @lay-pfa-high-not-started-multi-client-deputy
@lay-pfa-high-not-started-multi-client-deputy
Scenario: A user tries to login to the service with their primary account
And a Lay Deputy tries to login with their "primary" email address
Then they should be on the Choose a Client homepage
Expand All @@ -57,7 +57,7 @@ Feature: Users logging into the service
Then they should be on the "non-primary" Client's dashboard
And when they log out they shouldn't see a flash message for non primary accounts

@multi-feature-flag-enabled @lay-pfa-high-not-started-multi-client-deputy-with-ndr
@lay-pfa-high-not-started-multi-client-deputy-with-ndr
Scenario: A user tries to login to the service with their primary account and has an NDR
And a Lay Deputy tries to login with their "primary" email address
Then they should be on the Choose a Client homepage
Expand All @@ -68,14 +68,14 @@ Feature: Users logging into the service
Then they should be on the "non-primary" Client's dashboard
And when they log out they shouldn't see a flash message for non primary accounts

@multi-feature-flag-enabled @lay-pfa-high-not-started-multi-client-deputy
@lay-pfa-high-not-started-multi-client-deputy
Scenario: A user logs in with their primary account and uses breadcrumbs to navigate client dashboard
And a Lay Deputy tries to login with their "primary" email address
When they choose their "primary" Client
Then they should be on the "primary" Client's dashboard
And the Lay deputy navigates back to the Choose a Client homepage using the breadcrumb

@multi-feature-flag-enabled @lay-pfa-high-not-started-multi-client-deputy
@lay-pfa-high-not-started-multi-client-deputy
Scenario: A user logs in with their primary account and uses breadcrumbs to navigate report overview page
And a Lay Deputy tries to login with their "primary" email address
When they choose their "primary" Client
Expand All @@ -86,13 +86,13 @@ Feature: Users logging into the service
When the Lay deputy navigates to the report overview page
And the Lay deputy navigates back to the Choose a Client homepage using the breadcrumb

@multi-feature-flag-enabled @lay-pfa-high-not-started-multi-client-deputy
@lay-pfa-high-not-started-multi-client-deputy
Scenario: A user logs in with their primary account and uses breadcrumbs to navigate Your details page
And a Lay Deputy tries to login with their "primary" email address
When the Lay deputy navigates to your details page
And the Lay deputy navigates back to the Choose a Client homepage using the breadcrumb

@multi-feature-flag-enabled @lay-pfa-high-not-started-multi-client-deputy
@lay-pfa-high-not-started-multi-client-deputy
Scenario: A user logs in with their primary account and uses breadcrumbs to navigate Client details page
And a Lay Deputy tries to login with their "primary" email address
When they choose their "primary" Client
Expand All @@ -105,22 +105,22 @@ Feature: Users logging into the service
And the Lay Deputy navigates back to the Client dashboard using the breadcrumb
Then they should be on the "primary" Client's dashboard

@multi-feature-flag-enabled @lay-pfa-high-started-multi-client-deputy-primary-client-discharged-two-active-clients
@lay-pfa-high-started-multi-client-deputy-primary-client-discharged-two-active-clients
Scenario: A user logs into the service with their primary account given they're active clients are linked to their secondary accounts
Given a Lay Deputy tries to login with their "primary" email address
Then they should be on the Choose a Client homepage
And have access to all active client dashboards
When they try to access their "primary" discharged Client
Then I should be redirected and denied access to continue as client not found

@multi-feature-flag-enabled @super-admin @lay-pfa-high-started-multi-client-deputy-primary-client-discharged-two-active-clients
@super-admin @lay-pfa-high-started-multi-client-deputy-primary-client-discharged-two-active-clients
Scenario: A user logs into the service with their primary account given they're remaining active client is linked to their secondary account
Given a super admin user accesses the admin app
And they discharge the deputy from "1" secondary client(s)
Then a Lay Deputy tries to login with their "primary" email address
And should arrive on the client dashboard of their only active client

@multi-feature-flag-enabled @super-admin @lay-pfa-high-started-multi-client-deputy-primary-client-discharged-two-active-clients
@super-admin @lay-pfa-high-started-multi-client-deputy-primary-client-discharged-two-active-clients
Scenario: A user logs into the service with their primary account given all of their clients are discharged
Given a super admin user accesses the admin app
And they discharge the deputy from "2" secondary client(s)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ Feature: View client details
Given I view the lay deputy your details page
Then I should not see the link for client details

@multi-feature-flag-enabled @lay-pfa-high-not-started-multi-client-deputy
@lay-pfa-high-not-started-multi-client-deputy
Scenario: A user does not see Client details in nav bar on choose a client homepage
Given a Lay Deputy tries to login with their "primary" email address
Then they should be on the Choose a Client homepage
Then I should not see "Client details"

@multi-feature-flag-enabled @lay-pfa-high-not-started-multi-client-deputy
@lay-pfa-high-not-started-multi-client-deputy
Scenario: A user has access to the client details page of the client they have selected
Given a Lay Deputy tries to login with their "primary" email address
Then they should be on the Choose a Client homepage
Expand Down
11 changes: 2 additions & 9 deletions client/app/src/Controller/ClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use App\Service\Client\Internal\PreRegistrationApi;
use App\Service\Client\Internal\UserApi;
use App\Service\Client\RestClient;
use App\Service\ParameterStoreService;
use App\Service\Redirector;
use Psr\Log\LoggerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
Expand Down Expand Up @@ -53,7 +52,7 @@ public function showAction(Redirector $redirector)
*
* @Template("@App/Client/show.html.twig")
*/
public function showClientDetailsAction(Redirector $redirector, int $clientId, ParameterStoreService $parameterStore)
public function showClientDetailsAction(Redirector $redirector, int $clientId)
{
// redirect if user has missing details or is on wrong page
$user = $this->userApi->getUserWithData();
Expand All @@ -66,13 +65,7 @@ public function showClientDetailsAction(Redirector $redirector, int $clientId, P

$client = $this->clientApi->getById($clientId);

$isMultiClientFeatureEnabled = $parameterStore->getFeatureFlag(ParameterStoreService::FLAG_MULTI_ACCOUNTS);

$deputyHasMultiClients = false;

if ('1' == $isMultiClientFeatureEnabled) {
$deputyHasMultiClients = $this->clientApi->checkDeputyHasMultiClients($user->getDeputyUid());
}
$deputyHasMultiClients = $this->getUser()->isLayDeputy() && $this->clientApi->checkDeputyHasMultiClients($user->getDeputyUid());

return [
'client' => $client,
Expand Down
Loading
Loading