Skip to content

feat: [UIE-8089] - DBaaS Resize GA#11040

Merged
mjac0bs merged 6 commits intolinode:developfrom
smans-akamai:UIE-8089-dbaas-resize
Oct 10, 2024
Merged

feat: [UIE-8089] - DBaaS Resize GA#11040
mjac0bs merged 6 commits intolinode:developfrom
smans-akamai:UIE-8089-dbaas-resize

Conversation

@smans-akamai
Copy link
Contributor

@smans-akamai smans-akamai commented Oct 2, 2024

Description 📝

DBaaS Resize GA

Changes 🔄

List any change relevant to the reviewer.

  • Added Number of Nodes selector to the Database Resize tab
  • The node selection is cleared if they have 2 nodes option selected and try to switch to a plans tab where it is unavailable.
  • Updated newly added Node selector so that the plan is cleared if 2 nodes option is selected for a plan that does not have it.
  • Updated summary so that both current and resize cluster pricing summaries are displayed for comparison

Target release date 🗓️

10/14/24

Preview 📷

Before After
Before After

How to test 🧪

Prerequisites

(How to setup test environment)

  • For testing this change, ensure that DBaaS v2 is enabled, Beta is turned off, and the user has the "Managed Databases" account capability

Verification steps

(How to verify changes)

  • Navigate to the Databases section.
  • Select the New Databases tab and click into one of the databases to see your details
  • Navigate to the Resize tab
  • Scroll down below the plans selection to view the Number of Nodes section is visible
  • Verify that the correct node options are visible in the different tabs (ie. Dedicated vs Shared, etc)
  • Verify that your current cluster size is selected and that lower sizes are disabled
  • Verify that making a higher node selection enables the Resize button
  • Verify that updated summary is visible and updates with selection
  • Make an invalid selection for the 2 node option to see the summary remove the current selection

As an Author I have considered 🤔

Check all that apply

  • 👀 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

@smans-akamai smans-akamai requested a review from a team as a code owner October 2, 2024 23:08
@smans-akamai smans-akamai requested review from carrillo-erik and coliu-akamai and removed request for a team October 2, 2024 23:08
@github-actions
Copy link

github-actions bot commented Oct 2, 2024

Coverage Report:
Base Coverage: 86.96%
Current Coverage: 86.96%

@bnussman-akamai bnussman-akamai added the DBaaS Relates to Database as a Service label Oct 3, 2024
@cpathipa cpathipa requested review from cpathipa and removed request for carrillo-erik October 3, 2024 13:36
@smans-akamai smans-akamai force-pushed the UIE-8089-dbaas-resize branch 3 times, most recently from cc97faf to 325cee2 Compare October 7, 2024 22:27
Comment on lines 155 to 156
Copy link
Contributor

Choose a reason for hiding this comment

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

We can simply this isDatabasesGAEnabled ? 'Please select a plan or set the number of nodes.' : 'Please select a plan.'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was part of the old version, so I've excluded this change as well.

Comment on lines 165 to 192
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 to something like this?

{summaryText ? (
  <>
    <StyledPlanSummarySpan>
      Resized Cluster: {summaryText.plan}
    </StyledPlanSummarySpan>{' '}
    {isDatabasesGAEnabled && (
      <span className={classes.summarySpanBorder}>{summaryText.basePrice}</span>
    )}
    <span className={isDatabasesGAEnabled ? classes.nodeSpanSpacing : ''}>
      {summaryText.numberOfNodes} Node{summaryText.numberOfNodes > 1 ? 's' : ''}
      {isDatabasesGAEnabled ? ' - HA ' : ': '}
    </span>
    {summaryText.price}
  </>
) : (
  <>
    <StyledPlanSummarySpan>Resized Cluster:</StyledPlanSummarySpan>{' '}
    {isDatabasesGAEnabled
      ? 'Please select a plan or set the number of nodes.'
      : 'Please select a plan.'}
  </>
)}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cpathipa Unfortunately, there isn't an easy way to simplify this since many of the smaller changes in the markup are hidden behind that flag so that they won't show without it.

I didn't include this in the my changes, but perhaps we could rework this in a future PR or refactor.

Copy link
Contributor

Choose a reason for hiding this comment

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

@smans-akamai I would recommend addressing the tech debt in this component, as it has grown too large and will be difficult to maintain in the future. It should be broken down into smaller components, as its current state is not maintainable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cpathipa There's an upcoming ticket to refactor the CreateDatabase and ResizeDatabase components since they share a lot similar features (ie. node selector, summary). The ticket is UIE-8082 and that work is set for the 10/28 release and will involve breaking down these similar features into smaller, shared components.

So we should be able to move ahead with this change and address the tech debt and maintainability for these 2 components with that upcoming ticket.

Copy link
Member

Choose a reason for hiding this comment

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

we should prefer userEvent over fireEvent whenever possible: https://testing-library.com/docs/user-event/intro/#differences-from-fireevent

Suggested change
fireEvent.click(selectedNodeRadioButton);
await userEvent.click(selectedNodeRadioButton);

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 @bnussman-akamai! I've included this changes in the test file!

Copy link
Contributor

@cpathipa cpathipa left a comment

Choose a reason for hiding this comment

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

Changes look good to me! Approving pending tests and follow-up tickets for refactoring the DatabaseResize component.

Comment on lines 165 to 192
Copy link
Contributor

Choose a reason for hiding this comment

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

@smans-akamai I would recommend addressing the tech debt in this component, as it has grown too large and will be difficult to maintain in the future. It should be broken down into smaller components, as its current state is not maintainable.

Copy link
Member

Choose a reason for hiding this comment

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

This file needs so serious work

  • There is way too much state
    • State like summaryText, nodePricing , and shouldSubmitBeDisabled all seem like states that do not need to exist. They likely should be consts that are derived from existing state. See https://medium.com/@noriller/react-state-x-derived-state-97ff47769914
    • Fixing these unessesary states will hopefully allow us to remove the useEffects. We are really trying to eliminate use of useEffect in Cloud Manager because they are bug prone and generally a sign of bad state management

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bnussman-akamai
There's an upcoming ticket to refactor the CreateDatabase and ResizeDatabase components since they share a lot similar features (ie. node selector, summary). The ticket is UIE-8082 and that work is set for the 10/28 release and will involve breaking down these similar components into smaller shared components.

This should change how summaryText, and nodePricing are handled since those components share states and logic. I can include a note in the ticket to look into changing how the disabling behavior for the submit button is disabled in Resize, rather than using shouldSubmitBeDisabled in state.

@cpathipa
Copy link
Contributor

cpathipa commented Oct 9, 2024

@smans-akamai Looks like there is E2E test failing in resize-database.spec.ts relevant to this PR. Could you look into this ?

@smans-akamai smans-akamai force-pushed the UIE-8089-dbaas-resize branch from f50d2cf to 6b2aa25 Compare October 9, 2024 16:07
@smans-akamai smans-akamai requested a review from a team as a code owner October 9, 2024 16:07
@smans-akamai smans-akamai requested review from AzureLatte and removed request for a team October 9, 2024 16:07
Copy link
Contributor

@cpathipa cpathipa left a comment

Choose a reason for hiding this comment

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

Confirming on the failed e2e test resize-database.spec

@cpathipa
Copy link
Contributor

cpathipa commented Oct 9, 2024

Looks like failed test clone-linode.spec is flaky cc: @jdamore-linode

@cpathipa
Copy link
Contributor

cpathipa commented Oct 9, 2024

After taking with @jdamore-linode internally confirming failed clone-linode.spec is flaky.

@mjac0bs mjac0bs merged commit 6767382 into linode:develop Oct 10, 2024
@cypress
Copy link

cypress bot commented Oct 10, 2024

Cloud Manager E2E    Run #6656

Run Properties:  status check failed Failed #6656  •  git commit 6767382768: feat: [UIE-8089] - DBaaS Resize GA (#11040)
Project Cloud Manager E2E
Run status status check failed Failed #6656
Run duration 31m 20s
Commit git commit 6767382768: feat: [UIE-8089] - DBaaS Resize GA (#11040)
Committer smans-akamai
View all properties for this run ↗︎

Test results
Tests that failed  Failures 2
Tests that were flaky  Flaky 5
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 428

Tests for review

Failed  cypress/e2e/core/images/machine-image-upload.spec.ts • 2 failed tests

View Output Video

Test Artifacts
machine image > uploads machine image, mock upload canceled failed event Screenshots Video
machine image > uploads machine image, mock failed to decompress failed event Screenshots Video
Flakiness  linodes/resize-linode.spec.ts • 1 flaky test

View Output Video

Test Artifacts
resize linode > resizes a linode by increasing size: cold migration Screenshots Video
Flakiness  linodes/rebuild-linode.spec.ts • 1 flaky test

View Output Video

Test Artifacts
rebuild linode > cannot rebuild a provisioning linode Screenshots Video
Flakiness  placementGroups/delete-placement-groups.spec.ts • 1 flaky test

View Output Video

Test Artifacts
Placement Group deletion > can delete with Linodes assigned when unexpected error show up and retry Screenshots Video
Flakiness  linodes/backup-linode.spec.ts • 1 flaky test

View Output Video

Test Artifacts
linode backups > can enable backups Screenshots Video
Flakiness  kubernetes/smoke-lke-create.spec.ts • 1 flaky test

View Output Video

Test Artifacts
LKE Create Cluster > Simple Page Check Screenshots Video

@smans-akamai smans-akamai deleted the UIE-8089-dbaas-resize 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

DBaaS Relates to Database as a Service

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants