Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
feat(cloud-assembly-schema): add feature flag report as a possible ar…
…tifact
  • Loading branch information
rix0rrr committed Jun 10, 2025
commit a4789d2e7f060d6a744600afc6dd5650d80c3f0f
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,62 @@ export interface NestedCloudAssemblyProperties {
readonly displayName?: string;
}

/**
* Artifact properties for a feature flag report
*
* A feature flag report is small enough that all the properties can be inlined
* here, and doesn't need an additional file.
*/
export interface FeatureFlagReportProperties {
/**
* The library that this feature flag report applies to.
*/
readonly libraryName: string;
Copy link
Contributor

@mrgrain mrgrain Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure I like this name. we could use jsii terminology module or something more generic like source


/**
* Information about every feature flag supported by this library.
*/
readonly flags: Record<string, FeatureFlag>;
}

/**
* A single feature flag
*/
export interface FeatureFlag {
/**
* The library-recommended value for this flag, if any
*
* It is possible that there is no recommended value.
*
* @default - No recommended value.
*/
readonly recommendedValue?: any;

/**
* The value configured by the user
*
* This is the value configured at the root of the tree. Users may also have
* configured values at specific locations in the tree; we don't report on
* those.
*
* @default - Not configured by the user
*/
readonly userValue?: any;

/**
* Explanation about the purpose of this flag that can be shown to the user.
*
* @default - No description
*/
readonly explanation?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this not going to be quite a lot of text?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering the same thing, but then I came down on, it's probably going to be ~1kB per flag. It's not going to break the bank in terms of file size.

}

/**
* Properties for manifest artifacts
*/
export type ArtifactProperties =
| AwsCloudFormationStackProperties
| AssetManifestProperties
| TreeArtifactProperties
| NestedCloudAssemblyProperties;
| NestedCloudAssemblyProperties
| FeatureFlagReportProperties;
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export enum ArtifactType {
* Nested Cloud Assembly
*/
NESTED_CLOUD_ASSEMBLY = 'cdk:cloud-assembly',

/**
* Feature flag report
*/
FEATURE_FLAG_REPORT = 'cdk:feature-flag-report',
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
},
{
"$ref": "#/definitions/NestedCloudAssemblyProperties"
},
{
"$ref": "#/definitions/FeatureFlagReportProperties"
}
]
},
Expand All @@ -99,7 +102,8 @@
"aws:cloudformation:stack",
"cdk:tree",
"cdk:asset-manifest",
"cdk:cloud-assembly"
"cdk:cloud-assembly",
"cdk:feature-flag-report"
]
},
"MetadataEntry": {
Expand Down Expand Up @@ -492,6 +496,27 @@
"directoryName"
]
},
"FeatureFlagReportProperties": {
"description": "Artifact properties for a feature flag report\n\nA feature flag report is small enough that all the properties can be inlined\nhere, and doesn't need an additional file.",
"type": "object",
"properties": {
"libraryName": {
"description": "The library that this feature flag report applies to.",
"type": "string"
},
"flags": {
"$ref": "#/definitions/Record<string,FeatureFlag>",
"description": "Information about every feature flag supported by this library."
}
},
"required": [
"flags",
"libraryName"
]
},
"Record<string,FeatureFlag>": {
"type": "object"
},
"MissingContext": {
"description": "Represents a missing piece of context.",
"type": "object",
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/cloud-assembly-schema/schema/version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"schemaHash": "5dcc6511e8b96c378ad35c391cdc2dcbaa52d08a8015760692eaad73efc9a949",
"schemaHash": "2d1072dd1745d5fe5fd41ea719ba135791783f186390c14eb8ff23c7e88a945d",
"revision": 44
}
}
Loading