poc: [M3-10153] - Update legacy/beta toggle behavior for Metrics, Alerts & Banners
Description ๐
Currently, we use account level user preferences (endpoint) to track whether they are on legacy or beta (ACLP), but this is applied globally across all Linodes. We need to handle this on a per-Linode basis, as users may have different preferences for each Linode.
We have two options to solve this:
-
Linode ID to Boolean Map โ: Store a map of linodeId to a boolean value to track ACPL/beta mode for each Linode in the account level user preferences endpoint. This works, but it's not an ideal solution and should be AVOIDED if possible.
-
API Update for Shared/Individual Experiences โ : Modify the getLinode API to return a
is_betaflag for shared experience between Alerts and Metrics features for legacy/beta. For more control, we could get a separate flags likeis_alerts_betaoris_metrics_betafor individual experiences. We need to figure out the best way to manage legacy-ACPL/beta settings on a per-Linode basis, without relying on global preferences.- This implementation includes the following updates:
- Metrics => Use (account level) users/preferences for banners (global across all the linodes)
- Alerts => Use local state + api field to show banners (users may have different preferences for each linode)
- This implementation includes the following updates:
[!Note] The API field (
is_betaoris_alerts_beta, or something similar) is not confirmed yet
Changes ๐
- Metrics: Updated the legacy-beta banner & Metrics to use account-level user preferences, making the banner state consistent across all Linodes
- Alerts: Updated the legacy-beta banner & Alerts to use local state + get Linode API field (note: field is not confirmed yet) to manage its visibility. The banner & Alerts appears:
- In the Create Linode flow under
Additional Options-> Alerts - On the Linode Details page under the Alerts tab
- In the Create Linode flow under
Target release date ๐๏ธ
N/A
Preview ๐ท
No visual changes
How to test ๐งช
Prerequisites
- Enable MSW and
ACLP Beta Services->alerts&metricsfeature flag
Verification steps
- Verify Metrics legacy/beta mode and experience is common across all the ACLP-supported linodes
- Go to mocked ACLP-supported linodes, toggle the preference between legacy and beta on one linode, and ensure the change reflects across all aclp supported linodes
- Verify Alerts legacy/beta mode and experience is distinct across multiple linodes
- Test this with mocked ACLP-supported linodes to ensure Alerts behave differently based on each linode's individual state
- Verify the default state of Alerts/banner on the Linode Details page is based on the Get Linode API field:
is_alerts_beta(this field indicates whether the user has opted for beta or legacy mode) - Verify the default state of Alerts on the Linode Create page is always set to legacy mode (Alerts can be found under
Additional Optionssection)
Author Checklists
As an Author, to speed up the review process, I considered ๐ค
๐ Doing a self review โ Our contribution guidelines ๐ค Splitting feature into small PRs โ Adding a changeset ๐งช Providing/improving test coverage ๐ Removing all sensitive information from the code and PR description ๐ฉ Using a feature flag to protect the release ๐ฃ Providing comprehensive reproduction steps ๐ Providing or updating our documentation ๐ Scheduling a pair reviewing session ๐ฑ Providing mobile support โฟ Providing accessibility support
- [x] I have read and considered all applicable items listed above.
As an Author, before moving this PR from Draft to Open, I confirmed โ
- [x] All unit tests are passing
- [x] TypeScript compilation succeeded without errors
- [x] Code passes all linting rules
This PR is stale because it has been open 15 days with no activity. Please attend to this PR or it will be closed in 5 days
Cloud Manager UI test results
:tada: 675 passing tests on test run #14 โ๏ธ
| :x: Failing | :white_check_mark: Passing | :arrow_right_hook: Skipped | :clock1: Duration |
0 Failing | 675 Passing | 4 Skipped | 121m 45s |