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

removed: [M3-7554, M3-7559] - Post Release Cleanup Parent/Child Feature Flags #10497

Merged
merged 6 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
@@ -0,0 +1,5 @@
---
"@linode/manager": Removed
---

Post release cleanup of parent/child feature flags ([#10489](https://github.com/linode/manager/pull/10489))
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ import {
} from 'support/util/random';
import type { CancelAccount } from '@linode/api-v4';
import { mockWebpageUrl } from 'support/intercepts/general';
import {
mockAppendFeatureFlags,
mockGetFeatureFlagClientstream,
} from 'support/intercepts/feature-flags';
import { makeFeatureFlagData } from 'support/util/feature-flags';

describe('Account cancellation', () => {
/*
Expand Down Expand Up @@ -325,12 +320,6 @@ describe('Parent/Child account cancellation', () => {

const cancellationComments = randomPhrase();

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

mockGetAccount(mockAccount).as('getAccount');
mockGetProfile(mockProfile).as('getProfile');
mockCancelAccountError(cancellationPaymentErrorMessage, 409).as(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ import { profileFactory } from 'src/factories';
import { accountLoginFactory } from 'src/factories/accountLogin';
import { formatDate } from 'src/utilities/formatDate';
import { mockGetAccountLogins } from 'support/intercepts/account';
import {
mockAppendFeatureFlags,
mockGetFeatureFlagClientstream,
} from 'support/intercepts/feature-flags';
import { mockGetProfile } from 'support/intercepts/profile';
import { makeFeatureFlagData } from 'support/util/feature-flags';
import { PARENT_USER } from 'src/features/Account/constants';

describe('Account login history', () => {
Expand Down Expand Up @@ -42,15 +37,9 @@ describe('Account login history', () => {
'getAccountLogins'
);

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(false),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

// Navigate to Account Login History page.
cy.visitWithLogin('/account/login-history');
cy.wait(['@getClientStream', '@getFeatureFlags', '@getProfile']);
cy.wait(['@getProfile']);

// Confirm helper text above table is visible.
cy.findByText(
Expand Down Expand Up @@ -114,15 +103,9 @@ describe('Account login history', () => {

mockGetProfile(mockProfile).as('getProfile');

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

// Navigate to Account Login History page.
cy.visitWithLogin('/account/login-history');
cy.wait(['@getClientStream', '@getFeatureFlags', '@getProfile']);
cy.wait(['@getProfile']);

// Confirm helper text above table and table are not visible.
cy.findByText(
Expand All @@ -149,15 +132,9 @@ describe('Account login history', () => {

mockGetProfile(mockProfile).as('getProfile');

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

// Navigate to Account Login History page.
cy.visitWithLogin('/account/login-history');
cy.wait(['@getClientStream', '@getFeatureFlags', '@getProfile']);
cy.wait(['@getProfile']);

// Confirm helper text above table and table are not visible.
cy.findByText(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { Profile } from '@linode/api-v4';
import { profileFactory } from '@src/factories';
import {
mockAppendFeatureFlags,
mockGetFeatureFlagClientstream,
} from 'support/intercepts/feature-flags';
import { makeFeatureFlagData } from 'support/util/feature-flags';
import { mockGetProfile } from 'support/intercepts/profile';
import { getProfile } from 'support/api/account';
import { interceptGetProfile } from 'support/intercepts/profile';
Expand All @@ -18,12 +13,6 @@ const verifyUsernameAndEmail = (
tooltip: string,
checkEmail: boolean
) => {
// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

mockGetProfile(mockRestrictedProxyProfile);

// Navigate to User Profile page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ import {
} from 'support/intercepts/profile';
import { randomLabel, randomString } from 'support/util/random';
import { ui } from 'support/ui';
import {
mockAppendFeatureFlags,
mockGetFeatureFlagClientstream,
} from 'support/intercepts/feature-flags';
import { makeFeatureFlagData } from 'support/util/feature-flags';
import { PROXY_USER_RESTRICTED_TOOLTIP_TEXT } from 'src/features/Account/constants';

describe('Personal access tokens', () => {
Expand Down Expand Up @@ -278,24 +273,13 @@ describe('Personal access tokens', () => {
});
const proxyUserProfile = profileFactory.build({ user_type: 'proxy' });

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

mockGetProfile(proxyUserProfile);
mockGetPersonalAccessTokens([proxyToken]).as('getTokens');
mockGetAppTokens([]).as('getAppTokens');
mockRevokePersonalAccessToken(proxyToken.id).as('revokeToken');

cy.visitWithLogin('/profile/tokens');
cy.wait([
'@getClientStream',
'@getFeatureFlags',
'@getTokens',
'@getAppTokens',
]);
cy.wait(['@getTokens', '@getAppTokens']);

// Find token in list, confirm "Rename" is disabled and tooltip displays.
cy.findByText(proxyToken.label)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@ import {
mockUpdateUser,
mockUpdateUserGrants,
} from 'support/intercepts/account';
import {
mockAppendFeatureFlags,
mockGetFeatureFlagClientstream,
} from 'support/intercepts/feature-flags';
import { mockGetProfile } from 'support/intercepts/profile';
import { ui } from 'support/ui';
import { shuffleArray } from 'support/util/arrays';
import { makeFeatureFlagData } from 'support/util/feature-flags';
import { randomLabel } from 'support/util/random';

// Message shown when user has unrestricted account access.
Expand Down Expand Up @@ -504,12 +499,6 @@ describe('User permission management', () => {
global: { account_access: 'read_write' },
});

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

mockGetUsers([mockActiveUser, mockRestrictedUser]).as('getUsers');
mockGetUser(mockActiveUser);
mockGetUserGrants(mockActiveUser.username, mockUserGrants);
Expand All @@ -520,7 +509,6 @@ describe('User permission management', () => {
);
mockGetUser(mockRestrictedUser);
mockGetUserGrants(mockRestrictedUser.username, mockUserGrants);
cy.wait(['@getClientStream', '@getFeatureFlags']);

cy.get('[data-qa-global-section]')
.should('be.visible')
Expand Down Expand Up @@ -573,12 +561,6 @@ describe('User permission management', () => {
global: { account_access: 'read_write' },
});

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

mockGetUsers([mockRestrictedProxyUser]).as('getUsers');
mockGetUser(mockChildUser);
mockGetUserGrants(mockChildUser.username, mockUserGrants);
Expand All @@ -590,8 +572,6 @@ describe('User permission management', () => {
`/account/users/${mockRestrictedProxyUser.username}/permissions`
);

cy.wait(['@getClientStream', '@getFeatureFlags']);

cy.findByText('Parent User Permissions', { exact: false }).should(
'be.visible'
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@ import {
mockGetUsers,
} from 'support/intercepts/account';
import { mockGetSecurityQuestions } from 'support/intercepts/profile';
import {
mockAppendFeatureFlags,
mockGetFeatureFlagClientstream,
} from 'support/intercepts/feature-flags';
import { ui } from 'support/ui';
import { mockGetProfile } from 'support/intercepts/profile';
import { makeFeatureFlagData } from 'support/util/feature-flags';
import { verificationBannerNotice } from 'support/constants/user';

describe('User verification banner', () => {
Expand Down Expand Up @@ -46,12 +41,6 @@ describe('User verification banner', () => {
global: { account_access: 'read_write' },
});

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream();

mockGetUsers([mockRestrictedProxyUser]);
mockGetUser(mockChildUser);
mockGetUserGrants(mockChildUser.username, mockUserGrants);
Expand Down Expand Up @@ -128,12 +117,6 @@ describe('User verification banner', () => {
mockSecurityQuestions.security_questions[2].response =
mockSecurityQuestionAnswers[2];

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

mockGetUsers([mockRestrictedProxyUser]).as('getUsers');
mockGetUser(mockChildUser);
mockGetUserGrants(mockChildUser.username, mockUserGrants);
Expand Down Expand Up @@ -211,12 +194,6 @@ describe('User verification banner', () => {
mockSecurityQuestions.security_questions[2].response =
mockSecurityQuestionAnswers[2];

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

mockGetUsers([mockRestrictedProxyUser]).as('getUsers');
mockGetUser(mockChildUser);
mockGetUserGrants(mockChildUser.username, mockUserGrants);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,11 @@ import {
mockGetUsers,
mockDeleteUser,
} from 'support/intercepts/account';
import {
mockAppendFeatureFlags,
mockGetFeatureFlagClientstream,
} from 'support/intercepts/feature-flags';
import {
mockGetProfile,
mockGetProfileGrants,
} from 'support/intercepts/profile';
import { ui } from 'support/ui';
import { makeFeatureFlagData } from 'support/util/feature-flags';
import { randomLabel } from 'support/util/random';
import { PARENT_USER } from 'src/features/Account/constants';

Expand Down Expand Up @@ -65,12 +60,6 @@ const initTestUsers = (profile: Profile, enableChildAccountAccess: boolean) => {
global: { child_account_access: enableChildAccountAccess },
});

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

// Initially mock user with unrestricted account access.
mockGetUsers(mockUsers).as('getUsers');
mockGetUser(mockRestrictedParentWithoutChildAccountAccess);
Expand Down Expand Up @@ -228,12 +217,6 @@ describe('Users landing page', () => {
restricted: false,
});

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

// Initially mock user with unrestricted account access.
mockGetUsers([mockUser]).as('getUsers');
mockGetUser(mockUser);
Expand Down Expand Up @@ -276,12 +259,6 @@ describe('Users landing page', () => {
global: { account_access: 'read_write' },
});

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(true),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

mockGetUsers([mockRestrictedProxyUser]).as('getUsers');
mockGetUser(mockChildUser);
mockGetUserGrants(mockChildUser.username, mockUserGrants);
Expand Down Expand Up @@ -466,12 +443,6 @@ describe('Users landing page', () => {
restricted: true,
});

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(false),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

mockGetUsers([mockUser]).as('getUsers');
mockGetUser(mockUser);
mockGetUserGrantsUnrestrictedAccess(mockUser.username);
Expand Down Expand Up @@ -565,7 +536,6 @@ describe('Users landing page', () => {
expect(intercept.request.body['restricted']).to.equal(newUser.restricted);
});
cy.wait('@getUsers');
cy.wait(['@getClientStream', '@getFeatureFlags']);

// the new user is displayed in the user list
cy.findByText(newUser.username).should('be.visible');
Expand All @@ -587,12 +557,6 @@ describe('Users landing page', () => {
restricted: false,
});

// TODO: Parent/Child - M3-7559 clean up when feature is live in prod and feature flag is removed.
mockAppendFeatureFlags({
parentChildAccountAccess: makeFeatureFlagData(false),
}).as('getFeatureFlags');
mockGetFeatureFlagClientstream().as('getClientStream');

mockGetUsers([mockUser, additionalUser]).as('getUsers');
mockGetUser(mockUser);
mockGetUserGrantsUnrestrictedAccess(mockUser.username);
Expand Down
Loading
Loading