{"push_id":1213047139,"size":4,"distinct_size":1,"ref":"refs/heads/update/docker-pause-server-init","head":"f35555bd75ed14455717fec2fdfb7be31fbfab5c","before":"177e37c0f35edc06675022ffff085a2e7d828817","commits":[{"sha":"49b50c21c2b9f94a92253ba0320a4ab28fb1ae3b","author":{"name":"Dennis Snell","email":"84520f699cfdb0c67a3da2f8e8b6601649c21318@automattic.com"},"message":"Profile Pictures: Refactor upload handling code\n\nPrecursor to #71\nShould prevent problems in #15\n\nThis patch refactors a fair bit of code surrounding the way user profile\npictures are uploaded and saved. The existing process is full of nested\nblocks and hard-coded information, preventing some flexibility in the\nway we deal with uploads.\n\nThe refactor should provide the following benefits:\n\n - Image types are recognized from their actual data and not from the\n   file extension. This closes off the possibility to defeat the rule by\n   simply changing the filename. The new check relies on the built-in\n   `imghdr` library in Python\n\n - Some image operations have been modularized in order to isolate and\n   simplify their behaviors. This should allow incorporating\n   alternatives to the S3 storage, such as for when developing locally.\n\nThese changes alter the way the image filenames are generated.\nPreviously, the stored filename was a function of the first fifty\ncharacters in the uploaded filename. Now, the filename is generated as a\nfunction of the SHA1 hash of the uploaded file contents, which not only\ngreatly limits the range of characters sent as the filename (no possible\nencoding issues, for example), but also ends up mapping identical images\nto identical filenames, regardless of the given name.\n\nThis last point about mapping to the same name could carry a negative\nimplication: we could end up having two references to the same file and\naccidentally delete \"both\" because we deleted the singular mapping\nendpoint. It does not appear like this will be a problem given the way\nthe app is structured.\n\n_Example_\n\n - User uploads profile picture\n - User uploads picture for some other use, but the contents are\n   identical to the profile picture\n - User deletes this picture, but since it shares the same filename as\n   the profile picture (they are identical), both get erased.\n\nThis new file naming behavior is more regular and standard than the\nexisting formula, but we could just as easily reproduce the old behavior\nby updating the `image_to_user_filename()` function.","distinct":false,"url":"https://api.github.com/repos/communityshare/communityshare/commits/49b50c21c2b9f94a92253ba0320a4ab28fb1ae3b"},{"sha":"6848f1898687f91c2444ad8bfc1c00f8f4e3c461","author":{"name":"Ben Reynwar","email":"9c85637c38b80821c7bd8a03bde7b59da81ab77d@reynwar.net"},"message":"Merge pull request #110 from communityshare/refactor/user/picture-handling\n\nProfile Pictures: Refactor upload handling code","distinct":false,"url":"https://api.github.com/repos/communityshare/communityshare/commits/6848f1898687f91c2444ad8bfc1c00f8f4e3c461"},{"sha":"2e61d7690dd7d4fc082bdbaea3cff9cf5c079180","author":{"name":"Dennis Snell","email":"84520f699cfdb0c67a3da2f8e8b6601649c21318@automattic.com"},"message":"Code refactoring and restyling in `setup.py` (#107)\n\n* Code refactoring and restyling in `setup.py`\r\n\r\n* Reformat get_labels()\r\n\r\n* Reformatted list comprehension\r\n\r\n* Fix error in calculating max number of possible name combinations\r\n\r\nI had accidentally used the sum of the count of first name and last\r\nnames when the total should have been the product.\r\n\r\nThis commit fixes that mistake.\r\n\r\n* Reformat comprehensions in `make_random_user()`\r\n\r\n - Splits comprehensions into multiple lines\r\n - Removes a variable holding only a random value\r\n - Renames `institution_associations` to trim line length\r\n\r\n* Extract return value into variable\r\n\r\n* Fix merge conflict from rebase\r\n\r\nSomehow the old `@notarealemail.com` came through after a rebase, so\r\nthis updates it appropriately to `@example.com`","distinct":false,"url":"https://api.github.com/repos/communityshare/communityshare/commits/2e61d7690dd7d4fc082bdbaea3cff9cf5c079180"},{"sha":"f35555bd75ed14455717fec2fdfb7be31fbfab5c","author":{"name":"Dennis Snell","email":"84520f699cfdb0c67a3da2f8e8b6601649c21318@automattic.com"},"message":"Delay startup of web app to allow DB to initialize\n\nPreviously we have had some sporadic issues where the Flask app was not\nproperly starting up because it could not attach to the database.\n\nI believe that this problem was due to timing issues initializing\npostgres.\n\nNow, the Flask app startup is delayed by five seconds to allow proper DB\ninitialization before starting and this seems to be resolving any of\nthose sporadic issues.","distinct":true,"url":"https://api.github.com/repos/communityshare/communityshare/commits/f35555bd75ed14455717fec2fdfb7be31fbfab5c"}]}
{"actor":{"display_login":"dmsnell"}}