Keep AWS Lambda code in source control somewhere... This is the code used to support the WebKitArchives.
<rdar://problem/34721629>
Created attachment 322110 [details] v1 patch for review
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.
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?
Comment on attachment 322110 [details] v1 patch for review It may be useful to have comments explaining what event triggers these lambdas.
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.
Committed revision 222634.