Commit Graph

3393 Commits

Author SHA1 Message Date
Tim Abbott c931e76cf2 docs: Rewrite docs on writing API documentation.
This had gotten badly out of date, since it wasn't updated when we did
the big migration to the OpenAPI documentation system.

Fixes part of #12571.
2019-07-19 18:00:01 -07:00
Anders Kaseorg e80b57a18a provision_inner: Remove unused lsb_release run.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-19 16:36:11 -07:00
Anders Kaseorg c5a4b0501b provision: Start a new Python process after activating the virtualenv.
Mismatching imports from outside and inside the virtualenv in the same
process was causing segfaults after apparently benign changes to the
script!

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-19 12:16:55 -07:00
Anders Kaseorg a7eb3faf96 storage: Move the staticfiles.json hack to ZulipStorage.
There’s no reason to monkey-patch something that we were already
subclassing.

Removing the PRODUCTION conditional causes us to generate
staticfiles.json in the right place to begin with so we don’t need to
move it later.  It also allows Django to find staticfiles.json if
running the dev server with PIPELINE_ENABLED.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-19 11:47:51 -07:00
Anders Kaseorg 695b79c5d8 generate_zulip_bots_static_files: Write to static, not STATIC_ROOT.
Otherwise the files aren’t processed by collectstatic and don’t end up
in the staticfiles.json manifest.

Signed-off-by: Anders Kaseorg <andersk@zulipchat.com>
2019-07-19 11:33:08 -07:00
Anders Kaseorg 5f712b960f update-authors-json: Write to static, not STATIC_ROOT.
Otherwise the file isn’t processed by collectstatic and doesn’t end up
in the staticfiles.json manifest.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-19 11:33:08 -07:00
Anders Kaseorg 1d05a71b5d install, provision: Treat all nonzero exit codes as failure, not just 1.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-19 11:22:11 -07:00
Wyatt Hoodes 89df6e9425 check-templates: Add fix option to tools/check_templates.
`valid_indent_html` allows for replacing the incorrectly
indented file with the correct pretty-printed version
if `--fix` is passed to `tools/lint`.

Fixes #12641.
2019-07-19 11:12:11 -07:00
Anders Kaseorg ab89f40a66 generate-custom-icon-webfont: Replace with webpack webfonts-loader.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-18 12:00:00 -07:00
Anders Kaseorg 586aaddcc0 documentation_crawler: Stop treating all portico URLs as external.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-18 11:56:15 -07:00
Wyatt Hoodes 1418b8b05f test_server: Set LOCAL_UPLOADS_DIR in set_up_django.
For the Casper and API tests, we need to allow setting
LOCAL_UPLOADS_DIR, which is normally managed within test_runner.py.
2019-07-17 16:14:20 -07:00
Anders Kaseorg 54304b4008 webpack: Remove partial from handlebars-loader knownHelpers.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-17 16:07:17 -07:00
Anders Kaseorg b1aa304c4a templates: Suppress Handlebars automatic partial indentation.
Fixes #12795.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-17 16:07:17 -07:00
Sumanth V Rao 2c9f5e3980 tools: Add tool to update API field of local zuliprc file.
This tool can be used to update the API field of local
zuliprc files for dummy users of development server
(iago, prospero, etc) with the correct API key from database.

This tool can be run after provisioning (or similar tools) which change
the API keys in the database.
2019-07-17 16:00:21 -07:00
Tim Abbott 7c71e987ac openapi: Fix endpoints incorrectly tagged as documentation_pending. 2019-07-15 13:39:29 -07:00
Amal Rajan 09049f1678 provision: Add provision support for Ubuntu 19.04
This commit adds support for Ubuntu 19.04 in the development
environment.
2019-07-13 16:44:09 -07:00
Anders Kaseorg aa36e2f5e1 check-templates: Exclude static/icons/fonts/template.hbs.
This file was unchecked until the .handlebars ↦ .hbs rename, so this
is the easiest way to get tests passing again.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 22:52:41 -07:00
Anders Kaseorg 0c565f50be templates: Use upstream Handlebars partials syntax.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:14 -07:00
Anders Kaseorg db0b33842c templates: Replace templates.render with require calls.
This removes an unnecessary layer of indirection and allows webpack to
catch filename mistakes.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:14 -07:00
Anders Kaseorg 3c3471b720 templates: Rename *.handlebars ↦ *.hbs and - ↦ _.
Tweaked by tabbott to avoid accidentally disabling the linter for
handlebars templates.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-12 21:11:03 -07:00
Wyatt Hoodes 0e3fddbc6e test_fixtures: Add logic for removing stale test directories.
Similarly to how stale database removal is handled, we add a check for
stale test run directories at the end of the `test-backend` script.
2019-07-12 17:42:18 -07:00
Wyatt Hoodes 16abd3d1e7 test-backend: Remove long-term clean up code.
With the refactored file structure approach, the clean up block at the
end of `test-backend` is no longer necessary.
2019-07-12 17:42:18 -07:00
Rishi Gupta 0f3c2748dd notification bot: Update stream announcement message. 2019-07-11 15:22:36 -07:00
Rishi Gupta 7de7b6872b notification bot: Modify initial stream creation message.
Discussion at
https://chat.zulip.org/#narrow/stream/137-feedback/topic/hello.20topic

The "by @**X**" part in the message content is in a later commit.
2019-07-11 14:16:56 -07:00
Anders Kaseorg 218c60ae86 third: Upgrade spectrum-colorpicker to 1.8.0 from NPM.
We had several patches to spectrum, but the only essential one 
(0ea770fc18) had already been fixed upstream,
and another was just handling jQuery deprecation warnings for not yet removed features.

See #12749 for details.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-10 10:07:34 -07:00
Wyatt Hoodes 886932fd23 provision: Update error output on failed `yarn install` reattempt. 2019-07-08 12:13:34 -07:00
Vishnu Ks 1f250a3fd2 casper: Add support for exporting results as XUnit XML file. 2019-07-07 22:30:01 -07:00
Vishnu Ks 4f65b50c44 requirements: Upgrade django-otp from 0.5.2 to 0.6.0.
This indirect dependency was upgraded separately since
it contained a migration with autogenerated name.
2019-07-07 22:28:54 -07:00
Anders Kaseorg 9f08513acb bundles: Rename commons.js to common.js.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-03 15:03:22 -07:00
Aman Agrawal 05aa3bcbc1 lint: Make `--fix` a default arg for zulint.
Since the check for `--fix` is in `zulint/command.py`,
we should keep it as an arg for zulint.
2019-07-03 14:57:31 -07:00
Aman Agrawal aa5a1cb509 lint: Make zulint independent of extra lint options in `./tools/lint`.
Check `options.full` in `pyflakes.py` instead of `linters.py` to
make zulint independent of `./tools/lint`.
2019-07-03 14:57:31 -07:00
Anders Kaseorg 1868e96850 tools/webpack: Don’t import Django.
It added about 150ms to the startup time of running webpack, for no
benefit.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-03 14:52:11 -07:00
Wyatt Hoodes 40227171e6 provision: Improve error messaging when attempting to use Ubuntu Trusty.
As part of dropping support, we add appropriate error messaging when a
user attempts to provision while using trusty.  If the user is running
in Vagrant we append information on how to proceed.
2019-07-03 14:32:25 -07:00
Anders Kaseorg 3ded6f53c3 storage: Transfer responsibility for hash-naming webpack files to webpack.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-03 14:16:17 -07:00
Anders Kaseorg b0a30aa01a storage: Remove RemoveUnminifiedFilesMixin.
This can be done much more easily with the right options to
collectstatic.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-03 14:16:07 -07:00
Anders Kaseorg 0cd6c75ab1 update-prod-static: Remove unused pre-webpack files.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-03 13:58:21 -07:00
Anders Kaseorg 079ddae4c8 minify-js: Remove; everything has been migrated to Webpack.
min/sockjs-0.3.4.min.js is not used.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-03 13:58:21 -07:00
Anders Kaseorg 5f3d36ae87 tex: Bundle KaTeX CLI using Webpack.
We don’t need a hacked copy anymore.  We run the installed version out
of node_modules in development, and a Webpack-bundled version of that
in production.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-02 16:50:03 -07:00
Anders Kaseorg 9f074fc071 webpack: Fix production setting of publicPath.
This is needed by webpack asynchronous require.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-02 16:49:38 -07:00
Anders Kaseorg 05663aa3fa webpack: Rectify "common" bundle with bundles/commons.js.
Moving bootstrap-typeahead from bundles/commons.js to bundles/app.js
and csrf.js from bundles/app.js to bundles/commons.js makes
bundles/commons.js equivalent to the "common" bundle, so we can
replace the latter with the former.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-02 16:38:26 -07:00
Anders Kaseorg 1b94733953 webpack: Remove resolve.modules override.
The minimal syntactic sugar it might provide isn’t worth the
unexpected side effects (including side effects on third party
modules).

For now, we allow zrequire to emulate the previous syntax in the Node
test suite, even though stealing part of the NPM namespace is
confusing.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-02 16:38:26 -07:00
Thomas Ip 8c199fd44c webpack: Use handlebars-loader to handle frontend templates.
And remove the compile-handlebars-templates system.
2019-07-02 16:23:29 -07:00
Anders Kaseorg fc3305b623 webpack: Trim resolve.extensions.
We don’t have any .tsx files, and nobody expects to be able to omit
the extension when importing .json, .scss, or .css files.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-02 16:09:29 -07:00
Anders Kaseorg 7b2a605978 provision: Sort system dependencies deterministically.
set iteration order is randomized in Python ≥ 3.3.  That might or
might not have had the potential for causing rare probabilistic bugs,
but if nothing else, it made build logs harder to compare.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-02 15:04:44 -07:00
Anders Kaseorg bbb56df6b0 i18n: Move static/locale back to locale.
As of commit cff40c557b (#9300), these
files are no longer served directly to the browser.  Disentangle them
from the static asset pipeline so we can refactor it without worrying
about them.

This has the side effect of eliminating the accidental duplication of
translation data via hash-naming in our release tarballs.

This reverts commit b546391f0b (#1148).

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-07-02 14:57:55 -07:00
Anders Kaseorg a1cf77ca54 test-help-documentation: Bind vnu.jar to 127.0.0.1.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-06-28 18:18:29 -07:00
Anders Kaseorg 2d50dcf7cc test-help-documentation: Validate HTML with vnu.jar.
The VNU_IGNORE whitelist lets in some crazy-invalid preexisting HTML,
but hopefully this will stop the problem from getting much larger.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-06-27 14:53:21 -07:00
Anders Kaseorg f407a12ba2 test-documentation: Validate HTML with vnu.jar.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-06-27 14:53:21 -07:00
Aman Agrawal 7a3e8c4868 zulint: Add option to list groups using `--list-groups`. 2019-06-27 14:42:33 -07:00
Aman Agrawal 4424867adc zulint: Show errors in `--verbose` in a more readable format. 2019-06-27 14:42:33 -07:00