Commit Graph

12408 Commits

Author SHA1 Message Date
Tomasz Kolek 95825973c7 Add branch name to topic in Gitlab integration.
Fixes: #1831.
2016-09-23 10:04:01 -07:00
Tomasz Kolek 8cdc5b7a02 Fix bug with wrong branch name in Gitlab integration.
Need to change lstrip to replace particular string with empty string.

Fixes: #1830.
2016-09-23 10:03:09 -07:00
Tomasz Kolek d4da60fbe2 Split test_hooks file into one test file per hook. 2016-09-23 10:02:16 -07:00
Tomasz Kolek 9197c82d8f Move WebhookTestCase class from test_hooks.py to test_helpers.py. 2016-09-23 10:02:16 -07:00
Steve Howell 28bb9c883a css linter: Report empty declarations more clearly.
Raise a CssParserException when declarations are empty.
2016-09-23 09:13:43 -07:00
Steve Howell f0eaee68e4 bug: Fix traceback in get_missed_message_token_from_address().
If you supplied an unrecognizable address to our email system,
or you had EMAIL_GATEWAY_PATTERN configured wrong,
the get_missed_message_token_from_address() used to crash
hard and cryptically with a traceback saying that you can't
call startswith() on a None object.

Now we throw a ZulipEmailForwardError exception.  This will
still lead to a traceback, but it should be easier to diagnose
the problem.
2016-09-22 13:41:26 -07:00
Steve Howell dbbc64dbfe bug: Fix code that mis-identifies missed message formats.
In our email mirror, we have a special format for missed
message emails that uses a 32-bit randomly generated token
that we put into redis that is then prefixed with "mm" for
a total of 34 characters.

We had a bug where we would mis-classify emails like
mmcfoo@example.com as being these system-generated emails
that were part of the redis setup.

It's actually a little unclear how the bug in the library
function would have manifested from the user's point of view,
but it was definitely buggy code, and it's possibly related in
a subtle way to an error report we got from a customer where
only one of their users, who happened to have a name like
mmcfoo, was having problems with the mirror.
2016-09-22 13:41:26 -07:00
Steve Howell 0b7cac04d4 email mirror: Extract is_mm_32_format(). 2016-09-22 13:41:26 -07:00
hackerkid 0412e1e20b Add support for markdown preview in compose area.
This doesn't currently use the backend markdown processor, so the
previews are not completely faithful.

Fixes #217.
2016-09-21 22:33:35 -07:00
Umair Khan 94e0bb5abb Fix race conditions in 03-narrow casper tests.
Re-arranges code so that two waitFor functions that can have
a race condition are separated by a then function.

Fixes: #1455
2016-09-21 17:54:42 +05:00
Tim Abbott 535a40ded9 requirements: Add enum34 for ipython on python 2.
I guess we don't have anything that tests ipython in CI, so this was
missed when I upgraded ipython earlier this week.
2016-09-20 22:37:47 -07:00
Steve Howell 13d6f52203 provision: Handle VENV_CACHE_PATH not existing.
If VENV_CACHE_PATH does not exist (which can happen if you destroy
your vagrant environment), then do a short circuit return in
try_to_copy_venv().
2016-09-20 06:55:08 -07:00
Tim Abbott 59f3fd55c9 requirements: Upgrade moto and dependencies. 2016-09-19 22:55:05 -07:00
Umair Khan e3078b226a Optimize incremental virtualenv creation.
This adds a new system for copying packages from old virtualenvs that
are sufficiently similar to the new virtualenv required.

In practice, this results in a huge performance improvement for
re-provisioning Zulip development environments when the requirements
files have changed (which is the dominant performance problem with
provision today).

Fixes: #1507.
2016-09-19 22:35:32 -07:00
Tim Abbott 27e4ed126f requirements: Upgrade various Python dependencies. 2016-09-19 22:32:02 -07:00
Tim Abbott 0cab02b58a Upgrade mypy to latest upstream git.
This new mypy version supports some performance improvements and
should also facilitate running mypy on our scripts more efficiently.
2016-09-19 22:19:38 -07:00
Brock Whittaker f87c78d3f1 Add preview button to subscriptions page.
This adds a preview button to the subscriptions page to allow a user
to check out the stream without having to subscribe.

The button’s default state is hidden but on subscription row hover it
shows itself.

The preview button updates its text from "Narrow" to "Preview" and
back when a user subscribes and unsubscribes from a stream.

Fixes: #1519.
2016-09-19 22:13:47 -07:00
Tim Abbott 47045179fc Fix traceback rendering narrows to non-subscribed streams.
This fixes a bug where Zulip would throw a TypeError if the user were
to try to narrow to a stream they had never been subscribed to.  With
the new "preview" feature on the subscriptions page, this will now
happen much more often.
2016-09-19 22:10:52 -07:00
Brock Whittaker 706f422c3a Massively refactor settings page templates and styling.
This restructures the styling for the Zulip settings and
administration pages to minimize use of Bootstrap and use a consistent
styling library for similar elements.

While it is basically a wash in terms of the page's visuals, it will
make our life a lot easier for future work on improving the settings
pages section of the site.
2016-09-19 21:55:06 -07:00
Tim Abbott 68c51912c9 extract_recipients: Add a type: ignore for problematic arguments.
We'll want to redo this function to be less crazy, but this is a quick
fix to be able to upgrade mypy.
2016-09-19 21:48:12 -07:00
Tim Abbott e488d4d6e8 log_event: Fix unicode handling of log writing. 2016-09-19 21:45:52 -07:00
Tim Abbott 939528303d upload: Add type: ignore for mimetypes.guess_type stubs issue. 2016-09-19 21:40:08 -07:00
Steve Howell 6b3f945a7e dead code: Remove linebreak(). 2016-09-19 18:25:03 -07:00
Steve Howell c2277afd06 Simplify bulk_get_streams().
We can always expect a realm here.
2016-09-19 18:25:03 -07:00
Steve Howell eb09dd217d Simplify get_stream_backend.
Assume that get_stream_backend() always receives a realm, not a
realm id.  We can be pretty confident of that now due to mypy.
2016-09-19 18:25:03 -07:00
Steve Howell 1dbc94bcd9 annotations: Require a Realm for get_stream(). 2016-09-19 18:25:02 -07:00
Steve Howell feb94a90aa tests: Add ModelTest class for miscellaneous model tests. 2016-09-19 18:25:02 -07:00
Steve Howell 7d257b03fc test: Add coverage for Recipient.__unicode__(). 2016-09-19 18:25:02 -07:00
Steve Howell e0d59d9386 dead code: Remove Stream.create(). 2016-09-19 18:25:02 -07:00
Steve Howell a67d17b9f7 tests: Add coverage for RealmFilter.__unicode__(). 2016-09-19 14:57:53 -07:00
Steve Howell 5daa2b10d5 tests: Add coverage for RealmEmoji.__unicode__(). 2016-09-19 14:57:53 -07:00
Steve Howell 068a783d88 tests: Test creating user with aliased realm. 2016-09-19 14:57:53 -07:00
Steve Howell 2d0d823a59 tests: Add test_fetch_raw_message(). 2016-09-19 14:25:21 -07:00
Steve Howell 7d4995ded0 tests: Add test_render_message_api(). 2016-09-19 14:25:21 -07:00
Steve Howell d0f9374b71 tests: Add test_messages_in_narrow(). 2016-09-19 14:25:21 -07:00
Steve Howell 318f8e86a1 tests: Extract _update_tsvector_index(). 2016-09-19 14:25:21 -07:00
Tim Abbott 9ed5ccd332 alert_words: Use the ID to reference create_alert_word_button. 2016-09-19 14:23:11 -07:00
Brock Whittaker 0274475e5e Fixes hash system for saving page state.
This changes the JavaScript to fix the hash system to correctly save
state to allow a user to deep link to a particular app platform.

The mechanism is handled by a click event on #apps-tabs [data-toggle]
that fires a hash setter which then fires a hash getter which loads the
correct tab if necessary.
2016-09-19 13:19:01 -07:00
sunnypalace 3b76a489c9 Remove humbug-user-uploads and related code.
Fixes: #1672.
2016-09-19 10:52:05 -07:00
Steve Howell e2f7f7b672 tests: Add test_update_alert_words(). 2016-09-18 22:08:53 -07:00
Steve Howell a58cad3093 tests: Extract test_alert_words.py 2016-09-18 22:08:53 -07:00
Tim Abbott ec850e3053 Revert "tests: Skip test_get_old_messages_with_search_pgroonga."
This reverts commit 8ae7e7b451.

We believe this issue may have been fixed in
e80279c2e4.
2016-09-18 20:26:35 -07:00
Kouhei Sutou e80279c2e4 test: Add a missing PGroonga configuration
Fix #1769
2016-09-19 01:06:52 +09:00
Tim Abbott 8ae7e7b451 tests: Skip test_get_old_messages_with_search_pgroonga.
This test fails nondeterministically, apparently due to a problem in
pgroonga itself.
2016-09-17 12:29:24 -07:00
Steve Howell 1c37c0e93f uploads: Remove redir=False codepath for serving S3 files.
It does not seem that we need to support this any more.  Eliminating
the code gets us to 100% line coverage with our tests on view/uploads.py.
2016-09-17 12:13:07 -07:00
Steve Howell 9c0282139a tests: Add test_serve_s3_error_handling(). 2016-09-17 12:13:07 -07:00
Steve Howell 934385a238 tests: Add test_download_non_existent_file(). 2016-09-17 12:13:07 -07:00
Steve Howell 5c54b53fc0 tests: Add test_file_too_big_failure(). 2016-09-17 12:13:07 -07:00
Steve Howell a630bbf8b8 uploads: Remove dead code in serve_local(). 2016-09-17 12:13:07 -07:00
Steve Howell ca18b631c5 tests: Add ZephyrTest. 2016-09-17 09:29:09 -07:00