upcoming: [M3-9502, M3-9504, M3-10103] - Maintenance Policy Selects
Description 📝
Adds Maintenance policy select dropdowns in the following locations:
- Account Settings
- Linode Create
- Linode Settings
Note: Only two regions supported are us-iad and us-ord at the moment
Changes
- New
MaintenancePolicySelectcomponent with:- Autocomplete dropdown with Migrate/Power Off options
- Default policy chip indicator
- Tooltips explaining each policy type
- Support for custom options and disabled states
- Integration with account maintenance policies API
- GPU plans show a Notice banner with only Warm/Cold policy options
- Added Storybook stories for component testing and documentation
- For create payload,
maintenance_policy_idshould be omitted from request for unsupported regions (everything exceptus-iadandus-ordat the moment).
Target release date 🗓️
~6/17~ 6/24 off-cycle based on Slack thread
Preview 📷
| Create Flow | |
|---|---|
| Unsupported Regions |
| Account Settings | |
|---|---|
| Linode Settings | |
|---|---|
| Storybook - Light | Storybook - Dark |
|---|---|
How to test 🧪
Prerequisites
- Enable
VM Host Maintenance PolicyFlag - Enable MSW Legacy MSW
Verification steps
Linode Create:
- When no region is selected
- [ ] VM Host Maintenance should be visible in "Additional Options"
- [ ] Maintenance policy select should be disabled
- [ ] Section should be collapsed by default
- [ ] No helper text should appear
- [ ] When not using mocks, ideally no options should be pre-selected
- When unsupported region is selected
- [ ] All the above and...
- [ ] Helper text should appear indicating region is not supported
- [ ]
maintenance_policy_idshould not be sent in POST payload
- Wen supported region is selected (us-iad, us-ord)
- [ ] Maintenance policy select should be enabled
- [ ] Default option
Migrateshould be pre-selected - [ ] Migrate & Power Off / Power On options should appear
- [ ]
maintenance_policy_idshould be sent in POST payload - [ ] Manually check that GPU banner appears either by adding
Maintenance Policycapability to a GPU (Newark - us-east) supported region or manually reviewing code.
Account Settings / Linode Settings:
- Observe the same component here and check UI
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
I'll be honest—this PR got bigger and more complex than I initially thought. The screenshots and checklist should help with the review, and we have tests and Storybook stories available for reference too.
The E2E test failures we're seeing are likely legitimate issues:
If anyone figures out how to get the region capability to show up in devenv, let me know. I can't figure out how to get the region capability to show. I also can't figure out how to create a Linode with a policy.
Edit... I figured it out. They made it so any API request for this project needs to be v4beta.
We have to request GET /v4beta/regions to see the region capability. We have to POST /v4beta/linodes to attach a policy. We have to GET /v4beta/account/settings to know the default policy. We have to GET /v4beta/linode/instances/:id to know a Linode's policy.
I'm gonna pause any more work on this until we get this figured out. Conditionally calling all of those endpoints is something we are not easily equipped to do
Linode Create:
- When no region is selected
- [x] VM Host Maintenance should be visible in "Additional Options"
- [x] Maintenance policy select should be disabled
- [x] Section should be collapsed by default
- [x] No helper text should appear
- [x] When not using mocks, ideally no options should be pre-selected
Question: should the default chip still appear when not using mocks / no option pre-selected?
- When unsupported region is selected
- [x] All the above and...
- [x] Helper text should appear indicating region is not supported
- [x]
maintenance_policy_idshould not be sent in POST payload
- Wen supported region is selected (us-iad, us-ord)
- [x] Maintenance policy select should be enabled
- [ ] Default option
Migrateshould be pre-selected- [x] default option of 'power off/on option pre-selected
- [x] Migrate & Power Off / Power On options should appear
- [x]
maintenance_policy_idshould be sent in POST payload - [x] Manually check that GPU banner appears either by adding
Maintenance Policycapability to a GPU (Newark - us-east) supported region or manually reviewing code.
Account Settings / Linode Settings:
- Observe the same component here and check UI
I need to see why some of these apparent unrelated unit tests are failing 👀
Question: should the default chip still appear when not using mocks / no option pre-selected?
@coliu-akamai yea the default will be migrate when the API is ready. There will always be a preselection
~~Tests appear to be passing locally with latest 🤔~~
And they're back... 👀
Cloud Manager UI test results
:small_red_triangle: 1 failing test on test run #39 ↗︎
| :x: Failing | :white_check_mark: Passing | :arrow_right_hook: Skipped | :clock1: Duration |
1 Failing | 662 Passing | 5 Skipped | 116m 47s |
Details
| Failing Tests | ||
|---|---|---|
| Spec | Test | |
| :x: | access-key.e2e.spec.ts | Cloud Manager Cypress Tests→object storage access key end-to-end tests » object storage access key end-to-end tests |
Troubleshooting
Use this command to re-run the failing tests:
pnpm cy:run -s "cypress/e2e/core/objectStorage/access-key.e2e.spec.ts"