Skip to content

Commit

Permalink
Merge branch 'main' into 28371
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Jan 10, 2024
2 parents c37634b + 783f610 commit 93c8c07
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 19 deletions.
10 changes: 10 additions & 0 deletions packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,16 @@ This product includes software developed at
Amazon Web Services, Inc. (http://aws.amazon.com/).


----------------

** aws-sdk@2.1532.0 - https://www.npmjs.com/package/aws-sdk/v/2.1532.0 | Apache-2.0
AWS SDK for JavaScript
Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.

This product includes software developed at
Amazon Web Services, Inc. (http://aws.amazon.com/).


----------------

** balanced-match@1.0.2 - https://www.npmjs.com/package/balanced-match/v/1.0.2 | MIT
Expand Down
1 change: 1 addition & 0 deletions packages/aws-cdk-lib/aws-codebuild/lib/compute-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export enum ComputeType {
SMALL = 'BUILD_GENERAL1_SMALL',
MEDIUM = 'BUILD_GENERAL1_MEDIUM',
LARGE = 'BUILD_GENERAL1_LARGE',
X_LARGE = 'BUILD_GENERAL1_XLARGE',
X2_LARGE = 'BUILD_GENERAL1_2XLARGE',
LAMBDA_1GB = 'BUILD_LAMBDA_1GB',
LAMBDA_2GB = 'BUILD_LAMBDA_2GB',
Expand Down
3 changes: 2 additions & 1 deletion packages/aws-cdk-lib/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2117,7 +2117,8 @@ export class WindowsBuildImage implements IBuildImage {
errors.push('Windows images do not support Lambda compute types');
}

if (buildEnvironment.computeType === ComputeType.SMALL || buildEnvironment.computeType === ComputeType.X2_LARGE) {
const unsupportedComputeTypes = [ComputeType.SMALL, ComputeType.X_LARGE, ComputeType.X2_LARGE];
if (buildEnvironment.computeType !== undefined && unsupportedComputeTypes.includes(buildEnvironment.computeType)) {
errors.push(`Windows images do not support the '${buildEnvironment.computeType}' compute type`);
}
return errors;
Expand Down
18 changes: 18 additions & 0 deletions packages/aws-cdk-lib/aws-codebuild/test/codebuild.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,24 @@ test('using ComputeType.Small with a Windows image fails validation', () => {
}).toThrow(/Windows images do not support the 'BUILD_GENERAL1_SMALL' compute type/);
});

test('using ComputeType.XLarge with a Windows image fails validation', () => {
const stack = new cdk.Stack();
const invalidEnvironment: codebuild.BuildEnvironment = {
buildImage: codebuild.WindowsBuildImage.WIN_SERVER_CORE_2019_BASE,
computeType: codebuild.ComputeType.X_LARGE,
};

expect(() => {
new codebuild.Project(stack, 'MyProject', {
source: codebuild.Source.s3({
bucket: new s3.Bucket(stack, 'MyBucket'),
path: 'path',
}),
environment: invalidEnvironment,
});
}).toThrow(/Windows images do not support the 'BUILD_GENERAL1_XLARGE' compute type/);
});

test('using ComputeType.X2Large with a Windows image fails validation', () => {
const stack = new cdk.Stack();
const invalidEnvironment: codebuild.BuildEnvironment = {
Expand Down
10 changes: 10 additions & 0 deletions packages/aws-cdk/THIRD_PARTY_LICENSES
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@ This product includes software developed at
Amazon Web Services, Inc. (http://aws.amazon.com/).


----------------

** aws-sdk@2.1532.0 - https://www.npmjs.com/package/aws-sdk/v/2.1532.0 | Apache-2.0
AWS SDK for JavaScript
Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.

This product includes software developed at
Amazon Web Services, Inc. (http://aws.amazon.com/).


----------------

** balanced-match@1.0.2 - https://www.npmjs.com/package/balanced-match/v/1.0.2 | MIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/node": "20.10.4",
"@types/node": "20.10.7",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"aws-cdk": "%cdk-version%",
Expand All @@ -24,4 +24,4 @@
"constructs": "%constructs-version%",
"source-map-support": "^0.5.21"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/node": "20.10.4",
"@types/node": "20.10.7",
"aws-cdk-lib": "%cdk-version%",
"constructs": "%constructs-version%",
"jest": "^29.7.0",
Expand All @@ -21,4 +21,4 @@
"aws-cdk-lib": "%cdk-version%",
"constructs": "%constructs-version%"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.11",
"@types/node": "20.10.4",
"@types/node": "20.10.7",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"aws-cdk": "%cdk-version%",
Expand All @@ -23,4 +23,4 @@
"aws-cdk-lib": "%cdk-version%",
"constructs": "%constructs-version%"
}
}
}
6 changes: 3 additions & 3 deletions packages/aws-cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@
"@types/yargs": "^15.0.19",
"aws-cdk-lib": "0.0.0",
"aws-sdk-mock": "5.6.0",
"axios": "^1.6.2",
"axios": "^1.6.5",
"constructs": "^10.0.0",
"fast-check": "^3.14.0",
"fast-check": "^3.15.0",
"jest": "^29.7.0",
"jest-mock": "^29.7.0",
"madge": "^5.0.2",
Expand All @@ -102,7 +102,7 @@
"@aws-cdk/region-info": "0.0.0",
"@jsii/check-node": "1.93.0",
"archiver": "^5.3.2",
"aws-sdk": "^2.1517.0",
"aws-sdk": "^2.1532.0",
"camelcase": "^6.3.0",
"cdk-assets": "0.0.0",
"cdk-from-cfn": "^0.113.0",
Expand Down
43 changes: 35 additions & 8 deletions tools/@aws-cdk/prlint/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,50 @@
# prlint

A Github action that checks pull requests around PR titles, description and other metadata.
This package includes a GitHub Action that does the following:
- Checks pull requests around PR titles, description and other metadata.
- Assesses whether or not the PR is ready for review and attaches the correct label to the PR.

# Checks
# Rules

### Mandatory Changes
The first part of the GitHub Action validates whether or not the pull request adheres
(or has been exempted from) to the following rules:

This check validates that the modified files in the PR follow these rules:

1. `feat` requires a change to a `README.md`.
2. `feat` requires a change to a unit test file and integration test files.
3. `fix` requires a change to a unit test file and integration test files.
1. `feat` requires a change to a `README.md` (exemption is the label `pr-linter/exempt-readme`).
2. Both `feat` and `fix` PRs require a change to a unit test file and integration test files (exemption is the label `pr-linter/exempt-unit-test` or `pr-linter/exempt-integ-test`).
4. `BREAKING CHANGE` section is formatted correctly, per the [conventional commits] spec.
5. No breaking changes announced for stable modules.
6. Title prefix and scope is formatted correctly.
7. The PR is not opened from the main branch of the author's fork.
8. Changes to the cli have been run through the test pipeline where cli integ tests are run (indicated by the label `pr-linter/cli-integ-tested`).
9. No manual changes to `packages/aws-cdk-lib/region-info/build-tools/metadata.ts` file.

> These rules are currently hard coded, in the future, we should consider using [danger.js](https://danger.systems/js/).
[conventional commits]: https://www.conventionalcommits.org

# Evaluation and Assigning Labels

The GitHub Action also handles whether or not the PR is ready for review, and by whom.
A PR is ready for review when:

1. It is not a draft
2. It does not have any merge conflicts
3. The PR linter is not failing OR the user has requested an exemption (`pr-linter/exemption-requested`)
4. A maintainer has not requested changes
5. A maintainer has not approved

If the PR is ready for review, we also differentiate whether or not it is ready for a
maintainer review (`pr/needs-maintainer-review`) or if we are soliciting help from our
pool of trusted reviewers (`pr/needs-community-review`).

A PR is prioritized for core team review when:

1. It links to a p1 issue
2. It links to a p2 issue and has an approved community review

Based on the above rules, prlint will apply the correct label `pr/needs-maintainer-review` or `pr/needs-community-review`
to the PR.

# Installation

```console
Expand Down
34 changes: 33 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5839,6 +5839,22 @@ aws-sdk@^2.1231.0, aws-sdk@^2.1517.0, aws-sdk@^2.928.0:
uuid "8.0.0"
xml2js "0.5.0"

aws-sdk@^2.1532.0:
version "2.1532.0"
resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1532.0.tgz#7c78054e53584ce6396406e87d3edfbadb0ffa81"
integrity sha512-4QVQs01LEAxo7UpSHlq/HaO+SJ1WrYF8W1otO2WhKpVRYXkSxXIgZgfYaK+sQ762XTtB6tSuD2ZS2HGsKNXVLw==
dependencies:
buffer "4.9.2"
events "1.1.1"
ieee754 "1.1.13"
jmespath "0.16.0"
querystring "0.2.0"
sax "1.2.1"
url "0.10.3"
util "^0.12.4"
uuid "8.0.0"
xml2js "0.5.0"

axios@^0.27.2:
version "0.27.2"
resolved "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972"
Expand All @@ -5856,6 +5872,15 @@ axios@^1.0.0, axios@^1.6.2:
form-data "^4.0.0"
proxy-from-env "^1.1.0"

axios@^1.6.5:
version "1.6.5"
resolved "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz#2c090da14aeeab3770ad30c3a1461bc970fb0cd8"
integrity sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==
dependencies:
follow-redirects "^1.15.4"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

babel-core@^7.0.0-bridge.0:
version "7.0.0-bridge.0"
resolved "https://registry.npmjs.org/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece"
Expand Down Expand Up @@ -8116,6 +8141,13 @@ fast-check@^3.14.0:
dependencies:
pure-rand "^6.0.0"

fast-check@^3.15.0:
version "3.15.0"
resolved "https://registry.npmjs.org/fast-check/-/fast-check-3.15.0.tgz#3ee501aa82c836efb96d7bc8c68aa7bbc1d79f8e"
integrity sha512-iBz6c+EXL6+nI931x/sbZs1JYTZtLG6Cko0ouS8LRTikhDR7+wZk4TYzdRavlnByBs2G6+nuuJ7NYL9QplNt8Q==
dependencies:
pure-rand "^6.0.0"

fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
version "3.1.3"
resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
Expand Down Expand Up @@ -8319,7 +8351,7 @@ fn.name@1.x.x:
resolved "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz#26cad8017967aea8731bc42961d04a3d5988accc"
integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==

follow-redirects@^1.14.9, follow-redirects@^1.15.0, follow-redirects@^1.15.2:
follow-redirects@^1.14.9, follow-redirects@^1.15.0, follow-redirects@^1.15.2, follow-redirects@^1.15.4:
version "1.15.4"
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf"
integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==
Expand Down

0 comments on commit 93c8c07

Please sign in to comment.