Skip to content

Conversation

@smans-akamai
Copy link
Contributor

@smans-akamai smans-akamai commented Aug 4, 2025

Description 📝

This pull request applies a a fix for the premium plans feature in DBaaS, fixing the node options that are available and applies the plan disabling by region functionality present in Create. It also includes some additional handling for an edge case.

Changes 🔄

List any change(s) relevant to the reviewer.

  • Fixes the node selector options for the premium plans tab so that all 3 node options are available (1, 2, 3 nodes)
  • Enables the plan disabling behavior by region in resize for new database clusters.
  • Handles edge case where the current plan could appear as disabled, preventing users from making changes to an unavailable plan (ie. node selection) and provides a warning notice (See screenshots below)
  • PlansPanel additionalBanners property added to handle rendering additional notification banners provided from parent
  • disabled property added for DatabaseNodeSelector

Scope 🚢

Upon production release, changes in this PR will be visible to:

  • All customers
  • Some customers (e.g. in Beta or Limited Availability)
  • No customers / Not applicable

Target release date 🗓️

8/12/25

Preview 📷

Node Selection Fix

Before After
before-create-premium-2-nodes-unavailable after-create-2-nodes-available
before-resize-premium-2-nodes-unavailable after-resize-premium-2-node-option-available

Region Does Not Support Plan Disabling Behavior
after-resize-plans-disabled-by-region

Current Plan Unavailable Due To Limited Availability in Region with Notification
after-resize-current-plan-unavailable

How to test 🧪

Prerequisites

(How to setup test environment)

  • Have access to the databases tab
  • Have databasePremium feature flag enabled

Reproduction steps

(How to reproduce the issue, if applicable)

  • Update the serverHandlers.ts to change the mock data by adding the following lines under the database instance handler right after the database variable is declared.
    database.type = 'premium-4';
    database.region = 'us-iad';
    database.platform = 'rdbms-default';
    This will provide consistent data in resize

  • In the develop branch with the mock data running. Access the Database Create view and switch the premium plans tab

  • See that only the 1 and 3 nodes options are displayed

  • Access the details for a database cluster with support for premium plans and navigate to the Resize tab

  • See that only the 1 and 3 nodes options are displayed

Verification steps

(How to verify changes)
Scenario 1: View updated node selection for premium plans in Create and Resize:

  • Update the serverHandlers.ts to change the mock data by adding the following lines under the database instance handler right after the database variable is declared.
    database.type = 'premium-4';
    database.region = 'us-iad';
    database.platform = 'rdbms-default';
    This will provide consistent data in resize for this scenario

  • Switch back to the branch with these changes

  • In this feature branch with the mock data running. Access the Database Create view and switch the premium plans tab

  • Verify that all nodes options are displayed

  • Access the details for a database cluster with support for premium plans and navigate to the resize tab

  • Verify that all nodes options are displayed (1, 2, and 3).

Scenario 2: View scenario when current plan is unavailable:

  • Update the serverHandlers.ts to change the mock data by adding the following lines under the database instance handler right after the database variable is declared.
    database.region = 'us-iad';
    database.type = 'premium-32';
    database.platform = 'rdbms-default';
    This will provide consistent data in resize for this scenario.

  • Access the details for a database cluster and navigate to the resize tab

  • Verify that the current plan is disabled

  • Verify that the node selections are disabled

  • Verify that all node selections are disabled (1, 2, and 3) and you can't make changes to the node selection to enable the resize button

  • Verify that the node selector buttons are enabled upon selecting a new plan

  • Verify that a notification is displayed at the top that says, "Warning: The current plan for this cluster is currently unavailable and can't be used to resize the cluster. You can only resize the cluster using other available plans."

Scenario 3: View Disabled panel when premium plans are not supported by the region

  • Update the serverHandlers.ts to change the mock data by adding the following lines under the database instance handler right after the database variable is declared.
    database.region = 'us-east';
    database.platform = 'rdbms-default';
    This will provide consistent data in resize for this scenario.

  • Access the details for a database cluster and navigate to the resize tab

  • Verify that all plans in the premium plans panel is disabled with a notice above the plans panel

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


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All tests and CI checks are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

…ans and provide disabling behavior for plans by region in resize
@smans-akamai smans-akamai marked this pull request as ready for review August 4, 2025 22:33
@smans-akamai smans-akamai requested a review from a team as a code owner August 4, 2025 22:33
@smans-akamai smans-akamai requested review from bnussman-akamai, corya-akamai, hana-akamai, mpolotsk-akamai and rodonnel-akamai and removed request for a team August 4, 2025 22:33
onSelect={(selected: string) => setSelectedPlanId(selected)}
regionsData={regionData ? [regionData] : undefined}
selectedId={selectedPlanId}
selectedRegionID={databaseRegion}
Copy link
Contributor Author

@smans-akamai smans-akamai Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Providing the selectedRegionID is what allows the plansPanel to check for region availability and whether a region supports specific types of plans. Though the region for the database cluster can't be changed in resize, we still need to provide it so that the disabling logic works.

@smans-akamai smans-akamai added 🚨 Urgent DBaaS Relates to Database as a Service labels Aug 4, 2025
…rom PlansPanel are only made for new database clusters
const databaseRegion =
flags.databasePremium && database.platform === 'rdbms-default'
? database.region
: '';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed up a change so that this logic is only applied to new database clusters.

@smans-akamai smans-akamai requested review from jaalah-akamai and removed request for mpolotsk-akamai and rodonnel-akamai August 5, 2025 17:29
regionAvailabilities: regionAvailabilities ?? [],
selectedRegionId: databaseRegion,
})
: false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit(non-blocking): I think getIsLimitedAvailability returns a boolean of false if falsy

Copy link
Contributor Author

@smans-akamai smans-akamai Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaalah-akamai It was written this way because the plan provided to getIsLimitedAvailability can't be undefined. However, since currentPlan uses the .find method, it has both the plan type and undefined.

const currentPlan = displayTypes?.find((type) => type.id === database.type);

  const isCurrentPlanUnavailable = currentPlan
    ? getIsLimitedAvailability({
        plan: currentPlan,
        regionAvailabilities: regionAvailabilities ?? [],
        selectedRegionId: databaseRegion,
      })
    : false;

Removing it causes a type error, so I did this make sure we have a currentPlan before we provide it to the function. Here's the LimitedAvailabilityPlanStatusOptions type that getIsLimitedAvailability uses.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could update the type, but that seemed intentional, so I left it as is and opted for this workaround.

@jaalah-akamai
Copy link
Contributor

Overall this looks good - thanks for the walkthrough.

  • Premium plans display all three node options
  • Resize has the plan disabling functionality
  • Approve additional banners approach 👍

@jcallahan-akamai jcallahan-akamai removed the request for review from corya-akamai August 5, 2025 18:03
Comment on lines 99 to 101
Boolean(flags.soldOutChips) &&
Boolean(flags.databasePremium) &&
Boolean(databaseRegion)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just use one Boolean?

Suggested change
Boolean(flags.soldOutChips) &&
Boolean(flags.databasePremium) &&
Boolean(databaseRegion)
Boolean(flags.soldOutChips && flags.databasePremium && databaseRegion)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can! I'll update this!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've applied this change!


const currentPlanUnavailableNotice = (
<Notice variant="warning">
<PlanNoticeTypography variant="h3">{`Warning: Your current plan is currently unavailable and it can't be used to resize the cluster. You can only resize the cluster using other available plans.`}</PlanNoticeTypography>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the backticks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hana-akamai I'm using the backtickets because of the apostrophe can't. I see examples in the UI replacing the apostrophe with, \u{2019} (eg. 'You can\u{2019}t delete the currently active user.')

I'll try using that instead.

Copy link
Contributor Author

@smans-akamai smans-akamai Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hana-akamai I pushed up a fix for this and I can see the banner appearing as expected.
Screenshot 2025-08-05 at 4 25 02 PM

"@linode/manager": Added
---

PlansPanel additionalBanners property to handle rendering additional notification banners provided from parent and disabled property for DatabaseNodeSelector ([#12634](https://github.com/linode/manager/pull/12634))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we simplify this sentence?

Suggested change
PlansPanel additionalBanners property to handle rendering additional notification banners provided from parent and disabled property for DatabaseNodeSelector ([#12634](https://github.com/linode/manager/pull/12634))
PlansPanel additionalBanners property for rendering additional banners and disabled property for DatabaseNodeSelector ([#12634](https://github.com/linode/manager/pull/12634))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've updated the changeset

@github-project-automation github-project-automation bot moved this from Review to Approved in Cloud Manager Aug 5, 2025
@hana-akamai hana-akamai added the Approved Multiple approvals and ready to merge! label Aug 5, 2025
@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 2 failing tests on test run #6 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
2 Failing703 Passing4 Skipped124m 55s

Details

Failing Tests
SpecTest
linode-storage.spec.tsCloud Manager Cypress Tests→linode storage tab » delete disk
qemu-reboot-upgrade-notice.spec.tsCloud Manager Cypress Tests→QEMU reboot upgrade notification » should display maintenance banner in 'Linode' landing page when one or more Linodes get impacted.

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/linodes/linode-storage.spec.ts,cypress/e2e/core/notificationsAndEvents/qemu-reboot-upgrade-notice.spec.ts"

@jaalah-akamai
Copy link
Contributor

This is good to go - the QEMU test will be resolved with #12639

@jaalah-akamai jaalah-akamai merged commit 473315f into linode:develop Aug 6, 2025
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Merged in Cloud Manager Aug 6, 2025
abailly-akamai pushed a commit to abailly-akamai/manager that referenced this pull request Aug 7, 2025
…de plan disabling behavior in resize (linode#12634)

* fix: [UIE-9003] - DBaaS - expand node selector options for premium plans and provide disabling behavior for plans by region in resize

* Adding changesets

* Updating added changeset

* Updating logic so that region queries that allow disabling behavior from PlansPanel are only made for new database clusters

* Applying additional feedback
@smans-akamai smans-akamai deleted the UIE-9003-dbaas-premium-plans-resizing-fix branch September 9, 2025 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Multiple approvals and ready to merge! DBaaS Relates to Database as a Service 🚨 Urgent

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants