Skip to content

Commit bbc2628

Browse files
authored
chore(aws-cdk): Revert "fix(aws-cdk): include nested stacks when building changesets … (#19618)
…(#19494)" This reverts commit 97cc8e2. Reverting this commit since it introduced a regression. Or, it is not a regression but the regression runs of the CLI integ tests think it is. The same test fails in the run-against-latest-release and the run-against-latest-code regression test suites: https://github.com/aws/aws-cdk/blob/master/packages/aws-cdk/test/integ/cli/cli.integtest.ts#L629. Test fails with: ``` expect(received).not.toEqual(expected) // deep equality Expected: not "arn:aws:cloudformation:ap-southeast-2:416588550161:changeSet/cdk-deploy-change-set/c8c68622-fc38-4199-81b2-b74206380152" at cli.integtest.ts:644:38 at runMicrotasks (<anonymous>) at ../helpers/cdk.ts:130:7 at ResourcePool.using (../helpers/resource-pool.ts:44:14) at ../helpers/test-helpers.ts:38:14 ``` ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 9b4a22e commit bbc2628

File tree

4 files changed

+7
-21
lines changed

4 files changed

+7
-21
lines changed

packages/aws-cdk/lib/api/deploy-stack.ts

-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ async function prepareAndExecuteChangeSet(
299299
StackName: deployName,
300300
ChangeSetName: changeSetName,
301301
ChangeSetType: update ? 'UPDATE' : 'CREATE',
302-
IncludeNestedStacks: true,
303302
Description: `CDK Changeset for execution ${executionId}`,
304303
TemplateBody: bodyParameter.TemplateBody,
305304
TemplateURL: bodyParameter.TemplateURL,

packages/aws-cdk/test/api/deploy-stack.test.ts

-12
Original file line numberDiff line numberDiff line change
@@ -164,18 +164,6 @@ test('correctly passes CFN parameters, ignoring ones with empty values', async (
164164
}));
165165
});
166166

167-
test('correctly passes IncludeNestedStacks', async () => {
168-
// WHEN
169-
await deployStack({
170-
...standardDeployStackArguments(),
171-
});
172-
173-
// THEN
174-
expect(cfnMocks.createChangeSet).toHaveBeenCalledWith(expect.objectContaining({
175-
IncludeNestedStacks: true,
176-
}));
177-
});
178-
179167
test('reuse previous parameters if requested', async () => {
180168
// GIVEN
181169
givenStackExists({

packages/aws-cdk/test/integ/cli/cli.integtest.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -638,13 +638,10 @@ integTest('fast deploy', withDefaultFixture(async (fixture) => {
638638
const changeSet2 = await getLatestChangeSet();
639639
expect(changeSet2.ChangeSetId).toEqual(changeSet1.ChangeSetId);
640640

641-
// Deploy the stack again with --force. This creates a changeset which will be
642-
// empty (since CFN now tracks changes into nested stacks as well), so we delete
643-
// it again because it couldn't be executed anyway.
644-
const output = await fixture.cdkDeploy('with-nested-stack', { options: ['--force'] });
641+
// Deploy the stack again with --force, now we should create a changeset
642+
await fixture.cdkDeploy('with-nested-stack', { options: ['--force'] });
645643
const changeSet3 = await getLatestChangeSet();
646-
expect(output).toContain('No changes are to be performed on');
647-
expect(changeSet3.ChangeSetId).toEqual(changeSet2.ChangeSetId);
644+
expect(changeSet3.ChangeSetId).not.toEqual(changeSet2.ChangeSetId);
648645

649646
// Deploy the stack again with tags, expected to create a new changeset
650647
// even though the resources didn't change.

packages/aws-cdk/test/integ/helpers/cdk.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -720,9 +720,11 @@ export async function installNpmPackages(fixture: TestFixture, packages: Record<
720720
const installNpm7 = memoize0(async (): Promise<string> => {
721721
const installDir = path.join(os.tmpdir(), 'cdk-integ-npm7');
722722
await shell(['rm', '-rf', installDir]);
723-
await shell(['mkdir', '-p', `${installDir}/node_modules`]);
723+
await shell(['mkdir', '-p', installDir]);
724724

725-
await shell(['npm', 'install', 'npm@7'], { cwd: installDir });
725+
await shell(['npm', 'install',
726+
'--prefix', installDir,
727+
'npm@7']);
726728

727729
return path.join(installDir, 'node_modules', '.bin', 'npm');
728730
});

0 commit comments

Comments
 (0)