Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into cloudfront-allow-move…
Browse files Browse the repository at this point in the history
…-domainname
  • Loading branch information
Tietew committed Mar 26, 2024
2 parents 54fedef + f60e6e9 commit a444971
Show file tree
Hide file tree
Showing 950 changed files with 232,253 additions and 81,896 deletions.
File renamed without changes.
58 changes: 58 additions & 0 deletions .github/workflows/repo-metrics-weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Weekly repo metrics
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * MON'

permissions:
issues: write
pull-requests: read

jobs:
build:
# this workflow will always fail in forks; bail if this isn't running in the upstream
if: github.repository == 'aws/aws-cdk'
name: metrics
runs-on: ubuntu-latest

steps:
- name: Get dates for last week
shell: bash
run: |
# Calculate the date of the previous Monday
PREVIOUS_MONDAY=$(date -d "7 days ago" "+%Y-%m-%d")
# Calculate the date of the current Sunday
CURRENT_SUNDAY=$(date -d "1 day ago" "+%Y-%m-%d")
# Set an environment variable with the date range
echo "$PREVIOUS_MONDAY..$CURRENT_SUNDAY"
echo "last_week=$PREVIOUS_MONDAY..$CURRENT_SUNDAY" >> "$GITHUB_ENV"
- name: Report on issues
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:aws/aws-cdk is:issue created:${{ env.last_week }} -reason:"not planned"'

- name: Create report for issues
uses: peter-evans/create-issue-from-file@v5
with:
title: Weekly issue metrics report
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
assignees: paulhcsun

- name: Report on PRs
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEARCH_QUERY: 'repo:aws/aws-cdk is:pr created:${{ env.last_week }} -is:draft'

- name: Create report for PRs
uses: peter-evans/create-issue-from-file@v5
with:
title: Weekly PR metrics report
token: ${{ secrets.GITHUB_TOKEN }}
content-filepath: ./issue_metrics.md
assignees: paulhcsun
2 changes: 1 addition & 1 deletion .github/workflows/request-cli-integ-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
persist-credentials: false
- name: Find changed cli files
id: changed-cli-files
uses: tj-actions/changed-files@800a2825992141ddde1a8bca8ad394cec34d3188
uses: tj-actions/changed-files@20576b4b9ed46d41e2d45a2256e5e2316dde6834
with:
base_sha: ${{ github.event.pull_request.base.sha }}
files_yaml: |
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.v2.alpha.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

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.133.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.132.1-alpha.0...v2.133.0-alpha.0) (2024-03-14)

## [2.132.1-alpha.0](https://github.com/aws/aws-cdk/compare/v2.132.0-alpha.0...v2.132.1-alpha.0) (2024-03-12)

## [2.132.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.131.0-alpha.0...v2.132.0-alpha.0) (2024-03-08)


### Bug Fixes

* **glue:** `PythonRayExecutableProps` has innaccurate properties ([#28625](https://github.com/aws/aws-cdk/issues/28625)) ([7994733](https://github.com/aws/aws-cdk/commit/79947337d59539a03a2d7d2849043aa9405268d8)), closes [#28570](https://github.com/aws/aws-cdk/issues/28570)

## [2.131.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.130.0-alpha.0...v2.131.0-alpha.0) (2024-03-01)

## [2.130.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.129.0-alpha.0...v2.130.0-alpha.0) (2024-02-23)

## [2.129.0-alpha.0](https://github.com/aws/aws-cdk/compare/v2.128.0-alpha.0...v2.129.0-alpha.0) (2024-02-21)
Expand Down
99 changes: 99 additions & 0 deletions CHANGELOG.v2.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"@types/prettier": "2.6.0",
"@yarnpkg/lockfile": "^1.1.0",
"aws-sdk-js-codemod": "^0.28.2",
"cdk-generate-synthetic-examples": "^0.1.304",
"cdk-generate-synthetic-examples": "^0.1.307",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.11",
"jest-junit": "^13.2.0",
"jsii-diff": "1.94.0",
"jsii-pacmak": "1.94.0",
"jsii-reflect": "1.94.0",
"jsii-rosetta": "~5.3.18",
"jsii-diff": "1.95.0",
"jsii-pacmak": "1.95.0",
"jsii-reflect": "1.95.0",
"jsii-rosetta": "~5.3.29",
"lerna": "^7.4.2",
"nx": "^16.10.0",
"patch-package": "^6.5.1",
Expand Down
9 changes: 6 additions & 3 deletions packages/@aws-cdk-testing/cli-integ/bin/apply-patches
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ fi

candidate_dir="${scriptdir}/../resources/cli-regression-patches/v${version}"

if [[ -f "$candidate_dir" ]]; then
cp -R "${candidate_dir}/"* "$2"
fi
if [[ -d "$candidate_dir" ]]; then
echo "Found patch directory: ${candidate_dir}"
cp -vR "${candidate_dir}/"* "$2"
else
echo "No patch directory named: ${candidate_dir}"
fi
11 changes: 9 additions & 2 deletions packages/@aws-cdk-testing/cli-integ/lib/integ-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import * as fs from 'fs';
import * as path from 'path';
import { MemoryStream } from './corking';

const SKIP_TESTS = fs.readFileSync(path.join(__dirname, '..', 'skip-tests.txt'), { encoding: 'utf-8' }).split('\n');
const SKIP_TESTS = fs.readFileSync(path.join(__dirname, '..', 'skip-tests.txt'), { encoding: 'utf-8' })
.split('\n')
.map(x => x.trim())
.filter(x => x && !x.startsWith('#'));

if (SKIP_TESTS) {
process.stderr.write(`ℹ️ Skipping tests: ${JSON.stringify(SKIP_TESTS)}\n`);
}

export interface TestContext {
readonly randomString: string;
Expand All @@ -11,7 +18,7 @@ export interface TestContext {
};

if (process.env.JEST_TEST_CONCURRENT === 'true') {
process.stderr.write('ℹ️ JEST_TEST_CONCURRENT is true: tests will run concurrently and filters have no effect!');
process.stderr.write('ℹ️ JEST_TEST_CONCURRENT is true: tests will run concurrently and filters have no effect!\n0');
}

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk-testing/cli-integ/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"license": "Apache-2.0",
"devDependencies": {
"@aws-cdk/cdk-build-tools": "0.0.0",
"@types/semver": "^7.5.7",
"@types/semver": "^7.5.8",
"@types/yargs": "^15.0.19",
"@types/fs-extra": "^9.0.13",
"@types/glob": "^7.2.0",
Expand All @@ -39,8 +39,8 @@
},
"dependencies": {
"@octokit/rest": "^18.12.0",
"aws-sdk": "^2.1562.0",
"axios": "^1.6.7",
"aws-sdk": "^2.1583.0",
"axios": "^1.6.8",
"fs-extra": "^9.1.0",
"glob": "^7.2.3",
"jest": "^29.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ if (process.env.PACKAGE_LAYOUT_VERSION === '1') {
aws_sns: sns,
aws_sqs: sqs,
aws_lambda: lambda,
aws_ecr_assets: docker
aws_ecr_assets: docker,
Stack
} = require('aws-cdk-lib');
}

Expand Down Expand Up @@ -65,6 +66,59 @@ class YourStack extends cdk.Stack {
}
}

class ListMultipleDependentStack extends Stack {
constructor(scope, id) {
super(scope, id);

const dependentStack1 = new DependentStack1(this, 'DependentStack1');
const dependentStack2 = new DependentStack2(this, 'DependentStack2');

this.addDependency(dependentStack1);
this.addDependency(dependentStack2);
}
}

class DependentStack1 extends Stack {
constructor(scope, id) {
super(scope, id);

}
}

class DependentStack2 extends Stack {
constructor(scope, id) {
super(scope, id);

}
}

class ListStack extends Stack {
constructor(scope, id) {
super(scope, id);

const dependentStack = new DependentStack(this, 'DependentStack');

this.addDependency(dependentStack);
}
}

class DependentStack extends Stack {
constructor(scope, id) {
super(scope, id);

const innerDependentStack = new InnerDependentStack(this, 'InnerDependentStack');

this.addDependency(innerDependentStack);
}
}

class InnerDependentStack extends Stack {
constructor(scope, id) {
super(scope, id);

}
}

class MigrateStack extends cdk.Stack {
constructor(parent, id, props) {
super(parent, id, props);
Expand Down Expand Up @@ -498,6 +552,8 @@ switch (stackSet) {

new StackWithNestedStack(app, `${stackPrefix}-with-nested-stack`);
new StackWithNestedStackUsingParameters(app, `${stackPrefix}-with-nested-stack-using-parameters`);
new ListStack(app, `${stackPrefix}-list-stacks`)
new ListMultipleDependentStack(app, `${stackPrefix}-list-multiple-dependent-stacks`);

new YourStack(app, `${stackPrefix}-termination-protection`, {
terminationProtection: process.env.TERMINATION_PROTECTION !== 'FALSE' ? true : false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This patch brings the [fix](https://github.com/aws/aws-cdk/issues/29420) into the regression suite.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Skipping the test to fix issue https://github.com/aws/aws-cdk/issues/29420.
# cli-integ tests failing for the old tests with the new cli changes for list stacks.

cdk ls --show-dependencies --json
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,139 @@ integTest('cdk ls', withDefaultFixture(async (fixture) => {
}
}));

/**
* Type to store stack dependencies recursively
*/
type DependencyDetails = {
id: string;
dependencies: DependencyDetails[];
};

type StackDetails = {
id: string;
dependencies: DependencyDetails[];
};

integTest('cdk ls --show-dependencies --json', withDefaultFixture(async (fixture) => {
const listing = await fixture.cdk(['ls --show-dependencies --json'], { captureStderr: false });

const expectedStacks = [
{
id: 'test-1',
dependencies: [],
},
{
id: 'order-providing',
dependencies: [],
},
{
id: 'order-consuming',
dependencies: [
{
id: 'order-providing',
dependencies: [],
},
],
},
{
id: 'with-nested-stack',
dependencies: [],
},
{
id: 'list-stacks',
dependencies: [
{
id: 'list-stacks/DependentStack',
dependencies: [
{
id: 'list-stacks/DependentStack/InnerDependentStack',
dependencies: [],
},
],
},
],
},
{
id: 'list-multiple-dependent-stacks',
dependencies: [
{
id: 'list-multiple-dependent-stacks/DependentStack1',
dependencies: [],
},
{
id: 'list-multiple-dependent-stacks/DependentStack2',
dependencies: [],
},
],
},
];

function validateStackDependencies(stack: StackDetails) {
expect(listing).toContain(stack.id);

function validateDependencies(dependencies: DependencyDetails[]) {
for (const dependency of dependencies) {
expect(listing).toContain(dependency.id);
if (dependency.dependencies.length > 0) {
validateDependencies(dependency.dependencies);
}
}
}

if (stack.dependencies.length > 0) {
validateDependencies(stack.dependencies);
}
}

for (const stack of expectedStacks) {
validateStackDependencies(stack);
}
}));

integTest('cdk ls --show-dependencies --json --long', withDefaultFixture(async (fixture) => {
const listing = await fixture.cdk(['ls --show-dependencies --json --long'], { captureStderr: false });

const expectedStacks = [
{
id: 'order-providing',
name: 'order-providing',
enviroment: {
account: 'unknown-account',
region: 'unknown-region',
name: 'aws://unknown-account/unknown-region',
},
dependencies: [],
},
{
id: 'order-consuming',
name: 'order-consuming',
enviroment: {
account: 'unknown-account',
region: 'unknown-region',
name: 'aws://unknown-account/unknown-region',
},
dependencies: [
{
id: 'order-providing',
dependencies: [],
},
],
},
];

for (const stack of expectedStacks) {
expect(listing).toContain(fixture.fullStackName(stack.id));
expect(listing).toContain(fixture.fullStackName(stack.name));
expect(listing).toContain(stack.enviroment.account);
expect(listing).toContain(stack.enviroment.name);
expect(listing).toContain(stack.enviroment.region);
for (const dependency of stack.dependencies) {
expect(listing).toContain(fixture.fullStackName(dependency.id));
}
}

}));

integTest('synthing a stage with errors leads to failure', withDefaultFixture(async (fixture) => {
const output = await fixture.cdk(['synth'], {
allowErrExit: true,
Expand Down
Loading

0 comments on commit a444971

Please sign in to comment.