RESOLVED FIXED 177614
check in AWS Lambda code used for WebKitArchiveSupport
https://bugs.webkit.org/show_bug.cgi?id=177614
Summary check in AWS Lambda code used for WebKitArchiveSupport
Lucas Forschler
Reported 2017-09-28 12:39:18 PDT
Keep AWS Lambda code in source control somewhere... This is the code used to support the WebKitArchives.
Attachments
v1 patch for review (7.77 KB, patch)
2017-09-28 12:45 PDT, Lucas Forschler
ap: review+
lforschler: commit-queue-
Radar WebKit Bug Importer
Comment 1 2017-09-28 12:40:23 PDT
Lucas Forschler
Comment 2 2017-09-28 12:45:28 PDT
Created attachment 322110 [details] v1 patch for review
Lucas Forschler
Comment 3 2017-09-28 12:46:38 PDT
Note: AWS will not allow a lambda function to be used for multiple triggers. Therefore, these files are pretty similar, only differing in a few variables/constant values.
Alexey Proskuryakov
Comment 4 2017-09-28 14:29:10 PDT
Comment on attachment 322110 [details] v1 patch for review View in context: https://bugs.webkit.org/attachment.cgi?id=322110&action=review rs=me, as this code is in production already. Would be nice to have regression tests for it. > Tools/WebKitArchiveSupport/lambda/delete-minified-s3-archive-from-dynamodb.py:32 > + print('Error deleting item: {}\nfrom database: {}.'.format(item, table_name)) > + raise e Where do these errors go? How will we notice them? > Tools/WebKitArchiveSupport/lambda/register-minified-s3-archive-in-dynamodb.py:26 > + split_key = key.split('/') > + identifier = split_key[0] # mac-sierra-x86_64-debug > + filename = split_key[1] # 218331.zip > + revision = filename.split('.')[0] # 218331 Is there a way to avoid duplicating code?
Alexey Proskuryakov
Comment 5 2017-09-28 14:30:52 PDT
Comment on attachment 322110 [details] v1 patch for review It may be useful to have comments explaining what event triggers these lambdas.
Lucas Forschler
Comment 6 2017-09-28 14:42:32 PDT
Comment on attachment 322110 [details] v1 patch for review View in context: https://bugs.webkit.org/attachment.cgi?id=322110&action=review >> Tools/WebKitArchiveSupport/lambda/delete-minified-s3-archive-from-dynamodb.py:32 >> + raise e > > Where do these errors go? How will we notice them? These errors are sent to Amazon CloudWatch. We would never see them unless we noticed problems and went back through logs to figure out what is going wrong. It might be possible to configure events to watch for specific errors, I can investigate. >> Tools/WebKitArchiveSupport/lambda/register-minified-s3-archive-in-dynamodb.py:26 >> + revision = filename.split('.')[0] # 218331 > > Is there a way to avoid duplicating code? I've read several articles on this, and haven't found any solutions that look reasonable. It's something I will watch out for as we grow our infrastructure.
Lucas Forschler
Comment 7 2017-09-28 14:43:57 PDT
Committed revision 222634.
Note You need to log in before you can comment on or make changes to this bug.