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: correct installLatestAwsSdkDefault flag docs #28887

Closed
wants to merge 3 commits into from

Conversation

joshlartz
Copy link
Contributor

Correcting docs about this flag as the implementation still defaults to true.

https://github.com/aws/aws-cdk/blob/v2.123.0/packages/aws-cdk-lib/custom-resources/lib/aws-custom-resource/aws-custom-resource.ts#L471-L473


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team January 26, 2024 19:14
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 labels Jan 26, 2024
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@joshlartz joshlartz changed the title correct installLatestAwsSdkDefault flag docs chore: correct installLatestAwsSdkDefault flag docs Jan 26, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review January 26, 2024 21:42

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jan 26, 2024
Copy link
Contributor

@kylelaker kylelaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That markdown file will get overwritten the next time the package is built. If this documentation change is correct, I believe this needs to be changed by specifying defaults: { v2: true } in features.ts. I am not sure if that will have any other downstream effects.

The change would be somewhere around here:

compatibilityWithOldBehaviorMd: 'Set installLatestAwsSdk: true on all resources that need it.',
introducedIn: { v2: '2.60.0' },
recommendedValue: false,

This is the code that performs the generation of that markdown file:

flag.introducedIn.v2
? [flag.introducedIn.v2, renderValue(flag.defaults?.v2 ?? false), renderValue(flag.recommendedValue)]
: flag.defaults?.v2 !== undefined
? ['(default in v2)', renderValue(flag.defaults?.v2), '']
: ['(not in v2)', '', ''],

@joshlartz
Copy link
Contributor Author

Thanks @kylelaker !

Copy link
Contributor

@kylelaker kylelaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think there should be some other files that are modified as a consequence of this if you were to build the aws-cdk-lib package. CONTRIBUTING.md has details on how to do that, but you probably would want to do the following:

  1. In the base of the repo run yarn install to install all the CDK dependencies
  2. Move into the aws-cdk-lib directory with cd packages/aws-cdk-lib
  3. Build that package and its dependencies with ../../scripts/buildup

From there, you can run tests locally with yarn test. The CodeBuild check on the PR will also run the full test suite after you push.

packages/aws-cdk-lib/cx-api/lib/features.ts Outdated Show resolved Hide resolved
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 0b03393
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@joshlartz
Copy link
Contributor Author

@kylelaker You were right that there were unintended changes from this. It looks like there was an assumption built in that flags would always end up being true in v2. It is causing the "Flags with a different default in v2" section to be updated incorrectly.

Example:

Flag Summary Type Since v1 default v2 default
@aws-cdk/customresources:installLatestAwsSdkDefault Whether to install the latest SDK by default in AwsCustomResource (default) false true

Here is an example of a cdk.json file that restores v1 behavior for these flags:

{
  "context": {
    "@aws-cdk/core:newStyleStackSynthesis": false,
    "@aws-cdk/core:stackRelativeExports": false,
    "@aws-cdk/aws-rds:lowercaseDbIdentifier": false,
    "@aws-cdk/aws-apigateway:usagePlanKeyOrderInsensitiveId": false,
    "@aws-cdk/aws-lambda:recognizeVersionProps": false,
    "@aws-cdk/aws-cloudfront:defaultSecurityPolicyTLSv1.2_2021": false,
    "@aws-cdk/customresources:installLatestAwsSdkDefault": false
  }
}

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the BUILD FAILING state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@aws-cdk-automation
Copy link
Collaborator

This PR has been deemed to be abandoned, and will be automatically closed. Please create a new PR for these changes if you think this decision has been made in error.

@aws-cdk-automation aws-cdk-automation added the closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. label Feb 28, 2024
@joshlartz
Copy link
Contributor Author

Not stale, just waiting on an answer still :(
@kylelaker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants