Commit Graph

24185 Commits

Author SHA1 Message Date
Tim Abbott ddf83f65ce docs: Update dead references to puppet/zulip_internal.
This was renamed in the codebase to puppet/zulip_ops months ago.
2018-02-12 16:00:56 -08:00
Aman Agrawal 0db9f55924 Update versions for Vagrant and VirtualBox.
Update version of Vagrant from 1.8.6 to 2.0.2.
Update version of VirtualBox from 5.1.8 to 5.2.6.

We needed to update Vagrant because older versions have networking
problems on modern Macs, resulting in weird `apt` errors when
provisioning.

Commit message and some text tweaked by tabbott.
2018-02-12 15:46:59 -08:00
Florian Jüngermann ec3e0caece right-sidebar: Enable up and down arrow keys.
This users the new generic functions in stream_list.js to implement a
similar behaviour for the right sidebar (user list).

Fixes #5920.
2018-02-12 15:38:23 -08:00
Florian Jüngermann b489ccc126 left-sidebar: Enable up and down arrow keys.
When in the stream-searchbar, a user can now use the arrow keys to iterate
through the suggestions. Therefore the currently selected list element is
assigned a CSS class 'highlighted_user'.
The main functional testing is done with casper but node test are still
included to keep the high coverage.
Line-wrapping issues are resolved. Night-mode CSS handling is included.
2018-02-12 15:35:56 -08:00
Aditya Bansal 35969edd66 deps: Replace libz-dev with zlib1g-dev since the former was renamed. 2018-02-12 14:40:26 -08:00
Aditya Bansal d5736ef65a provision.py: Remove duplicate install candidated from APT_DEPENDENCIES.
This is necessary, since we now have some dependencies in common
between the Thumbor and main Zulip dependency lists.
2018-02-12 14:40:26 -08:00
Aditya Bansal a137ed9e27 thumbor: Fix issue with dependencies.
We do the following here:
* Remove libjasper-dev from THUMBOR_VENV_DEPENDENCIES.
Reason: This dependancy wasn't really needed by us for using
thumbor. It was a dependancy for using open-cv as Imaging Engine
in thumbor but we use PIL (Pillow now) as Imaging Engine.
* Add zlib1g-dev, libfreetype6-dev to THUMBOR_VENV_DEPENDENCIES.
Reason: These are dependancies of Pillow which are required for it
Pillow to function. Since we use Pillow in thumbor as Imaging Engine
we need these. Stuff before this didn't break because we also use
Pillow in development Environment and have these dependancies
installed from VENV_DEPENDENCIES as well.
2018-02-12 14:40:26 -08:00
Greg Price ecbc72b857 push notifs: Add a diagnostic in API of whether push notifs enabled.
When the answer is False, this will allow the mobile app to show a
warning that push notifications will not work and the server admin
should set them up.

Based partly on Kunal's PR #7810.  Provides the necessary backend API
for zulip/zulip-mobile#1507.
2018-02-12 14:34:59 -08:00
Greg Price cc1d64edf8 tests: Dedupe a bit the test for server_settings.
We keep having to change the same thing in three places here; and also
the duplicates have accumulated unnecessary variation that makes it
hard to see what's actually supposed to be different and not different
in the three cases.
2018-02-12 14:34:28 -08:00
Greg Price 3fba90f6c3 billing: Make several small style fixes to new tests.
* Put imports in order.
* `import stripe`; that's the style upstream docs recommend, and it avoids
  confusion e.g. between our StripeError and the library's StripeError.
* Simplify loading JSON.
* Keep lines largely to 100 columns.
2018-02-12 12:46:01 -08:00
Vishnu Ks bed4ca642a stripe: Add backend tests for stripe. 2018-02-12 12:45:46 -08:00
Vishnu Ks 003cb0478a stripe: Use sources.list instead of sources.all.
Sources.all would be depricated soon in favor of sources.list.
See https://github.com/stripe/stripe-python/blob/
v1.77.1/stripe/api_resources/list_object.py#L18
2018-02-12 12:45:46 -08:00
Tim Abbott b9ca7bd954 beeminder: Clean up messy imports in tests. 2018-02-12 12:06:12 -08:00
Ricky 3f832b95de webhooks/beeminder: Fix documentation to append email to URL.
The Beeminder integration requires an `email` parameter that
our bot creation documentation macros don't yet support.
2018-02-12 12:03:25 -08:00
Ricky 76c56ad81d webhooks/beeminder: Make deadline time (time_remain) positive. 2018-02-12 12:03:25 -08:00
Tim Abbott 6bbce451bc analytics: Fix a minor mypy error. 2018-02-12 11:57:47 -08:00
Steve Howell 35cc206dcc Add narrow.narrow_to_next_pm_string().
This helper function will allow us to cycle through PM narrows
that are unread, once we map it to a hotkey and/or other UI.

(We intend to make something like the "n" key for topics, but
that works on PM narrows instead.)
2018-02-12 09:34:59 -08:00
Steve Howell 13abed229c Add narrow_state.pm_string(). 2018-02-12 09:34:59 -08:00
Steve Howell 6ea2765c9f Add topic_generator.get_next_unread_pm_string().
We will use this for keyboard navigation to cycle through
our unread PM narrows.
2018-02-12 09:34:59 -08:00
Steve Howell 9f8526ce29 Add pm_conversations.recent.get_strings().
We will use this method for hotkey navigation through recent
pms.
2018-02-12 09:34:59 -08:00
Steve Howell 4f52e095e8 refactor: Extract pm_conversations.recent.
This is a pretty pure code move, where we moved stuff from
message_store to pm_conversations:

    insert_recent_private_message() -> recent.insert()
    recent_private_messages -> recent.get()

The object message_store.recent_private_messages was not
encapsulated in a function before this change.  Now it is
hidden in the scope of pm_conversations.recent.

Both of the modules touched here maintain 100% line coverage.
2018-02-12 09:34:59 -08:00
Aman Jain a0b58b1560 activity: Add a link to copy list of realm admins.
Tweaked by tabbott to do the database queries properly.

This should help user to copy realm admin emails in a go.
Fixes: #7885
2018-02-12 08:55:45 -08:00
Rhea Parekh 3ebd30120c slack importer: Remove depreciated test.
This test was added in '/tests/test_slack_importer' in
6addf79edb.
2018-02-12 00:43:02 +05:30
Greg Price 7925e258a2 mypy: Tweak a bit of syntax to avoid a mypy bug.
The error message, in relevant part:
```
zerver/templatetags/app_filters.py: error: INTERNAL ERROR --
  please report a bug at https://github.com/python/mypy/issues version: 0.560
  File ".../site-packages/mypy/nodes.py", line 497, in accept
    return visitor.visit_func_def(self)
  File ".../site-packages/mypy/report.py", line 317, in visit_func_def
    assert start_indent is not None and start_indent > old_indent
AssertionError:
zerver/templatetags/app_filters.py: : note: use --pdb to drop into pdb
```

Seems mypy gets confused by the comment following the decorator.
2018-02-09 19:43:27 -08:00
Greg Price b374ea7357 mypy: Pass --show-traceback.
This saves a bit of debugging in the event that we hit a crash
inside mypy.
2018-02-09 19:42:49 -08:00
Greg Price 8be2dfa81c APNs: Fix a case I broke while working out tests.
I got distracted, came back later to a successful test run in my
terminal, and thought I remembered finishing the change and just
kicking off a final test run to check.

In fact, there was an `assert False` right in the normal case for
production, and I just hadn't finished a test for that path. (m.-)
Definitely the most grateful I've been for our coverage checks,
which highlighted this for me.

Remove the `assert False`, and also finish writing the test it was
there to help me write.  Those lines are covered now.
2018-02-09 18:28:16 -08:00
Umair Khan 59f61c2525 render_markdown_path: Use limited caching.
This results in an almost 50% increase in performance in the slow
test_urls test.

Fixes #6901.
2018-02-09 18:14:17 -08:00
Umair Khan 0eca2e102d cache: Add ignore_unhashable_lru_cache function.
This is a wrapper over lru_cache function. It adds following features on
top of lru_cache:

    * It will not cache result of functions with unhashable arguments.
    * It will clear cache whenever zerver.lib.cache.KEY_PREFIX changes.
2018-02-09 18:14:08 -08:00
Umair Khan 91ce455ac3 app_filters: Remove unused lru_cache import. 2018-02-09 18:12:55 -08:00
Priscilla 6badac5d33 docs: Add v shortcut to the lightbox article. 2018-02-09 18:02:24 -08:00
Greg Price 20c734c90a puppet: Fix type error in new Nagios check for analytics state. 2018-02-09 17:46:46 -08:00
Brock Whittaker 6028e79440 subs: Remove call to go to "all-streams" on stream creation.
This will essentially run the code paths to go from whatever you were
at before to /all and back in the case of /new, which will call the
render function three times (!!), so remove this call because it isn’t
really necessary anyways.
2018-02-09 17:29:59 -08:00
Brock Whittaker ad4e976406 streams: Have new streams list only populate once.
Currently the new streams user list will populate twice when you click
the new stream button (or “+”), because it is triggered once directly
by the button click and then once by the hash change to /new, so we
want to ignore the changes by the hash change.
2018-02-09 17:29:59 -08:00
Greg Price 7f6a1714aa APNs: Don't try to send anything when not configured. 2018-02-09 17:16:21 -08:00
Greg Price 12d878c785 APNs: Drop disused setting from old implementation. 2018-02-09 17:16:21 -08:00
Tim Abbott 005b0fb566 puppet: Clean up ssh authorized_keys configuration rules. 2018-02-09 16:37:03 -08:00
Tim Abbott aca25b6f0a puppet: Move ssh configuration to use notify.
This handles more correctly the case where we're using the upstream
sshd_config file.
2018-02-09 16:37:03 -08:00
Tim Abbott 486de8abfc puppet: Edit some rules to support chat.zulip.org.
This should make it possible to use the zulip_ops base rules
successfully on chat.zulip.org.  Many of the changes in this commit
are hacks and probably can be cleaned up later, but given that we plan
to drop trusty support soon, it's likely that most of them will simply
be deleted then.
2018-02-09 16:37:03 -08:00
Rishi Gupta 1d581a9c6e nagios: Add nagios check for analytics state.
This should help us detect issues where the analytics cron jobs aren't
running properly.

The cron/nagios part of the implementation done by tabbott.
2018-02-09 16:36:05 -08:00
Priyank Patel dcec2e3a4d dark-mode: Make all modals compatible with night mode.
This should cover the remaining modals that didn't already support this.
2018-02-09 14:21:13 -08:00
Robert Hönig 3e1b817376 bot settings: Move config item generation from js to handlebars. 2018-02-09 12:30:24 -08:00
Robert Hönig c0a0e6fd70 Set add_bot_backend() config_data param default to {}.
Previously, the default was None. This caused 500s when
adding a bot without adding a config_data argument.
2018-02-09 12:30:24 -08:00
Robert Hönig 02bc506518 bot_data.js: Fix dict indentation. 2018-02-09 12:30:24 -08:00
Robert Hönig 0abb0315f3 test_events.py: Properly check the bot added event dict.
Previously, the 'services' entry in the bot added event dict,
did not get verified, because the test didn't include a service bot.
2018-02-09 12:30:24 -08:00
Robert Hönig 760cbcc98e test_events.py: Use create_test_bot(). 2018-02-09 12:30:24 -08:00
Robert Hönig 323284e0b6 backend: Call real endpoint in create_test_bot().
This allows tests to be more realistical and to
directly test payload added to add_bot_backend().
2018-02-09 12:30:24 -08:00
Robert Hönig 33322fed51 bot_settings.js: Narrow config item selector.
Needed to avoid selector conflicts with the future
config items in the edit sidebar.
2018-02-09 12:30:24 -08:00
Robert Hönig 561e0ffe3b frontend: Delete page_params.realm_bots after first usage.
The data in page_params.realm_bots is parsed and captured
in bot_data. bot_data provides a safe system for accessing
this data.
2018-02-09 12:30:24 -08:00
Robert Hönig 7539512af8 settings-bots.js: Restructure bot edit event handler.
Shift and unify some variables to make the code more
logical and concise.
2018-02-09 12:30:03 -08:00
Robert Hönig f371c79c22 settings-bots.js: Fully generate bot owner list in handlebars. 2018-02-09 12:30:03 -08:00