manager icon indicating copy to clipboard operation
manager copied to clipboard

upcoming: [M3-9502, M3-9504, M3-10103] - Maintenance Policy Selects

Open hkhalil-akamai opened this issue 7 months ago • 3 comments

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 MaintenancePolicySelect component 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_id should be omitted from request for unsupported regions (everything except us-iad and us-ord at the moment).

Target release date 🗓️

~6/17~ 6/24 off-cycle based on Slack thread

Preview 📷

Create Flow
localhost_3000_linodes (1) localhost_3000_linodes (2)
Unsupported Regions localhost_3000_linodes_create (8)
Account Settings
localhost_3000_linodes_create (4) localhost_3000_linodes_create (5)
Linode Settings
localhost_3000_linodes_create (6) localhost_3000_linodes_create (7)
Storybook - Light Storybook - Dark
Screenshot 2025-06-10 at 10 03 38 PM Screenshot 2025-06-10 at 10 03 47 PM
Screenshot 2025-06-09 at 11 03 19 PM Screenshot 2025-06-09 at 11 02 19 PM

How to test 🧪

Prerequisites

  • Enable VM Host Maintenance Policy Flag
  • 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_id should not be sent in POST payload
  • Wen supported region is selected (us-iad, us-ord)
    • [ ] Maintenance policy select should be enabled
    • [ ] Default option Migrate should be pre-selected
    • [ ] Migrate & Power Off / Power On options should appear
    • [ ] maintenance_policy_id should be sent in POST payload
    • [ ] Manually check that GPU banner appears either by adding Maintenance Policy capability 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

hkhalil-akamai avatar Jun 04 '25 23:06 hkhalil-akamai

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: Screenshot 2025-06-10 at 9 18 13 PM

jaalah-akamai avatar Jun 11 '25 02:06 jaalah-akamai

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

bnussman-akamai avatar Jun 12 '25 17:06 bnussman-akamai

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? image

  • When unsupported region is selected
    • [x] All the above and...
    • [x] Helper text should appear indicating region is not supported
    • [x] maintenance_policy_id should not be sent in POST payload
  • Wen supported region is selected (us-iad, us-ord)
    • [x] Maintenance policy select should be enabled
    • [ ] Default option Migrate should 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_id should be sent in POST payload
    • [x] Manually check that GPU banner appears either by adding Maintenance Policy capability to a GPU (Newark - us-east) supported region or manually reviewing code.

Account Settings / Linode Settings:

  • Observe the same component here and check UI

coliu-akamai avatar Jun 17 '25 15:06 coliu-akamai

I need to see why some of these apparent unrelated unit tests are failing 👀

jaalah-akamai avatar Jun 17 '25 15:06 jaalah-akamai

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

jaalah-akamai avatar Jun 17 '25 15:06 jaalah-akamai

~~Tests appear to be passing locally with latest 🤔~~

And they're back... 👀

jaalah-akamai avatar Jun 17 '25 16:06 jaalah-akamai

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 Failing662 Passing5 Skipped116m 47s

Details

Failing Tests
SpecTest
:x:access-key.e2e.spec.tsCloud 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"

linode-gh-bot avatar Jun 18 '25 15:06 linode-gh-bot