Commit Graph

1778 Commits

Author SHA1 Message Date
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
Tim Abbott 497b24d7a6 lint: Ban use of i18n.t in portico js. 2017-03-17 14:14:54 -07:00
Tim Abbott 5db3f60c7d travis: Temporarily disable failing Nagios tests.
Apparently Travis CI has a very strange issue today that causes our
Nagios/E2E tests to have Tornado failing to connect to RabbitMQ.
Causes unknown, but I've spent a day trying to debug this without
luck, and we need our test suites passing in the meantime.
2017-03-15 22:01:04 -07:00
Rishi Gupta 40fb6ea80e lint: Prevent importing from zerver in migrations. 2017-03-15 12:02:24 -07:00
Tim Abbott e7b3ea8fab coverage: Require 100% coverage in analytics. 2017-03-14 17:11:25 -07:00
Tim Abbott 85fe53f5e3 coverage: Don't require test coverage for __unicode__ methods.
These are usually just used for manual debugging, and so aren't super
important to make sure we have tests for always.
2017-03-14 17:07:18 -07:00
adnrs96 dd52291fa5 linter: Add support for automatic checking for 4 space indents in HTML. 2017-03-14 14:50:16 -07:00
Umair Khan cdb07c7005 Fix test_get_old_messages_with_narrow_pm_with.
Fixes #3940.
2017-03-14 09:38:24 -07:00
Steve Howell 1e5ec689b7 tools/css: Trim whitespace around CSS values. 2017-03-14 09:29:56 -07:00
Steve Howell 2ffea94bd8 tools/css: Require semicolons after CSS declarations. 2017-03-14 09:29:56 -07:00
Rishi Gupta 00f49d4121 views/users.py: Change error message to use Realm.string_id instead of domain. 2017-03-13 09:37:06 -07:00
adnrs96 a75c0dd248 Enhance template parser for comments, Fix deep nesting in Jinja2.
In this commit we add the ability of recognizing comments in
handlebar and Jinja2 templates to the template parser. This
fixes issue of template parser picking up code tags which are
commented out in files.
Also we fix the problem of too much deep nesting in the Jinja2
logic statement. Now only nested Jinja2 logic statements will get
a deeper indentation level.With this another fix was introduced
relating with the tags before a nested handlebar or django tag getting
wrong indent.
We also fix the issue with wrong offsets with closing tags in
cases if they were not matching indent level of the starting
tag intially.
Also we also start to ignore any tags occuring in between 'pre'
tags for deeper indent levels. As well we start to filter out django
non block tags from getting deeper indent level.
2017-03-11 15:16:44 -08:00
Tim Abbott b1f12133be build-release-tarball: Error on uncommitted changes. 2017-03-10 11:49:49 -08:00
Umair Khan 90ee06bd89 capitalization: Make it easier to ignore phrases.
This commit allows us to add the errors shown by the
tools/check-capitalization in the IGNORED_PHRASES list
without any modification.
2017-03-10 11:21:49 -08:00
Harshit Bansal c5ffef28bb tools/check-capitalization: Make error messages more clear. 2017-03-10 10:51:01 -08:00
Umair Khan 7bc3fa034e linter: Add rule to check periods in translatable.
Make sure that the periods are part of the translatable strings.

Tweaked by tabbott to properly scope the rules.
2017-03-09 21:57:26 -08:00
Tim Abbott 4ac5da7860 travis: Run test-tools in Travis CI backend suite. 2017-03-09 20:21:13 -08:00
Tim Abbott c5cae34512 tools: Fix test-capitalization dependence on Django.
This was a totally unnecessary dependency, and actually broke
test-tools.
2017-03-09 20:21:13 -08:00
Umair Khan 32849b80ad Django 1.10: Url pattern doesn't use _callback_str.
Fixes #3941
2017-03-09 00:50:12 -08:00
Umair Khan 83dd901ecf Add capitalization checker tool.
Initial rules significantly by modified by tabbott, who also added the
hacky list of excludes that the tool can't handle correctly yet.

Fixes: #3899.
2017-03-09 00:44:57 -08:00
Tim Abbott 84d4f62abf lint: Exclude Acme placeholders from translations.
These strings represented a small waste of time for our translators.
2017-03-09 00:38:15 -08:00
Tim Abbott 8bdbcbc371 lint: Fix unnecessarily translated test file strings.
Our linter for translation strings shouldn't check test files, since
then we'll end up translating non-user-facing strings.

So we fix that, and actually add the opposite lint rule.
2017-03-09 00:37:44 -08:00
Tim Abbott 342a80c3de lint: Ban use of datetime.(utc)now in Python backend.
This may be all we're doing for #3999, but leaving it open just in
case.
2017-03-08 21:03:27 -08:00
Rishi Gupta 3797fa657e Change bot domains to string_id.EXTERNAL_HOST.
Change applies to both subdomains and non-subdomains case, though we use
just the EXTERNAL_HOST in the non-subdomains case if there is only 1 realm.

Fixes #3903.
2017-03-08 16:26:13 -08:00
Elliott Jin 8d936601d3 test-backend: Raise zerver/views/test_upload.py test coverage to 100%. 2017-03-08 11:42:25 -08:00
K.Kanakhin 6a801db1c2 missed-emails-sending: Move email sending to separate queue worker.
- Add new 'missedmessage_email_senders' queue for sending missed messages emails.
- Add the new worker to process 'missedmessage_email_senders' queue.
- Split aggregation missed messages and sending missed messages email
  to separate queue workers.
- Adapt tests for sending missed emails to the new logic.

Fixes #2607
2017-03-07 20:08:40 -08:00
K.Kanakhin ea4b9cb609 production-helper: Fix sorting queue workers by name.
- Shell command `sort` depends on system locale and
  symbol `_` (underscore) is located after letters
  in the default locale of Travis instances. Otherwise,
  python sorting uses its own symbols ordering and
  underscore is located before letters. Changing the
  locale for `sort` shell command with adding environment
  variable doesn' t work on Travis instances. That's why
  It was decided to apply the same sorting command to both
  comparing lists.
2017-03-07 20:05:53 -08:00
Elliott Jin 3127ebfa3b test-backend: Raise zerver/views/events_register.py test coverage to 100%. 2017-03-07 19:47:16 -08:00
sinwar 6f0564e9f4 python: Fix remaining bare excepts in codebase.
Fixes #2862.
2017-03-05 16:17:04 -08:00
Tim Abbott b6f53d6c14 coverage: bring zerver/lib/validator.py to 100% coverage. 2017-03-05 00:53:27 -08:00
Tim Abbott e95f139308 coverage: bring zerver/lib/response.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott 89decf6ded coverage: bring zerver/lib/request.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott e7ff3415ab coverage: bring test_helpers.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott 546fb9199d coverage: bring test_classes.py to 100% coverage. 2017-03-05 00:53:26 -08:00
Tim Abbott e3cfb256dd coverage: Bring zerver.lib.narrow.py to 100% coverage. 2017-03-05 00:53:26 -08:00