-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix: --force
flag does not applies to assets
#197
Conversation
The `cdk deploy --force` flag is intended to disable all smartness around saving work. If set, it won't check whether assets already exist in the cloud, and remove the build and publishing steps from the work graph. However, this by itself is not enough to make sure the asset truly gets published again, because the `publish()` action has its own version of short-circuiting again. Rather than remove the short-circuiting behavior from `cdk-assets`, we add another `{ force }` flag there as well, which gets its value from the CLI's `--force` flag.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #197 +/- ##
==========================================
+ Coverage 85.10% 85.22% +0.12%
==========================================
Files 208 208
Lines 35775 35786 +11
Branches 4631 4650 +19
==========================================
+ Hits 30445 30500 +55
+ Misses 5183 5131 -52
- Partials 147 155 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: github-actions <github-actions@github.com>
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.
Needs adding to toolkit-lib as well (as forcePublishAssets
or something)
Good catch. |
Signed-off-by: github-actions <github-actions@github.com>
Applied |
The
cdk deploy --force
flag is intended to disable all smartness around saving work. If set, it won't check whether assets already exist in the cloud, and remove the build and publishing steps from the work graph.However, this by itself is not enough to make sure the asset truly gets published again, because the
publish()
action has its own version of short-circuiting again.Rather than remove the short-circuiting behavior from
cdk-assets
, we add another{ force }
flag there as well, which gets its value from the CLI's--force
flag.This will make it possible to recover from corrupted assets which were accidentally published, as fixed in aws/aws-cdk#33692, by running
rm -rf cdk.out && cdk deploy --force
.Fixes aws/aws-cdk#14474.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license