Skip to content

Conversation

@otaviomacedo
Copy link
Contributor

@otaviomacedo otaviomacedo commented Apr 28, 2025

Allow the user to select resources to be skipped for refactoring. There are two ways to do this:

  • By adding the aws:cdk:skip-refactor = true metadata to each resource to be skipped, in the cloud assembly manifest.
  • By passing a skip fie via command line or the toolkit library API. The file should be in JSON format and contain a list of destination locations. Entries in this list can be either in the form "<stack name>.<logical ID>" or a construct path.

The main abstraction is the SkipList interface, used by the mapping detection algorithm to query for mappings that should be excluded.

Closes #412, #379


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 April 28, 2025 13:19
@github-actions github-actions bot added the p2 label Apr 28, 2025
* logical IDs, that is, the logical IDs of the resources
* as they would be after the refactor.
*/
skipFile?: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm looking for a better name. If anyone has any suggestions, let me know.

Copy link
Contributor

Choose a reason for hiding this comment

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

For toolkit-lib, this should be an array. We can make the read from file a CLI feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm looking for a better name. If anyone has any suggestions, let me know.

exclude?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'm going with exclude.

Base automatically changed from otaviom/refactor-stack-filtering to main April 29, 2025 08:31
@otaviomacedo otaviomacedo disabled auto-merge April 29, 2025 09:19
@otaviomacedo otaviomacedo marked this pull request as draft April 29, 2025 09:22
# Conflicts:
#	packages/@aws-cdk/tmp-toolkit-helpers/src/api/refactoring/index.ts
#	packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts
#	packages/@aws-cdk/toolkit-lib/test/actions/refactor.test.ts
#	packages/aws-cdk/lib/cli/cli-config.ts
#	packages/aws-cdk/lib/cli/convert-to-user-input.ts
#	packages/aws-cdk/lib/cli/parse-command-line-arguments.ts
#	packages/aws-cdk/lib/cli/user-input.ts
#	packages/aws-cdk/test/api/refactoring/refactoring.test.ts
@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2025

Codecov Report

Attention: Patch coverage is 42.85714% with 20 lines in your changes missing coverage. Please review.

Project coverage is 79.18%. Comparing base (27aad24) to head (d750e5c).

Files with missing lines Patch % Lines
packages/aws-cdk/lib/cli/cdk-toolkit.ts 44.11% 19 Missing ⚠️
packages/aws-cdk/lib/cli/cli.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #421      +/-   ##
==========================================
+ Coverage   79.15%   79.18%   +0.03%     
==========================================
  Files          54       54              
  Lines        6889     6895       +6     
  Branches      772      773       +1     
==========================================
+ Hits         5453     5460       +7     
+ Misses       1418     1417       -1     
  Partials       18       18              
Flag Coverage Δ
suite.unit 79.18% <42.85%> (+0.03%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

# Conflicts:
#	packages/@aws-cdk/toolkit-lib/lib/api/refactoring/skip.ts
#	packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts
#	packages/aws-cdk/test/api/refactoring/refactoring.test.ts
@otaviomacedo otaviomacedo added this pull request to the merge queue May 2, 2025
Merged via the queue into main with commit eafb53b May 2, 2025
20 checks passed
@otaviomacedo otaviomacedo deleted the otaviom/refactor-skip branch May 2, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define and implement a skipping contract in Cloud Assembly

3 participants