Commit Graph

12560 Commits

Author SHA1 Message Date
Tim Abbott 3973ae5dbb update_analytics_counts: Fix buggy argument parsing. 2016-10-04 20:43:19 -07:00
Tim Abbott a2b91221d0 upgrade-zulip: Only remove zproject/local_settings.py if symlink.
This fixes a problem where if we're deploying from git,
local_settings.py ends up part of the diff in the deployed git
repository.
2016-10-04 20:41:17 -07:00
Tomasz Kolek 7df50cee34 docs: Fix paths in webhooks part of integration-guide.
We forgot to update the documentation when we rearranged the webhooks
tests to be split across several files.

[mostly rewritten by tabbott]
2016-10-04 20:09:58 -07:00
Tim Abbott 49bea381b7 zjsunit: Fix running stream_data and node tests individually.
These tests failed if you ran them along with:
 `ReferenceError: $ is not defined` errors.

Fixes #1909.
2016-10-04 18:38:17 -07:00
umkay b4108f7a5f Rerun add-apt-repository for ppa:groonga/ppa
On occasion, provisioning will fail because groonga is not added. Add a
check to see if the command fails and retry.
2016-10-04 18:21:36 -07:00
Tim Abbott 9b30594bb6 run-casper: Fix buggy comments about subdomains testing. 2016-10-04 18:16:53 -07:00
umkay d260a22637 Add a new statistics/analytics framework.
This is a first pass at building a framework for collecting various
stats about realms, users, streams, etc. Includes:
* New analytics tables for storing counts data
* Raw SQL queries for pulling data from zerver/models.py tables
* Aggregation functions for aggregating hourly stats into daily stats, and
  aggregating user/stream level stats into realm level stats
* A management command for pulling the data

Note that counts.py was added to the linter exclude list due to errors
around %%s.
2016-10-04 17:18:54 -07:00
Steve Howell 43e21f6fb4 Remove unused bugdown global from models.py.
Fixes: #1379

(It was really a series of fixes leading up to this.)
2016-10-04 11:35:03 -07:00
Steve Howell b2f84f0fa4 Move render_markdown() to lib/message.py.
This removes a bugdown circular dependency.
2016-10-04 11:34:53 -07:00
Steve Howell b81a961fdd Remove Message.set_rendered_content(). 2016-10-04 11:31:21 -07:00
Steve Howell d21d443d29 Deprecate render_old_messages command. 2016-10-04 11:31:21 -07:00
Steve Howell 7fb992dba3 Simplify and "fix" render_old_messages management command.
The command to render old messages now looks for all messages
not matching the bugdown version, and it no longer directly calls
into model code.  We should still be extremely cautious about
using this code.
2016-10-04 11:31:20 -07:00
Steve Howell 6b71f5bd5f Inline most calls to set_rendered_content().
This is part of breaking the circular dependency on
bugdown in models.py.  A subsequent commit will fully
kill off set_rendered_content().
2016-10-04 11:31:20 -07:00
Steve Howell 583a6bbadd Extract zerver/lib/message.py.
This pulls message-related code from models.py into a new
module called message.py, and it starts to break some bugdown
dependencies.  All the methods here are basically related to
serializing Message objects as dictionaries for caches and
events.

    extract_message_dict
    stringify_message_dict
    message_to_dict
    message_to_dict_json
    MessageDict.to_dict_uncached
    MessageDict.to_dict_uncached_helper
    MessageDict.build_dict_from_raw_db_row
    MessageDict.build_message_dict

This fix also removes a circular dependency related
to get_avatar_url.

Also, there was kind of a latent bug in Message.need_to_render_content
where it was depending on other calls to Message to import bugdown
and set it globally in the namespace.  We really need to just
eliminate the function, since it's so small and used by code that
may be doing very sketchy things, but for now I just fix it.  (The
bug would possibly be exposed by moving build_message_dict out to the
library.)
2016-10-04 11:31:20 -07:00
Steve Howell ac994fdd51 Move three functions from models.py to lib/cache.py.
I move these three functions to lib/cache.py:

    to_dict_cache_key_id
    to_dict_cache_key
    flush_message

This will prepare us for a more significant refactoring that
eventually breaks down some circular dependencies with
Message and bugdown.
2016-10-04 11:31:20 -07:00
Tim Abbott 279f805448 run-dev: Automate passing --interface='' for vagrant environment.
Fixes #877.
2016-10-04 10:48:26 -07:00
Steve Howell 69fa60080c tests: Test get_prereg_user_by_email(). 2016-10-04 10:35:43 -07:00
Steve Howell ad149141f3 tests: Test Subscription.__unicode__(). 2016-10-04 10:35:43 -07:00
Steve Howell 5ae8cff289 code cleanup: Remove unused Attachment methods.
This removes some unused code on Attachment.  Some of these
methods might be useful in a manage.py shell, but without tests,
they are not very trustworthy, and the Attachment model isn't that
complicated to write raw Django queries against.
2016-10-04 10:35:43 -07:00
Steve Howell 732bf5e6d0 tests: Test Attachment.__unicode__(). 2016-10-04 10:35:43 -07:00
Steve Howell cfc4010667 Add test code for UserMesssage.__unicode__(). 2016-10-04 10:35:43 -07:00
Steve Howell fc2329ccb7 tests: Add test_is_status_message(). 2016-10-04 10:35:43 -07:00
Umair Khan 06b8c76bda casper: Use local_id check to ensure messages are actually sent.
Previously, we only used this approach of waiting until the local echo
ID was cleared in the message edit tests.
2016-10-03 09:27:22 -07:00
Umair Khan 4fa9a786fc casper: Wait for logouts to complete. 2016-10-03 09:27:02 -07:00
Tim Abbott ac2007dd9b resize_avatar: Add a size option. 2016-10-02 21:29:04 -07:00
Tim Abbott 87b9017845 upload: Extract get_avatar_url and add to UploadBackend. 2016-10-02 21:20:43 -07:00
Tim Abbott 22fd7ba02a avatar: Move avatar hash computations to their own file. 2016-10-02 21:19:10 -07:00
baali 142dce2cd4 Replace legacy endpoint for renaming a stream and add tests.
This moves the logic for renaming a stream to the REST API
update_stream_backend method, eliminating the legacy API endpoint for
doing so.

It also adds a nice test suite covering international stream names.
2016-10-02 20:33:49 -07:00
Rishi Gupta 48bec80c61 Fix test_signup.LoginTest.test_register.
The test currently expects 67 database queries during registration, but we
added two more (likely calls to resolve_subdomain_to_realm) in ea39fb2.
2016-10-02 19:16:24 -07:00
Tomasz Kolek 464ced2b48 Add Pipeline Hook event handling to gitlab integration. 2016-10-02 09:35:07 -07:00
Tomasz Kolek 36745a68cf Add Build Hook event handling to gitlab integration. 2016-10-02 09:35:07 -07:00
Brock Whittaker a550399f7d lightbox: Change aesthetic to white-on-blue design.
No longer is there a white information bar at the bottom. Now it is all
aligned to the top.
2016-09-30 16:44:40 -07:00
Brock Whittaker 339249602f Remove Blur on lightbox background.
This removes the blur feature as the background of the info settings
container is now #FFF.
2016-09-30 16:42:26 -07:00
Brock Whittaker 6b3aded32d Aesthetic Changes for Overlay.
This includes reduced title font size to bring the total info bar
height to the same height as the buttons, and an image preview that
doesn’t hit the walls of the container.
2016-09-30 16:42:26 -07:00
Umair Khan b6ad24b11b Fix names of sprite emojis. 2016-09-30 10:42:52 -07:00
Umair Khan b4214ec8cb Fix formatting of print in run function. 2016-09-30 10:42:52 -07:00
Umair Khan 81174fa580 Change message contents to differentiate messages.
I have a hunch that the messages sent from different files
are interfering with each other as well. This commit will make
it clear if indeed this is the case.
2016-09-30 17:34:02 +05:00
Umair Khan de905457ac Remove race condition while sending messages in casper.
Fixes: #1455
2016-09-30 16:49:29 +05:00
Umair Khan 406191cbe8 Upload test event log. 2016-09-30 16:49:26 +05:00
Brock Whittaker 70af5b49e0 On stream click, blur so key events unbind from sidebar.
Unblur the link that was clicked so that when a user presses up/down
buttons it will automatically go back over to the individual messages
rather than tabbing up and down the sidebar.

Fixes: #1875.
2016-09-29 16:01:29 -07:00
Brock Whittaker 64238f9426 hotkeys: Fix additional downloads of images.
This fixed additional downloads of a downloaded image by following the
keypress pattern of “Download” -> Esc -> Enter -> Enter -> … where
each enter downloads the image again.

It is necessary to blur the focus on the link when closing the overlay
to prevent this.
2016-09-29 14:08:10 -07:00
Brock Whittaker f097581497 hotkeys: Fix escape key unnarrow/close lightbox interaction.
There is an issue where the unnarrow on escape was firing before the
overlay would escape. This shouldn’t happen because then when you try
to close out the overlay you also lose your spot on the page.

By changing the order, all is restored with the world.
2016-09-29 14:08:10 -07:00
Tim Abbott c819a66e09 postgres-init-db: Use default bash to call flush-memcached. 2016-09-28 20:46:34 -07:00
Tim Abbott 66c63abfb9 hotkey: Prevent escape in lightbox from also unnarrowing. 2016-09-28 20:05:51 -07:00
Tim Abbott 5ed37beb02 test-backend: Simplify argument rewriting logic. 2016-09-28 11:52:05 -07:00
sonali0901 4869e1b0b2 test-backend: Add convenience arguments to run subsets of the tests.
This optimizes the process of running individual or small groups of
backend tests (./tools/test-backend
zerver.tests.test_bugdown.FencedBlockPreprocessorTest.test_simple_quoting)
to allow the following syntaxes:

    ./tools/test-backend zerver/tests/test_bugdown.py
    ./tools/test-backend zerver.tests.test_bugdown.py
    ./tools/test-backend zerver/tests/test_bugdown
    ./tools/test-backend zerver.tests.test_bugdown
    ./tools/test-backend test_bugdown.py
    ./tools/test-backend test_bugdown
    ./tools/test-backend FencedBlockPreprocessorTest
    ./tools/test-backend FencedBlockPreprocessorTest.test_simple_quoting

Fixes #1670.
2016-09-28 11:52:05 -07:00
Tim Abbott cd5b38f5d8 provision: Fix node_modules being owned by root.
A bug in the node_cache.py code resulted in the node_modules symlink
in Zulip development environments being incorrectly owned by root.
This causes that bug to be fixed the next time a user provisions.
2016-09-28 00:36:48 -07:00
Tim Abbott 9c0c6c0c23 node_cache: Don't make node_modules symlinks as root. 2016-09-28 00:36:40 -07:00
Tim Abbott cfaba35b9a hotkey: Fix tab_up_down detection of arrow keys.
The new code in 65ab368ff0 incorrectly
used the closest list as a bool, and thus broken using the normal
arrow key hotkeys.
2016-09-28 00:25:32 -07:00
Tim Abbott c7b7893254 auth: Give nicer subdomain errors when using ZulipDummyBackend.
This improves Google and JWT auth as well as the registration
codepath to log something if the wrong subdomain is encountered.

Ideally, we'd have tests for these, and code to make the Google and JWT
auth cases show a clear error message.
2016-09-27 23:25:07 -07:00