Skip to content

Commit 32ee050

Browse files
committed
fix: "Invalid Assembly Manifest" when used with CLI 2.1017.0 and 2.1018.0 (#34880)
`aws-cdk-lib` 2.203.0 gives an incorrect error message when used with AWS CLI 2.2017.0 and 2.2018.0. The error message should have been: ``` This CDK CLI is not compatible with the CDK library used by your application. Please upgrade the CLI to the latest version. ``` Instead, the error message is: ``` Invalid assembly manifest: instance.artifacts.aws-cdk-lib/feature-flag-report.type is not one of enum values: none,aws:cloudformation:stack,cdk:tree,cdk:asset-manifest,cdk:cloud-assembly ... ``` This reverts the change that introduces that new artifact type: #34798
1 parent 740bb0e commit 32ee050

File tree

5 files changed

+4
-97
lines changed

5 files changed

+4
-97
lines changed

packages/aws-cdk-lib/core/lib/private/feature-flag-report.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.

packages/aws-cdk-lib/core/lib/private/synthesis.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { Stack } from '../stack';
1515
import { ISynthesisSession } from '../stack-synthesizers/types';
1616
import { Stage, StageSynthesisOptions } from '../stage';
1717
import { IPolicyValidationPluginBeta1 } from '../validation';
18-
import { generateFeatureFlagReport } from './feature-flag-report';
1918
import { ConstructTree } from '../validation/private/construct-tree';
2019
import { PolicyValidationReportFormatter, NamedValidationPluginReport } from '../validation/private/report';
2120

@@ -65,8 +64,6 @@ export function synthesize(root: IConstruct, options: SynthesisOptions = { }): c
6564
// stacks to add themselves to the synthesized cloud assembly.
6665
synthesizeTree(root, builder, options.validateOnSynthesis);
6766

68-
generateFeatureFlagReport(builder, root);
69-
7067
const assembly = builder.buildAssembly();
7168

7269
invokeValidationPlugins(root, builder.outdir, assembly);

packages/aws-cdk-lib/core/test/feature-flag-report.test.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

packages/aws-cdk-lib/core/test/stage.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ describe('stage', () => {
252252
const rootAssembly = app.synth();
253253

254254
// THEN
255-
expect(rootAssembly.manifest.artifacts).toMatchObject({
255+
expect(rootAssembly.manifest.artifacts).toEqual({
256256
'assembly-StageLevel1': {
257257
type: 'cdk:cloud-assembly',
258258
properties: {
@@ -263,7 +263,7 @@ describe('stage', () => {
263263
});
264264

265265
const assemblyLevel1 = rootAssembly.getNestedAssembly('assembly-StageLevel1');
266-
expect(assemblyLevel1.manifest.artifacts).toMatchObject({
266+
expect(assemblyLevel1.manifest.artifacts).toEqual({
267267
'assembly-StageLevel1-StageLevel2': {
268268
type: 'cdk:cloud-assembly',
269269
properties: {
@@ -274,7 +274,7 @@ describe('stage', () => {
274274
});
275275

276276
const assemblyLevel2 = assemblyLevel1.getNestedAssembly('assembly-StageLevel1-StageLevel2');
277-
expect(assemblyLevel2.manifest.artifacts).toMatchObject({
277+
expect(assemblyLevel2.manifest.artifacts).toEqual({
278278
'assembly-StageLevel1-StageLevel2-StageLevel3': {
279279
type: 'cdk:cloud-assembly',
280280
properties: {

packages/aws-cdk-lib/core/test/synthesis.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('synthesis', () => {
2424
// THEN
2525
expect(app.synth()).toEqual(session); // same session if we synth() again
2626
expect(list(session.directory)).toEqual(['cdk.out', 'manifest.json', 'tree.json']);
27-
expect(readJson(session.directory, 'manifest.json').artifacts).toMatchObject({
27+
expect(readJson(session.directory, 'manifest.json').artifacts).toEqual({
2828
Tree: {
2929
type: 'cdk:tree',
3030
properties: { file: 'tree.json' },

0 commit comments

Comments
 (0)