Commit Graph

5075 Commits

Author SHA1 Message Date
Zev Benjamin 15d13f8f40 puppet: Add script for doing Postgres base backups and purging old backups
(imported from commit 93a92729b2e964e054aa1af7bcb8a0bae3fd1b33)
2013-06-21 14:08:57 -04:00
Zev Benjamin 33b3b1fa62 puppet: Switch which S3 bucket we backup Postgres to
The old bucket was versioned and didn't allow deletes.  This was
great for paranoia, but not so great for being able to delete old
backups.

(imported from commit be79b5c582ca5ee466cdfea6d3093b6d5ba0e23d)
2013-06-21 14:08:57 -04:00
Zev Benjamin 1b6514b89f puppet: Use the correct Postgres archive command
I hadn't changed it previously out of paranoia in the case we had a
faulty failover and had two masters both uploading to the same place.
However, I now don't think this can happen, as recovery completion
will cause Postgres to start a new timeline.

(imported from commit d58f1aa306eff4f6fd950664ff658539c1249bdf)
2013-06-21 14:08:57 -04:00
Zev Benjamin bf82fadc95 puppet: Move /tmp to local storage on Postgres master servers
(imported from commit eae0a31faad6d95c8e2b55c11481aa19d7e108f2)
2013-06-21 14:08:57 -04:00
Waseem Daher 316d4e9220 Slight cleanup of registration page.
(In anticipation of the implementation of Trac #1391.)

(imported from commit 91b4577c20afaf3ee9f5bed7f4e3451020960cf5)
2013-06-21 11:57:48 -04:00
Michael McCanna 425a247569 Fix path injection for tools/review
(imported from commit 25bac426b71a55f29faa232dcac1d957f2941182)
2013-06-21 11:44:40 -04:00
acrefoot a37b08db58 In-Browser Notifications
Some browsers don't support desktop notifications. Some people haven't allowed permissions
for humbug to have desktop notifications. This is a poor man's attempt at desktop notifications.

We are adding the bootstrap-notify package (http://nijikokun.github.io/bootstrap-notify/)

Resolves Trac #1336.

(imported from commit 6a54f7d1875e765dabd32d94ada8ebe4474a3d71)
2013-06-21 11:44:25 -04:00
Jessica McKellar 05bbfb42a9 Make bankrupting more resilient against regular pointer updates being in flight.
(imported from commit 90e1dc16e7d3295b6ed3f5993fe82ac4fcd2d7cc)
2013-06-21 11:00:44 -04:00
Jessica McKellar 24b41351a6 Clean up the message we display while bankrupting you.
(imported from commit 007c97eded421a021cd6aefb7f38fe8f4946b26c)
2013-06-21 11:00:44 -04:00
Jessica McKellar e0b109c6ae Remove the bankruptcy button on the Settings page.
(imported from commit 3f67422df3e96b0902b315c8d055c607e07bc533)
2013-06-21 11:00:43 -04:00
Jessica McKellar 30ab99d765 Offer to bankrupt a user if they are way behind.
(imported from commit 5483bb548a55e6cbf788b71a8885b3c990b94b77)
2013-06-21 11:00:43 -04:00
Zev Benjamin 06bff38655 [schema] Remove old Postgres full text index
We haven't been using this for months and not removing it before was
just an oversight.

(imported from commit d95c1911765a04a0c8713cc6c0dd346c123c97a3)
2013-06-21 10:58:40 -04:00
Tim Abbott 5eca964f0e onboarding: Only update onboarding checklist state if it changed.
I noticed in our server logs that some users were sending
update_onboarding_steps requests to the server every time they sent a
message -- because they hadn't finished the onboarding process.

(imported from commit 8e1751a3344149f386022d96e7893e687d6631e8)
2013-06-21 10:42:32 -04:00
Waseem Daher fd2f41cc5e Slightly cleaner hotkey help for "New X message" buttons.
The "hotkey='x'" syntax was a bit too programmery for my tastes.

(imported from commit 3b4c6f500301b4a4efc2834190f1e86e7f825c3a)
2013-06-20 18:43:19 -04:00
Waseem Daher e5dbf4240e Hide the popover title area if it is empty.
This makes our popovers-as-menus look a bit better.

(imported from commit 53b8be0a4f16fc7a7884b3fcb276a9ab85fe6f24)
2013-06-20 18:42:06 -04:00
Tim Abbott 6cc45b89b1 Revert "Hide pointer until a hotkey is used"
This reverts commit fec64815c879f9704847795cc163e2b517b4190d.

We've decided this experiment didn't work out.

(imported from commit 04f38e15c8ef19fbaa022a06bbcca3b0c67ec5ad)
2013-06-20 18:02:18 -04:00
Tim Abbott c87e12ad41 Revert "Tweak hotkey behavior when pointer isn't shown."
This reverts commit 74fb298c711e61ae98c210d0ed11c875ce6ba591.

We've decided this experiment didn't work out.

(imported from commit 8acd3a030b692f9397155a20a9f89e63ed6a6cf7)
2013-06-20 18:02:18 -04:00
Tim Abbott e55eb53297 Use get_user_profile_by_* functions to get UserProfiles.
We had a few bugs where we were using a raw Django database query to
get a UserProfile object.  This might seem OK, but going through
memcached is more efficient, and also guarantees that we get back the
.select_related() version of the object, so that if we later access
related fields like user_profile.realm.domain, we don't end up doing a
second database query as well.

Fixing these should in practice save a substantial number of database
queries on handling update_status_list requests, which happen very
often and access user_profile.realm.domain.

(imported from commit 0a2027da1b5bbc7a4f6c6927aca498530d7a4977)
2013-06-20 17:57:06 -04:00
Steve Howell 2ee31f46cb Enforce timely tests more aggressively.
(imported from commit b14e484bd72f0fa19b246efeec64815633217a2f)
2013-06-20 16:52:16 -04:00
Steve Howell 92539daa99 Enforce timely test completion.
(imported from commit f2e3ff32b7372cc916cc60ba04abcb90c39197e2)
2013-06-20 16:52:16 -04:00
Steve Howell fac3b756b7 Add decorator to annotate slow Python tests.
(imported from commit adab5330e7f14f38da6755648ae7741fde48d852)
2013-06-20 16:52:16 -04:00
Leo Franchi 468bbf216d Add a new window.bridge call for unread pms
(imported from commit 098c31dbd69c4c020e4c093095e4c78723db0bb1)
2013-06-20 16:23:30 -04:00
Scott Feeney eb3281b193 Update a comment mentioning PipelineCachedStorage
(imported from commit 7b4029db2831538e3077a2f090804da418e13d38)
2013-06-20 16:20:52 -04:00
Steve Howell ca144b5297 Eliminate MyResult class by calling test method directly.
Instead of calling test(result), we emulate the behavior of
calling SimpleTestCase.__call__, minus the results protocol.

(imported from commit e12e3d5caa8726c050a2a7cfa583ca4d571d6cbb)
2013-06-20 13:42:32 -04:00
Steve Howell 1e48388728 removed obsolete comment
(imported from commit e04378869834189c26579727fb7727e63e2e1b5d)
2013-06-20 13:13:39 -04:00
Steve Howell 0e40dc9fc6 Print "Running <test>" from within run_test(), not MyResult.
(imported from commit c8e150c5bd56eabd60c167c207655efc2059d6af)
2013-06-20 13:13:39 -04:00
Steve Howell 618ec40ef7 Import time module at top of tests.py
(imported from commit daf6d20f0c452a51b0485c7dca01d1e541661fd5)
2013-06-20 13:13:39 -04:00
Steve Howell cdc095c3b3 Extract run_test() method in back end tests.
(imported from commit 264bf689b282fccf8b4e423060fe0c4d2708b934)
2013-06-20 13:13:39 -04:00
Allen Rabinovich e0c05ea7a9 Prevent buttons from stacking in a narrow window by removing their text labels
(imported from commit ab1526e12d7fea0dd791ae02f419ab65d7430e30)
2013-06-20 09:24:40 -07:00
Zev Benjamin 86b450ca06 Remove trailing whitespace
(imported from commit 1770beb3936b3f3290e3fde3a2548c7ea60cd503)
2013-06-20 12:21:42 -04:00
Zev Benjamin 0754430c86 Make portico pages structurally valid HTML
There were a few things the W3C validator complained about that I
didn't bother fixing (like img tags without alt attributes and
obsolete tags).  There also a few pages that were slightly more
annoying to get my local instance to render (like the 404 and 500
error pages), so I checked those by eye.

This does not cover the actual app at all.

(imported from commit 1cbe1ec11067e96718814ec23eaf5a8b4b68ef19)
2013-06-20 12:21:42 -04:00
Zev Benjamin 552347ac52 Grammar nit
(imported from commit cbb20cb7114c8fe4bc2a5021f35be55dc12ac4dd)
2013-06-20 12:21:42 -04:00
Zev Benjamin 0e330e7d7e Add mixpanel badge to the front page
Displaying the badge gets us a bunch of free mixpanel data points/month.

We only display the badge on the login page (which `/` redirects to)
and not on other portico pages.

(imported from commit 75871173a10ae888fdb7c92fe8e20586ce60c6bf)
2013-06-20 12:21:42 -04:00
Zev Benjamin d8f1413bc4 Rework bottom navbar styling
This just makes the markup on each list item more consistent.

(imported from commit d12f6ef503b6da10c39aaaadcf2c6d359e9d0d47)
2013-06-20 12:21:42 -04:00
Zev Benjamin 8921621621 Make our portico bottom copyright and navigation stick to the bottom of the page
We use the technique described here:
http://ryanfait.com/resources/footer-stick-to-bottom-of-page/

(imported from commit 108f3c9cc4ce9dbf483ff76d6f9a6a014077da56)
2013-06-20 12:21:42 -04:00
Allen Rabinovich 8ea3dc285d Fix for an overlapping scrollbar in streams list
(imported from commit f07114e06745b9dd7e8b31eec61d21a1914c22c6)
2013-06-20 08:43:32 -07:00
Tim Abbott 47255e9cd8 Fix buggy key computation in cache_with_key.
The refactoring to use the cache_get() method incorrectly didn't
remove the addition of KEY_PREFIX inside cache_with_key.  The result
was that the KEY_PREFIX was being added twice, once by cache_with_key
and again inside cache_get.

This had the impact of causing pointer saves to not take effect,
because our attempts to update the memcached cache when we save the
UserProfile object were using the correct cache key, but the actual
code reading values out of the caceh wasn't.

(imported from commit dcea000833f00622bdc0249488de3b186a7417b2)
2013-06-20 10:57:32 -04:00
Steve Howell c5631eb489 Make test_emoji about 500ms faster.
The test_emoji test makes sure that we build the correct image
tag for all of our emojis.  It's the same underlying algorithm
for all 800+ images, so we now test it in O(1) times instead
of O(N) time.  Randomly sampling the emojis makes the tests
slightly non-determinisitic in a theoretical sense, but not in
a practical sense.

(imported from commit c78b50072953f2c081fca0272b9ecf762a4802db)
2013-06-20 10:24:40 -04:00
Steve Howell 07afbabb79 Double speed of Python tests by removing fixtures code.
(We don't need the fixtures code once we override Django's
run_suite() method not to clobber our test database, since
all our tests use the same data anyway, and since Django
runs all the tests in a transaction and rolls back their
changes.)

(imported from commit d9daf09be3967de2de30934173b882d3d6b9ea27)
2013-06-20 09:41:34 -04:00
Steve Howell 3c79f6fa53 Make RateLimitTests less brittle to speedy tests
(imported from commit 1b81356d90bdb19b0550363aebb2f1426d386d10)
2013-06-20 09:41:25 -04:00
Steve Howell 712dce8a97 Do not have Django wipe out our test database during Python tests.
In tools/test-backend, we build the test database before calling
"manage.py test, so there is no reason for Django to wipe it
clean.

(imported from commit 7b09e9cc1a9259900ec1cc4f9ebbcacab1efb265)
2013-06-20 09:41:25 -04:00
Steve Howell ad03644371 Add help message for method-missing scenario in tests.
(We now have a full replacement for TestResult, but we don't
support the full API of TestResult.  If folks were to add new
tests that caused TestCase to call our class with an unsupported
method, this diff will provide hopefully a more clear error
message.)

(imported from commit 92033b12a1a901bd649ecb03e08779aa76bfef7a)
2013-06-20 09:38:53 -04:00
Steve Howell f2f9fb7c3b Simplify run_suite for Python tests so we can debug tests more easily.
We use a simplified version of run_suite in our subclass of
DjangoTestSuiteRunner so that we can have more control over failing
fast and indicating progress.  This change also speeds up the tests
by taking roughly 200 lines unittest/Django code out of the picture.
(We basically reinvent a simpler TextTestRunner and TextTestResult.)

(imported from commit 5216b6b582b071bd7c9e923c9886c3bc61faf581)
2013-06-20 09:37:00 -04:00
Steve Howell 25c9f5bace Subsume Django method into our codebase for code review clarity.
(This commit will probably be squashed, but it makes the subsequent
diffs more clear with respect to how we remove functionality from
run_tests.)

(imported from commit 9d0edcd5282a0f90ebd38e0ac229ef874dc00504)
2013-06-20 09:36:49 -04:00
Steve Howell 00a2b23843 Sort the import statements in tests.py (cosmetic).
(imported from commit d730d73841818f7104522b126e7faf1735c897fd)
2013-06-20 09:36:49 -04:00
Tim Abbott 60b8635593 cache: Add a helper function to get the right cache backend.
(imported from commit 3e80178dbaa0fcc77d1075bb3fad29ace7540a02)
2013-06-19 18:40:58 -04:00
Tim Abbott d2e18094d8 cache: Refactor cache_with_key to use the helper functions.
(imported from commit 24f8af8de17d3376c8ee56da5c2a901c2c314e78)
2013-06-19 18:40:58 -04:00
Tim Abbott 46c40c011a cache: Use KEY_PREFIX in cache_set().
(imported from commit 3dbddc9c513b58f692947f0c30a18ec12250e3a5)
2013-06-19 18:40:58 -04:00
Tim Abbott cb4e965fd2 cache: Remove KEY_PREFIX from keys returned by cache_get_many.
Otherwise code paths that use those keys, like get_old_messages, will
incorrectly use the prefix-included keys.

This bug in our KEY_PREFIX system results in our memcached caching for
get_old_messages always missing.

(imported from commit 506c13e06d6f266596ead0b381c324c256e576c3)
2013-06-19 18:40:58 -04:00
Tim Abbott cc02890b1f tornado: Clean up legacy code for message event format change.
(imported from commit 6feb1a26e86d72febf965c409648339ea4811797)
2013-06-19 18:40:58 -04:00