fix: --force flag does not applies to assets#197
Merged
aws-cdk-automation merged 9 commits intomainfrom Mar 7, 2025
Merged
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.
2 tasks
Codecov Report✅ All 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>
iankhou
approved these changes
Mar 5, 2025
kaizencc
reviewed
Mar 5, 2025
Contributor
Author
Good catch. |
Signed-off-by: github-actions <github-actions@github.com>
Contributor
|
Applied |
mrgrain
approved these changes
Mar 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
cdk deploy --forceflag 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--forceflag.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