Skip to content

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Mar 17, 2025

This change is three fold:

  • We clean up the private HotswapOperation interface (née HotswappableChange) by removing two unused fields and adding in a new filed in preparation for structured data alongside hotswap messages
  • In the hotswap providers, pull gates outside of the apply function. This prevents hotswaps being reported when nothing would actually be done. These are local checks and now just run a little bit earlier.
  • In lambda-functions.ts don't report hotswappable changes for versions and aliases. These used to be reported with an empty array for resourceNames and a noop apply function. This means that literally nothing happens with these entries, since apply doesn't do anything and the CLI uses resourceNames to print anything. Just removing these as they are reported as part of a change to the function.

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

@mrgrain mrgrain temporarily deployed to integ-approval March 17, 2025 19:43 — with GitHub Actions Inactive
@github-actions github-actions bot added the p2 label Mar 17, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team March 17, 2025 19:44
Comment on lines -9 to -10
readonly resourceType: string;
readonly propsChanged: Array<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.

Surprisingly, these were unused. propsChanged is not made available as raw data via change.

/**
* Represents a change that can be hotswapped.
*/
export class HotswappableChangeCandidate {
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 is a class, but was never used as one. It's now an interface as it should be.

@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2025

Codecov Report

Attention: Patch coverage is 88.27160% with 19 lines in your changes missing coverage. Please review.

Project coverage is 85.10%. Comparing base (cb8a7e0) to head (6eb409c).

Files with missing lines Patch % Lines
...ckages/aws-cdk/lib/api/hotswap/lambda-functions.ts 92.42% 5 Missing ⚠️
...s/aws-cdk/lib/api/hotswap/s3-bucket-deployments.ts 70.58% 4 Missing and 1 partial ⚠️
...s-cdk/lib/api/hotswap/appsync-mapping-templates.ts 72.72% 3 Missing ⚠️
...ges/aws-cdk/lib/api/hotswap/code-build-projects.ts 72.72% 3 Missing ⚠️
...dk/lib/api/hotswap/stepfunctions-state-machines.ts 75.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #244   +/-   ##
=======================================
  Coverage   85.09%   85.10%           
=======================================
  Files         206      206           
  Lines       35215    35197   -18     
  Branches     4535     4534    -1     
=======================================
- Hits        29966    29954   -12     
+ Misses       5099     5095    -4     
+ Partials      150      148    -2     
Flag Coverage Δ
suite.unit 85.10% <88.27%> (+<0.01%) ⬆️

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.

Comment on lines +358 to +361
logicalId: string;
resourceType: string;
physicalName?: string;
description: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

💅 This would be nicer with a named struct definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Coming up next!

@mrgrain mrgrain added the pr/exempt-integ-test Skips the integ test steps if set. label Mar 18, 2025
@mrgrain
Copy link
Contributor Author

mrgrain commented Mar 18, 2025

Bypassing tests due to unrelated test failure.

@mrgrain mrgrain added this pull request to the merge queue Mar 18, 2025
Merged via the queue into main with commit 53ea256 Mar 18, 2025
11 checks passed
@mrgrain mrgrain deleted the mrgrain/chore/hotswap-no-unnecessary-changes branch March 18, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2 pr/exempt-integ-test Skips the integ test steps if set.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants