-
Notifications
You must be signed in to change notification settings - Fork 35
feat: diff
shows moved resources
#708
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
Conversation
Signed-off-by: github-actions <github-actions@github.com>
Show both mappings and ambiguities;
Signed-off-by: github-actions <github-actions@github.com>
…rides # Conflicts: # packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts
Signed-off-by: github-actions <github-actions@github.com>
# Conflicts: # packages/@aws-cdk/toolkit-lib/lib/actions/refactor/index.ts # packages/@aws-cdk/toolkit-lib/lib/api/refactoring/context.ts # packages/@aws-cdk/toolkit-lib/lib/api/refactoring/index.ts # packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts # packages/@aws-cdk/toolkit-lib/test/_fixtures/stack-with-two-buckets/index.ts # packages/@aws-cdk/toolkit-lib/test/actions/refactor.test.ts # packages/aws-cdk/README.md # packages/aws-cdk/lib/cli/cdk-toolkit.ts # packages/aws-cdk/lib/cli/cli-config.ts # packages/aws-cdk/lib/cli/cli-type-registry.json # packages/aws-cdk/lib/cli/cli.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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conditionally approved, give my comments a thought
@@ -239,6 +246,10 @@ export class Formatter { | |||
} | |||
} | |||
|
|||
private formatMove(move?: Move): string { | |||
return !move ? '' : chalk.gray('(OR', chalk.italic(chalk.bold('move')), `${move.direction} ${move.stackName}.${move.resourceLogicalId} via refactoring)`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this slightly more visible than grey? Maybe yellow or orange or something?
}); | ||
return { | ||
environment: context.environment, | ||
mappings: Object.fromEntries( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than splatting down the object to a string here, aren't we better off maintaining the object and rendering it later when it comes time to present the diff?
When a resource is moved from one location to another, the
diff
command will show two entries: an addition and a removal. This PR augments those entries to show where they moved to and from, respectively:This information is not shown by default. To enable it, the user has to pass
--include-moves
to the CLI, andincludeMoves: true
to the toolkit.Closes #362
Depends on #679.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license