Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: [M3-8807] - Improve Linode Create VPC user experience #11188

Conversation

bnussman-akamai
Copy link
Member

@bnussman-akamai bnussman-akamai commented Oct 30, 2024

Description 📝

  • Cleans up old VPC code related to Linode Create v1 🧹
  • Preselects the VPC and the subnet when creating the VPC while on the Linode Create flow ⌨️ ✨
    • Previously, the VPC would only preselect. This PR makes it so the subnet also gets selected
  • Preselects a VPC's subnet if the user picks a VPC with only one subnet ✨

Preview 📷

Before After
Screen.Recording.2024-10-29.at.8.40.03.PM.mov
Screen.Recording.2024-10-29.at.8.41.15.PM.mov

How to test 🧪

  • Check out this PR
  • Go to the Linode Create flow
  • Test the VPC section of the form 🧪
    • Verify both the VPC and subnet get preselected when you uses the Create VPC drawer to create a VPC
    • Verify error field handling works as expected
    • Verify the clean up done in this PR does not break anything else
    • Verify the subnet gets auto selected when you select a VPC that only has 1 subnet

As an Author I have 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

@bnussman-akamai bnussman-akamai self-assigned this Oct 30, 2024
@bnussman-akamai bnussman-akamai requested a review from a team as a code owner October 30, 2024 00:44
@bnussman-akamai bnussman-akamai requested review from carrillo-erik and abailly-akamai and removed request for a team October 30, 2024 00:44
Copy link
Member Author

@bnussman-akamai bnussman-akamai Oct 30, 2024

Choose a reason for hiding this comment

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

This component is a bit crazy. It was a shared component used on Linode Create v1 and in the Linode Config dialog.

Now that Linode Create v1 is gone, we can clean this up because Linode Create v2 does not share any of this code.

Hopefully I don't break anything here in the process 😅

/**
* A function that is called when a VPC is successfully created
*/
onSuccess: (vpc: VPC) => void;
Copy link
Member Author

Choose a reason for hiding this comment

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

I find onSuccess to be a but more understandable than handleSelectVPC

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine.. our handlers naming conventions are really all over the place 😅

Copy link

github-actions bot commented Oct 30, 2024

Coverage Report:
Base Coverage: 87.16%
Current Coverage: 87.16%

@bnussman-akamai bnussman-akamai requested a review from a team as a code owner October 30, 2024 02:56
@bnussman-akamai bnussman-akamai requested review from cliu-akamai and removed request for a team October 30, 2024 02:56
Copy link
Member Author

@bnussman-akamai bnussman-akamai Oct 30, 2024

Choose a reason for hiding this comment

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

The diff here is a bit hard to read but I essentially just deleted any test that tested the prop from="linodeCreate". The "from" prop doesn't need to exist anymore now that Linode Create doesn't use this component

@bnussman-akamai bnussman-akamai changed the title change: Improve Linode Create VPC user experience change: [M3-8807] - Improve Linode Create VPC user experience Oct 30, 2024
@bnussman-akamai bnussman-akamai added the VPC Relating to VPC project label Oct 30, 2024
Copy link
Contributor

@abailly-akamai abailly-akamai left a comment

Choose a reason for hiding this comment

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

Nice, thanks for the clarity improvements too ✅
No regressions when testing Linode creation with VPC

/**
* A function that is called when a VPC is successfully created
*/
onSuccess: (vpc: VPC) => void;
Copy link
Contributor

Choose a reason for hiding this comment

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

That's fine.. our handlers naming conventions are really all over the place 😅

@@ -135,12 +136,12 @@ export const useCreateVPC = (inputs: UseCreateVPCInputs) => {
};

try {
const response = await createVPC(createVPCPayload);
const vpc = await createVPC(createVPCPayload);
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@coliu-akamai coliu-akamai left a comment

Choose a reason for hiding this comment

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

✅ confirmed updated unit and cypress test pass + test failure in cypress run looks unrelated
✅ verified that subnet gets preselected if VPC only has one subnet, for both creating a new VPC and choosing an already existing VPC
✅ verified subnet doesn't get preselected if VPC has 2+ subnets
✅ vpc configuration panel

Thanks Banks!! This is some really nice cleanup + added clarity! 🎉

(...on a side note, now that I'm looking at the VPC Create code again, I kinda wanna clean that up + switch it all to react-hook-form too... gonna try to get that in before VPC part 2 starts up!! 🤞🙏 )

@coliu-akamai coliu-akamai added the Approved Multiple approvals and ready to merge! label Oct 30, 2024
@bnussman-akamai bnussman-akamai merged commit 926fca5 into linode:develop Oct 30, 2024
22 of 23 checks passed
Copy link

cypress bot commented Oct 30, 2024

Cloud Manager E2E    Run #6758

Run Properties:  status check failed Failed #6758  •  git commit 926fca5cc7: change: [M3-8807] - Improve Linode Create VPC user experience (#11188)
Project Cloud Manager E2E
Branch Review develop
Run status status check failed Failed #6758
Run duration 31m 04s
Commit git commit 926fca5cc7: change: [M3-8807] - Improve Linode Create VPC user experience (#11188)
Committer Banks Nussman
View all properties for this run ↗︎

Test results
Tests that failed  Failures 3
Tests that were flaky  Flaky 2
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 442
View all changes introduced in this branch ↗︎

Tests for review

Failed  linodes/clone-linode.spec.ts • 1 failed test

View Output Video

Test Artifacts
clone linode > can clone a Linode from Linode details page Screenshots Video
Failed  databases/resize-database.spec.ts • 2 failed tests

View Output Video

Test Artifacts
Resizing existing clusters > Resizes a g6-standard-6 MySQL v8.x 3-node cluster > Can resize active database clusters Screenshots Video
Resizing existing clusters > Resizes a g6-dedicated-16 MySQL v5.x 3-node cluster > Can resize active database clusters Screenshots Video
Flakiness  linodes/linode-storage.spec.ts • 1 flaky test

View Output Video

Test Artifacts
linode storage tab > delete disk Screenshots Video
Flakiness  images/create-image.spec.ts • 1 flaky test

View Output Video

Test Artifacts
create image (e2e) > create image from a linode Screenshots Video

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! VPC Relating to VPC project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants