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-7702] - Update Region Select for edge sites #10194

Merged

Conversation

hana-akamai
Copy link
Contributor

@hana-akamai hana-akamai commented Feb 14, 2024

Description 📝

Update our Region Select to support edge regions for Project Gecko

Changes 🔄

  • New site_type property to the Region type
  • New gecko feature flag
  • New icon to indicate an Edge region and updates to support displaying it

Preview 📷

image

How to test 🧪

Prerequisites

(How to setup test environment)

  • Turn on the MSW and Gecko feature flag in DevTools

Verification steps

(How to verify changes)

  • Go to /linodes/create and open the Region Select dropdown. You should see an icon next to the Gecko Edge Test region and also icon helper text next to the region select.
  • You should not see the icon or icon helper text for Marketplace, Cloning, or Images
yarn test RegionSelect
yarn test RegionSelect.utils

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

@hana-akamai hana-akamai added the Gecko Beta Relating to Gecko project label Feb 14, 2024
@hana-akamai hana-akamai self-assigned this Feb 14, 2024
Comment on lines +115 to +120
endAdornment: (
<React.Fragment>
{textFieldProps?.InputProps?.endAdornment}
{params.InputProps.endAdornment}
</React.Fragment>
),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add support for displaying end adornments and the select dropdown arrow at the same time

image

@hana-akamai hana-akamai marked this pull request as ready for review February 20, 2024 19:06
@hana-akamai hana-akamai requested a review from a team as a code owner February 20, 2024 19:06
@hana-akamai hana-akamai requested review from mjac0bs and bnussman-akamai and removed request for a team February 20, 2024 19:06
Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Confirmed that:

  • I see the icon and helper text for the mock edge site in the Linodes region dropdown.
  • I do not see the icon or helper text for the region dropdown in other places it is used.
  • Light and dark mode color looks good.

Any test coverage to come for edge sites in the region dropdown?

I left just a few minor punctuation and styling suggestions.

Edit: Also seeing the following unit test failure locally, so 943b272 might not have addressed the issue completely.
image

@@ -47,6 +47,7 @@ export interface Flags {
databaseScaleUp: boolean;
databases: boolean;
firewallNodebalancer: boolean;
gecko: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

This PR slips the new feature flag in. Can we call that out in the PR description too, just for completeness?

Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to consider using a object flag as we discussed recently. Something tells me gecko is going to have more than one parameter we will want to control individually. CC @jaalah-akamai

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@abailly-akamai I'll look into using an object flag in a separate PR

Comment on lines 85 to 90
// Hide edge sites from Marketplace, Cloning, and Images
const unsupportedEdgeEntities = [
'Clone Linode',
'Images',
'One-Click',
].includes(createType);
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it will bother people that we won't allow users to deploy Marketplace apps to edge regions in Cloud Manager.

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 won't allow it for now but may in the future. The Gecko team needs time to test and curate a Marketplace for edge regions.

@hana-akamai
Copy link
Contributor Author

@mjac0bs @bnussman-akamai great feedback, addressed!

@jaalah-akamai jaalah-akamai self-requested a review February 21, 2024 20:05
Copy link
Contributor

@mjac0bs mjac0bs left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the feedback -- confirmed the above styling issues look good now and thanks for test coverage!

Do we have a plan for accessibility of the end adornment in the region select via aria? Using voice over, that icon is not read out and I don't think the user is able to view the tooltip, so they would not be able to distinguish edge sites (other than by name).

Approving pending that is addressed.

Also, I'm not sure what's going on with CI for this PR. It failed initially, so I restarted the PR in jenkins, and now it's showing e2es passing but not sure why the rest of CI is still pending. Unit tests pass locally.

@mjac0bs mjac0bs added the Add'tl Approval Needed Waiting on another approval! label Feb 21, 2024
@@ -47,6 +47,7 @@ export interface Flags {
databaseScaleUp: boolean;
databases: boolean;
firewallNodebalancer: boolean;
gecko: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to consider using a object flag as we discussed recently. Something tells me gecko is going to have more than one parameter we will want to control individually. CC @jaalah-akamai

region.site_type === 'edge' &&
region.capabilities.includes(currentCapability)
)
);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd love to see a isGeckoEnabled util to which you pass your entities (useFlags can be invoked in the util) and tested as such. In doing so, we need to make those entities type safe

Copy link

github-actions bot commented Feb 22, 2024

Coverage Report:
Base Coverage: 81.33%
Current Coverage: 81.35%

icon={<EdgeServer />}
status="other"
sxTooltipIcon={sxEdgeIcon}
text="This region is an Edge server."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
text="This region is an Edge server."
text="This region is an Edge site."

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.

Thanks for the changes! - second pass looks great - 🚢 ✅

color: 'inherit',
display: 'flex',
marginLeft: 8,
padding: '8px 0',
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick (no need to address but good to keep in mind for the future) - while sizing an svg with hard coded values is totally fine, we can use theme spacing units for, well, spacing, especially for values we know to be 8 or multiple of 8. Who knows if the compact theme will ever make a comeback :D

@hana-akamai hana-akamai added Approved Multiple approvals and ready to merge! and removed Add'tl Approval Needed Waiting on another approval! labels Feb 26, 2024
@hana-akamai hana-akamai merged commit 02bdf6d into linode:develop Feb 26, 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! Gecko Beta Relating to Gecko project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants