Skip to content
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

chore(aws-cdk): Revert "fix(aws-cdk): include nested stacks when building changesets … #19618

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/aws-cdk/lib/api/deploy-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ async function prepareAndExecuteChangeSet(
StackName: deployName,
ChangeSetName: changeSetName,
ChangeSetType: update ? 'UPDATE' : 'CREATE',
IncludeNestedStacks: true,
Description: `CDK Changeset for execution ${executionId}`,
TemplateBody: bodyParameter.TemplateBody,
TemplateURL: bodyParameter.TemplateURL,
Expand Down
12 changes: 0 additions & 12 deletions packages/aws-cdk/test/api/deploy-stack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,6 @@ test('correctly passes CFN parameters, ignoring ones with empty values', async (
}));
});

test('correctly passes IncludeNestedStacks', async () => {
// WHEN
await deployStack({
...standardDeployStackArguments(),
});

// THEN
expect(cfnMocks.createChangeSet).toHaveBeenCalledWith(expect.objectContaining({
IncludeNestedStacks: true,
}));
});

test('reuse previous parameters if requested', async () => {
// GIVEN
givenStackExists({
Expand Down
9 changes: 3 additions & 6 deletions packages/aws-cdk/test/integ/cli/cli.integtest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,13 +638,10 @@ integTest('fast deploy', withDefaultFixture(async (fixture) => {
const changeSet2 = await getLatestChangeSet();
expect(changeSet2.ChangeSetId).toEqual(changeSet1.ChangeSetId);

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

// Deploy the stack again with tags, expected to create a new changeset
// even though the resources didn't change.
Expand Down
6 changes: 4 additions & 2 deletions packages/aws-cdk/test/integ/helpers/cdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,11 @@ export async function installNpmPackages(fixture: TestFixture, packages: Record<
const installNpm7 = memoize0(async (): Promise<string> => {
const installDir = path.join(os.tmpdir(), 'cdk-integ-npm7');
await shell(['rm', '-rf', installDir]);
await shell(['mkdir', '-p', `${installDir}/node_modules`]);
await shell(['mkdir', '-p', installDir]);

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

return path.join(installDir, 'node_modules', '.bin', 'npm');
});
Expand Down