Commit Graph

3992 Commits

Author SHA1 Message Date
Mohit Gupta 3390a70bcd tests: Add extra console output detection in test-backend output.
This commit adds automatic detection of extra output (other than
printed by testing library or tools) in stderr and stdout by code under
test test-backend when it is run with flag --ban-console-output.
It also prints the test that produced the extra console output.

Fixes: #1587.
2020-08-27 11:39:53 -07:00
Aman 88821b960a vagrant: Add parallels as a provider.
There are file sharing issues with the macOS 10.15.6 and
vagrant. var/remote_cache_prefix was an empty file when using
VirtualBox and Docker on macOS.
Using parallels as a provider for vagrant fixes the issue.

Use --watch-poll which makes webpack to recompile
automatically on file changes, since inotify is not
working here too.
2020-08-14 16:03:51 -07:00
Steve Howell 196df919f2 minor: Improve error message for check-node-fixtures.
This is helpful now, but it will also reduce confusion
when we extend this tool to also look at openapi schemas.
2020-08-14 10:40:29 -04:00
Anders Kaseorg d0f4af5f8c python: Catch JSONDecodeError instead of ValueError when decoding JSON.
These weren’t wrong since orjson.JSONDecodeError subclasses
json.JSONDecodeError which subclasses ValueError, but the more
specific ones express the intention more clearly.

(ujson raised ValueError directly, as did json in Python 2.)

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-12 11:59:59 -07:00
Anders Kaseorg 42aa916967 sanity_check: Test for the virtualenv by its path.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-11 12:30:26 -07:00
Anders Kaseorg 61d0417e75 python: Replace ujson with orjson.
Fixes #6507.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-11 10:55:12 -07:00
Anders Kaseorg 768f9f93cd docs: Capitalize Markdown consistently.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-11 10:23:06 -07:00
Alex Vandiver 39368cad3a tornado: Extract functions called from django into one module.
This makes clearer the separation of concerns.
2020-08-10 16:55:56 -07:00
Anders Kaseorg 18dcb86de5 Revert "provision: Fix missing <sasl/sasl.h> headers during provision."
This reverts commit cc9dc07b07.  It was
merged with no review and has various issues (see #16086).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-10 12:09:37 -07:00
Aman cc9dc07b07 provision: Fix missing <sasl/sasl.h> headers during provision.
This fixes the error of missing sasl.h when compiling python-ldap
from source during provision.
2020-08-09 23:21:13 -07:00
Anders Kaseorg f63d132276 js: Use unminified KaTeX (and minifiy it with everything else).
Since our Webpack config passes pre-minified JS files to
script-loader, they can’t be used as modules.  Use the normal
unminified version, letting Webpack minify it and give us source maps.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-07 11:27:44 -07:00
Anders Kaseorg dbdf67301b memcached: Switch from pylibmc to python-binary-memcached.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-06 12:51:14 -07:00
Tim Abbott 907b16aa23 node tests: Disable coverage for recent_senders.
This was lost in 5142bdd317.
2020-08-06 12:29:27 -07:00
Anders Kaseorg 9f2cd66a4d lint: Migrate all custom CSS rules to stylelint.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-06 11:30:07 -07:00
Anders Kaseorg a1e90917d6 lint: Remove custom whitespace rules obsoleted by Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-04 16:54:03 -07:00
Anders Kaseorg c6ed5c81de styles: Format CSS with Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-04 16:34:19 -07:00
Anders Kaseorg 6c0afbb68d stylelint: Move .stylelintrc to stylelint.config.js.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-08-04 16:32:04 -07:00
Priyank Patel 9504d403b3 github-actions: Fix incorrect hash key in production install job.
The hash keys were missing hash for package.json and yarn.lock
because they were not present since we don't do a full checkout
in this job. We fix this by sending over those files and generating
hashes from them.

I usally verify these cache keys by clicking the Restore <cache>
step dropdown menu and then clicking the Run ... dropdown menu again
to see the generated hash.
2020-08-03 12:37:20 -07:00
Anders Kaseorg 6ec808b8df js: Add "use strict" directive to CommonJS files.
ES and TypeScript modules are strict by default and don’t need this
directive.  ESLint will remind us to add it to new CommonJS files and
remove it from ES and TypeScript modules.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-31 22:09:46 -07:00
YashRE42 b4891a5841 navbar: Rename tab_bar to message_view_header.
Prior to commit eb4a2b9d4e the center
area of the navbar was based on a structure that appended crumbs or
"tabs" as <li>s, forming a tab_bar and a tab_list.

However, in eb4a2b9d4e we apply a new
style and structure to the navbar which lets go of the convention of
tabs. Hence, we'd like to purge the tab_bar and tab_list labels from
our code base.

We purged tab_list in 1267caf5009118875f47fdafe312880af08024e1.

This commit purges tab_bar, it includes:
- A blanket search and replace of tab_bar with message_view_header.
- Splitting a single line comment in
  tab_bar.js / message_view_header.js.
- The renaming of tab_bar.js to message_view_header.js.
- The renaming of tab_bar.hbs to message_view_header.hbs.
- A blanket search and replace of tab_data with
  message_view_header_data.
- Replacing the single occurrence of tabbar with message_view_header
  (it was within a comment.)
2020-07-30 16:23:13 -07:00
Anders Kaseorg 9d768b79c5 semgrep: Use upstream options for silencing extra messages.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-30 15:12:22 -07:00
Anders Kaseorg d35b5027bb semgrep: Upgrade semgrep to 0.17.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-30 15:12:22 -07:00
Priyank Patel dda7e938f4 puppeteer: Fix flake with compose box input.
There were a lots of flakes in CI recently because typeahead didn't
appear when Enter was pressed and real emails are not accepted as
valid inputs. To fix this we wait for typeahead to appear and then
click that instead of Enter. We also use delay option to type the
email (100ms delay between keypresses) since without we'd also get
flakes.

Re-enable puppeteer test in CI after this fix too.
2020-07-30 11:32:32 -07:00
Anders Kaseorg 7ee974729b docs: Replace Digital Ocean with DigitalOcean.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-30 11:30:43 -07:00
Anders Kaseorg 8cc34d168e webpack: Remove stale reference to webpack-helpers.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 16:46:08 -07:00
Anders Kaseorg 9e215093ca debug-require: Remove ES6 syntax.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 15:28:48 -07:00
Gittenburg 6081e0228b emoji: Make 😛 have open eyes.
😛 should be the most general version, which is the one
with open eyes. Other apps do the same and it also means that :P, which
is converted to 😛 is rendered like the emoticon.

Fixes #15970.
2020-07-29 11:18:43 -07:00
Anders Kaseorg d5d6e43453 debug-require: Throw errors for unknown and unloaded modules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 11:17:24 -07:00
Anders Kaseorg 11b0303d55 webpack: Reference webpack-dev-server types with triple-slash directive.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 11:17:24 -07:00
Anders Kaseorg d5176f4724 webpack: Inline the rest of webpack-helpers.
There’s no reason to separate this for one loader declaration.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 11:17:24 -07:00
Anders Kaseorg b9fd2a2b37 webpack: Inline getExposeLoaders abstraction.
We only have two of these and don’t intend to add more.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 11:17:24 -07:00
Anders Kaseorg 767ad1d90e debug: Remove debug from globals.
This is used rarely enough that it’s easier to document how to use it
as a non-global than to document the horrifying things that might go
wrong as a global.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 11:17:24 -07:00
Anders Kaseorg 226598edc4 js: Use Handlebars as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-29 11:17:24 -07:00
Steve Howell 46e80cdd3a check-node-fixtures: Enforce sorting of events.
We want lib/events.js to be somewhat of an
executable piece of documentation, and it's
really not that hard to keep it sorted going
forward.
2020-07-29 08:37:18 -04:00
Tim Abbott cee7e8e89d ci: Disable puppeteer tests. 2020-07-28 17:12:49 -07:00
Anders Kaseorg 0e0baca41e typescript: Enable strictNullChecks.
Let’s do this right from the beginning instead of making a mess to
clean up later.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 11:01:35 -07:00
Anders Kaseorg 584d6bfa41 stats: Use Plotly.js as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg eb09c137cf click_handlers: Use WinChan as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg 114cc1ec25 settings_profile_fields: Use SortableJS as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg 1d59fc272c js: Use Marked.js as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg bcab7efb37 js: Use XDate as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg c66931d4cd js: Use clipboard.js as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg f0021df3d4 people: Use blueimp-md5 as a module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-28 10:54:35 -07:00
Anders Kaseorg d2520cd7e0 js: Replace underscore with lodash and remove it from globals.
Tweaked by tabbott to bump PROVISION_VERSION.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 16:12:06 -07:00
Steve Howell da8691d7d7 ci: Add new check-node-fixtures tool to CI.
This tool only takes a couple seconds to run,
so it's pretty low risk to add to CI.
2020-07-26 16:07:40 -07:00
Steve Howell f9808d0c15 tools: Add tools/check-node-fixtures.
This makes sure out fixture data for node tests
is realistic, according to the schemas in
zerver/lib/event_schema.py.

Note that we are still in the process of extracting
schemas from test_events.py -> event_schema.py,
so the checks here are somewhat incomplete as of
now.

One nice thing is that the program will tell us
what checkers are missing, so this can motivate
us to move more checkers to event_schema.py.

I considered just making this happen as part of
tools/test-js-with-node, but it's convenient to
run by itself.  Also, it currently requires
Django (although we could fix that), which makes
it just expensive enough that I wouldn't want
to always run it before the node tests.
2020-07-26 16:07:33 -07:00
Priyank Patel 51199878ed tools/ci: Fix KeyError when running tools/ci/generate-dockerfiles.
This KeyError occurs because we remove extra_packages from
images.yml because it was no longer needed in a486872a8e.
2020-07-26 16:03:35 -07:00
Tim Abbott ec9c272165 help: Document process for changing organization URL. 2020-07-24 16:12:56 -07:00
Alex Vandiver a2fc823c3f provisioning: Use AWS CLI to automate provisioning
The previous steps for standing up a new host were somewhat manual.
This further scripts the process, by using the AWS CLI to start the
instance, and pass it a "user data" script to provision itself upon
boot.  This results in a hands-off provisioning process which
completes in 5min.

Additional settings are required for `~/.zulip-install-server.conf`.
It is not suited for all roles, as it assumes one instance type and
security group value.  Additionally, not all of the post-provision
process is currently automated -- Nagios SSH key verification, for
instance, is still a manual step.  There are also additional steps for
database or frontend servers.  Regardless, this is a move toward
automated provisioning.
2020-07-24 12:40:14 -07:00
Vishnu KS 3ec64b6092 team: Include users without an associated GitHub profile.
Including anon=1 in API requests will retrieve all contributors
of the repo. If there is no asscoiated GitHub account present for
the commits then the email and name of the author mentioned in
commit messages is returned.
2020-07-24 10:51:47 -07:00