-
Notifications
You must be signed in to change notification settings - Fork 361
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
feat: [M3-8837] - Add LKE-E feature flag #11259
Draft
mjac0bs
wants to merge
6
commits into
linode:develop
Choose a base branch
from
mjac0bs:M3-8837-add-lke-enterprise-feature-flag
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d6a65e7
Add lkeEnterprise flag, hook, and account beta query
mjac0bs 56fb71b
Add WIP tests for hook
mjac0bs 4d9bceb
Refactor added tests, trying to address failures
mjac0bs 53d3170
Different attempt for debugging purposes; will likely revert this
mjac0bs 25c3a31
Fix the APL test error and some linter warnings
mjac0bs 3cf7aeb
Add changesets
mjac0bs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/api-v4/.changeset/pr-11259-upcoming-features-1731690339160.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/api-v4": Upcoming Features | ||
--- | ||
|
||
Add v4beta/account endpoint and update Capabilities for LKE-E ([#11259](https://github.com/linode/manager/pull/11259)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-11259-upcoming-features-1731690367042.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Upcoming Features | ||
--- | ||
|
||
Add feature flag and hook for LKE-E enablement ([#11259](https://github.com/linode/manager/pull/11259)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ import { | |
import { useSnackbar } from 'notistack'; | ||
|
||
import { useIsTaxIdEnabled } from 'src/features/Account/utils'; | ||
import { useFlags } from 'src/hooks/useFlags'; | ||
import { useGrants, useProfile } from 'src/queries/profile/profile'; | ||
|
||
import { queryPresets } from '../base'; | ||
|
@@ -36,6 +37,21 @@ export const useAccount = () => { | |
}); | ||
}; | ||
|
||
/** | ||
* @TODO LKE-E - M3-8838: Clean up after released to GA, if not otherwise in use | ||
*/ | ||
export const useAccountBeta = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not to be confused with the |
||
const { data: profile } = useProfile(); | ||
const flags = useFlags(); | ||
|
||
return useQuery<Account, APIError[]>({ | ||
...accountQueries.accountBeta, | ||
...queryPresets.oneTimeFetch, | ||
...queryPresets.noRetry, | ||
enabled: !profile?.restricted && flags.lkeEnterprise?.enabled, | ||
}); | ||
}; | ||
|
||
export const useMutateAccount = () => { | ||
const queryClient = useQueryClient(); | ||
const { enqueueSnackbar } = useSnackbar(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to modify this test with the addition of the
useIsLkeEnterpriseEnabled
tests, due to the use of feature flags in both.In the words of the wise @jdamore-linode, the APL test needed to be modified because:
(And so the APL test would fail.)
In the interest of using one mocking solution in this file (not both
server.use
andvi.mock
), I switched this one over to using the queryMocks, as well.