Commit Graph

662 Commits

Author SHA1 Message Date
Waseem Daher 7329cedd84 iframe-bot: Properly style emoji (but you need to copy in the images).
(imported from commit 3fbf54a46d4f20e9da21c73cfe9f6a0064749f1c)
2013-08-13 10:36:05 -04:00
Waseem Daher dfb60ee966 File uploads using Dropbox.
(imported from commit c552133fc7025eca526fbfef24fd544260d7111b)
2013-08-12 17:22:23 -04:00
Waseem Daher 932d002ff4 Zulip embedded iframe bot.
Currently running for CUSTOMER3, at MIT.

(imported from commit 1c29d3fb3fbf29b9ea633e9fc102e7737eba4fd7)
2013-08-12 17:09:48 -04:00
Waseem Daher 067bd390ac Remove kiosk mode.
We instead implemented the ~desired functionality here using the
API and a bot to make a totally read-only, static, slowly-updating
view into the Zuliverse.

This is the moral equivalent of reverting deb035b4c702fcdb0e660ed549fe74c682abb6d9

(imported from commit 9d743fe82f197b37f005e5a038f77cc4b8566024)
2013-08-12 16:19:53 -04:00
Steve Howell 878ee2b3fd Move Filter class to filter.js from narrow.js.
1) The class Filter now lives in its own module.
2) The function canonicalized_operators() is now a class method on Filter.
3) The function message_in_home moved to filter.js and became private.
4) Various calling code had to change, of course.
5) Splitting out Filter helped simplify a few tests.

(imported from commit e41d792b46d3d6a30d3bd03db0419f129d0a2a7b)
2013-08-12 13:58:32 -04:00
Steve Howell 37f8cc9294 Extracted code into compose_fade.js.
The compose_fade has three public exports:

    set_focused_recipient
    unfade_messages
    update_faded_messages

All code was pulled directly from compose.js, except for the
one-line setter of set_focused_recipient.  The focused_recipients
variable that used to be in compose.js was moved to compose_fade.js,
hence the need for the setter.

(imported from commit 462ca5d0d0bd58612d0197f3734a8c78de8c6d30)
2013-08-11 17:05:13 -04:00
Waseem Daher 0dcaf9ca3d Kiosk mode [unsafe].
"Kiosk mode" is a "read-only" Zulip suitable for embedding into
an iframe on another site. I say "read-only" in quotation marks,
because the account is still a fully-fledged active account on
the server, and we just tear out a bunch of stuff in Javascript
(that a malicious user could easily re-enable).

So in that sense, it's not actually safe in security-sensitive
environments -- malicious users logged in via kiosk mode
can do anything the kiosk-mode user can do.

(We need this functionality for the customer3 realm specifically;
 we'll possibly just tear this code back out once that experiment
 has run its course.)

(imported from commit deb035b4c702fcdb0e660ed549fe74c682abb6d9)
2013-08-11 15:57:21 -04:00
Scott Feeney 4aab49657d Fix minify-js failure to update app.js when templates changed
Also adds a clarifying comment.

(imported from commit ae05fa7063b7e77ab6d8942eab2a2191429b312f)
2013-08-09 23:31:44 -04:00
Zev Benjamin 0cfc8fae9f Add basic Javascript Dict implementation
(imported from commit 9f2fb089eb6e269549de26b37bd588355757d22c)
2013-08-09 17:20:14 -04:00
Zev Benjamin e0eddabeb1 Add util.enforce_arity
util.enforce_arity takes a function and returns a new version which
throws an error if an incorrect number of arguments (as determined by
the function prototype) are passed.

(imported from commit 20e69a6dc7b6f8455726ab4fae8d5b7b04dc4103)
2013-08-09 17:12:23 -04:00
Steve Howell 9130fbec84 Show script names in test-js-with-node.
This makes it more like how we do other tests.

(imported from commit e7d96ad31aeed6186ef6ff1d23f8028c68762caa)
2013-08-09 14:47:11 -04:00
Steve Howell d897d0ad57 Fix pre-commit to call lint-all, not check-all
(imported from commit 8450e79c2d9538c7bfd3cebe597a2869f8800eea)
2013-08-09 14:23:36 -04:00
Steve Howell abba52fd4d Simplify test-js-with-node to simply run *.js in the test directory.
I finally got tired of the tedium of adding files explicitly to the
script.

(imported from commit 4c573fe4752c32a452e592fad687dd5145a173c8)
2013-08-09 14:23:36 -04:00
Tim Abbott 2b8fd43edd check-all: Run 'puppet parser validate' to validate puppet changes.
(imported from commit f1ab619b6e0b993f3b9b6fe081f085d2dd2072b0)
2013-08-09 13:53:17 -04:00
Steve Howell 6790ed79cc Add a unit test for activity.js.
This includes slightly invasive, but harmless, changes to
the production code.

(imported from commit ff40af504de2360ada866508da262e0d2e9f7ad9)
2013-08-09 13:11:59 -04:00
Steve Howell 29fd84fdbd Rename check-all to lint-all.
(imported from commit 844b2c69748f6d9df8ff1189c006ccf405f787c3)
2013-08-09 13:06:02 -04:00
Steve Howell db33028b98 Added tools/test-js-with-casper symlink.
The test-all script now calls the symlink, and the run script
has been cleaned up to be symlink friendly.

(imported from commit 8abb5c1e5744416e94ff843e50c53e0d0f7e1316)
2013-08-09 13:04:52 -04:00
Steve Howell 0a21b9b294 Simplify test-all: just use the script names as banners.
(imported from commit 20e48c468a5ccae63c64385dc114a4f8c892fc61)
2013-08-09 13:04:52 -04:00
Steve Howell cf1d94edef Add a test for stream_color.js (pick_color).
(imported from commit a49f96a4a7b61ef51c057e8a3f11c116d77ebb49)
2013-08-09 12:29:02 -04:00
Steve Howell cef72fd8b8 Add tests for the Filter class.
(imported from commit ef0917bd7911c5cc6f6d20d356c156d483ba723f)
2013-08-09 12:04:43 -04:00
Steve Howell cc73619a9d Add unit tests to narrow.js.
This includes slightly invasive, but harmless, changes to
production code.

(imported from commit 847557c11088b75c836cc399d0af75353a8faa3a)
2013-08-09 11:59:32 -04:00
Steve Howell e36fd929bc Created stream_color.js.
This is a pure refactoring that mostly just moves code from
subs.js to the new stream_color.js and updates module references
accordingly.  In order to prevent introducing some exports,
update_stream_color was given an additional "sub" parameter
and update_stream_sidebar_swatch_color was given an "id"
parameter.

Killed off unused initial_color_fetch var.

(imported from commit b7644ce67f50d31fb46f564d758d661eea776aa6)
2013-08-08 18:22:44 -04:00
Steve Howell 50b28dec49 Add node-based unit tests for util.js.
(imported from commit df666a5b96d378787e911c2cd6e509b7d42e1cb4)
2013-08-08 17:25:24 -04:00
Tim Abbott a8d553bd10 post-receive: Properly encode unicode argument.
(imported from commit adc94a100462a8a2de0be8c05e60c0e33180e50d)
2013-08-08 10:32:16 -04:00
Tim Abbott 9181c7c75b Move generate-fixtures to tools/.
(imported from commit 3d452b17e315ba9adf91e33408a7711d16b069a2)
2013-08-08 10:22:32 -04:00
Tim Abbott 6550134b3e Rename humbug_*_config.py to zulip_*_config.py.
(imported from commit a1d4dd22c59f812f0eb4875dc70c89ce96a4b90c)
2013-08-08 10:22:31 -04:00
Tim Abbott 03293b7be9 Rename humbug-send to zulip-send.
(imported from commit 61400841f8fffe4c706d867aaa012059bcba271d)
2013-08-08 10:22:31 -04:00
Tim Abbott 747a9c536f Rename the 'humbug' API module to 'zulip'.
(imported from commit b3a3d7c05459cbb0110cd0fbe2197d779f3a6264)
2013-08-08 10:22:31 -04:00
Tim Abbott 2ea1bb05a5 Rename ~/.humbugrc to ~/.zuliprc.
(imported from commit a0d53dd20097a56971874dc1d84c6f95267e84f2)
2013-08-08 10:22:31 -04:00
Tim Abbott 7b9305b06f Rename Django project to zproject.
This includes a hack to preserve humbug/backends.py as a symlink, so
that we don't need to regenerate all our old sessions.

(imported from commit b7918988b31c71ec01bbdc270db7017d4069221d)
2013-08-07 11:04:03 -04:00
Tim Abbott f512f53e9e Rename send_deployment_finished_humbug.
(imported from commit 8f1a0b6c70dcbda5bc7288ffd0eeae1ff494b40e)
2013-08-07 10:00:09 -04:00
Tim Abbott ef790d6793 Rename humbug-puppet-apply to zulip-puppet-apply.
(imported from commit f04563d5dcab6db23ddb3238b9c0e5c1a76e72d3)
2013-08-07 10:00:08 -04:00
Tim Abbott 130d381302 Rename humbug_tools to zulip_tools.
(imported from commit 7f21fdc2c2d6ad0bdbd99eb616ffc75c347d8dcb)
2013-08-07 10:00:08 -04:00
Tim Abbott 7232369619 Rename humbug puppet module to zulip.
(imported from commit 7ed2a40439a48f4ef47932b345b9fac1a76cbb58)
2013-08-07 10:00:08 -04:00
Tim Abbott a8c70f6dde Change Humbug => Zulip in tools.
(imported from commit a081a6f26407528d5952c8065f15f19c66ce9111)
2013-08-07 10:00:07 -04:00
Tim Abbott 1f1af26048 Change Humbug => Zulip in text/comments.
(imported from commit 2f9d73431ae40e1b9e9e11bc2f4f62f566ae758a)
2013-08-07 10:00:07 -04:00
Steve Howell 57f518c9c2 Add node JS unit tests for MessageList.
(imported from commit 486a343add91fd5037431504e1ce4a750bfa9fbf)
2013-08-07 09:25:13 -04:00
Tim Abbott e111a2f9a5 [manual] Rename Django app from zephyr to zerver.
This needs to be deployed to both staging and prod at the same
off-peak time (and the schema migration run).

At the time it is deployed, we need to make a few changes directly in
the database:

(1) UPDATE django_content_type set app_label='zerver' where app_label='zephyr';
(2) UPDATE south_migrationhistory set app_name='zerver' where app_name='zephyr';

(imported from commit eb3fd719571740189514ef0b884738cb30df1320)
2013-08-06 07:39:36 -04:00
Tim Abbott 6dd049fa26 Rename zephyr.js to zulip.js.
(imported from commit e62aa374f1bf2e75cebc00d0bba4e3ade82d19f6)
2013-08-05 17:59:04 -04:00
Waseem Daher c16651bf23 [schema] Add referral system
For now, we just get emails about referrals that we have to follow up
on manually.

I don't love using the name "referral" in some places and "invite" in
others, but we already use the verb "invite" to mean something else
and "invite" is a canonical noun.

(imported from commit 0814c18395952fcdef234c1584984f71ca1b6f37)
2013-08-05 17:14:51 -04:00
Steve Howell 770bc5c96a Fix pointer motion at top/bottom of viewport.
We always intended to move the pointer up when you were at the
top of the viewport and scrolling up, and we always intended to
move the pointer down when you were at the bottom of the viewport
and scrolling down.  We didn't intend to move the pointer up
when you were at the bottom, or vice versa.  This commit fixes
that bug, simplifies the code, and inlines the code into ui.js.

(imported from commit 77e2ace9d2fc1025e1349e3be13c76c3a397fd38)
2013-08-02 18:18:04 -04:00
Steve Howell 3726b86a94 (tests) Rename search.js -> search_suggestion.js
This follows up on extracting code to js/search_suggestion.js, and all
the search tests apply to the new module.

(imported from commit dec6c8614c25b4f82da57edeaddc7cfef28260a5)
2013-08-02 17:28:03 -04:00
Steve Howell b33858dd70 Created search_suggestion.js.
Moved 400+ lines out of search.js into search_suggestion.js.  This
leaves search.js primarily responsible for lots of little DOM
interactions, whereas search_suggestion is more about data.

(imported from commit 53d08b29367c0172e483064f213538d45098279e)
2013-08-02 17:28:03 -04:00
Steve Howell 2442edee9e Add the "static" directory to NODE_PATH for unit tests.
I added our "static" directory to NODE_PATH for our JS unit tests.
This eliminates most of the verbosity in our require statements, but
it still requires us to explicitly call out "js" or "third"
subdirectories, which should make it a bit easier for folks reading
the tests to distinguish modules from js, third, or node itself.

(imported from commit b77a5283135d388d46f4b7e511acc59986f1a8ba)
2013-08-01 17:58:25 -04:00
Waseem Daher 86cf40c8a9 Move feature_flags into its own file.
(imported from commit b775f85a24422d236b0079810b98b6b984cb60a2)
2013-08-01 13:00:15 -04:00
Tim Abbott f792adfa6a Disallow single-statement if statements without a brace.
(imported from commit e52f90a0f3e7340a764d391b1f38f1820e953ae7)
2013-08-01 11:47:54 -04:00
Kevin Mehall 0e0ed886e1 Add feature_flags mechanism to enable experiments.
In the future, this could come from the server to enable individual
experiments on a per-realm basis.

(imported from commit 8fd1ba1910b3cfd131f58bab8efbd11a42053bc3)
2013-08-01 11:26:55 -04:00
Tim Abbott 7b44451c3a Remove old code for backing up sqlite version of trac database.
(imported from commit 2b5c461a8426e9b93ce46f48ce14dbef1b099ae2)
2013-07-31 16:54:09 -04:00
Zev Benjamin e8112ff1c1 test-js-with-node: Fix searching for node binary
Previously, when the first `which` failed, the entire script would
fail with exist status 1 because we pass `-e` to the interpreter.

(imported from commit 601de3b3e3edd90110fc478f7874e644009d1b62)
2013-07-30 17:58:06 -04:00
Zev Benjamin b950121fc2 Account for nodejs sometimes being installed as 'node' and sometimes as 'nodejs'
(imported from commit 751216c9544671106dd555823e31ad9d4553a7aa)
2013-07-30 17:29:47 -04:00
Steve Howell d82ccb6243 rename tests
(imported from commit cd98a86a5e07765f753ac1904e45ccd1213d6d67)
2013-07-30 09:05:49 -04:00
Steve Howell 998a22eabb Created test_search.js. (unit tests for search.js)
(imported from commit 8127c04ccc68a9ac106e5684a7ea9a621cb1831f)
2013-07-30 08:55:44 -04:00
Steve Howell 032415fcb4 Move bot avatar code to avatar.js (from settings.js).
This step of the refactoring really just moves the code.

(imported from commit 4d551c43d25723b2556448f47b6b61228e782f54)
2013-07-30 08:40:49 -04:00
Steve Howell 46c4a6a9b3 Add unit test coverage to unread.js.
This covers most of the module's functionality, with special
emphasis on lines that use underscore.js (_.each and _.filter).

(imported from commit 074181a0273286a258504be634bdd1cead2eecd5)
2013-07-29 13:47:57 -04:00
Steve Howell 09bd52fff4 [third] Add underscore.js
(imported from commit ee17cc1d1dff2a6f816a81bb33fa04ca5562a441)
2013-07-29 13:47:56 -04:00
Tim Abbott 3bba0cc927 Move zephyr/static to just static.
It's not really a part of the server (aka the rest of zephyr/).

(imported from commit 27f6b6b064938ad927075a68d873e4b68710d279)
2013-07-29 12:11:26 -04:00
Luke Faraone a78718e299 Back up MediaWiki by dumping to an XML file and committing the result
(imported from commit 1f5d6b114e6dcf6940a56d9501ef41c15a772dd0)
2013-07-26 16:14:55 -04:00
Steve Howell 958955da23 Run node-based JS unit tests from test-all
(imported from commit 5bf9b690dfd3ac83296a58cf44a170960adaed39)
2013-07-26 14:52:33 -04:00
Steve Howell f258ce2127 Created test_message_tour.js.
I haven't hooked this into test-all yet, but I did modify
message_tour.js to accomodate the test.

(imported from commit e58f595f4fe1160f539c18ec09dbe22eebf1f104)
2013-07-26 14:52:32 -04:00
Steve Howell 625003cbe1 Nudge pointer past visited msgs when coming home.
When you return to Home, we normally restore your last
position when in Home, which might have been before the
first unread message.  This is cumbersome for sidebar readers,
so now we keep track of messages that you visit while on a
tour away from Home, and when you return Home, we skip forward
any messages that were in the tour, landing on the last visited
message.  This all happens before rendering.

(imported from commit 9124a231d94f153e283e5ea95e40c50a58406275)
2013-07-26 14:03:55 -04:00
Tim Abbott 3fcd6eb9e6 Update humbughq.com => zulip.net in tools.
This shouldn't be pushed until we get graphite.zulip.net working.

(imported from commit c0dd208222385a9ee92ad1ca8fbf141894f7c7b6)
2013-07-25 17:27:45 -04:00
Tim Abbott 5764e86edc Remove obsolete merge-messages-logs tool.
(imported from commit 7feb10e74df4b788f0f9c6ba34cf23aa7db26d11)
2013-07-25 17:19:18 -04:00
Tim Abbott b1aef98ed0 Change humbughq.com to zulip.com in usability data.
(imported from commit 8bd1b134ae0ce46e0000b62c2f1c6dabb1db06cd)
2013-07-25 17:19:18 -04:00
Tim Abbott e6ba8c8147 Update msmtprc for new zulip.com email addresses.
(imported from commit bb1e36193382b87c4426bdf259257468d30de70a)
2013-07-25 17:19:18 -04:00
Tim Abbott 77b0ddef78 [manual] Rename shakespeare users to zulip.com domain.
We need to update our Nagios configuration when this is deployed.

(imported from commit 28cc3ecfe30c41562742733d6952c8e69b87d67e)
2013-07-25 17:19:17 -04:00
Tim Abbott c7d57e6e4a [manual] Rename commit bot to zulip.com domain.
When we push this to staging, we'll need to rename the bot in the
database and also pull on git.zulip.net.

(imported from commit 22b2397b197c8820f0e55daecd8f98d829e195bd)
2013-07-25 17:16:53 -04:00
Steve Howell fad259d75d Move code from hotkey.js -> navigate.js.
Created up, down, page_up, page_down, to_home, and to_home pretty
mechanically from the old hotkey.code.

(imported from commit 5956b91c2e0122c6440f70db9b92f918c9b599aa)
2013-07-24 23:39:35 -04:00
Tim Abbott 270110d8a4 check-all: Fix output for jslint failures.
(imported from commit 1398eea533e4b8b273d3984d9872ef3706c1102e)
2013-07-24 15:43:44 -04:00
Scott Feeney 4b9c82fb97 Insert static_header.txt as a Closure input file
This way its presence doesn't throw off the generated source map.

(imported from commit 4d7cbb7cb3a9ce103a836ea9baa990c88fe5c804)
2013-07-23 16:18:00 -04:00
Scott Feeney 0a3d24826e Zulipify the review script
* CC to code-review@zulip.com
* If domains are omitted, assume @zulip.com
* Don't set email or site explicitly, instead relying on ~/.humbugrc

(imported from commit 9700a0e3d6aac97c8030dcbaba7790018173929a)
2013-07-23 14:53:34 -04:00
Scott Feeney 1e8881d21a Accept zulip.com emails in post-commit hook
(imported from commit 783aec2bf0613ef962afa48614d56d3f81d54e38)
2013-07-23 14:50:39 -04:00
Jessica McKellar 12a37ed2b8 Always keep the compose box open after sending.
(Some cases are disabled on outside of staging still due to mix
protection concerns).

(imported from commit 26fcb95c055640ddd87c5df424990ebd865a336a)
2013-07-19 15:48:12 -04:00
Kevin Mehall c7db0f8147 Fix test breakage introduced by 16af5e3
(imported from commit 6945b32a0ae1105c3ad91de5b9f98d39ae0228a5)
2013-07-19 10:49:34 -04:00
Tim Abbott 6a333395ca check-all: Run checks in parallel.
This save most of a second on the runtime for check-all on my laptop.

(imported from commit 16af5e3cbeb1511d9491c1cfb9778bdb19a9fb8c)
2013-07-18 17:54:46 -04:00
Scott Feeney 3395ac2fb1 Allow CasperJS tests to use 'document' & 'window'
(imported from commit f3f3834d723c7b07e7aaff4ce8cab10a72255f22)
2013-07-16 17:53:44 -04:00
Luke Faraone bb0a7c8fc3 [manual] Switch various configuration files to refer to .zulip.net.
We only want to change cases where we're talking about the hostname; HTTP
requests should still go to staging.humbughq.com for now.

Before this commit is deployed the hostname of staging.humbughq.com should
be changed to staging.zulip.net on the VM.

(the same for prod)

(imported from commit 7412530773f720ac227f40061c9ddb1a851e19bb)
2013-07-15 16:49:55 -04:00
Scott Feeney 3942907eec Fix pathname in an update-deployment error message
(imported from commit 1f21593056d4a272c0ad9f7f16ed5664f9d393f1)
2013-07-12 11:59:11 -04:00
Scott Feeney 2c33320746 Reuse minified JS from previous deploys
This is a big change affecting lots of areas:

* Pipeline no longer deals with JS (though it still minifies CSS)
* A new script, tools/minify-js (called from update-prod-static),
  minifies JavaScripts
* A command-line argument --prev-deploy, if passed to minify-js or
  update-prod-static, is used to copy minified JS from a previous
  deploy (i.e., a previous git checkout), if the source files have
  not changed
* update-deployment passes --prev-deploy
* Scripts are now included with the minified_js template tag, rather
  than Pipeline's compressed_js

Also, as a side benefit of this commit, our Handlebars templates will
no longer be copied into prod-static/ and accessible in production.

Unminification is probably broken, but, per Zev and Trac ticket #1377,
it wasn't working perfectly before this change either.

(Based on code review, this commit has been revised to:
 * Warn if git returns an error in minify-js
 * Add missing output redirects in update-prod-static
 * Use DEPLOY_ROOT instead of manually constructing that directory
 * Use old style formatting)

(imported from commit e67722ea252756db8519d5c0bd6a421d59374185)
2013-07-12 11:59:04 -04:00
Scott Feeney 88d070e182 Convert update-prod-static from shell to Python
(imported from commit 6c362367776bbfa678632adde2379d6e8c0096f3)
2013-07-12 11:59:04 -04:00
Kevin Mehall 8df4857524 Revert to old mark as unread on view behavior.
Effectively reverts 185e865 and b67e52d.

(imported from commit e9b95f1fd9e2ab7926f15910044e9e9879ea085f)
2013-07-11 14:01:26 -04:00
Kevin Mehall d284f6e91f Preliminary stress testing tool.
(imported from commit a94bb7798788870d90423af10959e6a145dc8e85)
2013-07-09 15:56:57 -04:00
Tim Abbott 493d8276e5 update-deployment: Fix buffering argument.
(imported from commit 7a62af4727384d4c1c0f87513aa62c25ab075569)
2013-07-09 14:41:06 -04:00
Tim Abbott 9ddf6b0295 do-destroy-rebuild-database: Default to randomly generated message data.
And use only 1 thread, to work around pylibmc multithreading issues on
OSX.

(imported from commit bb065b611cb67133f727747cec4a0ff568513788)
2013-07-09 14:35:02 -04:00
Steve Howell ca3f2f4c4d Do not buffer deployment output.
(imported from commit a4ffde1096cc8eb5ca64b0feafd33063e6a159d1)
2013-07-09 12:39:21 -04:00
Scott Feeney c42bf9b9b2 Refactor popovers into their own file
(imported from commit 36ad3c61e4d7eb05751f9b886d15edceab656d71)
2013-07-08 18:53:03 -04:00
Steve Howell 0908f15109 Make narrow.by_subject 'read' its message.
(imported from commit e81140c440fecd283443eab46f0c65faffee8df1)
2013-07-08 17:12:32 -04:00
acrefoot fdb597b4d3 v1 Emoji autocomplete
(imported from commit 0b0d4b004936ce4abc37f44317aec414451f3a8e)
2013-07-08 15:26:39 -04:00
Steve Howell aacb5c3da9 Prevent 'function(' in JS code.
(imported from commit 1f86de8786ec9db10c54c1630da633690990859b)
2013-07-05 16:32:33 -04:00
Kevin Mehall 0f6bdafea3 Mark all messages in view as read when you hit the bottom.
Trac #1428

(imported from commit f40d890091528969ae4e4db80adb019cbce60fef)
2013-07-03 17:10:15 -04:00
Kevin Mehall 22c1a66da8 Don't mark messages as read by visibility.
Trac #1428

(imported from commit b67e52d7434220e397ca20ffa49915de6633519c)
2013-07-03 17:10:15 -04:00
Michael McCanna d284c92ea0 Reworded usage help for tools/review
(imported from commit 75595c9fde0ce37ec052c18fbb4b4d35623fe1ce)
2013-07-03 14:16:56 -04:00
Jessica McKellar 5688ee5e57 Provide a function to set the get_updates timeout to 0 for the tutorial.
(imported from commit c904360ffe6fe3cacc9de37d523501a0d45f7176)
2013-07-02 18:26:17 -04:00
Steve Howell 741929008b Add profiled decorator and a tool to show profiler results.
The goal here is to make it easier to do ad hoc profiling on
our codebase, particularly by running tests.

(imported from commit 71da06feb3a369dec8dc4d8391f7f40e4c2d02ff)
2013-07-02 16:47:34 -04:00
Tim Abbott 8dcdf74af8 update-deployment: Wait up to 5 minutes for lock, rather than just failing.
(imported from commit 3677354841d6084f0917acde4baa79f9c8c3d26b)
2013-07-02 11:36:40 -04:00
Tim Abbott 152ba9ccc7 update-deployment: Remove unnecessary arguments.
(imported from commit b28336b1e45de85a7bc24ee89327d19e106cf3cb)
2013-07-02 11:36:40 -04:00
acrefoot b62d7acbc7 W3C Notifications to allow Desktop Notifications in FF too.
Caveats:

- Since Chrome has trouble using W3C Notification when it's not
  initiated by a user gesture, we try to use webkitNotification first.
- FF doesn't allow iconUrl to be of a different origin, so it won't display
  our gravatars

(imported from commit c4f99ce6927a0d203d9f220d50b06737779bd7f8)
2013-06-28 17:30:57 -04:00
Scott Feeney 83cd963c49 Remove unused imports
(imported from commit 9e3050c72a2d1137b9096c6cfa1c3945341b9a56)
2013-06-27 16:22:39 -04:00
Steve Howell 7c9aee1dd0 Check for more Python gotchas in check-all.
Avoid these idioms:
   "foo"(2)
   'foo'(2)
   "Hello %s" % planet

(imported from commit 3a726928d8e4e4f2148ea12d13b709d9adf1a3f1)
2013-06-27 14:41:17 -04:00
Steve Howell 2bacaf2213 Fix % formatting style in miscellaneous places.
(imported from commit 917196024c981f879355c728da9b4590e964eeef)
2013-06-27 14:41:17 -04:00
Tim Abbott 84b073b05c API: Release several additional API calls to users.
(imported from commit 8b32fa126ab76dc80ee775482a9749dff17edf37)
2013-06-25 16:34:45 -04:00
Kevin Mehall bab2c2f93a Don't print an error when nodejs is at /usr/bin/node
(imported from commit d9d7b1d258825c4ea9804eae71dffe54eedc3c1c)
2013-06-24 10:46:36 -04:00
Kevin Mehall fb678e330b Make test-all's check for trailing whitespace give the line number
of the failure.

(imported from commit 721a19145d52c285e134b82c4b0f6e7faa3c64db)
2013-06-24 10:42:16 -04:00
Michael McCanna 425a247569 Fix path injection for tools/review
(imported from commit 25bac426b71a55f29faa232dcac1d957f2941182)
2013-06-21 11:44:40 -04:00
Luke Faraone 7b75dd9cc4 Use different mechanism to determine the running user
Per http://docs.python.org/2/library/os.html#os.getlogin, getlogin()
only works when you have an associated controlling tty.

This script didn't work previously because when we do deployments there
is no tty. Thus, we switch to the alternative mechanism for determining
the current username described on the page linked above.

(imported from commit 1dbcf98fd7248d20e501fd7fb22e1dbd306040fd)
2013-06-19 16:35:35 -04:00
Luke Faraone df1211e6af Make restart-server refuse to run if non-Humbug user on deployment
If you're running this as a user other than "humbug" on a deployed server,
you're going to have a bad time.

Specifically, memcached won't work, and other undefined behaviour may
occur.

So here we add a check and error out if you run this script on an
app_frontend as non-"humbug".

(imported from commit a3d5f0f58ded42393c03f4d21b4650494fae418f)
2013-06-19 08:32:59 -07:00
Tim Abbott 5c1dda5e31 generate-activity-metrics: Use a long time horizon.
Now that we have more than a month worth of data, it's nice to
actually just display it all.

(imported from commit f2ec027af81699d6937e52b18ac40973a54c349b)
2013-06-18 14:59:07 -04:00
Leo Franchi 3fd7c44331 Tweak desktop app JS to support Cocoa WebScript
(imported from commit 6b0c3442f92cffedbd210530479a13d4af5ea266)
2013-06-14 10:46:26 -04:00
Tim Abbott cbbca8319b Restart Tornado _after_ moving the deployment symlink.
Otherwise we end up running Tornado against the _previous_ version of
our code!

Testing of using supervisorctl to stop and then start a process shows
it takes about the same amount of time as doing a supervisorctl
restart, so there's no reason not to split the two commands apart and
make it super clear that nothing is running at the time that we move
the deployment symlink.

(imported from commit c38049da2bfc9fa94320a32dbf3240d1fcba67f7)
2013-06-13 16:32:23 -04:00
Zev Benjamin 614b5396a6 Collect static files directly in the location that will be served
We exclude the original source files for minified files by using a
custom Finder.

(imported from commit a6a25eb6146da53167b71c6d1c44588f75966059)
2013-06-12 17:46:38 -04:00
Zev Benjamin 33fed064e2 Prepend the minified static file header using a custom Storage class
(imported from commit 2b67a6d94de1693bdb8a91f455b92375692f4c41)
2013-06-12 17:46:38 -04:00
Tim Abbott f0f8ce957a humbug-puppet-apply: Pass through arguments like --noop to puppet.
(imported from commit 3ec5c1402acd7910da399f420290c0269a12c525)
2013-06-12 17:19:33 -04:00
Tim Abbott 34904c51a3 Sync the local user's API key into test database.
(imported from commit 999334fea0d922ced506b454163e640a35a30509)
2013-06-12 16:21:10 -04:00
acrefoot da361b9208 jbarnold composebox UI experiment
1) When you send a message, restore the focus to the composebox, targeted at the same recipient
2) If the composebox is completely empty and you press up or down, have that close the composebox and take the appropriate action
3) If you started the compose via a reply option (r, enter, click), don't refocus the composebox if the cursor has changed.

(imported from commit 84545e49d06959eb62e7fd2b22e1387383df6d1d)
2013-06-07 17:39:31 -04:00
acrefoot 0972c1e677 [manual] Modify review to allow testing+review in the background
Does a test-all using /tmp.
Not safe to run with other tests simultaneously.

You use it just like tools/review, and on a successful test-all
it will submit the code review, without tying up your git working directory.

It depends on new patches to the acrefoot-bulk_create_with_id-1.5.1 branch of
django. Updating this is the [manual] step required. Since test-all doesn't happen
on staging or prod, this is not required for this commit to be deployed, but other
django patches will help with the SSL connection errors we've been seeing.

(imported from commit 3fd3ff00240a2d648c4c54748a8a70616067ef7d)
2013-06-06 17:36:02 -04:00
Zev Benjamin 8884e81bb3 Move the current deployment symlink in restart-server
This will help minimize downtime.

(imported from commit 47fb66f0d2e21fc12f62c69b7c59ca6828553309)
2013-06-05 16:33:43 -04:00
Zev Benjamin 300e57fcbd Fill memcached caches synchronously before restarting the server
(imported from commit a45fa845e94a1fc6e96a1aafca31e9a6fc2b7526)
2013-06-05 16:33:43 -04:00
acrefoot 8447174325 Make testing message appear on its own line in code reviews
(imported from commit 5d37c7dc51723d08aac7d12fa71e9d7da0f3f62c)
2013-06-05 15:38:16 -04:00
Tim Abbott 74f70f3915 generate-activity-metrics: Display by-week usage numbers changes.
(imported from commit 22bc1592c35c5f86ab89f7f4fc14ba7dbd2375db)
2013-06-05 10:24:23 -04:00
Tim Abbott 42ddabf91a Do only one bucket, as specified on command line.
(imported from commit 4ca4f9609a01a6cfedc55efdbe2423673bbe4904)
2013-06-05 10:24:23 -04:00
Tim Abbott 6f38feca05 Change display format for metrics
(imported from commit eb87f1958fd52098d8bdcf205efc95cdaad56787)
2013-06-05 10:24:23 -04:00
Leo Franchi b6a3446b62 Refactor to use wildcard/exclusion for all
(imported from commit 2874361aef2cbc14a3047f964eb584f27a29323c)
2013-06-05 10:24:23 -04:00
Tim Abbott 5f86ed92f3 generate-activity-metrics: Add support for specifying realm.
(imported from commit 09e2adb6ae8d9fb0a140fbbe9a0f1272e2aa81a7)
2013-06-05 10:24:23 -04:00
Tim Abbott 6425a894f5 generate-activity-metrics: Fix import issues.
(imported from commit a8dd3690200ea42616301adc29d136e7554f45df)
2013-06-05 10:24:23 -04:00
Tim Abbott efcf88a707 puppet: Fix paths in feedback-bot configuration.
(imported from commit e9407af884dc75490de5168e067453e77aa612d7)
2013-06-04 19:48:13 -04:00
Tim Abbott 0c78bb87fa puppet: Add tool to call puppet apply for the current machine type.
(imported from commit 995f32d3daed69f8fc01e950f7c40fc71cdad684)
2013-06-04 19:48:13 -04:00
Tim Abbott 0378c43dc6 update-deployment: Move Schema change detected to post-receive.
Since update-deployment is run on the host being deployed to and only
has access to a recent clone of the git repository, it doesn't
necessarily have the old refs available for reverts.

(imported from commit 3652f58a7b165c805822bf6d8a4f0792c629e28e)
2013-06-04 18:42:00 -04:00
Tim Abbott 795173ac86 update-deployment: Move color codes to humbug_tools.py.
(imported from commit 96a79a699ea032714b24aa6572fd188433b979a8)
2013-06-04 18:42:00 -04:00
Tim Abbott b753eb0c1e [manual] Include the events API in the API tarballs.
Previously our receive API bindings were broken in our API tarballs
because we weren't including the receive API bindings which they used.

This requires our deploying the built API tarball to the prod server
when we deploy it so that the link on /api isn't broken.

(imported from commit 14ecaab34556f4e29c72f4f567d8af73c89d6297)
2013-06-04 15:53:36 -04:00
Leo Franchi f9a99192df Add supervisor conf file for stats
(imported from commit e9104676e714dc36050fef50cabe8386b6c52e4d)
2013-06-03 16:16:22 -04:00
Tim Abbott 8d40864c8b Include the commit that was deployed in deployment finished notices.
With our currently rather slow deploys, this helps with the confusing
case where 2 deploys happen in quick succession and the second is
blocked by the lock.

(imported from commit 5a8bd449ecbe0825838faf72099b67f94db7797a)
2013-05-31 17:01:34 -04:00
Steve Howell 322128a771 Check for whitespace in check-all.
Exit with a failing status if any of your
non-excluded JS/Python files have trailing whitespace.

(imported from commit 0aa184fa85a4a1ddeef6ea40dff57ce43c10e459)
2013-05-31 15:25:35 -04:00
Tim Abbott 05f943395b post-receive: Send a notification when deployment process completes.
This is a little hackish in that I'm using humbug-send rather than
importing humbug_git_config.py to get the API keys and all, but this
was quick to do and I think it's valuable for us to have this output
on our deploys.

(imported from commit 24d7954d04aadeff77ea9cdb76fdc8be055f3ac5)
2013-05-30 16:42:14 -04:00
Zev Benjamin 6e0a5e0293 Add notice of inclusion of third-party code
(imported from commit 62d141e6ebd3368bd1cb3154d6903f9408f2b77c)
2013-05-30 13:51:47 -04:00
Tim Abbott 1ab3918338 Add pre-commit and post-commit hooks for use on dev systems.
As well as a little script to automatically configure them.

(imported from commit c2e7f990f5f2091b5bebdd1b3dad402457943c95)
2013-05-30 10:29:44 -04:00
Steve Howell 35ac129496 Remove unnecessary code in check-all.js.
(imported from commit 3b35f8f951692955402524100efc49cc1bffef69)
2013-05-29 17:52:14 -04:00
Tim Abbott 1960c8e8f1 Show data for every day we have, for now.
(imported from commit d1f26176c1efaf8ba5fa1a74bcd53d38627757d5)
2013-05-29 15:39:53 -04:00
Leo Franchi 444bec285b Add a rough tool to get day over day and week over week activity metrics
(imported from commit fd6e6771fd29a31d553620c0f29ed663e2d680aa)
2013-05-29 15:39:53 -04:00
Zev Benjamin ad2e59b506 update-deployment: Log the fact that we're about to clone the repo
(imported from commit 5dd09ed84c9aec228c700dfff651aea0e74a4a5b)
2013-05-29 15:29:52 -04:00
Tim Abbott 7927edb374 Ensure your dev environment API key matches your ~/.humbugrc.
(imported from commit d4d0699ce912685ede445ed677c46dfeefa68b42)
2013-05-29 15:11:24 -04:00
Zev Benjamin 4cd9abdf10 Fix post-receive to work with new update-deployment
update-deployment now expects the ref name to already be relative to
origin

(imported from commit 0a1792119dd2565c2413acbca25e0fe370f09bf8)
2013-05-29 13:53:41 -04:00
acrefoot c58ac9cc0c Re-focus on the compose box after a send
Re-focuses on the compose box after a send, but only if
the compose-box was opened by responding to the message
at the cursor (by hitting "r", enter, or clicking on the message)

(imported from commit 8e7560c8ea31397b57b2bc3e2e7d9dd996226a6f)
2013-05-29 13:07:45 -04:00
Zev Benjamin 6824c94b7e [manual] Remove dependence on /home/humbug/humbug git checkout on app frontends
Modified files need to be copied into the right place.  The checkout
on git.humbughq.com also needs to be updated.

(imported from commit dbe9e05a0512e1f59c7819dd8d44c2c4e9c83bcf)
2013-05-29 12:00:03 -04:00
Zev Benjamin de3b7253c2 update-deployment: Do a fresh git checkout instead of a copy
(imported from commit 13de8b0daf7725b8aa6ea46a7ee26649ceb4c0b0)
2013-05-29 12:00:03 -04:00
Zev Benjamin cce8dfab84 [manual] Use the same socket across server restarts
We let supervisor create the socket for us by making humbug-django a
fcig-program.  Unfortunately, supevisor doesn't support putting
fcgi-programs in groups (see
https://github.com/Supervisor/supervisor/issues/148), so we have to
restart tornado and django separately.

To deploy, copy the config files over and restart nginx and
supervisor (via stopping and then starting it because restart is
broken).  I believe the automated restart as part of
update-deployment will fail because of the way supervisor treats
programs in groups.  If so, after restarting supervisor, you will
also need to run restart-server manually to fill the caches and then
delete the lock directory in humbug-deployments.

(imported from commit bfb5db7dd42dcbc4bfefa2944355b3cbb2ef9104)
2013-05-23 00:19:17 -04:00
Tim Abbott 00a6cc902e postgres-init-db: Auto-detect whether we need to use sudo.
(imported from commit 4b01672835139c57486811e51399c3f03bc4182b)
2013-05-22 14:58:43 -04:00
Zev Benjamin a4bda36ab4 Add a wrapper to mixpanel so that we can selectively enable metrics collection
(imported from commit 1d72f2e98c4c756a8a988d08731282e4195b8e1a)
2013-05-21 17:56:49 -04:00
Zev Benjamin 8fd72a09bc Restart Django and Tornado separately from the other worker processes
The amount of process downtime during a supervisord-mediated restart
appears to be linear in the number of processes that are being
restarted.  Therefore, restarting just Django and Tornado causes less
downtime than doing them at the same time as the other worker
processes.

(imported from commit 1fa9ef547bcd88caeec49800664e37d5f2fcb7a8)
2013-05-21 16:13:39 -04:00
acrefoot 94c61f5507 [manual] Humbug testing databases now backed by postgres
Currently our test database is backed by sqlite; this commit moves
us to using postgres for our all database needs. This, in conjunction
with the patched django on github, allow us to have fewer hacks and
more true-to-life tests. It also sets the stage for testing the bulk_create
and schema search_path patches made to django.

Developers will need to run:
./tools/postgres-init-test-db
./tools/do-destroy-rebuild-test-database

this is assuming that they have already run:
./tools/postgres-init-db
./tools/do-destroy-rebuild-database

at some point on this pg_cluster. (The ordering is important; it will other-
wise complain about the south_migration table).

(imported from commit c56c6f27e13df7ae10b2e643e65d669dde61af3d)
2013-05-20 23:55:03 -04:00
acrefoot 9d8f847fed [manual] Run server using supervisord
This change will make it so that processes related to the app.humbughq.com
server are run under supervisord, which uses a state machine model to ensure
that programs are running. It also ensure process startup order.

We will need to manually switch the old way of running server (in screen) into
this new way of doing things, on both staging and prod (app_frontend.pp has been
updated appropriately). This means:
1) cp servers/puppet/modules/humbug/files/supervisord/conf.d/humbug.conf /etc/supervisord/conf.d
2) installing the supervisor package.
3) killing those while loops in that screen session
4) mkdir /var/log/humbug (as root)
5) /etc/init.d/supervisord start
6) check that nothing broke

(imported from commit 055269a70973db89acd69049e01b185fabdc8f90)
2013-05-20 23:42:28 -04:00
Steve Howell 62d6360a48 Extracted model code out to unread.js.
Most of the model logic pertaining to unread counts had been in
zephyr.js, along with a couple global variables.  Now the code
is encapsulated in unread.js.  It was a pretty straightforward
extraction with some minor method name changes.  Also, a small
bit of the logic had also been in stream_list.js.

Conflicts:
	tools/jslint/check-all.js

(imported from commit f0abdd48f26ab20c5beaef203479eb5a70dacfff)
2013-05-20 23:42:11 -04:00
Tim Abbott 2bdecd130a Add user interface frontend for editing messages.
The only known outstanding bug with this is that it doesn't properly
handle the updating of a message's highlighting/presence in a narrowed
view (e.g. in theory, a message should disappear if it is edited such
that its subject doesn't match your narrow or it no longer matches
your search).  I think I'll just open a trac ticket about that once
this is merged, since it's a little hairy to deal with and kinda a
marginal use case.

Also it's not pretty, but that should be easy to tweak once we get the
framework merged.

Conflicts:
	tools/jslint/check-all.js

(imported from commit 2d0e3a440bcd885546bd8e28aff97bf379649950)
2013-05-20 23:40:57 -04:00
Leo Franchi a6486a1fa0 Add a tab bar at the top of the Message list to aid navigation
The intent is that this will also make it easier to tell when you are narrowed.

(imported from commit 5e37721fbad304d30fc725aacf2cc9e6560e9da2)
2013-05-20 23:37:57 -04:00
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
Leo Franchi dbb2157457 Make home view unread count only count messages newer than the pointer
(imported from commit 0f699ed23f59380b04606bd30600373956f89ae4)
2013-03-26 18:34:16 -04:00
Jessica McKellar eaa2cc702e Autoscroll when you are at the bottom of your message feed.
(imported from commit 7ca92b13c874346f846aea8200a638a7914fe7d6)
2013-03-26 14:05:45 -04:00
Keegan McAllister 6d9aca5f1a Move "page parameters" (email, enter_sends, etc) into a single object
(imported from commit 842b2371bf6364982f1358f1cd2d91118c7fb2bf)
2013-03-26 13:50:03 -04:00
Keegan McAllister a5979f9e6a check-all: Restore failure on pyflakes fatal errors
(imported from commit 28db869c2b184d466e07373cb7ac8b11630780d0)
2013-03-26 13:50:03 -04:00
Keegan McAllister ae45217671 run-dev: Clean repo first
Makes sense because test-all has the same behavior.

(imported from commit 4c4e5ed539bf36fbb5f298abc40f4718dd9a93f1)
2013-03-26 13:50:03 -04:00
Leo Franchi 59228f7458 Run clean-repo before tests in test-all
(imported from commit 49bd072f6f60a742ea9fb7f55c479b8eb8ceb8aa)
2013-03-22 16:22:49 -04:00
Leo Franchi 6263c9ba1e Unify calculation of unread-count for notifications and use it in the title bar
Fixes trac #1004

(imported from commit 6f04d1d3ded198b46cc2ff1733b94b5c17beb581)
2013-03-20 10:09:40 -04:00
Keegan McAllister e8aec9d009 post-receive: Don't actually update servers on push to test-post-receive
Fixes #924.

(imported from commit 85789b39ef2665901c8a7c9560ef072d80d5e24d)
2013-03-18 17:21:13 -04:00
Leo Franchi 79dfe57840 Mark all messages between start of scroll and end of scroll as read
If the user scrolls super fast, our scroll handler might not catch
the user  passing by some messages.

(imported from commit 14cebffcd1321f02443971ac5e1c922db19648ab)
2013-03-15 10:43:17 -04:00
Tim Abbott c0d65124f8 restart-server: Add some output on what's happening as we go.
restart-server has been relatively slow recently, and it'd be nice to
know what it is spending its time doing when it hangs for a few
seconds.

(imported from commit a411c951f5a3f2a1366b6d5d3a40d0660ebec11b)
2013-03-14 15:07:42 -04:00
Tim Abbott 60c3cf826d restart-server: Fill memcached caches after clearing the cache.
Our previous code could in theory end up clearing the caches it had
just filled, if Tornado's cache filling work happened to be faster
than the memcached flush.

(imported from commit 48174aadad398fb7a7c917a1df765c1261b12a55)
2013-03-14 15:07:41 -04:00
Leo Franchi 7510f87eac Select first unread when narrowing by clicking on stream in sidebar
(imported from commit 557751f44e3fee61b6a55f8f8328e2f97e6adc04)
2013-03-14 15:01:13 -04:00
Leo Franchi ff42774551 Refactor unread client handling to use 'read' flags per message
(imported from commit ca48745396e7fbac456e5eb2e7dbe4adc62b3492)
2013-03-13 14:14:45 -04:00
Leo Franchi 0df3d5f2aa Give create db permissions to humbug postgres user
(imported from commit 85775d1885efcd8790593e6841ce9d56f027eea7)
2013-03-12 12:51:12 -04:00
Waseem Daher 33dc3a2fb7 Properly start tutorial on first run, even if you have new messages.
We were previously having an issue where the tutorial could
be pre-empted if you got a few messages while you were first
logging in.

I have some reservations about this being slightly fragile, and a
better approach might be to just have a bit that we use to determine
whether or not you've already seen a tutorial. (Or potentially that
checks whether or not you've ever sent a message.)

(imported from commit f8858f64a36bcd25887b76314caff283929f340c)
2013-03-12 09:56:57 -04:00
Zev Benjamin dc0913077a Add a new frontend error-reporting system
The new system, called blueslip, makes errors fatal when in debug
mode and only output a message when running in production.  In the
future, it could also send user errors back to us automatically.

(imported from commit 1232607c0311e885c8b5a5e8a45ffb28822426e0)
2013-03-11 13:22:12 -04:00
Tim Abbott d679a72952 [manual] Cache results of the Twitter API in the database.
This should substantially improve the repeat-rendering time for pages
with large numbers of tweets since we don't need to go all the way to
twitter.com, which can take like a second, to render tweets properly.

To deploy this commit properly, one needs to run

./manage.py createcachetable third_party_api_results

(imported from commit 01b528e61f9dde2ee718bdec0490088907b6017e)
2013-03-11 13:15:55 -04:00
Zev Benjamin d05ac105fe Move clear_table into MessageList
(imported from commit 138c3103920413580f86fede115843ecfddc0691)
2013-03-05 12:48:32 -05:00
Zev Benjamin f6ba728a24 Move message rendering into the MessageList
(imported from commit c1e16b1d2fafe5c079991e7ae96a013e25bc8618)
2013-03-05 12:48:32 -05:00
Zev Benjamin 95309539bc Move same_{stream_and_subject,recipient,sender} into the util module
(imported from commit 0d79bc3ae29be16eba59acea8bc5fda2aba1d4de)
2013-03-05 12:45:12 -05:00
Tim Abbott 91fb10e7dc restart-server: Move memcached flush to after server code restart.
(imported from commit 12123beac108db54e7e8a0c62b65762920997f7e)
2013-03-04 11:30:00 -05:00
Leo Franchi 7374fe53f1 Only show the "More messages below" if unread messages are in the home view
(imported from commit 6b1ded10519305bca935b093a74b59d7ab814c55)
2013-03-01 14:35:39 -05:00
Luke Faraone 2f6bc7ca1b Use dbshell instead of direct psql invocations
(imported from commit 6dd28dc353c0d79626c2853961bcb6873929e274)
2013-02-28 15:46:33 -05:00
Luke Faraone 903fbbe38e Script to automate creating a database for Humbug.
(imported from commit d44cd5ca1ab3383a8c262ed287f075cf21e3b129)
2013-02-28 15:40:21 -05:00
Jeff Arnold fcd033e33e [schema] Save enter_sends on the server in the database.
(imported from commit 4d82f6aaf5918f155a930253c9cc334dbcc0d97a)
2013-02-27 17:25:29 -05:00
Leo Franchi 19d107e42b Add a home_msg_list that contains all messages shown in the home view
By splitting up all_msg_list and home_msg_list, we can properly add/remove
streams from the home view without having to jump through hoops.

(imported from commit 92767197759f7519197dfc58be951b60fa823fbb)
2013-02-26 14:13:35 -05:00
Keegan McAllister 293be02d53 Don't clear prod-static/collected
Hopefully fixes the race condition where we get 500s during a deploy.

(imported from commit 2df471220a98e8902ab43e8c846a320c24c7fd25)
2013-02-25 17:55:50 -05:00
Keegan McAllister 49e16b0ba6 Add portico and misc CSS and JS to Pipeline
Fixes #963.

(imported from commit 63ec313a41fd13350657c78356efc16422a5fff1)
2013-02-25 16:18:35 -05:00
Keegan McAllister d31eab9325 Include hash in minified filenames to avoid browsers using stale files
Fixes #853.

(imported from commit f85ebe52df754f488a29c2ad814d582b78aadd14)
2013-02-25 16:18:35 -05:00
Tim Abbott c657be9fbc do-destroy-rebuild-database: Update for South.
(imported from commit f3e5d62aa2be0fd907a24fb9b4a5be6438e76c8d)
2013-02-22 17:52:39 -05:00
Keegan McAllister 56d183ea06 Remove lurk mode from web client and API examples
See #796.

(imported from commit e238ce571c3f30d8312b630df7048ad1d9cad6d2)
2013-02-21 15:11:10 -05:00
Zev Benjamin 4c9e3a167e Move message selection to an event-based system
Messages are now selected on a MessageList, which triggers a
message_selected event that other parts of the code can listen for.

(imported from commit 1da9e4121425c0ac4461b41b7aea169072e1512b)
2013-02-21 13:29:17 -05:00
Zev Benjamin ed51bd0432 Select messages on the MessageList instead of calling a global function
(imported from commit 0ea1c2695cda5ec415c42a450103e768cf2ff5db)
2013-02-21 13:29:17 -05:00
Zev Benjamin fc10556b84 Select a more correct message when narrowing by clicking on message's stream or subject
Previously we would select the first message in the block.  Now, we
only do that if a message that is selected will not be in the
resulting narrowed view.  If the selected message will be in the
narrowed view, we select that message once narrowed.

(imported from commit 4da5a3a0b597b58c2e028f1b29ac20ae3808a4d1)
2013-02-21 13:29:17 -05:00
Zev Benjamin e9b915c2b9 Remove global selected_message_id and persistent_message_id variables
Each message list now has a selected message id.

(imported from commit 041abc54ea42c636c30e39df4a2e838bb830e1aa)
2013-02-21 13:29:17 -05:00
Zev Benjamin 97160d79d4 Use the new MessageList for storing messages
(imported from commit 38a04d2ff504aa49189997b972318af7c944d528)
2013-02-21 13:28:23 -05:00
Zev Benjamin 814e3d6385 Implement a message list structure for storing messages and related information
(imported from commit 171de93636a215d9357c7fc4ee8fb71696d23fb5)
2013-02-21 13:27:45 -05:00
Waseem Daher b51dc36667 Add a tutorial.js file.
(imported from commit 58b72d08c0cd7815c3c54bd37c4a8033f32cc7ad)
2013-02-20 23:04:49 +00:00
Keegan McAllister 2d3212f3a4 check-all.js: Compact list of globals
(imported from commit c6d67517feaa5f33fa0a25e836ab0fe6ab8edc01)
2013-02-20 16:02:31 -05:00
Keegan McAllister c39e51cc30 Rewrite check-all with various enhancements
- Find Python and JavaScript files the same way, by looking at
  everything in Git with specific exceptions

- Check the non-browser JavaScript, with appropriate JSLint options

Fixes #19 and #387.

(imported from commit 042bd6c26aa7a7ea2209935320ef4da12344b02b)
2013-02-20 16:02:31 -05:00
Keegan McAllister 02ce209b5e Add a generic script to run the right Node binary
(imported from commit cf187323786cf1ee576ec70b6f7db4cbf61d6911)
2013-02-20 16:02:30 -05:00
Keegan McAllister 5f33298bf4 [manual] tools: Move check_output into a shared file
We leave the stuff under api/ alone for now, since we need to be able to ship
it as a standalone thing.

tools/post-receive wasn't using the function anyway.

For push to master: Push this commit, update post-receive per instructions at
the top of that file, then push the rest of the branch to confirm that the hook
still works.

No manual instructions for prod.

(imported from commit 9bcbe14c08d15eda47d82f0b702bad33e217a074)
2013-02-20 16:02:30 -05:00
Keegan McAllister 75704ad1e8 Consistently use #!/usr/bin/env python
At Ksplice we used /usr/bin/python because we shipped dependencies as Debian /
Red Hat packages, which would be installed against the system Python.  We were
also very careful to use only Python 2.3 features so that even old system
Python would still work.

None of that is true at Humbug.  We expect users to install dependencies
themselves, so it's more likely that the Python in $PATH is correct.  On OS X
in particular, it's common to have five broken Python installs and there's no
expectation that /usr/bin/python is the right one.

The files which aren't marked executable are not interesting to run as scripts,
so we just remove the line there.  (In general it's common to have libraries
that can also be executed, to run test cases or whatever, but that's not the
case here.)

(imported from commit 437d4aee2c6e66601ad3334eefd50749cce2eca6)
2013-02-20 16:02:30 -05:00
Leo Franchi 8162d46d5c Mark as unread messages loaded in a narrow view older than pointer
(imported from commit 37362d1fbb4932f064753a5d3d335d9b2bec2964)
2013-02-20 14:05:49 -05:00
Tim Abbott cdedb85934 Fix post-receive hook arguments issues and document the setup.
(imported from commit 0440cbc97337b8dd9f92bbbd428a069f79df400a)
2013-02-20 11:10:45 -05:00
Tim Abbott 3bc083ab0d post-receive: Remove unused imports.
(imported from commit 492b5a4a3a883022984d45d0d0934e7fe10a6f31)
2013-02-19 16:23:47 -05:00
Reid Barton 61350d65d1 Render recent dates as weekdays, part 2.
This commit does the actual work of formatting recent dates as weekday
names and updating the format when the date is sufficiently far in the
past.

Also, silence a bogus jslint warning.

(imported from commit 503286fbd9c1e33a81cc7d78cf8d08d5e7f78c1a)
2013-02-19 15:58:25 -05:00
Reid Barton 59dab21fcd Render recent dates as weekdays, part 1.
This commit just moves time rendering logic to its own file, and does
not make any functionality changes.

(imported from commit d111d03c6abc8d9550fcf65e4f89eab8056d1ed4)
2013-02-19 15:58:25 -05:00