Skip to content

Commit 57ff561

Browse files
authored
plumb change set deploymentMode to client for diff table usage (#282)
1 parent b0e4d53 commit 57ff561

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

src/handlers/StackHandler.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,17 +387,20 @@ export function listStackResourcesHandler(
387387
};
388388
}
389389

390+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment,
391+
@typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument,
392+
@typescript-eslint/no-unsafe-call */
390393
export function describeChangeSetHandler(
391394
components: ServerComponents,
392395
): RequestHandler<DescribeChangeSetParams, DescribeChangeSetResult, void> {
393396
return async (rawParams: DescribeChangeSetParams): Promise<DescribeChangeSetResult> => {
394397
const params = parseWithPrettyError(parseDescribeChangeSetParams, rawParams);
395398

396-
const result = await components.cfnService.describeChangeSet({
399+
const result = (await components.cfnService.describeChangeSet({
397400
ChangeSetName: params.changeSetName,
398401
IncludePropertyValues: true,
399402
StackName: params.stackName,
400-
});
403+
})) as any; // TODO: Remove 'as any' once SDK is released
401404

402405
return {
403406
changeSetName: params.changeSetName,
@@ -406,6 +409,7 @@ export function describeChangeSetHandler(
406409
creationTime: result.CreationTime?.toISOString(),
407410
description: result.Description,
408411
changes: mapChangesToStackChanges(result.Changes),
412+
deploymentMode: result.DeploymentMode,
409413
};
410414
};
411415
}

src/stacks/StackRequestType.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { StackSummary, StackStatus, StackResourceSummary, StackEvent, Stack } from '@aws-sdk/client-cloudformation';
22
import { RequestType } from 'vscode-languageserver-protocol';
3-
import { ChangeSetReference, StackChange } from './actions/StackActionRequestType';
3+
import { ChangeSetReference, DeploymentMode, StackChange } from './actions/StackActionRequestType';
44

55
export type ListStacksParams = {
66
statusToInclude?: StackStatus[];
@@ -51,6 +51,7 @@ export type ListChangeSetResult = {
5151
export type DescribeChangeSetResult = ChangeSetSummary & {
5252
stackName: string;
5353
changes?: StackChange[];
54+
deploymentMode?: DeploymentMode;
5455
};
5556

5657
export const ListChangeSetRequest = new RequestType<ListChangeSetParams, ListChangeSetResult, void>(

src/stacks/actions/StackActionRequestType.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export type Failable = {
147147
export type DescribeValidationStatusResult = GetStackActionStatusResult &
148148
Failable & {
149149
ValidationDetails?: ValidationDetail[];
150+
deploymentMode?: DeploymentMode;
150151
};
151152

152153
export type DescribeDeploymentStatusResult = GetStackActionStatusResult &

src/stacks/actions/StackActionWorkflowType.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
StackChange,
1010
ValidationDetail,
1111
CreateStackActionResult,
12+
DeploymentMode,
1213
} from './StackActionRequestType';
1314

1415
export type StackActionWorkflowState = {
@@ -23,6 +24,7 @@ export type StackActionWorkflowState = {
2324
validationDetails?: ValidationDetail[];
2425
lastPolled?: number;
2526
failureReason?: string;
27+
deploymentMode?: DeploymentMode;
2628
};
2729

2830
export type ValidationWaitForResult = {

src/stacks/actions/ValidationWorkflow.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export class ValidationWorkflow implements StackActionWorkflow<CreateValidationP
9090
phase: StackActionPhase.VALIDATION_IN_PROGRESS,
9191
startTime: Date.now(),
9292
state: StackActionState.IN_PROGRESS,
93+
deploymentMode: params.deploymentMode,
9394
});
9495

9596
void this.runValidationAsync(params, changeSetName);
@@ -125,6 +126,7 @@ export class ValidationWorkflow implements StackActionWorkflow<CreateValidationP
125126
...this.getStatus(params),
126127
ValidationDetails: workflow.validationDetails,
127128
FailureReason: workflow.failureReason,
129+
deploymentMode: workflow.deploymentMode,
128130
};
129131
}
130132

0 commit comments

Comments
 (0)