Commit Graph

1812 Commits

Author SHA1 Message Date
Ayush Jain 518d25a0cf Disable proxy setting for test-backend and test-js-with-casper.
This fixes the fact that our test suites would have trouble connecting
to the other parts of the Zulip service when run with a proxy
configuration (e.g. trying to send requests to localhost through the
proxy!).

Thanks for Vishnu Ks for his work on this.

Fixes #971.
2017-04-18 12:35:44 -07:00
Aditya Bansal 065dd9ae10 Clean emoji-settings-admin.handlebars to use 4 space indents. 2017-04-18 12:06:31 -07:00
Aditya Bansal 1f09e38101 Clean bot-settings.handlebars to use 4 space indents. 2017-04-18 12:06:30 -07:00
Aditya Bansal c12f93efc4 Clean stream_privacy.handlebars to use 4 space indents. 2017-04-18 12:06:28 -07:00
Aditya Bansal c98cf5ba63 Clean message_edit_history.handlebars to use 4 space indents. 2017-04-18 12:06:28 -07:00
Aditya Bansal 23f8ec9759 Clean single_message.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 5f7c89b087 Clean stream_sidebar_row.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 83da92c316 Clean recipient_row.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 0494944f3f Clean draft.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal face3562af Clean subscription_settings.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal bdcff375ab Clean deactivated-users-admin.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 4c1b89a2ef Clean attachment-item.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal e5d57c31b8 Clean muted-topics-settings.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 2a15fa17b9 Clean admin_auth_methods_list.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal c0ca8b10ed Clean deactivation-stream-modal.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 0e906b683d Clean realm-domains-modal.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 257b930492 Clean admin-realm-domains-list.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal e21731c1ae Clean streams-list-admin.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal 71c5444b86 Clean alert-word-settings.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Aditya Bansal b11866c2a8 Clean message_edit_form.handlebars to use 4 space indents. 2017-04-18 12:06:25 -07:00
Raghav Jajodia 79e48dc222 test-migrations: Suggest 'renumber-migrations'. 2017-04-17 20:54:47 -07:00
Raghav Jajodia 6e1e045fd5 tooling: Add script to automatically renumber migrations.
Previously, if you have a branch with a new migration,
and you rebase onto master past someone else's migration,
you have to manually renumber your migration.

Add a script that automatically renumbers the migrations.
Fix #4257.
2017-04-17 20:53:35 -07:00
Yago González e710110a9e i18n: Automatically strip Handlebars strings.
Some Handlebars strings contained whitespaces characters at their ends.
With this, such characters are removed, as well as multiple spaces
(like the ones produced by code indentation).

This also includes a couple of fixes that removes spaces that were
intentionally placed before/after the string to translate.
2017-04-14 17:37:25 -07:00
Steve Howell 5ba79f9c3a refactor: Move respond/reply methods to compose_actions.js.
This moves respond_to_mention() and reply_with_mention() to
compose_actions.js.  These methods are basically thin layers
on top of compose_actions.start().
2017-04-14 13:09:19 -07:00
Steve Howell dd0c50f0df Extract compose_actions.js.
This module extracts these two functions that get called by
several other modules:

    start()
    cancel()

It is a little bit arbitrary which functions got pulled over
with them, but it's generally functions that would have only
been called via start/cancel.

There are two goals for splitting out this code.  The first
goal is simply to make `compose.js` have fewer responsibilities.
The second goal is to help break up circular dependencies.
The extraction of this module does more to clarify
dependencies than actually break them.  The methods start()
and cancel() had actually been shimmed in an earlier commit,
and now they no longer have a shim.

Besides start/cancel, most of the functions here are only
exported to facilitate test stubbing.  An exception is
decorate_stream_bar(), which is currently called from
ui_init.js.  We probably should move the "blur" handler out
of there, but cleaning up ui_init.js is a project for another
day.

It may seem slightly odd that this commit doesn't pull over
finish() into this module, but finish() would bring in the
whole send-message codepath.  You can think of it like this:

* compose_actions basically just populates the compose box
* compose.finish() makes the compose box do its real job,
  which is to send a message
2017-04-14 13:09:19 -07:00
Umair Khan bf713bcdfe testing: Don't create DB twice for backend.
In backend tests, only call generate-fixtures when --generate-fixtures
is explicitly passed or is_template_database_current() returns False.

We don't need to flush cache for backend tests because we bounce the key
prefix used to create cache keys before running every test
2017-04-14 10:23:16 +05:00
Adarsh S d54dea819d Add option for re-running failed tests.
This adds the option '--rerun' to the `test-backend` infrastructure.
It runs the tests that failed during the last 'test-backend' run.  It
works by stailing failed test info at var/last_test_failure.json

Cleaned up by Umair Khan and Tim Abbott.
2017-04-12 11:35:31 -07:00
Rishi Gupta 44502da767 tools: Add check for uncommitted files to PR review scripts. 2017-04-11 22:29:38 -07:00
Umair Khan 5a3f83bba8 integrations: Move Trello webhook docs to markdown. 2017-04-07 15:52:15 -07:00
Tim Abbott 3a1912e829 mypy: Fix missing documentation_crawler annotation. 2017-04-06 15:33:41 -07:00
Tim Abbott 10e9c3bb84 documentation_crawler: Add exclude list.
This works around the issue that Google calendar returns errors on
HTTP HEAD requests.
2017-04-06 15:26:27 -07:00
Steve Howell f37ce1eeb1 Extract settings_lab.js. 2017-04-06 11:28:36 -07:00
Steve Howell 89128a2272 Extract settings_muting.js. 2017-04-06 11:28:36 -07:00
Steve Howell 1f38884b27 Extract settings_notifications.js. 2017-04-06 11:28:36 -07:00
sinwar 4296d608ab test_server: Improve warning in venv check.
This (1) changes test_server to use the common `check_venv` method and
(2) improves check_venv to provide a clearer error message in the case
that you're inside Vagrant but not in a venv.

Tweaked by tabbott to borrow logic from run_dev.py.
2017-04-05 16:51:23 -07:00
Tomasz Kolek a8633e0975 integrations doc: Move twitter doc to separate file. 2017-04-05 13:43:48 -07:00
Tomasz Kolek 85940aef7f integrations doc: Move trac doc to separate file. 2017-04-05 13:43:48 -07:00
Tomasz Kolek d8ed13740d integrations doc: Move subversion doc to separate file. 2017-04-05 13:43:48 -07:00
Tomasz Kolek 5426725c43 integrations doc: Move openshift doc to separate file. 2017-04-05 13:43:47 -07:00
Tomasz Kolek 484fef059b integrations doc: Move nagios doc to separate file. 2017-04-05 13:43:47 -07:00
Tomasz Kolek 489a7d1784 integrations doc: Move mercurial doc to separate file. 2017-04-05 13:43:47 -07:00
Tomasz Kolek 372c7224f0 integrations doc: Move jira-plugin doc to separate file. 2017-04-05 13:43:47 -07:00
Tomasz Kolek bd1103373d integrations doc: Move google-calendar doc to separate file. 2017-04-05 13:43:47 -07:00
Tomasz Kolek 6ff130b829 integrations doc: Move git doc to separate file. 2017-04-05 13:43:47 -07:00
Tomasz Kolek cbe00e020c integrations doc: Move capistrano doc to separate file. 2017-04-05 13:37:37 -07:00
Tomasz Kolek 5b17622589 docs: Move integrations.html to integrations/index.html.
Add omiting rule for all of integrations docs in test_templates.
2017-04-05 13:19:58 -07:00
Steve Howell 6b4825a763 tools: Convert test-js-with-node to Python.
This is mostly a straight port from bash to Python, but we
rename the coverage option to `--coverage` and we add checks
for being in a venv and being correctly provisioned.

Fixes #4009.
2017-04-05 12:02:49 -07:00
Umair Khan c1049f5bd9 github: Warn if GitHub settings are not filled. 2017-04-04 18:03:33 -07:00
Harshit Bansal 0605a9fb0f templates: Rename `admin-alias-list.handlebars`.
Rename `admin-alias-list.handlebars` to
`admin-realm-domains-list.handlebars`.

Fixes: #3145.
2017-04-04 15:48:03 -07:00
Harshit Bansal 885ec07192 frontend: `realm_alias` to `realm_domain` migration.
* Change the classes and ids of different widgets and modals
and make suitable changes in `admin.js`.

* Remove any other occurrences of `alias` or `realm_alias`
from admin.js.
2017-04-04 15:48:03 -07:00
Brock Whittaker 34f9ccb87c alerts: Change sidebar alerts to be at top of the screen.
This changes the alerts to be individual boxes that slide down from
the top of the screen for a better UI experience.
2017-04-03 16:22:05 -07:00
Steve Howell 2d52463b61 Extract ui_report.js.
This moves the implementations of error/report/message from
ui.js to ui_report.js.  They had been shimmed before, so calling
modules still use the same names to call the functions, but we
no longer need the shims.
2017-04-03 07:13:25 -07:00
Steve Howell 3d1ce3fafe js deps: Approve some more deps to break. 2017-03-30 15:35:57 -07:00
Steve Howell c0a6038a95 css: Enforce one selector per line.
While it's sometimes nice to put a few selectors on the same line,
it is generally better to have a consistent way of formatting our
selectors, and most of our code up until now lists them vertically.
This change fixes the linter to enforce one selector per line, and
it cleans up the places in the CSS where we had multiple selectors
on the same line.

The advantages of one-per-line are as followers:
    * cleaner diffs
    * easier to see when multiple areas of the app may have the
      same format
    * less likely to go over 80 cols
    * makes it more clear where we have deep nesting in the
      individual selectors
    * makes it easier for our linting tools to enforce
      whitespace violations

This also fixed an old bug where we had ".landing_page h2, h4", which
sets "h4" styles outside of the landing page.
2017-03-26 16:57:33 -07:00
Steve Howell 3d76088f59 tools: Make CSS style more consistent with opening brace.
We now always put the opening brace of a CSS section on
the same line as the last selector (with a space in front).
2017-03-26 16:57:33 -07:00
Tim Abbott 36bb2bf54a AdminZulipHandler: Bring logging_handlers.py to 100% test coverage.
This involved fixing some unupdated code in one code path.
2017-03-26 13:10:43 -07:00
Rishi Gupta b416587aab Change sender_domain to sender_realm_str in message dict. 2017-03-25 19:50:24 -07:00
Tim Abbott c7f1a7aa19 test_script: Use LooseVersion for version conparisons.
Fixes #4292.
2017-03-25 19:49:03 -07:00
Elliott Jin 98ddb4453e test-backend: Raise zerver/views/home.py test coverage to 100%. 2017-03-25 18:16:16 -07:00
Elliott Jin 1c0d58f897 test-backend: Raise zerver/views/auth.py test coverage to 100%. 2017-03-25 18:16:16 -07:00
Tim Abbott 3617ebfd41 api: Rename get_old_messages to get_messages in the backend.
Fixes #1315.
2017-03-23 23:52:44 -07:00
wizsid11 95789eb879 Add Slack webhook.
Adds a new webhook integration for Slack to receive messages
from one's Slack team's public channels.
Contains negative tests for broken, missing or invalid data.

Allows two different option for integration:
1. Receive notification on a single stream with different topics
for each of Slack's public channels.
2. Receive notification on different streams for each of Slack's
public channels.

Steps to choose between the two options is described in the documentation.

Fixes #3569.
2017-03-23 23:32:38 -07:00
Tim Abbott a6ae546f59 test_events: Bring zerver/lib/events.py to 100% coverage. 2017-03-23 22:43:10 -07:00
Tim Abbott eb19a25aba events: Fix races in stream creation event and add tests.
This fixes 2 issues:
* Being added to an invite_only stream did not correctly update the
  "streams" key of the initial state.

* Once that's resolved, subscribe_to_stream when called on a
  nonexistant stream would both send a "create" event (from
  create_stream_if_needed) and an "occupy" event (from
  bulk_add_subscriptions).

  The second event should just be suppressed in that case, and this
  implements that suppression.
2017-03-23 22:43:09 -07:00
Umair Khan 2d4a1f93ff testing: Bring zproject.backends coverage to 100%. 2017-03-23 17:12:58 -07:00
Tim Abbott debb00b190 lint: Fix get_stream lint error in actions.py. 2017-03-23 15:50:33 -07:00
Tim Abbott 06492738b5 dev: Expose coverage and built documentation to web.
This makes it much more convenient for developers to access coverage
and built developer documentation.
2017-03-23 13:10:06 -07:00
Umair Khan 0fc946aef4 testing: Add reverse option to test runner. 2017-03-22 12:07:21 -07:00
Umair Khan 2f243d8808 testing: Control parallelism through cmd args. 2017-03-22 11:59:30 -07:00
Steve Howell 8c0a1bddb0 linter: Deprecate ui.report_success/error(). 2017-03-22 06:57:23 -07:00
Eeshan Garg b8f71c5d24 Document how to set up an Asana integration via Zapier.
Fixes #3948.
2017-03-21 19:56:47 -07:00
Yago González 34a9e1ae11 markdown: Add TeX typesetting support.
Co-authored-by: Reid Barton <rwbarton@gmail.com>

Fixes #2056.
2017-03-21 16:40:00 -07:00
adnrs96 b3cbb13a79 linter: Add support for automatic checking for 4 space indents in CSS.
In this commit we modify our CSS parser not only to render the text from
a given CSS tokens produced but also enforce 4 space indentation on it.
Also we enforce some basic rules we would like our CSS to follow such as
* Always have "\n" in between the starting of body({) and body itself
  and ending of the body and the closing of body(}).
* Use 4 space indents while having but something within the block
  structure ( { .... } ).
* Have single space after ',' in between multiple selectors.
* Have only a single space in between selector and the starting of
  block structure ({ ... }) if block structure starts on same line as
  of selector.
  eg. body {
          body content here
      }
  Notice single space between 'body' and '{'.

Fixes: #1659.
2017-03-21 13:40:05 -07:00
adnrs96 a91012bd70 Move thirdparty-fonts.css from static/styles to static/third. 2017-03-21 13:40:05 -07:00
Umair Khan a2aeddba6b testing: Add infrastructure for running backend tests in parallel.
This doesn't yet provide an option to actually run the backend tests
parallelized yet.
2017-03-21 10:59:12 -07:00
Steve Howell 36b29a966e Add roadmap feature to js-dep-visualizer.
The js-dep-visualizer tool now attempts to find a set of edges
to remove from a call graph that would reduce it to having only
trivial mutual dependencies, and it produces a roadmap of the
changes that need to happen.

If the tool can't reduce the graph all the way, it still produces
a DOT file that can be visualized.

This fix also has some significant code cleanup.
2017-03-21 07:39:30 -07:00
Umair Khan 38572311f9 linter: Add a rule to check render_to_response. 2017-03-20 07:54:28 -07:00
Tim Abbott 24c2e62ae1 capitalization: Add exception for selected message.
This fixes a test that's been failing overnight.
2017-03-20 07:52:58 -07:00
Yago González df94719707 lint: Ban redundant linkified URLs. 2017-03-19 22:46:25 -07:00
Steve Howell edb8b0cb5e Improve js-dep-visualizer.
This adds a report of nodes, handles some errors better, adds
some helpful output, cleans up some abspath calls, and
updates which modules and/or dependencies we temporarily are
ignoring for the report.
2017-03-19 21:03:45 -07:00
Tim Abbott 9866124b78 mypy: Fix some new errors flagged by latest mypy master.
Mostly list -> List bugs in annotations.
2017-03-19 21:03:45 -07:00
Elliott Jin 356f57c831 refactor: Simplify pattern for adding external linters. 2017-03-19 14:13:38 -07:00
Elliott Jin ac488fd45f tools: Don't lint in pre-commit hook if no files changed. 2017-03-19 14:13:38 -07:00
Elliott Jin 5ada385b91 refactor: Check for empty list with `len(X) == 0` instead of `not X`. 2017-03-19 14:13:38 -07:00
Elliott Jin 750769f637 tools: Only lint changed template files in pre-commit hook. 2017-03-19 14:13:38 -07:00
Elliott Jin 2e246a936f tools: Support checking specific files in `check-templates`. 2017-03-19 14:13:38 -07:00
Elliott Jin 357e1a001f refactor: Move `check-templates` argument parsing to top level. 2017-03-19 14:13:38 -07:00
Elliott Jin 0d677042e7 tools: Remove assert in template linter.
Currently, in the case where `--modified` is not passed, the linter asserts
that it's checking at least 10 files.  Removing this (somewhat arbitrary)
check makes it easier to:

- Add support for specifying files to check via command line arguments
- Reason about cases where `check-templates` is called from `lint-all`
2017-03-19 14:13:38 -07:00
Elliott Jin bdf4b22772 tools: Only lint changed css files in pre-commit hook. 2017-03-19 11:49:19 -07:00
Elliott Jin ac5b62359a refactor: Use consistent naming for lint functions. 2017-03-19 11:49:19 -07:00
Steve Howell 6f3f031791 Make visualizer tool scan each file just once.
Rather than having a bunch of regexes to look for, we just
have a single regex for a function call.  And now we process
line by line, which allows us to more easily ignore comments.
2017-03-19 06:25:10 -07:00
Elliott Jin 1138057209 test-backend: Raise zerver/views/registration.py test coverage to 100%. 2017-03-18 18:11:59 -07:00
Steve Howell 16a37754cf Add recipient() and composing() shims. 2017-03-18 15:52:50 -07:00
Tim Abbott ecea8c2d43 run-dev: Fix missing type annotation. 2017-03-17 21:03:35 -07:00
Steve Howell 623a486c5c tools: Extract is_exterior_node(). 2017-03-17 20:53:27 -07:00
Steve Howell 758ff2e756 Exclude more nodes/edges from our JS visualization.
This also provides a roadmap for how to break some dependencies.
2017-03-17 20:53:02 -07:00
Tim Abbott 25488b550f casper: Fix issues with server autoreloading on save.
This fixes an issue where if you saved a Python file (even just
changing whitespace) while casper tests were running, the Tornado
server being used would restart, triggering a confusing error like
this:

ReferenceError: Can't find variable: $
Traceback:
  undefined:2
  :4
Suite explicitly interrupted without any message given.
2017-03-17 20:45:07 -07:00
Tim Abbott af8732fd42 py3: Remove unnecesary use of filter. 2017-03-17 20:30:22 -07:00
Tommy Ip da49db0201 Create tools/js-dep-visualizer.py.
This tools lets us view circular dependencies in our JS
code.  It does regex parsing, so it has a few false positives,
but it's an early draft of the tools.  Steve Howell helped
with this commit.
2017-03-17 16:09:21 -07:00
Steve Howell e04a9d38b5 Add tools/lib/graph.py.
This library helps us produce nice graphs for documentation.
2017-03-17 16:00:50 -07:00