Skip to content

Commit

Permalink
Merge branch 'master' into feat-context-reset-matches
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Apr 11, 2022
2 parents c6cb7a1 + 21dcc37 commit e0e7583
Show file tree
Hide file tree
Showing 116 changed files with 1,078 additions and 893 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@v2.2.0
- uses: hmarr/auto-approve-action@v2.2.1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
name: Stale issue job
steps:
- uses: aws-actions/stale-issue-cleanup@v3
- uses: aws-actions/stale-issue-cleanup@v5
with:
# Setting messages to an empty string will cause the automation to skip
# that category
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
npm -g install lerna npm-check-updates@^9.0.0
- name: Build CLI
run: cd packages/aws-cdk && ../../scripts/buildup
- name: Build Integ Runner
run: cd packages/@aws-cdk/integ-runner && ../../../scripts/buildup
- name: List Mono-Repo Packages
id: list-packages
# These need to be ignored from the `ncu` runs!
Expand All @@ -63,16 +65,18 @@ jobs:
lerna exec --parallel ncu -- --upgrade --filter=@types/node,@types/fs-extra --target=minor
lerna exec --parallel ncu -- --upgrade --filter=typescript --target=patch
lerna exec --parallel ncu -- --upgrade --reject='@types/node,@types/fs-extra,constructs,typescript,aws-sdk,aws-sdk-mock,${{ steps.list-packages.outputs.list }}' --target=minor
# This will ensure the current lockfile is up-to-date with the dependency specifications (necessary for "yarn update" to run)
- name: Run "yarn install"
run: yarn install

- name: Run "yarn upgrade"
run: yarn upgrade

- name: Regenerate CLI attributions
run: cd packages/aws-cdk && yarn pkglint
- name: Regenerate Integ Runner attributions
run: cd packages/@aws-cdk/integ-runner && yarn pkglint

# Next, create and upload the changes as a patch file. This will later be downloaded to create a pull request
# Creating a pull request requires write permissions and it's best to keep write privileges isolated.
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"cdk-generate-synthetic-examples": "^0.1.8",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.9",
"jest-junit": "^13.0.0",
"jsii-diff": "^1.55.1",
"jsii-pacmak": "^1.55.1",
"jsii-reflect": "^1.55.1",
"jsii-rosetta": "^1.55.1",
"graceful-fs": "^4.2.10",
"jest-junit": "^13.1.0",
"jsii-diff": "^1.56.0",
"jsii-pacmak": "^1.56.0",
"jsii-reflect": "^1.56.0",
"jsii-rosetta": "^1.56.0",
"lerna": "^4.0.0",
"patch-package": "^6.4.7",
"semver": "^6.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/app-delivery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const source = new codepipeline_actions.GitHubSourceAction({
output: sourceOutput,
owner: 'myName',
repo: 'myRepo',
oauthToken: cdk.SecretValue.plainText('secret'),
oauthToken: cdk.SecretValue.unsafePlainText('secret'),
});
pipeline.addStage({
stageName: 'source',
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/app-delivery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.1",
"fast-check": "^2.23.2",
"fast-check": "^2.24.0",
"jest": "^27.5.1"
},
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/app-delivery/test/integ.cicd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const source = new cpactions.GitHubSourceAction({
actionName: 'GitHub',
owner: 'awslabs',
repo: 'aws-cdk',
oauthToken: cdk.SecretValue.plainText('DummyToken'),
oauthToken: cdk.SecretValue.unsafePlainText('DummyToken'),
trigger: cpactions.GitHubTrigger.POLL,
output: sourceOutput,
});
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-amplify/lib/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface SourceCodeProviderConfig {
* to create webhook and read-only deploy key. OAuth token is not stored.
*
* Either `accessToken` or `oauthToken` must be specified if `repository`
* is sepcified.
* is specified.
*
* @default - do not use a token
*/
Expand Down Expand Up @@ -223,7 +223,7 @@ export class App extends Resource implements IApp, iam.IGrantable {
const sourceCodeProviderOptions = props.sourceCodeProvider?.bind(this);

const app = new CfnApp(this, 'Resource', {
accessToken: sourceCodeProviderOptions?.accessToken?.toString(),
accessToken: sourceCodeProviderOptions?.accessToken?.unsafeUnwrap(), // Safe usage
autoBranchCreationConfig: props.autoBranchCreation && {
autoBranchCreationPatterns: props.autoBranchCreation.patterns,
basicAuthConfig: props.autoBranchCreation.basicAuth
Expand All @@ -247,7 +247,7 @@ export class App extends Resource implements IApp, iam.IGrantable {
environmentVariables: Lazy.any({ produce: () => renderEnvironmentVariables(this.environmentVariables) }, { omitEmptyArray: true }),
iamServiceRole: role.roleArn,
name: props.appName || this.node.id,
oauthToken: sourceCodeProviderOptions?.oauthToken?.toString(),
oauthToken: sourceCodeProviderOptions?.oauthToken?.unsafeUnwrap(), // Safe usage
repository: sourceCodeProviderOptions?.repository,
customHeaders: props.customResponseHeaders ? renderCustomResponseHeaders(props.customResponseHeaders) : undefined,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-amplify/lib/basic-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class BasicAuth {
if (this.props.password) {
return {
...config,
password: this.props.password.toString(),
password: this.props.password.unsafeUnwrap(), // Safe usage
};
}

Expand All @@ -103,7 +103,7 @@ export class BasicAuth {
});
return {
...config,
password: secret.secretValueFromJson('password').toString(),
password: secret.secretValueFromJson('password').unsafeUnwrap(),
};
}
}
22 changes: 11 additions & 11 deletions packages/@aws-cdk/aws-amplify/test/app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test('create an app connected to a GitHub repository', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
buildSpec: codebuild.BuildSpec.fromObjectToYaml({
version: '1.0',
Expand Down Expand Up @@ -70,7 +70,7 @@ test('create an app connected to a GitLab repository', () => {
sourceCodeProvider: new amplify.GitLabSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
buildSpec: codebuild.BuildSpec.fromObject({
version: '1.0',
Expand Down Expand Up @@ -194,9 +194,9 @@ test('with basic auth from credentials', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
basicAuth: amplify.BasicAuth.fromCredentials('username', SecretValue.plainText('password')),
basicAuth: amplify.BasicAuth.fromCredentials('username', SecretValue.unsafePlainText('password')),
});

// THEN
Expand All @@ -215,7 +215,7 @@ test('with basic auth from generated password', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
basicAuth: amplify.BasicAuth.fromGeneratedPassword('username'),
});
Expand Down Expand Up @@ -254,7 +254,7 @@ test('with env vars', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
environmentVariables: {
key1: 'value1',
Expand Down Expand Up @@ -283,7 +283,7 @@ test('with custom rules', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
customRules: [
{
Expand Down Expand Up @@ -322,7 +322,7 @@ test('with SPA redirect', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
customRules: [amplify.CustomRule.SINGLE_PAGE_APPLICATION_REDIRECT],
});
Expand All @@ -345,7 +345,7 @@ test('with auto branch creation', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
autoBranchCreation: {
environmentVariables: {
Expand Down Expand Up @@ -384,7 +384,7 @@ test('with auto branch deletion', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
autoBranchDeletion: true,
});
Expand All @@ -401,7 +401,7 @@ test('with custom headers', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
customResponseHeaders: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-amplify/test/branch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ beforeEach(() => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
});
});
Expand All @@ -38,7 +38,7 @@ test('create a branch', () => {
test('with basic auth from credentials', () => {
// WHEN
app.addBranch('dev', {
basicAuth: amplify.BasicAuth.fromCredentials('username', SecretValue.plainText('password')),
basicAuth: amplify.BasicAuth.fromCredentials('username', SecretValue.unsafePlainText('password')),
});

// THEN
Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-amplify/test/domain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test('create a domain', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
});
const prodBranch = app.addBranch('master');
Expand Down Expand Up @@ -71,7 +71,7 @@ test('map a branch to the domain root', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
});
const prodBranch = app.addBranch('master');
Expand Down Expand Up @@ -111,7 +111,7 @@ test('throws at synthesis without subdomains', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
});

Expand All @@ -129,7 +129,7 @@ test('auto subdomain all branches', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
});
const prodBranch = app.addBranch('master');
Expand Down Expand Up @@ -163,7 +163,7 @@ test('auto subdomain some branches', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
});
const prodBranch = app.addBranch('master');
Expand Down Expand Up @@ -195,7 +195,7 @@ test('auto subdomain with IAM role', () => {
sourceCodeProvider: new amplify.GitHubSourceCodeProvider({
owner: 'aws',
repository: 'aws-cdk',
oauthToken: SecretValue.plainText('secret'),
oauthToken: SecretValue.unsafePlainText('secret'),
}),
role: iam.Role.fromRoleArn(
stack,
Expand Down Expand Up @@ -230,4 +230,4 @@ test('auto subdomain with IAM role', () => {
],
},
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ new cdk.CfnOutput(stack, 'TESTACCESSKEYID', {
});

new cdk.CfnOutput(stack, 'TESTSECRETACCESSKEY', {
value: userAccessKey.secretAccessKey.toString(),
value: userAccessKey.secretAccessKey.unsafeUnwrap(),
});

new cdk.CfnOutput(stack, 'TESTREGION', {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-applicationautoscaling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.1",
"fast-check": "^2.23.2",
"fast-check": "^2.24.0",
"jest": "^27.5.1"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-autoscaling-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.4.1",
"fast-check": "^2.23.2",
"fast-check": "^2.24.0",
"jest": "^27.5.1"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"aws-sdk-mock": "5.6.0",
"eslint": "^7.32.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-standard": "^4.1.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-codebuild/lib/source-credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class GitHubSourceCredentials extends Resource {
new CfnSourceCredential(this, 'Resource', {
serverType: 'GITHUB',
authType: 'PERSONAL_ACCESS_TOKEN',
token: props.accessToken.toString(),
token: props.accessToken.unsafeUnwrap(), // Safe usage
});
}
}
Expand Down Expand Up @@ -60,7 +60,7 @@ export class GitHubEnterpriseSourceCredentials extends Resource {
new CfnSourceCredential(this, 'Resource', {
serverType: 'GITHUB_ENTERPRISE',
authType: 'PERSONAL_ACCESS_TOKEN',
token: props.accessToken.toString(),
token: props.accessToken.unsafeUnwrap(), // Safe usage
});
}
}
Expand Down Expand Up @@ -92,8 +92,8 @@ export class BitBucketSourceCredentials extends Resource {
new CfnSourceCredential(this, 'Resource', {
serverType: 'BITBUCKET',
authType: 'BASIC_AUTH',
username: props.username.toString(),
token: props.password.toString(),
username: props.username.unsafeUnwrap(), // Safe usage
token: props.password.unsafeUnwrap(), // Safe usage
});
}
}
Loading

0 comments on commit e0e7583

Please sign in to comment.