Skip to content

Commit

Permalink
Merge branch 'main' into conroy/requireapproval
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizencc authored Feb 28, 2025
2 parents deb751c + b6faaba commit d756eaf
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/notices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export abstract class NoticesFilter {
// component can match more than one actual component
for (const ands of ors) {
const matched = ands.map(affected => actualComponents.filter(actual =>
NoticesFilter.componentNameMatches(affected, actual) && semver.satisfies(actual.version, affected.version)));
NoticesFilter.componentNameMatches(affected, actual) && semver.satisfies(actual.version, affected.version, { includePrerelease: true })));

// For every clause in the filter we matched one or more components
if (matched.every(xs => xs.length > 0)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"version": "tree-0.1",
"tree": {
"id": "App",
"path": "",
"children": {
"integ-idp": {
"id": "integ-idp",
"path": "integ-idp",
"children": {
"identitypool": {
"id": "identitypool",
"path": "integ-idp/identitypool",
"constructInfo": {
"fqn": "@aws-cdk/aws-cognito-identitypool-alpha.IdentityPool",
"version": "2.175.0-alpha.0",
"metadata": ["*", "*"]
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/integ-tests-alpha.IntegTest",
"version": "0.0.0"
}
},
"Tree": {
"id": "Tree",
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.4.2"
}
}
},
"constructInfo": {
"fqn": "aws-cdk-lib.App",
"version": "0.0.0"
}
}
}
21 changes: 21 additions & 0 deletions packages/aws-cdk/test/notices.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,19 @@ const NOTICE_FOR_APIGATEWAYV2 = {
schemaVersion: '1',
};

const NOTICES_FOR_IDENTITY_POOL = {
title: 'Regression on module foobar',
issueNumber: 1234,
overview: 'Some bug description',
components: [
{
name: "@aws-cdk/aws-cognito-identitypool-alpha.IdentityPool",
version: ">=2.74.0-alpha.0 <2.179.0-alpha.0"
}
],
schemaVersion: '1',
}

const NOTICE_FOR_APIGATEWAY = {
title: 'Regression on module foobar',
issueNumber: 1234,
Expand Down Expand Up @@ -247,6 +260,14 @@ describe(NoticesFilter, () => {
expect(NoticesFilter.filter({ data: [NOTICE_FOR_APIGATEWAYV2_CFN_STAGE], cliVersion, bootstrappedEnvironments: [], outDir: path.join(__dirname, 'cloud-assembly-trees', 'experimental-module') }).map(f => f.notice)).toEqual([NOTICE_FOR_APIGATEWAYV2_CFN_STAGE]);
});

test('module with pre-release version', () => {
// doesn't matter for this test because our data only has framework notices
const cliVersion = '1.0.0';

// module-level match
expect(NoticesFilter.filter({ data: [NOTICES_FOR_IDENTITY_POOL], cliVersion, bootstrappedEnvironments: [], outDir: path.join(__dirname, 'cloud-assembly-trees', 'experimental-module-pre-release-semver')}).map(f => f.notice)).toEqual([NOTICES_FOR_IDENTITY_POOL]);
});

test('bootstrap', () => {
// doesn't matter for this test because our data only has bootstrap notices
const outDir = path.join(__dirname, 'cloud-assembly-trees', 'built-with-2_12_0');
Expand Down

0 comments on commit d756eaf

Please sign in to comment.