-
Notifications
You must be signed in to change notification settings - Fork 112
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
[static-website] fix: stop silent fail on s3 deleteObjects #115
[static-website] fix: stop silent fail on s3 deleteObjects #115
Conversation
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.
The only thing I'm worried about is: what are the other cases a delete might fail ?
The current state is not ideal but is it better than a randomly failing deploy ? Would a warning be enough (probably not) ?
Would love to hear about what others think.
Also kinda linked to #111 because this originated from misconfigured deploy credentials |
Hello @t-richard and thanks for the review. The Maybe a warning could be enough, but I would argue that the deployment failure would only happen once (most probably at the second deploy). The alternative with the silent fail is that the list of files to delete grows at each deploy and the deployment fails at one point because the XML body sent to the s3 api is too large. Concerning the explicit error, I logged the error returned by the S3 api (as in the description of the PR). I saw that the tests were failing, I will try and fix them :) |
Ah ok ! Nonetheless I think my change broke the s3 sync test, so I fixed it |
I also think failing is somewhat better than a warning because it could lead to unnecessary objects being stored and billed which could become a significant cost over time.
I know you logged the errors but what I was suggesting is to add instructions on how to solve the issue Trying to give users some guidance on what may be wrong will help to get a good developer experience and reduce frustration (and IAM is a very good frustration generator 😅). See some examples: |
Great ! I'll do that ! |
2d9eaea
to
0c59547
Compare
@t-richard done :) |
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.
Thank you, I added minor suggestions for wording.
0c59547
to
9bf219f
Compare
@mnapoli thanks a lot, I applied your suggestions |
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.
LGTM
master is green again, you should be able to rebase or merge it into your branch, and then I think we'll be good to merge 💪 |
9bf219f
to
78def6e
Compare
Hello @mnapoli I think you can relaunch the workflow |
78def6e
to
0d16f8a
Compare
0d16f8a
to
d588e18
Compare
@mnapoli actually it is also used by the "server-side-website" contruct so I updated the tests and added it to the error message |
Thank you! |
Hello and thanks a lot for this awesome project!
When using the
static-website
construct on my project, I realized that I had forgotten thes3:deleteObject
IAM permission of my deployment policy. Therefore, the s3 files synced with lift were never deleted. However, no error was thrown and the deployement failed silently.This silent fail is due to a particularity in the S3
deleteObjects
SDK and the corresponding HTTP API. Since this API can encounter partial failures, the call never fails but returns the errors in aErrors
key.I think that Lift should explicitely fail when the
Errors
key is defined and the list of errors is not empty. In this case, the proposed error is the following: