Commit Graph

310 Commits

Author SHA1 Message Date
Tim Abbott fe987fb1c3 [manual] Excise South migrations prior to the User merge.
South doesn't properly deal with removing the Django User model, so
this commit redoes our South history to instead start after that
migration has already been applied.  This allows us to get rid of some
annoying hacks.

Note that developers and staging will need to run

./manage.py migrate --delete-ghost-migrations zephyr

in order to clear out the old versions of the migrations.

(imported from commit 7f45ea601b809dde33720f76e7dfb0ab348b0e65)
2013-05-20 23:29:54 -04:00
Zev Benjamin 4bfda4c49e update-deployment: Purge old deployments after deploy
(imported from commit 9a320617e22a1d71506fbb76443a00c178ae5367)
2013-05-17 01:02:34 -04:00
Zev Benjamin 30d417a692 Add tool to purge old deployments
(imported from commit d214e1a843ea5e5902b14551730d004ff04e903d)
2013-05-17 01:02:34 -04:00
Zev Benjamin 4cdecdea21 update-deployment: Move constants to humbug_tools
(imported from commit d3699d684b74b15a10f0a464f58623a376f7d486)
2013-05-17 01:02:34 -04:00
Zev Benjamin 6b3b418010 update-deployment: Make the deployment directory a constant
(imported from commit fcbd5f3e98881f33c5b50b28a90b4627593abe83)
2013-05-17 01:02:34 -04:00
Zev Benjamin 578eead441 update-deployment: Create the logs directory in addition to the humbug-deployments directory
The logs directory needs to be there the first time we start a frontend.

(imported from commit c37825f5bd41cbfa3ac22f61d05552e3d4f3ccbb)
2013-05-17 01:02:34 -04:00
Zev Benjamin e4e9613a59 Add a deployment lock to prevent concurrent deployments
The lock file is a directory in case we want to add future metadata
information.

(imported from commit 505a684870baff94f28bf689b0c5ca2e8265a3c0)
2013-05-17 01:02:34 -04:00
Steve Howell f024a7ab14 Call process_loaded_for_unread() more directly.
This is a prefactoring to eventually eliminate the home_unread_messages
global variable.  More commits to follow.

In order to set up process_loaded_for_unread() not to modify
global variable to get its job done, we want to pull it out of
add_messages(), so that add_messages() doesn't have to pass back
state to the 9 different places in the codebase where it's called.
There are only 2 places where process_loaded_for_unread() get
called after this commit.

In order to facilitate pulling up process_loaded_for_unread(), I
made it so that the contract for add_messages() was to accept
already-hydrated messages.  This way I could hydrate the messages
before calling process_loaded_for_unread() without have to
worry about double-caching them in add_messages.  This will
slightly improve performance, but it was mostly done for code
clarity.

(imported from commit ad5aaad5b1f22c31647370f4c9dcb5f89d7d99a7)
2013-05-14 15:21:27 -04:00
Jessica McKellar 76a57e78ed Enumerate onboarding steps client-side, and give a way to update them.
(imported from commit 0a993976e898cdb20ebb814a19d520572ef8b7e6)
2013-05-14 10:27:39 -04:00
Zev Benjamin 028d3adabf [manual] Lower the max number of child processes that runfcgi can spawn
The default is 50, which we believe was causing too much CPU
contention in prod during restarts.  This commit lowers the max to 20.

The django-command-line script needs to be restarted manually to pick
up this change.

(imported from commit c2d097d2141be50b6222efb4a34142108c241cce)
2013-05-10 17:39:49 -04:00
Leo Franchi 77fd5f1113 Also kill/restart send_missedmessage_reminders on a deploy
(imported from commit 560f6aabb0daec63d55806f8caab76d3fb7d260a)
2013-05-10 09:41:49 -04:00
Leo Franchi 1267ffe542 Show unread counts next to expanded subject names
(imported from commit 6de1145cdec8d7e68395c1f9a7a95cd59136d805)
2013-05-09 10:41:32 -04:00
Leo Franchi b9a39d7982 Make missed message keepalive executable
(imported from commit 66f96b2bd75ae84bc4aec7073542b11611990dee)
2013-05-09 10:35:48 -04:00
Leo Franchi 065e6de420 Add management command to handle & email notifications about missed messages
(imported from commit 5b1479bc91d559e96467aa09405d823f9b2bbdf6)
2013-05-09 10:35:48 -04:00
Tim Abbott 85742823d9 zephyr_mirror: Use json if simplejson is not available.
(imported from commit 4b5f6ff71067cd2697c864c715afbb3b9dd19302)
2013-05-09 10:35:47 -04:00
Zev Benjamin 7becd3e504 Move stream sidebar functions to their own module
(imported from commit 50771c1590eb3a0dbb151bf6a798bd14a4418857)
2013-05-09 10:35:46 -04:00
Zev Benjamin 96129b1cf0 Speed up string comparison for sorting
The String.localeCompare function is really slow, at least partially
because it creates a locale-aware collator object each time.  So now,
when we can, we create and cache a locale-aware collator object.
However, this is not supported on most browsers, so we fall back to a
non-locale-aware comparison.  This is not ideal, but for now we are
mostly working with English-speaking customers.

(imported from commit 51aa02e3b9fe4a0ef0cb084874fe26e91c57f65e)
2013-05-07 11:47:12 -04:00
Luke Faraone d7dba4ca3c Add audio folder to update-prod-static.
(imported from commit 08316159d8a9dd39b92402231dfa3b7c605a1485)
2013-05-03 15:22:54 -07:00
Leo Franchi 9362731e4d Mark messages behind pointer as read when moving pointer
(imported from commit 7e1d3d7124aec239a8fdd24da4aab682a41ff435)
2013-05-03 11:14:47 -04:00
Leo Franchi d0b8a2fd21 Mark messages as read when using the End key
(imported from commit b2495cb27b1362d037e786db7f108540f2ce655b)
2013-05-01 17:26:19 -04:00
Leo Franchi 7b0423efc1 Use incr instead of gauge when sending events to drawAsInfinite to statsd
(imported from commit 08a4b6920c7a4a8f472f147ddce7c04710fe5c0a)
2013-04-19 09:56:41 -04:00
Leo Franchi d02f46fba7 Log a statsd event when restarting the server
(imported from commit e9fa632a39f0a6b6aa7311e80e68faf4178a2cf3)
2013-04-18 18:05:52 -04:00
Tim Abbott 3fa32c8f7d Decrease restart timeouts for django and tornado command lines.
(imported from commit 5653de5e4e39f6ecfade794738d334a360bf2a7e)
2013-04-18 17:15:29 -04:00
Luke Faraone 80e452af82 Include get_messages call in tarball.
(imported from commit ed030c97ba3c34a72eb7ced867c20d1a7c315159)
2013-04-18 09:57:53 -07:00
Tim Abbott a54e8fee1c Add tool used for backing up wiki, trac, events.
This is a slightly tweaked version of the tool Keegan was using for
these backups.

(imported from commit c9fb7f0585c219703130fe1431ea40ca7320408e)
2013-04-17 10:19:13 -04:00
Tim Abbott 6ab480d9c6 restart-server: Call fill_memcached_caches via more direct path.
The previous version ended up being (at least sometimes) wrong after
the recent deployment system changes.

(imported from commit dec3beb1b1bf8b9c9ad6820b93b0a5d730d020e8)
2013-04-17 10:19:13 -04:00
Tim Abbott 104d3c8101 Make tools/send_confirmation_emails_command_line executable.
(imported from commit 3923efcbddaca705a64fb4359adc408c7f948ad4)
2013-04-12 15:37:49 -04:00
Tim Abbott 3ef78dd01c Fix restarting of commands with new deployment loops.
(imported from commit 139d80097d74b1c7f4ec92175a2052b4acf55af1)
2013-04-12 15:35:49 -04:00
Tim Abbott 1b3d93ad47 Fix restarting of various tools during deployments.
(imported from commit b16b8b3d7ce159a91e7d9c3781f1e69861bd3ff3)
2013-04-12 15:35:49 -04:00
Tim Abbott 28c77382d1 Update foo-command-line scripts for new deployment model.
(imported from commit 62a1fc9a5d90966d33afe31bdd5f4b80f6754fad)
2013-04-12 15:03:11 -04:00
Tim Abbott 1b8cf16988 [manual] Update deployment process to run atomically.
This requires manual steps on deploy to each of staging and prod:
(1) Run the new update-deployment code to setup the initial deployment directory.
(2) Restart all the programs running in screen sessions.
(3) Deploy the nginx changes and restart nginx.

(imported from commit 1ffe27933ee79274dc0a93d35c9938712de0ef36)
2013-04-12 11:54:50 -04:00
Tim Abbott 88e2949818 Move update-prod-static etc. out of restart-server.
(imported from commit 763af1c8b1937cda860acc635d9d87c12d66a938)
2013-04-12 11:54:49 -04:00
Leo Franchi 9130f6722f Show latest 5 subjects in sidebar when narrowed to a stream
This is a V1 of this feature. For now, the only way to expand is by narrowing
to the stream---future revisions may add a manual toggle if it is found to be
useful.

Additionally, showing per-subject unread counts will be coming in a future revision
as well.

(imported from commit fb5df0d27e928fa3b0f32b9ff2c1c508202cf7e5)
2013-04-12 11:51:09 -04:00
Keegan McAllister d6aafa260f JSLint: Allow typeof x === 'undefined' for testing if a variable exists
(imported from commit c6429911f65f05ba7ec11c43950d338cfc97b793)
2013-04-10 18:05:00 -04:00
Keegan McAllister 07bb220194 Add a password strength check on the signup page
(imported from commit a44101485e49fd7a7951bda05ba10a021b6d3ee0)
2013-04-10 18:05:00 -04:00
Luke Faraone 2fd4525531 Add process-mailchimp-signups-command-line so we can fire and forget this daemon.
(imported from commit 7a966199da51ec22ae62386d6382ebf05d151f31)
2013-04-05 10:22:27 -07:00
Tim Abbott c65f37c910 do-destroy-rebuild-database: Fix migration with AUTH_USER_MODEL.
Django's South migrations support for setting up a new database
doesn't properly handle AUTH_USER_MODEL changing over time.  Fix this
by having the initial migration be run with AUTH_USER_MODEL set to the
default value.

(imported from commit c373db9edc61f26527c486c741f8e870614600e3)
2013-04-04 17:39:01 -04:00
Tim Abbott a1aae4a39f [South] [schema] Add an index on Userprofile.email.
We accidentally lost this when we did the User/UserProfile merge (this
commit also deletes the old code to add the auth_user index in
do-destroy-rebuild-database).

This below is mostly just notes for future reference, but when
deploying this change to staging, we should consider running the
following instead of using the migration directly:

CREATE UNIQUE INDEX CONCURRENTLY zephyr_userprofile_email_uniq ON zephyr_userprofile(email);
ALTER TABLE zephyr_userprofile ADD CONSTRAINT zephyr_userprofile_email_uniq UNIQUE USING INDEX zephyr_userprofile_email_uniq;
CREATE INDEX CONCURRENTLY zephyr_userprofile_email ON zephyr_userprofile(email);

But I think it might be the case that it's fine to just run it
directly, since the ALTER TABLE part seems to hang if there's an open
transaction working on a UserProfile object anyway.

(imported from commit 1bf34ce242de51e97c91c8bab86b6b273e17fb43)
2013-04-04 15:45:42 -04:00
Zev Benjamin de1f4b0be2 Remove all inline event handlers
This allows blueslip to catch exceptions from the event handlers on
these elements in addition to the other benefits that not using
inline handlers provide.

(imported from commit 2bdcb2496c6c08fa7228a20ce6164b527cf64e41)
2013-04-04 11:34:32 -04:00
Tim Abbott 39e79271e2 test-all: Run frontend tests after backend tests.
When the backend is failing, the frontend often fails in much less
clear ways (e.g. timing out), so it's generally more useful to run the
backend tests first.

(imported from commit 36ac862ad1dbb21e32c0f44ba135c3c29bbea2f5)
2013-04-02 16:27:13 -04:00
Tim Abbott a095666770 test-backend: Don't pass --skip-generate to testing system by default.
It doesn't save much time (maybe 0.5s out of 12+s).

I'm leaving the option in because I think it is still useful for
iteratively testing a single test case.

(imported from commit a0ac43f4c48eec101f05d731740394b30a15773b)
2013-04-02 16:27:12 -04:00
Keegan McAllister 9dd987be7e Precompile Handlebars templates in production
Fixes #908.

(imported from commit 30458e9bea8117d1fa15dc962bb1a495f22672cc)
2013-04-02 14:43:59 -04:00
Keegan McAllister 17d5406b55 [manual] Fetch Handlebars templates using Ajax
...rather than embedding them into index.html.

This is only acceptable for dev, but the next commit adds an alternative
mechanism for prod.

There isn't actually a manual deployment step here.  However, this commit won't
work on staging / prod without the next one (since we don't serve
zephyr/static/templates in prod).

(imported from commit dce7ddfe89e07afc3a96699bb972fd124335aa05)
2013-04-02 14:43:58 -04:00
Keegan McAllister c375de29ad check-all: Ignore node_modules
Which we add in the next commit.

(imported from commit 8b55ec7ac5a62657d9ff28bee39c43d01158f982)
2013-04-02 14:43:58 -04:00
Jessica McKellar 3df47f2025 Do not try to recenter if you were already moving in the right direction.
Before this commit, if you try to arrow around when the selected
message is outside the pointer threshold for recentering, you get a
big jump, even if you are arrowing towards the center of the viewport.

(imported from commit 5c15d5ccccdf027a8bfa8b79bf519fccbfa971d8)
2013-03-28 17:08:25 -04:00
Zev Benjamin 401fa6063e [manual] Add get_events URL routing
The new nginx configuration file needs to be copied to
/etc/nginx/humbug-include and nginx needs to be restarted when this
commit is deployed.

(imported from commit 6c43f3c2c7a6acee6a852c672c96a38bda01dd0d)
2013-03-28 16:48:52 -04:00
Luke Faraone 3738d8215d Update run-dev to prefix match messages/latest.
This means all GET parameters were chopped off previously in local testing.

Nginx does pattern matching so this is not a problem on staging.

(imported from commit 25a28155b70d168228ca793fc0122b2ebea408e9)
2013-03-28 12:53:42 -07:00
Keegan McAllister aa3c446665 Generate source maps from Closure Compiler
(imported from commit 0e4de860b1dba85aa43b60a2c819ac44403186c5)
2013-03-28 12:11:23 -04:00
Luke Faraone 0d51e59fd5 Implement URLs for API redesign.
(imported from commit 2020491a737ec4c1e99a63f84eb6cfc594a2dd56)
2013-03-28 07:57:38 -07:00
Zev Benjamin 878646542f deploy-branch: Check out original ref by name if possible
(imported from commit eefc68574f1d1a94f1284670df18f59ef2aa1aa5)
2013-03-27 14:15:03 -04:00