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-7520] - AGLB Fixes and Improvements #9954

Merged
merged 20 commits into from
Dec 5, 2023

Conversation

bnussman-akamai
Copy link
Member

@bnussman-akamai bnussman-akamai commented Dec 1, 2023

Description πŸ“

  • Fixes ActionCell styles 🎨
  • Make copy changes required by technical writer ✏️
    • Add rule drawer now has dynamic copy depending on the protocol
  • Improves spacing of some error notices ⛔️
  • Fixes a lot of validation / payloads to match what the Linode API allows πŸš›
    • You should now be able to add TCP Rules now
    • You should be able to delete Rules

Preview πŸ“·

Before After
Screenshot 2023-12-01 at 4 48 00 PM Screenshot 2023-12-01 at 4 47 52 PM
Screenshot 2023-12-01 at 4 50 18 PM Screenshot 2023-12-01 at 4 50 35 PM
Screenshot 2023-12-04 at 8 48 14 AM Screenshot 2023-12-04 at 8 47 37 AM
Screenshot 2023-12-04 at 8 48 24 AM Screenshot 2023-12-04 at 8 47 22 AM

How to test πŸ§ͺ

Prerequisites

  • Use MSW to test or use the dev-test-aglb credentials

Verification steps

  • Verify the changes listed in the Description section
  • Check for any regressions to existing behavior

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 added the ACLB Relating to the Akamai Cloud Load Balancer label Dec 1, 2023
@bnussman-akamai bnussman-akamai self-assigned this Dec 1, 2023
@bnussman-akamai bnussman-akamai marked this pull request as ready for review December 4, 2023 13:22
@bnussman-akamai bnussman-akamai requested a review from a team as a code owner December 4, 2023 13:22
@bnussman-akamai bnussman-akamai requested review from carrillo-erik and tyler-akamai and removed request for a team December 4, 2023 13:22
Copy link

github-actions bot commented Dec 4, 2023

Coverage Report: βœ…
Base Coverage: 85.37%
Current Coverage: 85.39%

@bnussman-akamai bnussman-akamai requested a review from a team as a code owner December 4, 2023 19:55
@bnussman-akamai bnussman-akamai requested review from cliu-akamai and removed request for a team December 4, 2023 19:55
label: '',
type,
},
initialValues: initialValues[type],
Copy link
Member Author

Choose a reason for hiding this comment

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

Added dynamic initialValues because ca certs cannot have a key


const items = [
{
title: 'Hostname',
value: <IPAddress ips={[loadbalancer?.hostname ?? '']} isHovered />,
value: <IPAddress ips={[loadbalancer?.hostname ?? 'None']} isHovered />,
Copy link
Member Author

Choose a reason for hiding this comment

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

Show None instead of nothing when there is no hostname.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good call. One nitpick: do we want to hide the copy button when there is no hostname? It seems silly to be able to copy "None". May be more trouble than it's worth to change, because we'd also need some minor styling.

Screenshot 2023-12-05 at 8 55 52 AM

Comment on lines +38 to +39
label: route.label,
protocol: route.protocol,
Copy link
Member Author

Choose a reason for hiding this comment

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

The API needs us to pass these values. Passing protocol also helps our validation.

@@ -36,13 +39,23 @@ export const LoadBalancerRow = ({ handlers, loadBalancer }: Props) => {
</TableCell>
</Hidden>
<Hidden smDown>
<TableCell>{hostname}</TableCell>
<TableCell>
{hostname ? <IPAddress ips={[hostname]} /> : 'None'}
Copy link
Member Author

Choose a reason for hiding this comment

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

Show None if there is no hostname. Also makes the hostname copyable.

</Hidden>
<Hidden mdDown>
<TableCell>
{regions.map((region) => (
<Stack py={1} spacing={0.5}>
{alphaRegions.map(({ id, label }) => (
Copy link
Member Author

Choose a reason for hiding this comment

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

We're going to hardcode the regions for now because the dev environment does not return the production regions we need.

@@ -21,6 +21,10 @@ export const Ports = ({ loadbalancerId }: PortProps) => {
return <Skeleton sx={{ minWidth: '100px' }} />;
}

if (ports?.length === 0) {
return <Typography>None</Typography>;
Copy link
Member Author

Choose a reason for hiding this comment

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

Shows None is no configurations have been setup

Copy link
Member Author

Choose a reason for hiding this comment

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

Changes here match APIv4

Comment on lines 68 to 76
export const getNormzlizedRulePayload = (rule: RulePayload) => ({
match_condition: {
...rule.match_condition,
hostname: rule.match_condition.hostname
? rule.match_condition.hostname
: null,
},
service_targets: rule.service_targets,
});
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 really didn't want to have to do this, but we need to so that the API accepts our payload. I tired doing this other ways but this seemed to be the most typesafe and straightforward way

@bnussman-akamai bnussman-akamai changed the title upcoming: AGLB Fixes and Improvements upcoming: [M3-7520] - AGLB Fixes and Improvements Dec 4, 2023
@tyler-akamai
Copy link
Contributor

tyler-akamai commented Dec 5, 2023

Verified:

  • Action menu alignment
  • Better description in Add Rules
  • Better spacing for error in Add a Service Target drawer
  • Better spacing for error in Create Route drawer
  • No regressions to existing behavior
  • General code review

@tyler-akamai
Copy link
Contributor

Should we clamp these after a certain number of lines?
Screenshot 2023-12-05 at 11 15 40 AM

'be.visible'
);
});
// TODO: AGLB - Confirm that regions from the API are listed for load balancer
Copy link
Contributor

Choose a reason for hiding this comment

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

were these not working?

Copy link
Member Author

Choose a reason for hiding this comment

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

The Dev environment does not have the same regions as prod, so we need to hardcode for now.

path: string;
host: string;
path?: string | null;
host?: string | null;
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 this to be both optional and potentially null?

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 think we want both because we want users to be able to pass null or completely omit the property.

@@ -169,7 +169,7 @@ export interface ServiceTarget extends ServiceTargetPayload {

export interface Endpoint {
ip: string;
host?: string;
host?: string | null;
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@bnussman-akamai
Copy link
Member Author

@tyler-akamai We will clamp the regions post-alpha

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.

It's exciting to see things working more smoothly, nicely done! A couple minor things of feedback, approving pending those are addressed.

Verified:
βœ… Fixed ActionCell styles
βœ… Add rule drawer now has dynamic copy depending on the protocol
βœ… Error notice spacing looks good
Fixes a lot of validation / payloads to match what the Linode API allows πŸš›

  • ❗ I seem to be getting an error now on the service target label field when trying to add a rule. See screencap below.

βœ… Able to add TCP Rules now (this works, despite the visible error)
βœ… Able to delete Rules

Screen.Recording.2023-12-05.at.9.23.55.AM.mov

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the πŸ§ͺ !


const items = [
{
title: 'Hostname',
value: <IPAddress ips={[loadbalancer?.hostname ?? '']} isHovered />,
value: <IPAddress ips={[loadbalancer?.hostname ?? 'None']} isHovered />,
Copy link
Contributor

Choose a reason for hiding this comment

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

Good call. One nitpick: do we want to hide the copy button when there is no hostname? It seems silly to be able to copy "None". May be more trouble than it's worth to change, because we'd also need some minor styling.

Screenshot 2023-12-05 at 8 55 52 AM

@@ -38,7 +38,7 @@ export const LoadBalancerCertificates = () => {
Upload certificates to your Load Balancer for use across your
Configurations and Service Targets.
</Typography>
<Tabs index={tabIndex === -1 ? 0 : tabIndex}>
<Tabs index={tabIndex === -1 ? 0 : tabIndex} onChange={() => null}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yay, thank you πŸ™ŒπŸΌ I noticed this and was trying to decide the best place to mention it.

@bnussman-akamai bnussman-akamai merged commit 27616c5 into linode:develop Dec 5, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ACLB Relating to the Akamai Cloud Load Balancer Ready for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants