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: add metadata import and statement updater #32896

Open
wants to merge 1 commit into
base: yuanhaoz/feat/metadata-collection
Choose a base branch
from

Conversation

GavinZZ
Copy link
Contributor

@GavinZZ GavinZZ commented Jan 13, 2025

Issue # (if applicable)

Reason for this change

As a follow up to #32827. We need to add metadata statement to the constructor to every L2 constructs that inherits Resource class. We used ts-morph as the typescript parser to parse all CDK files and find the constructs that match the requirements.

Add import statement and this.node.addMetadata( statement to the file.

Description of changes

Main change is a one-time tool metadata-updater to automatically find the right classes and add import statements and add metadata statements. The tool can be run multiple times and should not add additional import or add metadata statements to files that already been added.

Description of how you validated changes

  1. Went through every changed file to verify the changes.
  2. Tests regarding the metadata-updater tool
  3. Existing tests

Checklist


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

@GavinZZ GavinZZ requested a review from a team as a code owner January 13, 2025 19:59
@aws-cdk-automation aws-cdk-automation requested a review from a team January 13, 2025 19:59
@github-actions github-actions bot added the p2 label Jan 13, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jan 13, 2025
@GavinZZ GavinZZ force-pushed the yuanhaoz/feat/metadata-collection-importer branch from 06edbd2 to 53577de Compare January 13, 2025 20:05
@GavinZZ GavinZZ changed the title chore(aws-cdk-lib): add metadata import and statement updater chore: add metadata import and statement updater Jan 13, 2025
@GavinZZ GavinZZ force-pushed the yuanhaoz/feat/metadata-collection-importer branch from 53577de to 4cf55d3 Compare January 14, 2025 03:37
@aws aws deleted a comment from aws-cdk-automation Jan 15, 2025
@GavinZZ GavinZZ force-pushed the yuanhaoz/feat/metadata-collection-importer branch 2 times, most recently from 7f7d372 to b41b6e5 Compare January 16, 2025 01:23
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: b41b6e5
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 16, 2025
@GavinZZ GavinZZ changed the base branch from main to yuanhaoz/feat/metadata-collection January 16, 2025 23:20
@GavinZZ GavinZZ force-pushed the yuanhaoz/feat/metadata-collection-importer branch from b41b6e5 to dd89c4f Compare January 18, 2025 01:02
@GavinZZ GavinZZ changed the base branch from yuanhaoz/feat/metadata-collection to main January 18, 2025 01:02
@GavinZZ
Copy link
Contributor Author

GavinZZ commented Jan 18, 2025

Changing the target branch to main to re-run tests.

@GavinZZ GavinZZ added the pr/do-not-merge This PR should not be merged at this time. label Jan 18, 2025
@GavinZZ GavinZZ changed the base branch from main to yuanhaoz/feat/metadata-collection January 20, 2025 18:54
@GavinZZ GavinZZ requested a review from samson-keung January 20, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. p2 pr/do-not-merge This PR should not be merged at this time. pr/needs-maintainer-review This PR needs a review from a Core Team Member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants