Skip to content

Commit 5df70c4

Browse files
authored
Merge branch 'master' into fix/settings
2 parents d69c5ed + 220d65c commit 5df70c4

File tree

35 files changed

+753
-90
lines changed

35 files changed

+753
-90
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/core/src/awsService/cloudformation/auth/credentials.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ export class AwsCredentialsService implements Disposable {
1919
private client: LanguageClient | undefined
2020

2121
constructor(
22-
private stacksManager: StacksManager,
23-
private resourcesManager: ResourcesManager,
24-
private regionManager: CloudFormationRegionManager
22+
private readonly stacksManager: StacksManager,
23+
private readonly resourcesManager: ResourcesManager,
24+
private readonly regionManager: CloudFormationRegionManager
2525
) {
2626
this.authChangeListener = globals.awsContext.onDidChangeContext(() => {
2727
void this.updateCredentialsFromActiveConnection()
@@ -53,7 +53,7 @@ export class AwsCredentialsService implements Disposable {
5353
await this.client.sendRequest('aws/credentials/iam/update', encryptedRequest)
5454
}
5555

56-
void this.stacksManager.reload()
56+
this.stacksManager.clear()
5757
void this.resourcesManager.reload()
5858
}
5959

packages/core/src/awsService/cloudformation/explorer/nodes/stacksNode.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,23 @@ export class StacksNode extends AWSTreeNodeBase {
3333
}
3434

3535
public override async getChildren(): Promise<AWSTreeNodeBase[]> {
36+
await this.stacksManager.ensureLoaded()
3637
this.updateNode()
3738
const stacks = this.stacksManager.get()
3839
const nodes = stacks.map((stack: StackSummary) => new StackNode(stack, this.changeSetsManager))
3940
return this.stacksManager.hasMore() ? [...nodes, new LoadMoreStacksNode(this)] : nodes
4041
}
4142

4243
private updateNode(): void {
43-
const count = this.stacksManager.get().length
44-
const hasMore = this.stacksManager.hasMore()
45-
this.description = hasMore ? `(${count}+)` : `(${count})`
46-
this.contextValue = hasMore ? 'stackSectionWithMore' : 'stackSection'
44+
if (this.stacksManager.isLoaded()) {
45+
const count = this.stacksManager.get().length
46+
const hasMore = this.stacksManager.hasMore()
47+
this.description = hasMore ? `(${count}+)` : `(${count})`
48+
this.contextValue = hasMore ? 'stackSectionWithMore' : 'stackSection'
49+
} else {
50+
this.description = undefined
51+
this.contextValue = 'stackSection'
52+
}
4753
}
4854

4955
public async loadMoreStacks(): Promise<void> {

packages/core/src/awsService/cloudformation/stacks/stacksManager.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,14 @@ type ListStacksResult = {
2323
}
2424

2525
const ListStacksRequest = new RequestType<ListStacksParams, ListStacksResult, void>('aws/cfn/stacks')
26-
const PollIntervalMs = 1000
2726

2827
type StacksChangeListener = (stacks: StackSummary[]) => void
2928

3029
export class StacksManager implements Disposable {
3130
private stacks: StackSummary[] = []
3231
private nextToken?: string
3332
private readonly listeners: StacksChangeListener[] = []
34-
private poller?: NodeJS.Timeout
33+
private loaded = false
3534

3635
constructor(private readonly client: LanguageClient) {}
3736

@@ -51,6 +50,23 @@ export class StacksManager implements Disposable {
5150
void this.loadStacks()
5251
}
5352

53+
isLoaded() {
54+
return this.loaded
55+
}
56+
57+
async ensureLoaded() {
58+
if (!this.loaded) {
59+
await this.loadStacks()
60+
}
61+
}
62+
63+
clear() {
64+
this.stacks = []
65+
this.nextToken = undefined
66+
this.loaded = false
67+
this.notifyListeners()
68+
}
69+
5470
updateStackStatus(stackName: string, stackStatus: string) {
5571
const stack = this.stacks.find((s) => s.StackName === stackName)
5672
if (stack) {
@@ -80,21 +96,8 @@ export class StacksManager implements Disposable {
8096
}
8197
}
8298

83-
startPolling() {
84-
this.poller ??= setInterval(() => {
85-
this.reload()
86-
}, PollIntervalMs)
87-
}
88-
89-
stopPolling() {
90-
if (this.poller) {
91-
clearInterval(this.poller)
92-
this.poller = undefined
93-
}
94-
}
95-
9699
dispose() {
97-
this.stopPolling()
100+
// do nothing
98101
}
99102

100103
private async loadStacks() {
@@ -106,16 +109,14 @@ export class StacksManager implements Disposable {
106109
})
107110
this.stacks = response.stacks
108111
this.nextToken = response.nextToken
112+
this.loaded = true
109113
} catch (error) {
110114
await handleLspError(error, 'Error loading stacks')
111115
this.stacks = []
112116
this.nextToken = undefined
113117
} finally {
114118
await setContext('aws.cloudformation.refreshingStacks', false)
115119
this.notifyListeners()
116-
if (this.stacks.length === 0) {
117-
this.stopPolling()
118-
}
119120
}
120121
}
121122

packages/core/src/eventSchemas/models/schemaCodeLangs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export function supportsEventBridgeTemplates(runtime: Runtime): boolean {
6262
'python3.11',
6363
'python3.12',
6464
'python3.13',
65+
'python3.14',
6566
'go1.x',
6667
].includes(runtime)
6768
}

packages/core/src/lambda/models/samLambdaRuntime.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export type RuntimePackageType = 'Image' | 'Zip'
3030
// TODO: Consolidate all of the runtime constructs into a single <Runtime, Set<Runtime>> map
3131
// We should be able to eliminate a fair amount of redundancy with that.
3232
export const nodeJsRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>([
33+
'nodejs24.x' as Runtime,
3334
'nodejs22.x' as Runtime,
3435
'nodejs20.x',
3536
'nodejs18.x',
@@ -51,6 +52,7 @@ export function getNodeMajorVersion(version?: string): number | undefined {
5152
}
5253

5354
export const pythonRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>([
55+
'python3.14' as Runtime,
5456
'python3.13' as Runtime,
5557
'python3.12',
5658
'python3.11',
@@ -66,6 +68,7 @@ export const javaRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>([
6668
'java8',
6769
'java8.al2',
6870
'java21',
71+
'java25' as Runtime,
6972
])
7073
export const dotNetRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>(['dotnet6', 'dotnet8'])
7174
export const rubyRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>(['ruby3.2', 'ruby3.3', 'ruby3.4' as Runtime])
@@ -94,12 +97,12 @@ export const deprecatedRuntimes: ImmutableSet<Runtime> = ImmutableSet<Runtime>([
9497
'ruby2.7',
9598
])
9699
const defaultRuntimes = ImmutableMap<RuntimeFamily, Runtime>([
97-
[RuntimeFamily.NodeJS, 'nodejs22.x' as Runtime],
98-
[RuntimeFamily.Python, 'python3.13' as Runtime],
100+
[RuntimeFamily.NodeJS, 'nodejs24.x' as Runtime],
101+
[RuntimeFamily.Python, 'python3.14' as Runtime],
99102
[RuntimeFamily.DotNet, 'dotnet8'],
100103
[RuntimeFamily.Go, 'go1.x'],
101-
[RuntimeFamily.Java, 'java21'],
102-
[RuntimeFamily.Ruby, 'ruby3.3'],
104+
[RuntimeFamily.Java, 'java25' as Runtime],
105+
[RuntimeFamily.Ruby, 'ruby3.4' as Runtime],
103106
])
104107

105108
export const mapFamilyToDebugType = ImmutableMap<RuntimeFamily, string>([

packages/core/src/lambda/remoteDebugging/ldkLayers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const regionToAccount: RegionAccountMapping = {
3131
}
3232

3333
// Global layer version
34-
const globalLayerVersion = 2
34+
const globalLayerVersion = 3
3535

3636
export function getRemoteDebugLayerForArch(region: string, arch: string): string | undefined {
3737
const account = regionToAccount[region]

packages/core/src/lambda/vue/remoteInvoke/remoteInvoke.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@
5757
:disabled="
5858
!initialData.runtimeSupportsRemoteDebug ||
5959
!initialData.remoteDebugLayer ||
60-
!initialData.LambdaFunctionNode?.configuration.SnapStart
60+
(!initialData.LambdaFunctionNode?.configuration.SnapStart &&
61+
initialData.LambdaFunctionNode?.configuration.State !== 'Active')
6162
"
6263
class="remote-debug-checkbox"
6364
/>
@@ -94,7 +95,10 @@
9495
Region {{ initialData.FunctionRegion }} doesn't support remote debugging yet
9596
</info>
9697
<info
97-
v-else-if="!initialData.LambdaFunctionNode?.configuration.SnapStart"
98+
v-else-if="
99+
!initialData.LambdaFunctionNode?.configuration.SnapStart &&
100+
initialData.LambdaFunctionNode?.configuration.State !== 'Active'
101+
"
98102
style="color: var(--vscode-errorForeground)"
99103
>
100104
Doesn't support remote debugging yet

packages/core/src/shared/sam/debugger/javaSamDebug.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6+
import { Runtime } from '@aws-sdk/client-lambda'
67
import { getCodeRoot, isImageLambdaConfig } from '../../../lambda/local/debugConfiguration'
78
import { RuntimeFamily } from '../../../lambda/models/samLambdaRuntime'
89
import { ExtContext } from '../../extensions'
@@ -55,9 +56,8 @@ function getJavaOptionsEnvVar(config: SamLaunchRequestArgs): string {
5556
// https://github.com/aws/aws-sam-cli/blob/86f88cbd7df365960f7015c5d086b0db7aedd9d5/samcli/local/docker/lambda_debug_settings.py#L53
5657
return `-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=*:${config.debugPort} -XX:MaxHeapSize=2834432k -XX:MaxMetaspaceSize=163840k -XX:ReservedCodeCacheSize=81920k -XX:+UseSerialGC -XX:-TieredCompilation -Djava.net.preferIPv4Stack=true`
5758
case 'java17':
58-
// https://github.com/aws/aws-sam-cli/blob/90aa5cf11e1c5cbfbe66aea2e2de10d478d48231/samcli/local/docker/lambda_debug_settings.py#L86
59-
return `-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=*:${config.debugPort} -XX:MaxHeapSize=2834432k -XX:+UseSerialGC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.net.preferIPv4Stack=true`
6059
case 'java21':
60+
case 'java25' as Runtime:
6161
// https://github.com/aws/aws-sam-cli/blob/90aa5cf11e1c5cbfbe66aea2e2de10d478d48231/samcli/local/docker/lambda_debug_settings.py#L96
6262
return `-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,quiet=y,address=*:${config.debugPort} -XX:MaxHeapSize=2834432k -XX:+UseSerialGC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.net.preferIPv4Stack=true`
6363
default:

packages/core/src/shared/sam/debugger/pythonSamDebug.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,13 @@ function getPythonExeAndBootstrap(runtime: Runtime) {
154154
// unfortunately new 'Image'-base images did not standardize the paths
155155
// https://github.com/aws/aws-sam-cli/blob/7d5101a8edeb575b6925f9adecf28f47793c403c/samcli/local/docker/lambda_debug_settings.py
156156
switch (runtime) {
157-
case 'python3.7':
158-
return { python: '/var/lang/bin/python3.7', bootstrap: '/var/runtime/bootstrap' }
159-
case 'python3.8':
160-
return { python: '/var/lang/bin/python3.8', bootstrap: '/var/runtime/bootstrap.py' }
161157
case 'python3.9':
162-
return { python: '/var/lang/bin/python3.9', bootstrap: '/var/runtime/bootstrap.py' }
163158
case 'python3.10':
164-
return { python: '/var/lang/bin/python3.10', bootstrap: '/var/runtime/bootstrap.py' }
165159
case 'python3.11':
166-
return { python: '/var/lang/bin/python3.11', bootstrap: '/var/runtime/bootstrap.py' }
167160
case 'python3.12':
168-
return { python: '/var/lang/bin/python3.12', bootstrap: '/var/runtime/bootstrap.py' }
169161
case 'python3.13' as Runtime:
170-
return { python: '/var/lang/bin/python3.13', bootstrap: '/var/runtime/bootstrap.py' }
162+
case 'python3.14' as Runtime:
163+
return { python: `/var/lang/bin/${runtime}`, bootstrap: '/var/runtime/bootstrap.py' }
171164
default:
172165
throw new Error(`Python SAM debug logic ran for invalid Python runtime: ${runtime}`)
173166
}

0 commit comments

Comments
 (0)