-
Notifications
You must be signed in to change notification settings - Fork 4k
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
(cli): --hotswap
does not detect function env variables changes
#16444
Comments
Hey @misterjoshua, thanks for opening the issue! Can you describe your full flow? I was unable to reproduce the issue on my end. Here's what I did:
And the CloudFormation deployment went through, updating the env variable (I verified it was updated by looking at the function in the AWS Console). Let me know what was your flow that led to the env variable not being updated - I'm very curious where is the discrepancy! Thanks, |
@skinny85 It's strange - I've tried this again in a fresh repository just now and my example above does not reproduce the problem either. However, I've made some adjustments in such a way that I can reproduce the problem here: https://github.com/misterjoshua/cdk-hotswap-bug To reproduce in this repository, install the dependencies and deploy the first time: npm install
cdk deploy Deploy it again with hotswap (no changes to the code are necessary): cdk deploy --hotswap Here's what I get:
But, I expected that |
Thanks @misterjoshua! If I could ask for one more thing 🙂. Before running |
@skinny85 Here you go:
So it doesn't look like
Shouldn't the diff be catching this? Given that environment variables can change the behaviour of the lambda, I would expect that that would be a meaningful diff from the customer's perspective. |
Yeah, this definitely looks like a bug in the |
Turns out, `parseFloat()` in JavaScript is even crazier than we thought, and returns nonsense like `2021` for a string containing a Date like `'2021-10-25'`. For that reason, add an explicit check that the string parsed looks like a number before calling `parseFloat()`. Fixes aws#16444
Turns out, `parseFloat()` in JavaScript is even crazier than we thought, and returns nonsense like `2021` for a string containing a Date like `'2021-10-25'`. For that reason, add an explicit check that the string parsed looks like a number before calling `parseFloat()`. Fixes aws#16444
--hotswap
does not detect function prop changes--hotswap
does not detect function env variables changes
Turns out, `parseFloat()` in JavaScript is even crazier than we thought, and returns nonsense like `2021` for a string containing a Date like `'2021-10-25'`. For that reason, add an explicit check that the string parsed looks like a number before calling `parseFloat()`. Fixes #16444 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Turns out, `parseFloat()` in JavaScript is even crazier than we thought, and returns nonsense like `2021` for a string containing a Date like `'2021-10-25'`. For that reason, add an explicit check that the string parsed looks like a number before calling `parseFloat()`. Fixes aws#16444 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
The new hot-swap feature doesn't detect function prop changes like environment variables.
Reproduction Steps
app.ts
bug-handler.js
What did you expect to happen?
I expected
cdk deploy BugStack --hotswap
to deploy the stack every time I ran it.What actually happened?
It said
(no changes)
on the second deployment, failing to update the environment variable.Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: