As a technical reviewer of the book related to this repo, I took some time to run through all of the example code to ensure that it is functional. Here is my review of the code. I've set the items as check boxes so that they can be checked off when addressed. When possible, the links to files include the relevant line number. I also hard-coded the commit hash in master that all these comments are currently referring to.
Thank you for creating this! What an awesome resource this will be to me in the future when I write serverless code. As a whole I am impressed with all the thought put into this codebase. Please note that most of these items are my opinions and that I understand that they may not be the direction you want to with this repo.
Current Status
This is the current status of the major items.
General Notes
env file example
A basic env example file per chapter that a user can copy, then fill in to get going.
Individual Chapter README.md files.
Right now each chapter either is missing a README.md or has a basic README.md that was generated with the serverless cookie cutter. It would be good to have succinct instructions for how to get started with each chapter example code.
Libs Issue
make libs fails on most chapters when ran a second time due to the line find $(LIBS_DIR) -name '*.pyc' | xargs rm in most Makefiles. The issue is due to a reinstall not creating any *.pyc files. Adding a -f flag to rm would fix this (e.g. find $(LIBS_DIR) -name '*.pyc' | xargs rm -f).
Database Port Collision
Both ch2 and ch3 postgres containers use the same port which makes it difficult to run both at the same time.
Database Instances Required
ch2 and ch3 are required for make shell even if you don't want to run tests (i.e. shell to deploy). Fixing the port collision will make this less of an issue.
Postgres Alpine Image
The alpine variants of the postgres docker images are considerably smaller. It would be nice to not use as much disk space for tests.
make clean
It would be nice to have a make clean command that cleans up libs, database containers, etc.jjjj
deploy dependent on libs
I forgot to run make libs before deploying a few times. It would be nice to either require libs to run for each deploy in the Makefile or have some form of a check to ensure libs have been installed before a deploy.
Chapter Specific Notes
ch2
You addressed most of my notes in #12. There are a few notes on that PR.
ch3
ch5
ch6
ch7
ch8
ch9
As a technical reviewer of the book related to this repo, I took some time to run through all of the example code to ensure that it is functional. Here is my review of the code. I've set the items as check boxes so that they can be checked off when addressed. When possible, the links to files include the relevant line number. I also hard-coded the commit hash in master that all these comments are currently referring to.
Thank you for creating this! What an awesome resource this will be to me in the future when I write serverless code. As a whole I am impressed with all the thought put into this codebase. Please note that most of these items are my opinions and that I understand that they may not be the direction you want to with this repo.
Current Status
This is the current status of the major items.
make cleanGeneral Notes
env file example
A basic env example file per chapter that a user can copy, then fill in to get going.
Individual Chapter README.md files.
Right now each chapter either is missing a README.md or has a basic README.md that was generated with the serverless cookie cutter. It would be good to have succinct instructions for how to get started with each chapter example code.
Libs Issue
make libsfails on most chapters when ran a second time due to the linefind $(LIBS_DIR) -name '*.pyc' | xargs rmin most Makefiles. The issue is due to a reinstall not creating any*.pycfiles. Adding a-fflag tormwould fix this (e.g.find $(LIBS_DIR) -name '*.pyc' | xargs rm -f).Database Port Collision
Both ch2 and ch3 postgres containers use the same port which makes it difficult to run both at the same time.
Database Instances Required
ch2 and ch3 are required for
make shelleven if you don't want to run tests (i.e. shell to deploy). Fixing the port collision will make this less of an issue.Postgres Alpine Image
The alpine variants of the postgres docker images are considerably smaller. It would be nice to not use as much disk space for tests.
make cleanIt would be nice to have a
make cleancommand that cleans up libs, database containers, etc.jjjjdeploy dependent on libs
I forgot to run
make libsbefore deploying a few times. It would be nice to either require libs to run for each deploy in the Makefile or have some form of a check to ensure libs have been installed before a deploy.Chapter Specific Notes
ch2
You addressed most of my notes in #12. There are a few notes on that PR.
ch3
ch5
make testtarget.us-west-2ch6
make testtarget.ch7
make testtarget.websocket-clientrequirement.kinesis = boto3.client('kinesis', region_name=os.environ['AWS_REGION'])). Maybe its due to me running a different version of boto3. Setting the exact version in the requirements.txt could fix this.ch8
make testtarget.serverless-prune-pluginas well as the addition of a package.json for ease of installation.serverless-design-patterns/ch8/map-reduce/serverless/serverless.yml
Lines 29 to 34 in 9591014
make libs, thenmake deploybreak.sls invoke -s $ENV -f Driver).empty-bucket.shis hard coded to a specific bucket that isn't useful for the user of this repo.ch9
make testtarget.KEY_ARNenv var (it currently usesKMS_KEY_ARNrather thanKEY_ARNused elsewhere.encryptfunction.os.envrironshould beos.environ)RollbarDividefunction decorated with the rollbar decorator.serverless-prune-pluginas well as the addition of a package.json for ease of installation.kms.py. Different version of boto3? Maybe that needs to be locked to a specific version.