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

upcoming: [M3-7726] - Assign Linodes to Placement Group Drawer #10140

Merged
merged 22 commits into from
Feb 9, 2024

Conversation

abailly-akamai
Copy link
Contributor

@abailly-akamai abailly-akamai commented Feb 1, 2024

Description 📝

This PR brings the drawer to assign linodes to a PG (in the VPC subnet fashion) + improvements and naming convention updates

Changes 🔄

  • Add new drawer and tests
  • Connect drawer to flow
  • Update utils and function names to use "linode" instead of "vm"
  • Small (non breaking) updates to the RemovableSelectionList to allow for extra styling and accessibility improvements

Preview 📷

Screenshot 2024-02-07 at 13 29 51

How to test 🧪

Prerequisites

  • Turn on both the "Placement Groups" feature flag and MSW

Verification steps

  • Navigate to /placement-groups/1/linodes
  • Click on "Add Linode to Placement Group"
  • Confirm
    • overall form behavior
    • adding/removing a linode from the list (and invalidation)

NOTE: due to limitations in using MSW, we can only really see adding/removing ONE linode at a time (subsequent tries won't be reflected in the UI)

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

CreatePlacementGroupPayload,
PlacementGroup,
UnassignVMsFromPlacementGroupPayload,
UnassignLinodesFromPlacementGroupPayload,
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 updated utils to read "linode(s)" instead of "VM(s)" for consistency since VM is more of of product name and linode is more clear in code

/**
* Additional styles to apply to the component
*/
sx?: SxProps<Theme>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Improving the RemovableSelectionList to make it a tad more flexible


export const unassignVMsFromPlacementGroupSchema = object({
linodeIds: array().of(number().max(1, 'Only one Linode id is supported.')),
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't really need those schemas cause we're using a drawer that does requests outside of a regular formik/form schema. We still have validation, but we don't need a schema for the one field

'linode',
updatedPlacementGroup.linode_ids[0],
'placement_groups',
]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding more granularity to our invalidations

@abailly-akamai abailly-akamai marked this pull request as ready for review February 7, 2024 18:46
@abailly-akamai abailly-akamai requested a review from a team as a code owner February 7, 2024 18:46
@abailly-akamai abailly-akamai requested review from jdamore-linode, hana-akamai and carrillo-erik and removed request for a team February 7, 2024 18:46
Copy link

github-actions bot commented Feb 7, 2024

Coverage Report:
Base Coverage: 81.12%
Current Coverage: 81.13%

Copy link
Contributor

@jaalah-akamai jaalah-akamai left a comment

Choose a reason for hiding this comment

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

Looks good overall, just confirming warning is expected?
Screenshot 2024-02-08 at 12 54 47 PM
Also, will this have it's own permissions/grant like add_placement_groups or something?

return [...acc, ...placementGroup.linode_ids];
}, []);

return Array.from(new Set(linodeIds));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

@abailly-akamai
Copy link
Contributor Author

abailly-akamai commented Feb 8, 2024

@jaalah-akamai yes the banner is expected - i intentionally made it appear with our mocks upon reaching the 10 limit in the drawer

Also, will this have it's own permissions/grant like add_placement_groups or something?

So the permissions are the same as the Linode permissions per the API specs. Not sure what the approach should be. We have a separate ticket to handle those

@jaalah-akamai jaalah-akamai added the Add'tl Approval Needed Waiting on another approval! label Feb 9, 2024
Copy link
Contributor

@hana-akamai hana-akamai left a comment

Choose a reason for hiding this comment

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

Verified form behavior and adding/removing a Linode from the Placement Group

@hana-akamai hana-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Feb 9, 2024
@abailly-akamai abailly-akamai merged commit ebc3f76 into linode:develop Feb 9, 2024
18 checks passed
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! Placement Groups
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants