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(enum-updater): add enum updater tool #33681

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

paulhcsun
Copy link
Contributor

@paulhcsun paulhcsun commented Mar 4, 2025

Description of changes

This tool currently takes in the CDK enums and SDK enums as inputs, creates a static mapping between CDK enums to SDK enums, and then identifies missing values to make code changes to add in the missing values.

Features

  • Downloads and processes CDK enum definitions and SDK models
  • Creates static mappings between CDK and SDK enums
  • Identifies missing enum values in CDK compared to SDK
  • Updates both regular enums and enum-like classes with missing values

Implementation Details

The tool consists of two main components:

  1. static-enum-mapping-updater.ts: Handles the downloading and processing of enum definitions, creating mappings between CDK and SDK enums
  2. missing-enums-updater.ts: Identifies missing enum values by referencing the static-enum-mapping and the CDK and SDK enum datasources and updates the source files.

Usage

This tool will be run automatically by a weekly GitHub workflow to keep CDK enums up to date.

Description of how you validated changes

Manual + unit tests.

Checklist


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 March 4, 2025 02:50
@github-actions github-actions bot added the p2 label Mar 4, 2025
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Mar 4, 2025
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.24%. Comparing base (6c882e0) to head (48fdeb8).
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #33681      +/-   ##
==========================================
+ Coverage   82.21%   82.24%   +0.02%     
==========================================
  Files         119      119              
  Lines        6876     6875       -1     
  Branches     1162     1161       -1     
==========================================
+ Hits         5653     5654       +1     
+ Misses       1120     1118       -2     
  Partials      103      103              
Flag Coverage Δ
suite.unit 82.24% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk ∅ <ø> (∅)
packages/aws-cdk-lib/core 82.24% <ø> (+0.02%) ⬆️
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@paulhcsun paulhcsun marked this pull request as ready for review March 4, 2025 06:06
Comment on lines +1 to +9
{
"amplify": {
"RedirectStatus": {
"cdk_path": "aws-cdk/packages/@aws-cdk/aws-amplify-alpha/lib/app.ts"
},
"CustomRule": {
"cdk_path": "aws-cdk/packages/@aws-cdk/aws-amplify-alpha/lib/app.ts"
}
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file is not really necessary, but I don't think it hurts to keep track of it. I'm open to removing it or keeping it for reference. It is a list of all the CDK enums that are not mapped.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Mar 4, 2025
@godwingrs22 godwingrs22 self-assigned this Mar 5, 2025
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

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/needs-maintainer-review This PR needs a review from a Core Team Member pr-linter/analytics-metadata-change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants