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(release): 2.165.0 #31966

Merged
merged 62 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
9572a62
adding imports for first draft
shikha372 Oct 10, 2024
52c087c
feat(VpcV2): adding imports for first draft
shikha372 Oct 10, 2024
4910b6f
fix issue of subnet ip check with ipam range
shikha372 Oct 15, 2024
34fdfb3
fix unit tests
shikha372 Oct 15, 2024
e1b038c
adding unit test for defining imports
shikha372 Oct 16, 2024
00eebb9
fix nits
shikha372 Oct 16, 2024
13d1458
adding arn field to populate account and region
shikha372 Oct 18, 2024
6ec70f6
addressing comments
shikha372 Oct 24, 2024
6136d9e
chore(scheduler-alpha): unit test schedule with Lambda version as tar…
samson-keung Oct 24, 2024
886283e
chore(scheduler-alpha): unit test schedule with Lambda alias as targe…
samson-keung Oct 24, 2024
4f29c1d
fix: enable node-fips compatible body checksums for S3 (#31883)
mrgrain Oct 24, 2024
b32f0d2
Merge branch 'main' into merge-back/2.164.0
mrgrain Oct 24, 2024
732f458
chore(scheduler-alpha): make LambdaInvoke prop optional (#31887)
samson-keung Oct 24, 2024
40ed730
Merge branch 'main' into merge-back/2.164.0
mergify[bot] Oct 24, 2024
fc73a4b
chore(merge-back): 2.164.0 (#31892)
mergify[bot] Oct 24, 2024
d7ad66d
chore(mergify): clean up core aliases (#31891)
kaizencc Oct 24, 2024
fc30425
chore: npm-check-updates && yarn upgrade (#31698)
aws-cdk-automation Oct 24, 2024
09256db
chore(ec2): add missing interface VPC endpoints (#31882)
badmintoncryer Oct 24, 2024
40f07ae
feat(redshift-alpha): query execution timeout setting during table cr…
badmintoncryer Oct 25, 2024
84d71a4
chore(rds): deprecate aurora mysql version 1 for mysql 5.6 (#31551)
go-to-k Oct 25, 2024
9bf7e24
chore(cli): integ tests don't buffer shell output (#31903)
rix0rrr Oct 25, 2024
7c47a49
add account and region in place of arn
shikha372 Oct 25, 2024
a1eef1d
chore(ec2): add missing interface VPC endpoint (#31907)
Leo10Gama Oct 25, 2024
e42cc02
Merge branch 'main' into merge-back/2.164.1
mrgrain Oct 25, 2024
e0615fe
chore(merge-back): 2.164.1 (#31910)
mergify[bot] Oct 25, 2024
cb3ecfe
fix(cli): garbage collection ignores review_in_progress stacks (#31906)
kaizencc Oct 25, 2024
da85e54
feat(cli): garbage collect ecr assets (under --unstable flag) (#31841)
kaizencc Oct 26, 2024
326624b
chore(deps): bump urllib3 from 1.26.18 to 1.26.19 in /packages/@aws-c…
dependabot[bot] Oct 26, 2024
5c6cc5e
chore(ec2): pricing api interface vpc endpoint duplicated (#31912)
mazyu36 Oct 26, 2024
8c93291
feat: update L1 CloudFormation resource definitions (#31917)
aws-cdk-automation Oct 28, 2024
046f041
feat(location): support Tracker and TrackerConsumer (#31268)
mazyu36 Oct 28, 2024
8c15b5f
feat(codebuild): add support of organization webhook in github source…
dviryamin Oct 28, 2024
186b8ab
fix(scheduler-alpha): scheduler input always get transformed to strin…
samson-keung Oct 28, 2024
a9d3b02
fix(sqs): queue with `fifo: false` does not deploy (#31922)
rix0rrr Oct 28, 2024
04d02f4
Merge branch 'main' into vpcv2_imports
moelasmar Oct 28, 2024
06678a3
fix(scheduler-alpha): too many KMS permissions granted (#31923)
samson-keung Oct 28, 2024
f80fefa
Merge branch 'main' into vpcv2_imports
mergify[bot] Oct 28, 2024
d108a80
feat(ec2-alpha): adding imports for SubnetV2 and VpcV2(WIP) (#31765)
mergify[bot] Oct 29, 2024
a279b98
chore: add Amplify integration tests (#31921)
rix0rrr Oct 29, 2024
ccab485
fix(s3-assets): cannot publish a file without extension (#30597)
sakurai-ryo Oct 29, 2024
e1cd1d4
chore(cli): add image to gc docs and document race condition (#31925)
kaizencc Oct 29, 2024
46e51f5
chore(cdk): increase coverage limits (#31936)
mrgrain Oct 29, 2024
a261c9d
fix(assertions): throw error or warn when `synth` is called multiple …
sumupitchayan Oct 29, 2024
33a4a5d
chore(tools): update README for spec2cdk with an example (#31935)
iph Oct 30, 2024
8e4c247
feat(cdk): update tsconfig to more modern settings in typescript init…
ren-yamanashi Oct 30, 2024
157c37d
chore: make the Amplify integration tests respect AWS region assignme…
rix0rrr Oct 30, 2024
bc67866
fix(location): remove base class from PlaceIndex class (#31287)
mazyu36 Oct 30, 2024
dae415e
chore(scheduler-alpha): minor doc updates (#31939)
samson-keung Oct 30, 2024
3818234
chore: fix C# build (#31946)
rix0rrr Oct 30, 2024
579041e
feat(bootstrap): delete noncurrent versions after 30 days (#31949)
kaizencc Oct 30, 2024
048e753
feat(apprunner): support vpc ingress connection (#30623)
mazyu36 Oct 30, 2024
a5fdf57
feat(pipes-targets): add SageMaker (#30696)
msambol Oct 30, 2024
a235a9f
fix(cli): ecr garbage collection hangs when repository has no images …
kaizencc Oct 30, 2024
3b28c50
chore(kinesisfirehose-alpha): set module and destinations module to d…
paulhcsun Oct 30, 2024
6f106c7
revert: feat(cdk): update tsconfig to more modern settings in typescr…
xazhao Oct 31, 2024
077262f
chore: automatically age out old TypeScript versions from testing (#3…
rix0rrr Oct 31, 2024
b800da8
feat(bootstrap): add lifecycle rule to abort multipart uploads after …
sumupitchayan Oct 31, 2024
408b20f
feat(cognito): support UserPoolGroup (#31351)
mazyu36 Oct 31, 2024
09052c2
feat(pipes-enrichments): support API Gateway enrichment (#31794)
mazyu36 Oct 31, 2024
59b3562
chore(release): 2.165.0
Oct 31, 2024
e33dd31
chore: update CHANGELOG.v2.alpha.md
moelasmar Oct 31, 2024
b3600f0
chore: update CHANGELOG.v2.md
moelasmar Oct 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/github-merit-badger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
badges: '[beginning-contributor,repeat-contributor,valued-contributor,admired-contributor,star-contributor,distinguished-contributor]'
thresholds: '[0,3,6,13,25,50]'
badge-type: 'achievement'
ignore-usernames: '[rix0rrr,iliapolo,otaviomacedo,kaizencc,comcalvi,TheRealAmazonKendra,vinayak-kukreja,mrgrain,pahud,cgarvis,kellertk,ashishdhingra,HBobertz,sumupitchayan,SankyRed,udaypant,colifran,khushail,scanlonp,mikewrighton,moelasmar,paulhcsun,awsmjs,evgenyka,GavinZZ,aaythapa,xazhao,ConnorRobertson,ssenchenko,gracelu0,jfuss,SimonCMoore,shikha372,kirtishrinkhala,godwingrs22,bergjaak,IanKonlog,Leo10Gama,samson-keung,scorbiere,michelle-wangg,jiayiwang7,1kaileychen,aws-cdk-automation,dependabot[bot],mergify[bot]]'
ignore-usernames: '[rix0rrr,iliapolo,otaviomacedo,kaizencc,comcalvi,TheRealAmazonKendra,mrgrain,pahud,kellertk,ashishdhingra,HBobertz,sumupitchayan,colifran,khushail,moelasmar,paulhcsun,GavinZZ,aaythapa,xazhao,gracelu0,jfuss,shikha372,kirtishrinkhala,godwingrs22,bergjaak,IanKonlog,Leo10Gama,samson-keung,scorbiere,michelle-wangg,jiayiwang7,1kaileychen,aws-cdk-automation,dependabot[bot],mergify[bot]]'
2 changes: 1 addition & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pull_request_rules:
label:
add: [ contribution/core ]
conditions:
- author~=^(rix0rrr|iliapolo|otaviomacedo|kaizencc|comcalvi|TheRealAmazonKendra|vinayak-kukreja|mrgrain|pahud|ashishdhingra|cgarvis|kellertk|HBobertz|sumupitchayan|SankyRed|udaypant|colifran|scanlonp|mikewrighton|moelasmar|paulhcsun|awsmjs|evgenyka|GavinZZ|aaythapa|xazhao|ConnorRobertson|ssenchenko|gracelu0|jfuss|SimonCMoore|shikha372|kirtishrinkhala|godwingrs22|bergjaak|samson-keung|IanKonlog|Leo10Gama|scorbiere|michelle-wangg|jiayiwang7|1kaileychen)$
- author~=^(rix0rrr|iliapolo|otaviomacedo|kaizencc|comcalvi|TheRealAmazonKendra|mrgrain|pahud|ashishdhingra|kellertk|HBobertz|sumupitchayan|colifran|moelasmar|paulhcsun|GavinZZ|aaythapa|xazhao|gracelu0|jfuss|shikha372|kirtishrinkhala|godwingrs22|bergjaak|samson-keung|IanKonlog|Leo10Gama|scorbiere|michelle-wangg|jiayiwang7|1kaileychen)$
- -label~="contribution/core"
- name: automatic merge
actions:
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,29 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.165.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.164.1-alpha.0...v2.165.0-alpha.0) (2024-10-31)


### ⚠ BREAKING CHANGES TO EXPERIMENTAL FEATURES

* **ec2-alpha:** The new `VpcCidrBlock` L2 construct replaces `CfnVPCCidrBlock`. This change alters the logical ID of `AWS::EC2::VPCCidrBlock` resources in CloudFormation templates. Existing deployments will see errors like `CIDR range conflicts with x.xx.xx.xx/xx with association ID vpc-cidr-assoc-ABCD`. To resolve this, you must recreate your existing stacks to use the new module.

### Features

* **apprunner:** support vpc ingress connection ([#30623](https://github.com/aws/aws-cdk/issues/30623)) ([048e753](https://github.com/aws/aws-cdk/commit/048e7538dd71d69c2add28ff454b6d9c69b4f256)), closes [#22850](https://github.com/aws/aws-cdk/issues/22850)
* **ec2-alpha:** adding imports for SubnetV2 and VpcV2(WIP) ([#31765](https://github.com/aws/aws-cdk/issues/31765)) ([d108a80](https://github.com/aws/aws-cdk/commit/d108a8003e463301acea15076501cd815b0eda4a))
* **location:** support Tracker and TrackerConsumer ([#31268](https://github.com/aws/aws-cdk/issues/31268)) ([046f041](https://github.com/aws/aws-cdk/commit/046f0418a3de08a59c940a7a3d93148cb5f0659b)), closes [#30712](https://github.com/aws/aws-cdk/issues/30712)
* **pipes-enrichments:** support API Gateway enrichment ([#31794](https://github.com/aws/aws-cdk/issues/31794)) ([09052c2](https://github.com/aws/aws-cdk/commit/09052c2060c410028896fd54e76a857b2141c8a4)), closes [#29384](https://github.com/aws/aws-cdk/issues/29384)
* **pipes-targets:** add SageMaker ([#30696](https://github.com/aws/aws-cdk/issues/30696)) ([a5fdf57](https://github.com/aws/aws-cdk/commit/a5fdf570beb1456b1307276f56d90fd1ba0b46d8))
* **redshift-alpha:** query execution timeout setting during table creation ([#31818](https://github.com/aws/aws-cdk/issues/31818)) ([40f07ae](https://github.com/aws/aws-cdk/commit/40f07ae330d074cfa7861e24a0427da7ec427f68)), closes [#31329](https://github.com/aws/aws-cdk/issues/31329) [/github.com/aws/aws-cdk/issues/31329#issuecomment-2353613773](https://github.com/aws//github.com/aws/aws-cdk/issues/31329/issues/issuecomment-2353613773)


### Bug Fixes

* **location:** remove base class from PlaceIndex class ([#31287](https://github.com/aws/aws-cdk/issues/31287)) ([bc67866](https://github.com/aws/aws-cdk/commit/bc67866f579c401556d427eb150bcd118d69bd17)), closes [#30711](https://github.com/aws/aws-cdk/issues/30711) [#30682](https://github.com/aws/aws-cdk/issues/30682) [/github.com/aws/aws-cdk/pull/30711#discussion_r1734937879](https://github.com/aws//github.com/aws/aws-cdk/pull/30711/issues/discussion_r1734937879)
* **scheduler-alpha:** scheduler input always get transformed to string with extra double quotes ([#31894](https://github.com/aws/aws-cdk/issues/31894)) ([186b8ab](https://github.com/aws/aws-cdk/commit/186b8abfab8452b31cba13b56998242f63c43159))
* **scheduler-alpha:** too many KMS permissions granted ([#31923](https://github.com/aws/aws-cdk/issues/31923)) ([06678a3](https://github.com/aws/aws-cdk/commit/06678a39e029582af14c8b021f946b9ce9cac9be)), closes [#31785](https://github.com/aws/aws-cdk/issues/31785)

## [2.164.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.164.0-alpha.0...v2.164.1-alpha.0) (2024-10-25)

## [2.164.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.163.1-alpha.0...v2.164.0-alpha.0) (2024-10-24)
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.165.0](https://github.com/aws/aws-cdk/compare/v2.164.1...v2.165.0) (2024-10-31)


### Features

* **bootstrap:** add lifecycle rule to abort multipart uploads after 7 days ([#31956](https://github.com/aws/aws-cdk/issues/31956)) ([b800da8](https://github.com/aws/aws-cdk/commit/b800da8172919a1ab27f885549e701d98323c9bb)), closes [#29045](https://github.com/aws/aws-cdk/issues/29045)
* **bootstrap:** delete noncurrent versions after 30 days ([#31949](https://github.com/aws/aws-cdk/issues/31949)) ([579041e](https://github.com/aws/aws-cdk/commit/579041e5d41e780ce1f6fb9f778c353868fb6938))
* **cdk:** update tsconfig to more modern settings in typescript init templates ([#31927](https://github.com/aws/aws-cdk/issues/31927)) ([8e4c247](https://github.com/aws/aws-cdk/commit/8e4c2473d9ac14bb26507a9aab1b1b62215d4c51))
* **cli:** garbage collect ecr assets (under --unstable flag) ([#31841](https://github.com/aws/aws-cdk/issues/31841)) ([da85e54](https://github.com/aws/aws-cdk/commit/da85e54d7d3dfb4e33942f58564e91039e7d22ff)), closes [#31611](https://github.com/aws/aws-cdk/issues/31611)
* **codebuild:** add support of organization webhook in github source ([#31740](https://github.com/aws/aws-cdk/issues/31740)) ([8c15b5f](https://github.com/aws/aws-cdk/commit/8c15b5f19a0c289fd0dad8c35b6734232d957836)), closes [#31736](https://github.com/aws/aws-cdk/issues/31736)
* **cognito:** support UserPoolGroup ([#31351](https://github.com/aws/aws-cdk/issues/31351)) ([408b20f](https://github.com/aws/aws-cdk/commit/408b20f92122069a04ff5776b4783ae220d04a56)), closes [#21026](https://github.com/aws/aws-cdk/issues/21026)
* update L1 CloudFormation resource definitions ([#31917](https://github.com/aws/aws-cdk/issues/31917)) ([8c93291](https://github.com/aws/aws-cdk/commit/8c93291f789b441397bc5a64308816e89f682199))
* **VpcV2:** adding imports for first draft ([52c087c](https://github.com/aws/aws-cdk/commit/52c087c9fe36c040c8aea62ad2fc016256b3ca6c))


### Bug Fixes

* **assertions:** throw error or warn when `synth` is called multiple times on mutated construct tree ([#31865](https://github.com/aws/aws-cdk/issues/31865)) ([a261c9d](https://github.com/aws/aws-cdk/commit/a261c9d8a316ec389f19c873122691d48c5ca16d)), closes [#24689](https://github.com/aws/aws-cdk/issues/24689)
* **cli:** ecr garbage collection hangs when repository has no images ([#31951](https://github.com/aws/aws-cdk/issues/31951)) ([a235a9f](https://github.com/aws/aws-cdk/commit/a235a9fad29bf0da141b27ca391861fa613f42b8))
* **cli:** garbage collection ignores review_in_progress stacks ([#31906](https://github.com/aws/aws-cdk/issues/31906)) ([cb3ecfe](https://github.com/aws/aws-cdk/commit/cb3ecfe8f255e626db3706632c9590c86c28bea5))
* **s3-assets:** cannot publish a file without extension ([#30597](https://github.com/aws/aws-cdk/issues/30597)) ([ccab485](https://github.com/aws/aws-cdk/commit/ccab485b87a7090ddf0773508d7b8ee84ff654b0)), closes [#30471](https://github.com/aws/aws-cdk/issues/30471) [/github.com/aws/aws-cdk/blob/c826d8faaeb310623eb9a1a1c82930b679768007/packages/aws-cdk-lib/core/lib/asset-staging.ts#L392](https://github.com/aws//github.com/aws/aws-cdk/blob/c826d8faaeb310623eb9a1a1c82930b679768007/packages/aws-cdk-lib/core/lib/asset-staging.ts/issues/L392) [/github.com/aws/aws-cdk/blob/c826d8faaeb310623eb9a1a1c82930b679768007/packages/aws-cdk-lib/core/lib/asset-staging.ts#L383](https://github.com/aws//github.com/aws/aws-cdk/blob/c826d8faaeb310623eb9a1a1c82930b679768007/packages/aws-cdk-lib/core/lib/asset-staging.ts/issues/L383)
* **sqs:** queue with `fifo: false` does not deploy ([#31922](https://github.com/aws/aws-cdk/issues/31922)) ([a9d3b02](https://github.com/aws/aws-cdk/commit/a9d3b02783104fe862a3e863e8c89af845b49c8c)), closes [#8550](https://github.com/aws/aws-cdk/issues/8550)
* enable node-fips compatible body checksums for S3 ([#31883](https://github.com/aws/aws-cdk/issues/31883)) ([4f29c1d](https://github.com/aws/aws-cdk/commit/4f29c1d04533b68535c1a5706855066d1d1ea577))


### Reverts

* feat(cdk): update tsconfig to more modern settings in typescript init templates ([#31953](https://github.com/aws/aws-cdk/issues/31953)) ([6f106c7](https://github.com/aws/aws-cdk/commit/6f106c7c042c05f59c9d1f7eb7e048264b394fb1))

## [2.164.1](https://github.com/aws/aws-cdk/compare/v2.164.0...v2.164.1) (2024-10-25)


Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
"build-all": "tsc -b"
},
"devDependencies": {
"@nx/workspace": "^19.7.2",
"@nx/workspace": "^19.8.6",
"@types/node": "18.11.19",
"@types/prettier": "2.6.0",
"@yarnpkg/lockfile": "^1.1.0",
"aws-sdk-js-codemod": "^0.28.2",
"cdk-generate-synthetic-examples": "^0.2.14",
"cdk-generate-synthetic-examples": "^0.2.17",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.11",
"jest-junit": "^13.2.0",
"jsii-diff": "1.103.1",
"jsii-pacmak": "1.103.1",
"jsii-reflect": "1.103.1",
"jsii-diff": "1.104.0",
"jsii-pacmak": "1.104.0",
"jsii-reflect": "1.104.0",
"lerna": "^8.1.8",
"nx": "^19.7.2",
"nx": "^19.8.6",
"patch-package": "^6.5.1",
"semver": "^7.6.3",
"standard-version": "^9.5.0",
Expand Down
30 changes: 29 additions & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,32 @@ export function typescriptVersionsSync(): string[] {

const versions: string[] = JSON.parse(stdout);
return Array.from(new Set(versions.map(v => v.split('.').slice(0, 2).join('.'))));
}
}

/**
* Use NPM preinstalled on the machine to query publish times of versions
*/
export function typescriptVersionsYoungerThanDaysSync(days: number, versions: string[]): string[] {
const { stdout } = spawnSync('npm', ['--silent', 'view', 'typescript', 'time', '--json'], { encoding: 'utf-8' });
const versionTsMap: Record<string, string> = JSON.parse(stdout);

const cutoffDate = new Date(Date.now() - (days * 24 * 3600 * 1000));
const cutoffDateS = cutoffDate.toISOString();

const recentVersions = Object.entries(versionTsMap)
.filter(([_, dateS]) => dateS > cutoffDateS)
.map(([v]) => v);

// Input versions are of the form 3.9, 5.2, etc.
// Actual versions are of the form `3.9.15`, `5.3.0-dev.20511311`.
// Return only 2-digit versions for which there is a non-prerelease version in the set of recentVersions
// So a 2-digit versions that is followed by `.<digits>` until the end of the string.
return versions.filter((twoV) => {
const re = new RegExp(`^${reQuote(twoV)}\\.\\d+$`);
return recentVersions.some(fullV => fullV.match(re));
});
}

function reQuote(str: string): string {
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export class ReleasePackageSource implements IPackageSource {
return this.version.split('.')[0] as string;
}

public requestedCliVersion() {
return this.version;
}

public requestedFrameworkVersion() {
return process.env.FRAMEWORK_VERSION!;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export class RepoPackageSource implements IPackageSource {
return releaseJson.majorVersion;
}

public requestedCliVersion(): string {
return '*';
}

public requestedFrameworkVersion(): string {
return '*';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export interface IPackageSource {

initializeDotnetPackages(targetDir: string): Promise<void>;

/**
* CLI version
*/
requestedCliVersion(): string;

/**
* Framework version if it's different than the CLI version
*
Expand Down
42 changes: 21 additions & 21 deletions packages/@aws-cdk-testing/cli-integ/lib/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,19 @@ export async function shell(command: string[], options: ShellOptions = {}): Prom
throw new Error('Use either env or modEnv but not both');
}

const outputs = new Set(options.outputs);
const writeToOutputs = (x: string) => {
for (const outputStream of outputs) {
outputStream.write(x);
}
};

// Always output the command
(options.output ?? process.stdout).write(`💻 ${command.join(' ')}\n`);

let output: NodeJS.WritableStream | undefined = options.output ?? process.stdout;
switch (options.show ?? 'always') {
case 'always':
break;
case 'never':
case 'error':
output = undefined;
break;
}
writeToOutputs(`💻 ${command.join(' ')}\n`);
const show = options.show ?? 'always';

if (process.env.VERBOSE) {
output = process.stdout;
outputs.add(process.stdout);
}

const env = options.env ?? (options.modEnv ? { ...process.env, ...options.modEnv } : process.env);
Expand All @@ -46,12 +44,16 @@ export async function shell(command: string[], options: ShellOptions = {}): Prom
const stderr = new Array<Buffer>();

child.stdout!.on('data', chunk => {
output?.write(chunk);
if (show === 'always') {
writeToOutputs(chunk);
}
stdout.push(chunk);
});

child.stderr!.on('data', chunk => {
output?.write(chunk);
if (show === 'always') {
writeToOutputs(chunk);
}
if (options.captureStderr ?? true) {
stderr.push(chunk);
}
Expand All @@ -66,8 +68,8 @@ export async function shell(command: string[], options: ShellOptions = {}): Prom
if (code === 0 || options.allowErrExit) {
resolve(out);
} else {
if (options.show === 'error') {
(options.output ?? process.stdout).write(out + '\n');
if (show === 'error') {
writeToOutputs(`${out}\n`);
}
reject(new Error(`'${command.join(' ')}' exited with error code ${code}.`));
}
Expand Down Expand Up @@ -97,10 +99,8 @@ export interface ShellOptions extends child_process.SpawnOptions {

/**
* Pass output here
*
* @default stdout unless quiet=true
*/
readonly output?: NodeJS.WritableStream;
readonly outputs?: NodeJS.WritableStream[];

/**
* Only return stderr. For example, this is used to validate
Expand All @@ -127,9 +127,9 @@ export class ShellHelper {
private readonly _cwd: string,
private readonly _output: NodeJS.WritableStream) { }

public async shell(command: string[], options: Omit<ShellOptions, 'cwd' | 'output'> = {}): Promise<string> {
public async shell(command: string[], options: Omit<ShellOptions, 'cwd' | 'outputs'> = {}): Promise<string> {
return shell(command, {
output: this._output,
outputs: [this._output],
cwd: this._cwd,
...options,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/staging/maven.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function uploadJavaPackages(packages: string[], login: LoginInforma
`-Dfile=${pkg.replace(/.pom$/, '.jar')}`,
...await pathExists(sourcesFile) ? [`-Dsources=${sourcesFile}`] : [],
...await pathExists(javadocFile) ? [`-Djavadoc=${javadocFile}`] : []], {
output,
outputs: [output],
modEnv: {
// Do not try to JIT the Maven binary
MAVEN_OPTS: `${NO_JIT} ${process.env.MAVEN_OPTS ?? ''}`.trim(),
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/staging/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function uploadNpmPackages(packages: string[], login: LoginInformat
await shell(['node', require.resolve('npm'), 'publish', path.resolve(pkg)], {
modEnv: npmEnv(usageDir, login),
show: 'error',
output,
outputs: [output],
});

console.log(`✅ ${pkg}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/staging/nuget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export async function uploadDotnetPackages(packages: string[], usageDir: UsageDi
'--disable-buffering',
'--timeout', '600',
'--skip-duplicate'], {
output,
outputs: [output],
});

console.log(`✅ ${pkg}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/lib/staging/pypi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function uploadPythonPackages(packages: string[], login: LoginInfor
TWINE_REPOSITORY_URL: login.pypiEndpoint,
},
show: 'error',
output,
outputs: [output],
});

console.log(`✅ ${pkg}`);
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk-testing/cli-integ/lib/with-aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export type AwsContext = { readonly aws: AwsClients };
*
* Allocate the next region from the REGION pool and dispose it afterwards.
*/
export function withAws(
block: (context: TestContext & AwsContext & DisableBootstrapContext) => Promise<void>,
export function withAws<A extends TestContext>(
block: (context: A & AwsContext & DisableBootstrapContext) => Promise<void>,
disableBootstrap: boolean = false,
): (context: TestContext) => Promise<void> {
return (context: TestContext) => regionPool().using(async (region) => {
): (context: A) => Promise<void> {
return (context: A) => regionPool().using(async (region) => {
const aws = await AwsClients.forRegion(region, context.output);
await sanityCheck(aws);

Expand Down
20 changes: 16 additions & 4 deletions packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable no-console */
import * as assert from 'assert';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
Expand Down Expand Up @@ -242,9 +243,9 @@ export interface CdkCliOptions extends ShellOptions {
* Prepare a target dir byreplicating a source directory
*/
export async function cloneDirectory(source: string, target: string, output?: NodeJS.WritableStream) {
await shell(['rm', '-rf', target], { output });
await shell(['mkdir', '-p', target], { output });
await shell(['cp', '-R', source + '/*', target], { output });
await shell(['rm', '-rf', target], { outputs: output ? [output] : [] });
await shell(['mkdir', '-p', target], { outputs: output ? [output] : [] });
await shell(['cp', '-R', source + '/*', target], { outputs: output ? [output] : [] });
}

interface CommonCdkBootstrapCommandOptions {
Expand Down Expand Up @@ -544,6 +545,17 @@ export class TestFixture extends ShellHelper {
return JSON.parse(fs.readFileSync(templatePath, { encoding: 'utf-8' }).toString());
}

public async bootstrapRepoName(): Promise<string> {
await ensureBootstrapped(this);

const response = await this.aws.cloudFormation.send(new DescribeStacksCommand({}));

const stack = (response.Stacks ?? [])
.filter((s) => s.StackName && s.StackName == this.bootstrapStackName);
assert(stack.length == 1);
return outputFromStack('ImageRepositoryName', stack[0]) ?? '';
}

public get bootstrapStackName() {
return this.fullStackName('bootstrap-stack');
}
Expand All @@ -569,7 +581,7 @@ export class TestFixture extends ShellHelper {
}

/**
* Cleanup leftover stacks and buckets
* Cleanup leftover stacks and bootstrapped resources
*/
public async dispose(success: boolean) {
const stacksToDelete = await this.deleteableStacks(this.stackNamePrefix);
Expand Down
Loading
Loading