-
Notifications
You must be signed in to change notification settings - Fork 367
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
feat: [M3-7487] - Add AGLB Endpoint Health #10008
Merged
bnussman-akamai
merged 18 commits into
linode:develop
from
bnussman-akamai:M3-7487-add-aglb-endpoint-health
Jan 16, 2024
Merged
Changes from 13 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0b3c3ba
add load balancer endpoint health api call and query
bnussman 3f07b87
and mocks and inital ui
bnussman eccb6a5
add health to summary tab and add unit test
bnussman 6cd1841
add endpoint health to configurations
bnussman 7771dc5
add service target endpoint health
bnussman f1e64aa
add test and improve some comments
bnussman ab17b40
add unit testing
bnussman 49f929a
add more testing and comments
bnussman 0693e98
Merge branch 'develop' into M3-7487-add-aglb-endpoint-health
bnussman 82fc104
Merge branch 'develop' into M3-7487-add-aglb-endpoint-health
bnussman 15f40ef
Added changeset: AGLB endpoint health endpoints
bnussman 4c4f692
add changeset
bnussman d53edeb
Merge branch 'develop' into M3-7487-add-aglb-endpoint-health
bnussman 36ee5b8
fix spelling of `LoadBalancerEndpontHeath` β‘οΈ `LoadBalancerEndpointHeβ¦
bnussman 54d0339
add minimum with to skeleton so that loading state is not tiny
bnussman 19fc4e3
hide `Endpoints:` if there is no status for a configuration
bnussman 40ccdaf
update tense `Added` β‘οΈ `Add` in the changeset
bnussman 894db74
Make Configurations health behavior consistent with others
bnussman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/api-v4": Added | ||
--- | ||
|
||
AGLB endpoint health endpoints ([#10008](https://github.com/linode/manager/pull/10008)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-10008-upcoming-features-1704919046550.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Upcoming Features | ||
--- | ||
|
||
Added AGLB Endpoint Health ([#10008](https://github.com/linode/manager/pull/10008)) | ||
bnussman-akamai marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...res/LoadBalancers/LoadBalancerDetail/Configurations/ConfigurationAccordionHeader.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import React from 'react'; | ||
|
||
import { | ||
configurationFactory, | ||
configurationsEndpointHealthFactory, | ||
endpointHealthFactory, | ||
} from 'src/factories'; | ||
import { rest, server } from 'src/mocks/testServer'; | ||
import { renderWithTheme } from 'src/utilities/testHelpers'; | ||
|
||
import { ConfigurationAccordionHeader } from './ConfigurationAccordionHeader'; | ||
|
||
describe('ConfigurationAccordionHeader', () => { | ||
it('renders configuration information', () => { | ||
const configuration = configurationFactory.build({ routes: [] }); | ||
|
||
const { getByText } = renderWithTheme( | ||
<ConfigurationAccordionHeader | ||
configuration={configuration} | ||
loadbalancerId={0} | ||
/> | ||
); | ||
|
||
// Label | ||
expect(getByText(configuration.label)).toBeVisible(); | ||
|
||
// ID | ||
expect(getByText(`ID: ${configuration.id}`)).toBeVisible(); | ||
|
||
// Port | ||
expect( | ||
getByText(`Port ${configuration.port}`, { exact: false }) | ||
).toBeVisible(); | ||
|
||
// Number of Routes | ||
expect(getByText('0 Routes', { exact: false })).toBeVisible(); | ||
}); | ||
|
||
it('renders endpoint health for a configuration', async () => { | ||
const configuration = configurationFactory.build({ routes: [] }); | ||
|
||
const configurationHealth = endpointHealthFactory.build({ | ||
healthy_endpoints: 5, | ||
id: configuration.id, | ||
total_endpoints: 9, | ||
}); | ||
|
||
const allConfigurationsEndpointHealth = configurationsEndpointHealthFactory.build( | ||
{ | ||
configurations: [configurationHealth], | ||
id: 5, | ||
} | ||
); | ||
|
||
server.use( | ||
rest.get( | ||
'*/v4beta/aglb/5/configurations/endpoints-health', | ||
(req, res, ctx) => res(ctx.json(allConfigurationsEndpointHealth)) | ||
) | ||
); | ||
|
||
const { findByText } = renderWithTheme( | ||
<ConfigurationAccordionHeader | ||
configuration={configuration} | ||
loadbalancerId={5} | ||
/> | ||
); | ||
|
||
await findByText('5 up'); | ||
|
||
await findByText('4 down'); // 9 - 5 | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
packages/manager/src/features/LoadBalancers/LoadBalancerDetail/EndpointHealth.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React from 'react'; | ||
|
||
import { renderWithTheme } from 'src/utilities/testHelpers'; | ||
|
||
import { EndpointHealth } from './EndpointHealth'; | ||
|
||
describe('EndpointHealth', () => { | ||
it('renders endpoints that are up and down', () => { | ||
const { getByText } = renderWithTheme(<EndpointHealth down={0} up={0} />); | ||
|
||
expect(getByText('0 up')).toBeVisible(); | ||
expect(getByText('0 down')).toBeVisible(); | ||
}); | ||
it('renders endpoints that are up and down', () => { | ||
const { getByLabelText, getByText } = renderWithTheme( | ||
<EndpointHealth down={6} up={18} />, | ||
{ theme: 'light' } | ||
); | ||
|
||
const upStatusIcon = getByLabelText('Status is active'); | ||
const downStatusIcon = getByLabelText('Status is error'); | ||
|
||
expect(upStatusIcon).toHaveStyle({ backgroundColor: '#17cf73' }); | ||
expect(downStatusIcon).toHaveStyle({ backgroundColor: '#ca0813' }); | ||
Comment on lines
+23
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
|
||
expect(getByText('18 up')).toBeVisible(); | ||
expect(getByText('6 down')).toBeVisible(); | ||
}); | ||
it('should render gray when the "down" number is zero', () => { | ||
const { getByLabelText, getByText } = renderWithTheme( | ||
<EndpointHealth down={0} up={18} /> | ||
); | ||
|
||
const statusIcon = getByLabelText('Status is inactive'); | ||
|
||
expect(statusIcon).toBeVisible(); | ||
expect(statusIcon).toHaveStyle({ backgroundColor: '#dbdde1' }); | ||
expect(getByText('0 down')).toBeVisible(); | ||
}); | ||
it('should render gray when the "up" number is zero', () => { | ||
const { getByLabelText, getByText } = renderWithTheme( | ||
<EndpointHealth down={8} up={0} /> | ||
); | ||
|
||
const statusIcon = getByLabelText('Status is inactive'); | ||
|
||
expect(statusIcon).toBeVisible(); | ||
expect(statusIcon).toHaveStyle({ backgroundColor: '#dbdde1' }); | ||
expect(getByText('0 up')).toBeVisible(); | ||
}); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, this isn't an upcoming feature anymore, is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to keep considering it an
upcoming feature
until it's in public beta. We're probably a few weeks away from thatThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, should this changeset entry be under
Upcoming Features
rather thanAdded
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I wen't with
added
because api-v4 has no way to to "gate" features. Once the code is released, it's "added" to the packageThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it still be
Upcoming Features
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's fair. I was thinking we'd been putting other AGLB api-v4 work under Upcoming, so suggested it for consistency, but I might be misremembering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not sure. Maybe api-v4 shouldn't have an
Upcoming Features
? I'll add a cafe item