Skip to content

fix(toolkit-lib): remove deprecated DeployOptions.force in favor of more specific options #315

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

Merged
merged 1 commit into from
Apr 3, 2025

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Apr 3, 2025

  • Rename force option to more descriptive forceDeployment for clarity
  • Add new forceAssetPublishing option to control asset publishing separately
  • Add orphanFailedResourcesDuringRollback option for better rollback control
  • Rename removePublishedAssets to removePublishedAssetsFromWorkGraph for clarity
  • Update tests and implementation to use the new parameter names
  • Improve documentation for deployment options

BREAKING CHANGE: The deprecated force option on DeployOptions has been removed. The removed option originally caused multiple different "force" actions. Each action now has a more targeted alternative. To force a deployment even if the CDK Toolkit has not detected any changes, use forceDeployment. To force re-publishing of previously published assets, use forceAssetPublishing. To force failing resource being orphaned during a rollback, use orphanFailedResourcesDuringRollback. To implement interactive confirmation of rollbacks during a deployment, react to the message request with code CDK_TOOLKIT_I5050 in your IoHost.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@@ -27,7 +27,7 @@ export function buildParameterMap(parameters?: Map<string, string | undefined>):
/**
* Remove the asset publishing and building from the work graph for assets that are already in place
*/
export async function removePublishedAssets(graph: WorkGraph, deployments: Deployments, options: DeployOptions) {
export async function removePublishedAssetsFromWorkGraph(graph: WorkGraph, deployments: Deployments, options: DeployOptions) {
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 name just confused me. The function does not actually remove the assets, it just removes the upload job from the work graph.

@aws-cdk-automation aws-cdk-automation requested a review from a team April 3, 2025 10:42
… multiple more specific options

- Rename `force` option to more descriptive `forceDeployment` for clarity
- Add new `forceAssetPublishing` option to control asset publishing separately
- Add `orphanFailedResourcesDuringRollback` option for better rollback control
- Rename `removePublishedAssets` to `removePublishedAssetsFromWorkGraph` for clarity
- Update tests and implementation to use the new parameter names
- Improve documentation for deployment options

BREAKING CHANGE: The deprecated `force` option on `DeployOptions` has been removed. The removed option originally caused multiple different "force" actions. Each action now has a more targeted alternative. To force a deployment even if the CDK Toolkit has not detected any changes, use `forceDeployment`. To force re-publishing of previously published assets, use `forceAssetPublishing`. To force failing resource being orphaned during a rollback, use `orphanFailedResourcesDuringRollback`. To implement interactive confirmation of rollbacks during a deployment, react to the message request with code `CDK_TOOLKIT_I5050` in your `IoHost`.
@mrgrain mrgrain force-pushed the mrgrain/fix/deployment-force branch from 019afa8 to c7d34a4 Compare April 3, 2025 11:41
@mrgrain mrgrain temporarily deployed to integ-approval April 3, 2025 11:41 — with GitHub Actions Inactive
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.57%. Comparing base (3e8359c) to head (c7d34a4).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...ackages/aws-cdk/lib/api/deployments/deployments.ts 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #315      +/-   ##
==========================================
- Coverage   85.58%   85.57%   -0.02%     
==========================================
  Files         223      223              
  Lines       37002    36989      -13     
  Branches     4493     4469      -24     
==========================================
- Hits        31668    31652      -16     
- Misses       5233     5239       +6     
+ Partials      101       98       -3     
Flag Coverage Δ
suite.unit 85.57% <89.47%> (-0.02%) ⬇️

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.

@mrgrain mrgrain changed the title fix(toolkit-lib): remove force in DeployOptions in favor of more specific alternatives fix(toolkit-lib): remove deprecated DeployOptions.force in favor of more specific options Apr 3, 2025
@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Apr 3, 2025
Merged via the queue into main with commit c14df8e Apr 3, 2025
32 checks passed
@aws-cdk-automation aws-cdk-automation deleted the mrgrain/fix/deployment-force branch April 3, 2025 13:12
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.

4 participants