-
Notifications
You must be signed in to change notification settings - Fork 56
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
fix: filter non-sandbox stacks #736
Conversation
🦋 Changeset detectedLatest commit: 0a198ee The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
packages/deployed-backend-client/src/deployed_backend_client.ts
Outdated
Show resolved
Hide resolved
.map(async (stackSummary: StackSummary) => { | ||
const deploymentType = await this.tryGetDeploymentType(stackSummary); | ||
|
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.
Do we now even need this call? Isn't it guaranteed that whatever got filtered is Sandbox
deploymentType by definition?
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 the idea is that it's possible for a stack to be named in way that matches the heuristic, but isn't truly a sandbox. The stack metadata is the best way to get the deploymentType.
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.
non blocker nits
import { ArnGenerator } from './deployed-backend-client/arn_generator.js'; | ||
import { ArnParser } from './deployed-backend-client/arn_parser.js'; | ||
|
||
const listStacksMock = { |
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.
const listStacksMock = { | |
const listStacksMockResponse = { |
]; | ||
|
||
beforeEach(() => { | ||
getOutputMock.mock.mockImplementation( |
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.
These need not be in beforeEach
I'm guessing, can be moved out to the describe
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.
One comment but it can be a fast follow if we need to get this merged. But it should be pretty easy to incorporate. If this PR goes in without it, please either make the follow up PR, or cut a tech-debt issue to track.
packages/deployed-backend-client/src/deployed_backend_client.ts
Outdated
Show resolved
Hide resolved
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.
Should we also add some retries when we configure SDK client ? That seems to be dealing with throttling in cleanup script.
maxAttempts: 5, |
packages/deployed-backend-client/src/deployed_backend_client.ts
Outdated
Show resolved
Hide resolved
@sobolk We can make a change on the console side to incorporate more retries. |
0a198ee
7f3ff40
to
0a198ee
Compare
Issue #, if available:
N/A
Description of changes:
There is currently an issue in deployed-backend-client where calling
getOutput
for every stack to determinedeploymentType: 'sandbox'
is causing high latency and throttling exceptions fromlistSandboxes
.This PR adds a heuristic to filter stacks that are not named using the sandbox naming convention in order to prevent excessive
getOutput
calls.I've also refactored the test suite a bit since it was getting unruly.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.