Tim Abbott
a063dd3b26
Update changelog for Zulip 1.4.3 release.
2017-01-29 15:09:02 -08:00
Tim Abbott
1cdd451d70
streams: Fix autosubscribe security bug (CVE-2017-0881).
...
A bug in Zulip's implementation of the "stream exists" endpoint meant
that any user of a Zulip server could subscribe to an invite-only
stream without needing to be invited by using the "autosubscribe"
argument.
Thanks to Rafid Aslam for discovering this issue.
2017-01-29 15:09:02 -08:00
Tim Abbott
8cc7642cdd
Update changelog for Zulip 1.4.1 and 1.4.2 releases.
2016-09-27 20:09:20 -07:00
Tim Abbott
6883c916af
Upgrade Django to 1.8.15 with Zulip patches.
2016-09-27 20:09:20 -07:00
Tim Abbott
978a568c0f
puppet: Fix buggy logrotate configuration.
2016-09-27 20:01:17 -07:00
Steve Howell
f6975f9334
Upgrade: revert change to default LOCAL_UPLOADS_DIR in prod settings.
...
The main purpose of the "var" convention is to make it easy to write stuff
inside of our git repo when running a dev instance, and then "var" gets
excluded from checkins. For production, that's not as much of a concern.
For upgrades we don't want to be changing the directory around and confusing
matters, especially with the extra moving part of nginx configs (which have
their own issues in terms of being overwritten by accident when admins go to
S3).
2016-09-02 12:30:29 -07:00
Christie Koehler
0120ff5612
upgrade: Create prod_settings symlink in step 2 if it doesn't exist.
...
Between releases 1.3.13 and 1.4.0, local_settings.py was renamed to
prod_settings.py. The upgrade scripts were adjusted to reflect this name
change. But because the first part of the upgrade script is run with the
currently installed version's code, the symlink to /etc/zulip/settings.py is
created with the old name. This was causing upgrade-zulip-stage-2 to fail.
Now upgrade-zulip-stage-2 creates the symlink at zproject/prod_settings.py
if it doesn't already exist.
Fixes #1731 .
2016-09-01 21:17:11 -07:00
Tim Abbott
7e4caf3a67
Release Zulip 1.4.
2016-08-25 10:49:00 -07:00
Tim Abbott
fba93cb494
scripts: rename deploy-zulip-from-git to reference upgrading.
2016-08-25 10:48:59 -07:00
Tim Abbott
7f445be23d
docs: Clean up headings for maintenance page.
2016-08-25 10:48:48 -07:00
Tim Abbott
54c5c989c9
docs: Fix some broken links in headings.
2016-08-25 10:41:00 -07:00
Tim Abbott
c0799a9d09
docs: Fix docs for upgrading from a git repository.
2016-08-25 10:40:51 -07:00
Tim Abbott
9839d93362
docs: Clean up duplicated content in development overview.
2016-08-25 10:40:51 -07:00
Tim Abbott
f6c4e46afe
docs: Move README.dev.md into ReadTheDocs.
...
Fixes : #669 .
2016-08-25 10:40:51 -07:00
Tim Abbott
d876909b69
docs: Clean up development environment headings.
2016-08-25 10:40:51 -07:00
Tim Abbott
30b5c2a4c0
docs: Document the fact that 14.04->16.04 is not supported.
2016-08-25 10:40:51 -07:00
Tim Abbott
f1a91c8028
docs: Document Zulip PPA is available for 16.04 as well.
2016-08-25 10:40:51 -07:00
Tim Abbott
c5417e723b
docs: Fix command sequence for retrying Zulip installation.
2016-08-25 10:40:51 -07:00
Tim Abbott
c0975b03a5
docs: Document Ubuntu 16.04 support in production.
2016-08-25 10:40:51 -07:00
Tim Abbott
c0e68d59cb
docs: Rename status/debug page to troubleshooting.
2016-08-25 09:37:33 -07:00
Tim Abbott
be4e806d60
docs: Collapse install steps 2 and 3 together.
2016-08-25 09:37:33 -07:00
Tim Abbott
cd632faff6
docs: Clean up scrollbar in install docs.
2016-08-25 09:37:33 -07:00
Tim Abbott
8a82c29d21
docs: Move SSL docs to a dedicated page.
2016-08-25 09:37:33 -07:00
Tim Abbott
8086cc549f
docs: Merge prod-auth-first-login into main installation page.
2016-08-25 09:37:33 -07:00
Tim Abbott
1d273b93da
docs: Move screenshots to their own page.
2016-08-25 09:37:33 -07:00
Tim Abbott
da0d9e716d
docs: Move management docs to a better place and expand.
...
Now that a management command is not required to install Zulip, we can
bury the documentation on them a bit more.
Fixes : #551 .
2016-08-25 09:37:33 -07:00
Christie Koehler
5a3db059d4
docs: Rewrite first time prod login docs to use new realm creation flow.
...
- Adds heading and reorganizes sections for improved clarity. Sections
now ordered: Create user, grant admin access, default realm settings,
changing realm settings, other manage.py commands, if you can't login.
- Adds screen shots of Zulip web interface.
2016-08-25 09:37:33 -07:00
Vishnu Ks
a7ead9e99d
settings: Eliminate ADMIN_DOMAIN for creating initial realm.
...
We now use `./manage.py generate_realm_creation_link` as the flow flow
for creating one's first realm.
2016-08-25 09:37:33 -07:00
Tim Abbott
5b68e0defe
settings: Fix buggy MANDRILL_API_KEY logic.
2016-08-25 09:37:33 -07:00
Tim Abbott
a90b470205
Fix regression in search interaction with wide unicode characters.
...
Apparently, we had incorrectly concluded that our highlight_string
search result highlighting offsets coming from tsearch_extras were
measured in bytes, whereas in fact it is measured in characters.
2016-08-25 09:04:29 -07:00
Tim Abbott
88fce4761a
Remove obsolete README.prod.md.
...
This was left as a placeholder when we moved the production
documentation to ReadTheDocs, but is no longer required since we have
eliminated links to the old path.
2016-08-24 22:21:58 -07:00
Tim Abbott
21b9efd985
Clarify ALLOWED_HOSTS string format.
...
This is obvious to anyone who knows Python, but knowing Python should
not be a requirement to administer a Zulip server.
Fixes #1606 .
2016-08-24 22:19:54 -07:00
Tim Abbott
f7ede485d2
docs: Move subscribe step to start of install docs.
2016-08-24 21:04:10 -07:00
Christie Koehler
7d6541867b
docs: Update Let's Encrypt CertBot install instructions.
2016-08-24 19:02:22 -07:00
Tim Abbott
d09b07310d
docs: Clean up and clarify documentation flow.
2016-08-24 19:02:18 -07:00
Christie Koehler
456da49b06
docs: Expand production install docs.
...
- Moves Let's Encrypt option for ssl certs above self-signed option.
Updates Let's Excrypt instructions to user Certbot (new recommended
method). Fixes #1426 .
- Adds and updates headings for clarity.
- Adds new step 6 about configuring authentication (from
prod-auth-first-login.html).
- Adds emphasis on using `su zulip`, `sudo -u zulip -i`, and `sudo -i`
where appropriate. Fixes #1356 .
Fixes #1245 .
2016-08-24 19:02:11 -07:00
Tim Abbott
cd0ef4ae5b
prod-requirements: Remove unnecssary authentication section.
2016-08-24 16:34:00 -07:00
Tim Abbott
2c171df9b5
docs: Reorganize requirements page with server/credentials categories.
2016-08-24 16:32:06 -07:00
Christie Koehler
b90f5537b0
docs: Improve production requirements doc.
...
- Adds headings and organizes for greater clarity.
- Adds some detail about each of the requirements.
2016-08-24 15:14:18 -07:00
Christie Koehler
f1daf3d66a
docs: Make headings consistent and use the imperative.
2016-08-24 15:02:14 -07:00
Christie Koehler
48ba0e3974
docs: Improve 'upgrading' section of prod-maintain-secure-upgrade page.
...
- Reformats bullets as regular paragraphs for improved readability.
- Adds headings to subsections to make them easier to read and linkable.
- Clarifies minor points throughout.
2016-08-24 15:01:32 -07:00
Christie Koehler
36b6184be2
docs: Improve navigation of prod-customize page.
...
- Add headings for each of the six major sections: integrations, streams
and topics, notification settings, mobile and desktop apps, other
great features, and enjoy your Zulip installation.
- Add links to each of these sections to top of page, with first and
most important four formatted as a list.
2016-08-24 14:56:39 -07:00
Christie Koehler
58ee43c3f0
docs: Improve prod-health-check-debug page.
...
- Adds headings for 'supervisorctl' and 'troubleshooting'.
- Rearranges to include most important info at top: that Supervisor is
used, a reminder to review components architecture, log location, link
to troubleshooting services section, and a request to report any
issues not already documented on this page.
2016-08-24 14:52:44 -07:00
Christie Koehler
d4f0565c92
docs: Improve Zulip in Production page navigation and ToC.
...
Improves readability of ToC and makes pages more navigable by shortening
Zulip in Production page headings.
2016-08-24 14:48:11 -07:00
Christie Koehler
8782f6a198
docs: Improve navigation of prod-maintain-secure-upgrade page.
...
- Adds a heading for Upgrading and clarifies wording on Backups heading.
- Adds intro text with links to other sections.
2016-08-24 14:46:40 -07:00
Tim Abbott
4e33b001af
Pull latest translations from Transifex.
...
A big addition here is tons of strings translated for Malayalam.
2016-08-24 14:42:00 -07:00
Tim Abbott
682d78bc30
puppet: Add default logrotate configuration.
...
This should prevent Zulip from eating all the disk now that we are
using the race-free WatchedFileHandler rather than
TimedRotatingFileHandler.
2016-08-24 14:30:54 -07:00
Tim Abbott
7965320877
Update changelog for Zulip 1.4 release.
2016-08-24 14:26:53 -07:00
Tim Abbott
4c834172ed
tools: Use 'upstream' as expected name for main zulip repo.
...
Fixes : #1698 .
2016-08-24 14:23:37 -07:00
Tim Abbott
797a7ef97b
notifications: Don't spoof emails as from users by default.
...
The previous default configuration resulted in delivery problems if
the Zulip server was authorized in the SPF records for the domains of
all users on the Zulip server.
2016-08-24 14:10:52 -07:00
Steve Howell
6af0bdfe6e
bots: Add --config-file to contrib_bots/run.py.
2016-08-24 12:09:11 -07:00
Steve Howell
acb3c6b75a
bots: Fix typo in contrib_bots/lib/readme.md.
2016-08-24 12:08:39 -07:00
Tim Abbott
1c40df9363
static_asset_compiler: Use correct package name on trusty.
2016-08-22 23:47:03 -07:00
Tim Abbott
97b622dffa
puppet: Fix postgres_appdb_tuned manifest on trusty.
2016-08-22 23:41:07 -07:00
Tim Abbott
750e43518f
puppet: Ensure supervisord starts on boot with systemd.
...
This is important to ensure that Zulip comes up properly after a
reboot on Ubuntu Xenial.
2016-08-22 23:25:54 -07:00
Rishi Gupta
4bfac78303
Refactor /integrations page links to support subdomains.
...
Also changes all links to /integrations to be relative rather than
absolute, so that users will primarily access the /integrations page
for their subdomain.
2016-08-22 22:39:53 -07:00
Tim Abbott
e3affe96a5
subdomains: Use subdomain host in password reset emails.
2016-08-22 22:39:52 -07:00
Tim Abbott
2b0a486077
Eliminate cross-realm PM conversation with ADMIN_DOMAIN.
...
In the future, we can use UserProfile.is_staff to control this, but
there isn't a current use case for it.
2016-08-22 21:46:16 -07:00
Tim Abbott
3bdbc33e94
initialize_voyager_db: Fix zulip.com hardcoding.
2016-08-22 21:36:15 -07:00
Tim Abbott
55d7947b76
email_mirror: Use ERROR_BOT for error reporting.
...
This has the nice side effect of getting rid of the now-unnecessary
ADMIN_DOMAIN from this codepath -- we really just want whichever
realm ERROR_BOT is in.
2016-08-22 21:28:01 -07:00
Tim Abbott
7d19d1809d
android: Default to the GOOGLE_CLIENT_ID needed by the Android app.
2016-08-22 21:06:40 -07:00
Brock Whittaker
edb7d72dc2
Fix 1px private message group header height difference.
...
Due to the border-top being tied to the .message-header-contents
element rather than the recipient_row in private message groups, the
floating container would be 1px more vertical when representing private
message groups than with public message groups.
2016-08-22 20:37:49 -07:00
Steve Howell
ba9e7e290d
frontend: Extract dispatch_normal_event().
...
Extract dispatch_normal_event() from the inner
function dispatch_event() in get_events_success()
in server_events.js. Also, alphabetize the cases in
the switch statement. This starts to address #1541 ,
but see the discussion on the ticket for how we can
continue to clean up our event dispatching.
2016-08-22 20:18:02 -07:00
Tim Abbott
3d83f25b15
contrib_bots: Expand documentation.
2016-08-22 19:53:16 -07:00
Steve Howell
8d0c68ac39
bots: Add example bots for "followup" and "help".
...
This commit also starts to build out the infrastructure for
helping Zulip contributors to more easily author bots in
a way that sets up for running some bots on the server itself.
2016-08-22 19:43:12 -07:00
Steve Howell
cd2e36d66f
export: Add lib.utils.query_chunker().
2016-08-22 19:27:32 -07:00
Steve Howell
fd6ee7117f
tests: Renamed AuthedTestCase to ZulipTestCase.
2016-08-22 19:07:44 -07:00
Steve Howell
29ba10dfdd
docs: Add docs for Django backend tests.
2016-08-22 19:07:44 -07:00
Tim Abbott
95fbd5ba31
Update zulip.com/integrations link to point to zulipchat.com.
...
zulip.com will stop running at some point in the near future, and we
don't want these links to break.
2016-08-22 17:26:41 -07:00
Tim Abbott
2be597dd09
puppet: Move support for accepting a loadbalancer to zulip manifests.
...
Previously, we didn't have an easy process for how one should do this.
Now, it's an (undocumented) zulip.conf setting!
2016-08-22 17:19:03 -07:00
Tim Abbott
13a51737d8
update-prod-static: Fix buggy color code usage.
2016-08-22 16:38:23 -07:00
Tim Abbott
55f2c49bbf
build-release-tarball: Fix code for handling update-prod-static.log.
...
This is still messy code, but at least the links to where the log file
is are correct.
2016-08-22 16:37:48 -07:00
Tim Abbott
96a5388fcb
mandrill: Fix hardcoded check for settings.VOYAGER.
...
Since this delayed sending feature is the only thing
settings.MANDRILL_API_KEY is used for, it seems reasonable for that to
be the gate as to whether we actually use Mandrill.
2016-08-22 16:25:28 -07:00
Tim Abbott
916a77e764
settings: Use DEFAULT_FROM_EMAIL for error traceback reporting.
2016-08-22 16:22:52 -07:00
Tim Abbott
602c7c69a9
lint: Document line length checking.
2016-08-19 12:08:22 -07:00
Tim Abbott
2e2dee3396
lint: Ban lines longer than 140 characters without #ignorelongline.
2016-08-19 12:03:09 -07:00
Tim Abbott
e1e384acc0
realm_emoji: Fix management command usage output.
2016-08-19 11:59:38 -07:00
Taranjeet Singh
7fc170d808
lint-all: Fix line with length greater than 120.
...
This updates file tools/lint-all.
2016-08-19 11:56:43 -07:00
Taranjeet Singh
eef1d78e68
bitbucket2.py: Fix line with length greater than 120.
...
This updates file zerver/views/webhooks/bitbucket2.py.
2016-08-19 11:56:43 -07:00
Taranjeet Singh
86ecf28588
prod_settings_template.py: Fix line with length greater than 120.
...
This updates file zproject/prod_settings_template.py.
2016-08-19 11:56:43 -07:00
Taranjeet Singh
230cc228c2
profile_request.py: Fix line with length greater than 120.
...
This updates file zilencer/management/commands/profile_request.py.
2016-08-19 11:56:43 -07:00
Taranjeet Singh
57253c6ba3
makemessages.py: Fix line with length greater than 120.
...
This updates file zerver/management/commands/makemessages.py.
2016-08-19 11:56:43 -07:00
Taranjeet Singh
5e5ad9de0c
bugdown/__init__.py: Fix line with length greater than 120.
...
This updates file zerver/lib/bugdown/__init__.py.
2016-08-19 11:56:43 -07:00
Taranjeet Singh
1819157a5f
show-last-messages: Fix line with length greater than 120 characters.
...
This updates file tools/deprecated/iframe-bot/show-last-messages.
2016-08-19 11:56:43 -07:00
Steve Howell
f6b332ecdb
docs: Add linters.md to document our linters.
...
(Also, link to it from the testing docs.)
2016-08-19 11:55:52 -07:00
Steve Howell
bf6a9ebe8a
docs: Add Community links to the overview page.
2016-08-19 09:54:17 -07:00
Tim Abbott
399f4f8870
Add management command to send password reset emails.
...
This is a convenient tool to have around.
We require an unusual argument value of "YES" to send to everyone on
the server, since that's something one should do with a great deal of
care.
2016-08-18 20:12:36 -07:00
Rishi Gupta
64179b2fd2
confirmation: Use realm host in activation URLs.
...
This is preparation for merging the subdomains feature.
2016-08-18 20:12:36 -07:00
Tim Abbott
b8050ce02f
Add realm.host property.
2016-08-18 18:48:40 -07:00
Tim Abbott
b5d85fe5f1
settings: Disable DisallowedHost error emails by default.
...
These error messages are pretty spammy because most servers on the
public Internet receive some amount of HTTP(S) scanning traffic.
We still log them, just don't email the administrators.
2016-08-18 18:44:20 -07:00
Tim Abbott
7950d3181e
zmirror: Fix hardcoding of zulip.com support email address.
...
We now use support_email == settings.ZULIP_ADMINISTRATOR just like
every other support email address reference.
2016-08-18 18:36:07 -07:00
Tim Abbott
e0432f21f1
Move webathena views to its own file.
2016-08-18 18:26:49 -07:00
Tim Abbott
05d3094420
webathena: Remove hardcoding of zulip.com server.
2016-08-18 18:21:38 -07:00
Tomasz Kolek
b1b864341c
Fix @all spam warning when typing @all in backticks.
...
When user'd like to send a message with @all in backticks
they see spam warning in spite of the fact that nobody
would be alerted.
Fixes : #1505 .
2016-08-18 16:10:09 -07:00
Tomasz Kolek
5c82e53b9a
Move checking all/everyone message to util.js module.
...
Create is_all_or_everyone_mentioned function in util.js.
2016-08-18 16:10:09 -07:00
Brock Whittaker
d8f108a5cf
Removing unnecessary comment.
...
This removes a comment that is dated and no longer relevant.
2016-08-18 15:32:30 -07:00
Brock Whittaker
6936d49202
Live update new avatars across users.
...
This sends an event when a new avatar is uploaded that refreshes the
avatar for all browser clients without the need to reload the browser.
Fixes : #1359 .
2016-08-18 15:32:29 -07:00
Umair Khan
194cbf17a1
Allow run command to accept **kwargs.
2016-08-18 15:06:22 -07:00
Tim Abbott
e7aac717e8
Fix markdown ordering bugs with some custom syntax.
...
!avatar, !modal_link, !gravatar, etc. were incorrectly being processed
before the escape character for code blocks.
While we're at it, we add tests for these special syntaxes.
2016-08-18 14:47:37 -07:00
Steve Howell
c6a888561a
tools: Extract build_custom_checkers() in tools/lint-all.
2016-08-18 14:15:01 -07:00
Steve Howell
f955991120
tools: Add bright_red_output() to tools/lint-all
2016-08-18 14:15:01 -07:00
Steve Howell
ffe648baa8
tools: Extract EXCLUDED_FILES in tools/lint-all.
2016-08-18 14:15:01 -07:00
Steve Howell
dfe01c4f83
tools: Move run_parallel() out of run().
2016-08-18 14:15:01 -07:00
Steve Howell
e3a7b9b1b2
tools: Move check_pyflakes() out of run().
2016-08-18 14:15:01 -07:00
Steve Howell
3c40157195
tools: Add a run() method to tools/lint-all.
2016-08-18 14:15:01 -07:00
Steve Howell
747744ad61
lint: Allow anchor tags to span up to four lines.
...
This starts to address 1533. I still think the </p> tags
should be on their own line lined up with the start tag,
so the linter won't let through the specific example
shown in the ticket.
2016-08-18 14:12:32 -07:00
Steve Howell
88a7ea54d2
lint: Enforce that code blocks can't split lines.
...
Fixes : #1644 .
2016-08-18 14:12:26 -07:00
Steve Howell
479aa5b83d
docs: Split out Django/Casper/Node testing docs.
2016-08-18 14:10:46 -07:00
Steve Howell
552a6dc017
tests: Add DocPageTest.
2016-08-18 13:28:58 -07:00
Steve Howell
d1c34a6618
tests: Fix test_create_user_backend().
...
It was passing in a UserProfile object to client_put(),
which is unnecessary and can break the url coverage
report.
2016-08-18 13:28:58 -07:00
Steve Howell
125dcad379
tools: Report OverflowErrors in url coverage report.
2016-08-18 13:28:58 -07:00
Christie Koehler
27c7319b50
vagrant: Suppress error output for which command.
2016-08-18 13:09:28 -07:00
Tim Abbott
e1b5a0e000
docs: Add link to life of a request docs on URLs.
2016-08-18 12:41:38 -07:00
acrefoot
920e605e17
Add extensive views writing documentation.
...
[section on REQ substantially expanded by tabbott]
Fixes : #880 .
2016-08-18 12:37:33 -07:00
Tim Abbott
483bbfe5dc
integrations: Fix a few more badly line-wrapped <code> tags.
2016-08-18 10:54:41 -07:00
Tim Abbott
685d63b6cc
notifications: Update digest email link URLs to use realm.uri.
...
This is preparation for fully supporting each realm having its own
subdomain in Zulip.
2016-08-17 22:58:35 -07:00
Tim Abbott
f357e9d30f
integrations: Fix Travis CI webhook URL to not be an example.
2016-08-17 22:53:15 -07:00
Tim Abbott
c9d3708ab8
integrations: Fix linewrapping in Nagios and Jenkins integrations.
2016-08-17 22:53:15 -07:00
Tim Abbott
e7c3a0c819
check-rabbitmq-consumers: Add missing tornado_return consumer.
...
I'd like to move this list to be automatically generated, but this
fixes the fact that it's missing for now.
2016-08-17 22:53:00 -07:00
Tim Abbott
91ad923d80
notifications: Use realm.uri in unsubscribe links.
2016-08-17 22:44:38 -07:00
Tim Abbott
d876fac01a
Use WatchedFileHandler rather than TimedRotatingFileHandler.
...
TimedRotatingFileHandler does not properly handle multiple processes
writing logs at the same time, and thus can end up losing data.
2016-08-17 22:39:33 -07:00
Tim Abbott
f999f63999
zephyr_mirror_backend: Update support email address.
...
Arguably we should figure out a way to make this fetch the support
email from the server (or something), but in the short term it seems
worth making the email address at least correct.
2016-08-17 22:39:08 -07:00
Tim Abbott
96cc54b83d
integrations: Document GitHub alternative endpoint.
2016-08-17 22:19:54 -07:00
Tim Abbott
743847bdd5
integrations: Fix some broken links / ids.
2016-08-17 22:19:54 -07:00
Tim Abbott
143bec97b4
integrations: Fix Asana page rendering.
2016-08-17 22:19:54 -07:00
Rishi Gupta
d9473979ea
Add javascript # navigation for the tabs on the /apps page.
...
Make it so that /apps/#electron (and related #tags) open the relevant tab.
2016-08-17 22:19:54 -07:00
Tim Abbott
566bef1258
Fix API Python examples missing --site.
2016-08-17 22:19:54 -07:00
Tim Abbott
8d05aec4de
zephyr-mirror: Eliminate use of old Humbug name.
2016-08-17 22:19:53 -07:00
Tim Abbott
bc7c9a5bbb
corporate: Update Zephyr mirroring docs.
2016-08-17 22:19:53 -07:00
Tim Abbott
48ed7e2e31
notifications: Use realm_uri for click here link.
2016-08-17 22:19:53 -07:00
Rishi Gupta
f51c1ea4ee
Minor server_uri fixes in templates/zerver/features.html
2016-08-17 22:19:53 -07:00
Tim Abbott
5f12136e7c
notifications: Fix broken one click unsubscribe link.
2016-08-17 22:19:53 -07:00
Tim Abbott
6ef79ac66c
notifications: Remove support@zulip.com comment in docstring.
2016-08-17 22:19:53 -07:00
Tim Abbott
74cdb4954c
docs: Fix outdated security contact list.
2016-08-17 22:19:53 -07:00
Tim Abbott
c5fb6dfcb8
TOS: Fix forcing users to double-accept terms of service.
2016-08-17 22:19:53 -07:00
Tim Abbott
f0a65fe52a
export_messages_single_user: Fix missing order_by.
...
This fixes a nasty bug where exporting messages sent by a single user
might only contain some of the messages in the event that the
unspecified sort order by the database didn't happen to be sorted by
message ID.
2016-08-17 22:18:58 -07:00
Tim Abbott
f952114010
Remove node_modules/.bin/handlebars from git.
...
This file, installed back when we had node_modules checked into git,
was leaked when we deleted node_modules/ from git and added it to
.gitignore. This caused occasional weird errors for anyone who tried
to `rm -rf node_modules` as part of reprovisioning.
2016-08-17 18:01:08 -07:00
Christie Koehler
096b098410
Flush stdout and stderr prior to exiting child process.
...
This fixes a confusing bug that we ran into where the output from
certain child processes wouldn't appear when running `lint-all` via
`ssh` (without a tty) into the Vagrant environment.
2016-08-16 18:11:14 -07:00
Brock Whittaker
433cdfad57
Restyle input groups to be more vertical
...
This changes the input group elements from the style where labels are
right aligned and input left aligned, to the labels being above the
input.
2016-08-16 16:38:26 -07:00
Brock Whittaker
cddd9379c6
Add password-container and password-reset wrappers
...
This adds the wrappers necessary to center the content vertically and
horizontally within the page.
2016-08-16 16:36:45 -07:00
Brock Whittaker
b83691fd6f
Apply styling to password reset modal
...
A centered version of the modal that looks more uniform and centers vertically as the screen height changes.
2016-08-16 16:36:42 -07:00
Sumana Harihareswara
f3abea0f1f
doc: Add version number to Trusty in prod requirements.
2016-08-16 16:24:34 -07:00
Sumana Harihareswara
23aaca376e
doc: Recommend provision stream for install help.
...
Adds a recommendation to the developer installation
documentation suggesting visiting the "provision" stream.
Fixes : #1537 .
2016-08-16 16:22:20 -07:00
Tim Abbott
28eae24882
Add some links to new pointer docs.
2016-08-16 16:19:14 -07:00
Tim Abbott
b839db1f45
Expand pointer and unread counts guide.
2016-08-16 16:17:54 -07:00
Sumana Harihareswara
1a9f961bb4
doc: Add pointer and unread counts guide.
...
Tim's comments in #789 are useful to developers
in explaining message selection at browser load,
narrow, etc.
2016-08-16 16:15:38 -07:00
Steve Howell
c12bd853f7
export: Add basic export tests. ( fixes #1584 )
2016-08-16 13:38:37 -07:00
Steve Howell
ab053845aa
export: Fetch messages with two queries.
2016-08-16 13:38:37 -07:00
Steve Howell
a5f651b81a
export: Add some user_id filtering to do_export_realm().
...
This commit only addresses tables that currently derive from
user_profile_config in get_realm_config:
zerver_userpresence
zerver_useractivity
zerver_useractivityinterval
zerver_subscription
zerver_recipient
zerver_stream
zerver_huddle
It also introduces an entry in realm.json for a virtual
table called "zerver_userprofile_mirrordummy" for dummy users,
which include prior dummy users and users excluded from the call
to do_export_realm().
Note that this feature is not yet exposed in the management command.
2016-08-16 13:38:37 -07:00
Sumana Harihareswara
83cfd3213f
doc: Recommend avoiding Vagrant install on slow connections.
...
Per #1508 , the manual install process is better
for the developer environment on slow connections.
2016-08-16 12:50:16 -07:00
Brock Whittaker
f7dac2b2e3
Show hex input field on color picker.
...
This enables the input field in the color pickers that allows users to
specify the hex of the color they would like to apply.
Fixes : #1364 .
2016-08-16 11:31:52 -07:00
ukhan
3c1027a584
Update sockjs-tornado to latest version.
2016-08-15 16:58:58 -07:00
ukhan
a7607f843b
Update Tornado to 3.2.2, which does not break tests
2016-08-15 16:57:19 -07:00
Taranjeet Singh
d606b95242
zulip_tools.py: Move zulip_tools.py in scripts/lib.
...
This commit moves zulip_tools.py as part of cleaning the root directory
and organizing proejct into better directory structure.
2016-08-15 16:44:50 -07:00
Brock Whittaker
c9b05a2a84
Removing the leading border-top in sidebar items.
...
When the feedback module is hidden the #userlist_header border would
brush against the navbar. Check if the feedback header isn’t there and
remove the border top.
2016-08-15 16:40:28 -07:00
Tim Abbott
bfa987f26e
Add missing realm_uri and server_uri to HomeTest.
2016-08-13 16:52:56 -07:00
Rishi Gupta
205fb996ec
templates: Use realm_uri and server_uri settings for server URL.
...
The policy here is essentially:
* Pages on the central server (documentation, etc.) are server_uri.
* Pages associated with a user's realm server (anything logged-in, plus
things like their login page) are realm_uri.
2016-08-13 16:37:45 -07:00
Rishi Gupta
902a7fbfe9
Change relative paths to absolute paths when we don't want the subdomain.
...
Changes relative path to an absolute path (that doesn't contain the
subdomain) for various links to
/create_realm, /api, /apps, /integrations, /hello, /terms, and the logged
out / (the Zulip in the upper left corner of portico)
I typically left links internal to the relevant pages (e.g. a link from
integrations.html to a subpage of integrations/) as relative links, and
changed external links from within the app to the absolute path (e.g. the
link to integrations from the gear menu).
2016-08-13 16:27:36 -07:00
Rishi Gupta
dff43fcc5e
Change https:// to external_uri_scheme in templates.
...
Helps in case the development environment is not using https.
We get the value from zerver/context_processors.py (which is
ultimately reading it from settings)
2016-08-13 16:27:36 -07:00
Tim Abbott
5cad3f5707
handlebars: Add server_uri and realm_uri to page_params.
2016-08-13 16:27:36 -07:00
Tim Abbott
4fbb8c3eee
templates: Add new context variables to all templates.
...
This adds a few new helpful context variables that we can use to
compute URLs in all of our templates:
* external_uri_scheme: http(s)://
* server_uri: The base URL for the server's canonical name
* realm_uri: The base URL for the user's realm
This is preparatory work for making realm_uri != server_uri when we
add support for subdomains.
2016-08-13 16:27:35 -07:00
Tim Abbott
4a46b879ee
import_uploads_s3: Fix setting of content-type.
2016-08-13 11:26:53 -07:00
Tim Abbott
8edc5110cd
export: Set re_map_foreign_keys verbose default to False.
...
Otherwise, this is super spammy when doing a large import.
2016-08-13 11:26:16 -07:00
Tim Abbott
8b170665e4
export: Add assertion that ./manage.py exists in current directory.
...
Otherwise we'll fail starting the UserMessage export, later on.
2016-08-13 10:13:11 -07:00
Tim Abbott
856ab48ec6
export: Fix stream export sanity check.
2016-08-13 10:02:34 -07:00
Steve Howell
603352630b
export: Update conversion docs.
2016-08-13 09:36:08 -07:00
Steve Howell
e932b03999
export: Clean up path.join/makedirs for avatars/uploads.
2016-08-13 09:31:49 -07:00
Steve Howell
12c25e7d5c
export: Filter attachments by message id.
2016-08-13 09:31:49 -07:00
Steve Howell
0f493d5000
export: Return msg ids from export_partial_message_files().
2016-08-13 09:31:49 -07:00
Tim Abbott
924d0475c1
cache_helpers: Disable filling message cache.
...
The message cache filling script actually used both database and
memcached queries as part of filling the cache (all used to compute
the needed display_recipient values). We would ideally fix this by
using bulk operations to fill the display_recipient cache, but until
we do so, this cache filler is counterproductive.
I believe this disabling fixes an issue where memcached would get
overloaded and stop handling requests during a server restart on busy
servers.
2016-08-13 09:27:56 -07:00
Rishi Gupta
befd665b91
Update static_header.txt with new license information.
...
This is the header file for the minified javascript.
2016-08-13 00:37:21 -07:00
Rishi Gupta
708b416ca1
Terms of Service: Fix corner cases around new users being created.
...
This fixes a few bugs in 7910a6e134 ,
related to automatically created user accounts.
2016-08-13 00:19:54 -07:00
Tim Abbott
3bae3cd54d
settings: Add option to disable email deliverer.
2016-08-12 19:24:45 -07:00
Steve Howell
0c3e98fa91
export: Introduce attachment.json file.
...
Now attachment data gets written to its own json file. We are
splitting this out so that will be easier for us to cross-check
attachments against messages without holding up writing a lot
of the other realm data. (message cross-checking is coming soon)
2016-08-12 18:59:14 -07:00
Steve Howell
ea0a7d87c8
export: Refactor how we fetch attachment data.
...
This commit doesn't change any behavior; it just moves fetching
attachments out of the Config scheme and into its own method.
This prepares us to start writing attachment data to its own
file and cross-checking against message ids (coming soon).
2016-08-12 18:59:14 -07:00
ukhan
db81647b7b
Update packages in requirements that won't break tests
...
upgrade moto, downgrade httpretty for compatibility
downgrade commonmark for compatibility
2016-08-12 17:56:23 -07:00
ukhan
180b438c44
Upgrade setuptools prior to updating mock
2016-08-12 17:56:23 -07:00
Steve Howell
fba7a9ca21
export: Unify top-down export configuration.
...
We now just have a single configuration get_realm_config() that
handles most of the top-down realm export tables. (It basically
does everything not related to messages or uploads/avatars.)
Unifying the configs allows us to be more strict in our
configuration about checking for anomalies. In the future
we may need to loosen up some of those restrictions again,
but for now we are picky and paranoid.
2016-08-12 15:27:23 -07:00
Steve Howell
5a5353b846
export: Fetch stream data only for stream recipients.
...
Fetch stream data only for stream recipients, instead of
getting streams via realm_id.
(This change is kind of moot for now, since our stream recipients
include all possible stream recipients in the realm, but this
sets us up for when we start restricting users that we export
within the realm.)
2016-08-12 15:27:22 -07:00
Steve Howell
7a429d1e30
export: Add sanity_check_stream_data().
2016-08-12 15:27:22 -07:00
Steve Howell
ec86e475b4
export: Add Config.post_process_data
2016-08-12 15:12:01 -07:00
Steve Howell
0c2c331905
export: Flip how we fetch stream subscription data.
...
We now get stream subscriptions BEFORE stream recipients.
2016-08-12 15:12:01 -07:00
Steve Howell
70a916aae3
export: Flip how we fetch user subscription data.
...
We now get user subscriptions BEFORE user recipients.
2016-08-12 15:12:01 -07:00
Steve Howell
2a2ce6ada1
export: Remove hard-to-maintain code comment.
...
Subsequent changes are gonna make the top-down/bottom-up comment
no longer valid.
2016-08-12 15:12:01 -07:00
Steve Howell
fd77585a8c
export: Add docs/conversion.md.
...
This is not hooked into anything yet. After this weekend's
conversion, it will probably be worthwhile to take a second pass
at it!
2016-08-12 15:10:49 -07:00
Steve Howell
90494cfec2
export: Note user-owned bot limitations.
2016-08-12 15:10:49 -07:00
Tim Abbott
88a123d5e0
Fix excessive CPU usage by rabbitmq-numconsumers Nagios checks.
...
The previous model for these Nagios checks was kinda crazy -- every
minute, we'd run a full `rabbitmctl list_consumers` for each of the
dozen+ consumers that we have, and then do the exact same parsing
logic for each to determine whether the target queue has a running
consumer to write out a state file.
Because `rabbitmctl list_consumers` takes a small amount of resources,
on systems where CPU is very limited (e.g. t2 style AWS instances),
this minor CPU wastage could be problematic.
Now we just do that `rabbitmqctl list_consumers` once per minute, and
output all the state files from a single command.
Further TODO items on this front include removing the hardcoded list
of queues.
2016-08-12 14:09:36 -07:00
Tim Abbott
852af83d3c
check_postgres_replication_lag: Fix psql command line.
...
This allows the plugin to be run as users other than the "zulip" user,
where the "zulip" database would not be the default.
2016-08-12 13:19:08 -07:00
Tim Abbott
5194485d74
log2zulip: use a Zulip virtualenv if available.
...
This makes it easier to use log2zulip in a Zulip server environment.
2016-08-12 13:17:36 -07:00
Tim Abbott
5b53521b32
memcached: set a low retry_timeout.
2016-08-12 12:57:24 -07:00
Tim Abbott
4baf120c7c
memcached: Enable TCP_NODELAY optimization.
2016-08-12 12:57:24 -07:00
Tim Abbott
d8c066ba52
memcached: Pass verify_keys option.
2016-08-12 12:57:23 -07:00
Tim Abbott
ed01842f95
notifications: Fix missed message emails with multiple senders.
...
Previously, missed message emails with multiple senders would
incorrectly have a "," outside the quoted sender name part of the from
address string, resulting in confusing email output.
2016-08-12 12:28:06 -07:00
Tim Abbott
386c6c2a31
settings: Refactor SYSTEM_ONLY_REALMS configuration.
2016-08-12 12:12:53 -07:00
Tim Abbott
ecb81fabf3
settings: Extract EVENT_LOGS_ENABLED setting.
2016-08-12 12:12:53 -07:00
Tim Abbott
f0e495831e
forms: Fix check for whether terms of service are enabled.
2016-08-12 11:04:45 -07:00
Steve Howell
6fdd42c08b
export: Create convenient soft links.
2016-08-12 10:48:33 -07:00
Steve Howell
70b68ddcc3
export: Use a config for export_single_user().
2016-08-12 10:37:41 -07:00
Steve Howell
c69a5bdec3
export: Handle more tables via export_from_config().
...
This commit introduces the ability to do custom fetches
and to essentially use temp tables for intermediate results.
(The temp table stuff deals with recipients/subscriptions
having three different flavors--user, stream, and huddle.)
2016-08-12 10:37:35 -07:00
Steve Howell
f471a1779e
export: Handle simple exports with export_from_config().
...
This handles the simple tables that don't need custom fetches.
2016-08-12 09:54:57 -07:00
Steve Howell
682155778d
export: Add export_with_config().
...
Subsequent commits will start to use this.
2016-08-12 09:54:57 -07:00
Tim Abbott
6496fe2a53
travis: Remove rabbitmq nodename dependency on hostname.
...
Because rabbitmq doesn't support changing the nodename of a running
rabbitmq node, Zulip installations suffered a plague of issues where
e.g. a Zulip server would reboot, the hostname would change, and
suddenly the local rabbitmq instance being used by Zulip would stop
working.
We address this problem by using, by default, a fixed rabbitmq
nodename, but providing server administrators the option to set the
rabbitmq nodename used by Zulip however they choose.
To upgrade an existing server to use this new configuration, one will
need to add something like the following to /etc/zulip/zulip.conf:
[rabbitmq]
nodename = zulip@localhost
However, I don't believe we have the puppet code in place to make this
work correctly at initial installation without rabbitmq-server being
already installed (but off), as we can easily setup in Travis CI but I
haven't been willing to do for the installer. So for now, this just
fixes our Travis CI problems.
Fixes : #1579 .
2016-08-12 09:38:23 -07:00
Tim Abbott
c7059c9751
travis: Update success-http-headers to match current certs.
...
Travis CI seems to have changed the way the snakeoil SSL certs are
generated in their infrastructure, so we need to update our expected
"success" HTTP headers accordingly.
2016-08-12 09:35:41 -07:00
Steve Howell
b0e6d20321
export: Write stats.txt for ./manage.py export <realm>.
2016-08-12 09:06:10 -07:00
Rishi Gupta
7910a6e134
Terms of Service: Add ability to update TOS and have users re-sign.
...
Most directly useful for the migration to zulipchat.com.
Creates a new field in UserProfile to store the tos_version, as well as two
new settings TOS_VERSION and FIRST_TIME_TOS_TEMPLATE. We check for a version
mismatch between what the user has signed and the current
settings.TOS_VERSION whenever the user hits the home page, and redirect them
if needed.
Note that accounts_accept_terms.html and
zerver.views.accounts_accept_terms were unused before this commit
(they date from c327446537 )
2016-08-11 23:37:48 -07:00
Tim Abbott
a648513580
production-helper: Remove /root/zulip during setup process.
...
This fixes a problem that caused production-helper to not be
idempotent.
2016-08-11 22:21:13 -07:00
Tim Abbott
7011c94465
production-helper: Use ln -nsf to install snakeoil symlinks.
...
This fixes a problem where production-helper was not idempotent.
2016-08-11 22:20:24 -07:00
Tim Abbott
28a7d991f6
setup-production: Remove more postgres packages.
...
Travis CI seems to have added Postgres 9.5 to the default-installed
Postgres package list, and we also missed a few side packages
previously as well.
2016-08-11 22:19:57 -07:00
Tim Abbott
2581ac166c
puppet: Automatically scale default memcached memory allocation.
...
Previously, we used a fixed memcached memory allocation of 512MB,
regardless of the size of the server. While that is a good allocation
for a server with 4GB of RAM, for servers with less, we should
decrease the allocation, and for a large server with much more RAM, we
should increase it. We still support the user overriding the
configuration setting, but this produces more sensible defaults.
2016-08-11 20:27:45 -07:00
Tim Abbott
2e0e8193d4
puppet: Make memcached memory allocation a variable.
2016-08-11 20:27:45 -07:00
Tim Abbott
3edf880c9b
Remove moreutils from zulip_internal::base.
...
We recently added this to zulip::base, so it would be a duplicate.
2016-08-11 18:12:59 -07:00
Tim Abbott
9afb1c7a71
puppet: Stop wholesale replacing /etc/redis/redis.conf.
...
Zulip had only patches the redis configuration in one small way, which
resulted in unnecessary portability issues for using Redis on
different versions of Linux. We replace this with just a adding an
include mechanism to the redis config.
While we're at it, we configure this to take advantage of the
new REDIS_PASSWORD secret to automatically configure redis passwords.
2016-08-11 17:26:04 -07:00
Tim Abbott
11cac86a58
settings: Add support for specifying a remote redis password.
2016-08-11 16:54:22 -07:00
Tim Abbott
f418e54ae2
local_settings: Fix zulip.com terms of service.
2016-08-11 16:39:47 -07:00
Steve Howell
df3aa39be3
export: Extract write_data_to_file().
2016-08-11 15:51:22 -07:00
Steve Howell
f29b32bbb2
export: Clarify message exporting code.
...
The function to create the message partial files has been
renamed to export_partial_message_files(). It now gets its own
list of user profile ids and recipient ids from the response,
so that we can de-clutter do_export_realm().
2016-08-11 15:51:22 -07:00
Steve Howell
5cd915694a
export: Extract launch_user_message_subprocesses().
...
This is the last in a series of commits that makes it
so that do_export_realm() mostly delegates work out
to other functions.
2016-08-11 15:21:30 -07:00
Steve Howell
b383f5ca5d
export: Extract fetch_user_profile_cross_realm().
2016-08-11 15:21:30 -07:00
Steve Howell
fee2106c6f
export: Extract fetch_huddle_objects().
...
This also removes the dead codepath for include_private=False.
2016-08-11 15:21:30 -07:00
Steve Howell
a6235f6a60
export: Add comments to export_single_user().
...
(This is a bit of a prefactoring to hopefully create a nice
diff in a subsequent commit.)
2016-08-11 15:21:30 -07:00
Steve Howell
6e7fe76cf4
export: s/avatar_bucket/processing_avatars
...
The name avatar_bucket was confusing for a boolean, and
in some places it was used for non-S3 paths.
I considered the more concise 'is_avatar', but that
was still confusing when you are processing multiple
files, because you think it's a calculated property
on one file instead of an overall codepath switch.
I also considered splitting up some functions, but
there is a lot of common logic between handling
file uploads and avatars that's not trivial to extract
into helpers, especially on the S3 side.
2016-08-11 15:21:30 -07:00
Steve Howell
3dab366733
export: Clean up names of upload/avatar export functions.
...
I did some minor moving around of code that made us have
one fewer function without any additional conditional
logic. The names are more explicit about saying
"from_local" and "from_s3". Also, there is less clutter
now in do_export_realm(), which is evolving into more of
a dispatcher and less of a worker.
2016-08-11 15:21:30 -07:00
Steve Howell
9582a83d10
export: Fix usage in export_single_user command.
2016-08-11 15:21:30 -07:00
Steve Howell
d62a351107
export: Add sanity_check_output().
2016-08-11 15:21:30 -07:00
Rishi Gupta
0301347e86
provision.py: Fix typo.
...
Typo in the last line of the script; fixing since we'll see it every time
we provision.
2016-08-11 15:20:29 -07:00
Tim Abbott
cb21584ffe
check_send_receive_time: Support being run in a cron job.
2016-08-11 14:48:21 -07:00
Tim Abbott
4dcbaf1e6b
check_send_receive_time: Cleanup unnecessary print statement.
2016-08-11 14:48:21 -07:00
Tim Abbott
95aee366c8
Enable local browser error reporting if ZILENCER_ENABLED.
2016-08-11 13:49:18 -07:00
Tim Abbott
ba7ef1c82d
zilencer: Fix regression in URLs.
...
When we refactored zilencer to use a single urls.py file in
bf50dd7771 , we accidentally lost the
prefix on the API urls.
This broke sending error report emails if zilencer was enabled.
2016-08-11 12:38:42 -07:00
Tim Abbott
dca585fa75
travis: re-disable test-queue-worker-reload.
...
It seems to still fail sometimes in Travis CI.
2016-08-10 16:43:00 -07:00
Umair Khan
8bf4d9288d
Create a nice default language modal.
...
Fixes : #1396 .
2016-08-10 16:22:36 -07:00
Umair Khan
af9f308f0e
Send double columned language list in page_params.
2016-08-10 16:19:28 -07:00
Umair Khan
73e5289736
Add default_language_name in page_params.
2016-08-10 16:19:28 -07:00
Umair Khan
ddaf1a2b67
Return unformatted list from get_language_list.
2016-08-10 16:19:28 -07:00
Umair Khan
740b5634ac
Fix and re-enable test-queue-worker-reload.
...
It seems that we no longer get the message, 'zerver/lib/actions.py
modified; restarting server', but the server reloads successfully
nonetheless.
Fixes : #1341 .
2016-08-10 16:17:23 -07:00
Umair Khan
99c430f707
Make English the fallback language in i18next.
...
Fixes : #1580
2016-08-10 16:06:57 -07:00
Tim Abbott
7736925d5b
compose: Fix sending PMs to Zephyr users.
2016-08-10 15:36:00 -07:00
Steve Howell
06b0df5efc
export: Remove spurious select_related() call for Client.
2016-08-10 14:16:17 -07:00
Steve Howell
cb59a11f0a
export: Extract get_primary_ids().
2016-08-10 14:16:17 -07:00
Steve Howell
90e9083b81
export: Extract filter_by_realm().
2016-08-10 14:16:17 -07:00
Steve Howell
4b6b1b8ad4
export: Extract filter_by_users().
2016-08-10 14:16:17 -07:00
Steve Howell
db9edfce34
export: Use DATE_FIELDS in fix_datetime_fields().
...
Now we only call this once per table and use DATE_FIELDS to
look up the data fields.
2016-08-10 14:16:17 -07:00
Steve Howell
35c59fc4d7
export: Clean up export_messages().
...
This is pretty minor cleanup, but it makes it a little more
explicit what we're writing to the shard file, and it allows
us to use a more specific mypy type when calling
floatify_datetime_fields.
2016-08-10 14:16:17 -07:00
Steve Howell
1d1f36c0b8
export: Always use subprocesses to export UserMessage.
...
We no longer have an in-process code path to export
UserMessage rows. We want to only maintain the
subprocess code, which we'll always use in production,
and which will work fine in dev.
2016-08-10 14:16:17 -07:00
Steve Howell
78bbefbf94
export: Create import_attachments.
2016-08-10 14:16:17 -07:00
Steve Howell
01d28458fc
Add frontend_tests/node_tests/dispatch.js.
...
This tests the dispatching code in server_events.js.
2016-08-09 18:49:13 -07:00
Steve Howell
48af751e8d
Clean up server_events.js (minor stuff).
...
Make exceptions more clear and upstream patching of builtins to index.js.
2016-08-09 18:49:13 -07:00
Steve Howell
ccb1d54e55
Export server_events._get_events_success for testing.
2016-08-09 18:49:13 -07:00
ukhan
dced137f6f
Fix function formatting in admin.js
2016-08-09 17:52:25 -07:00
Rag Sagar
2fef36f15a
Add realm-level default language setting.
...
Adds a new field default language in the zerver_realm model.
This realm level default language will be used as default language
for newly created users. Realm level default language can be
changed from the administration page.
Fixes #1372 .
2016-08-09 17:38:29 -07:00
Steve Howell
7ec6a394fe
export: Filter Attachment objects by realm.
2016-08-09 16:47:14 -07:00
Steve Howell
cecfaa7761
export: Extract import_message_data().
2016-08-09 16:47:14 -07:00
Steve Howell
5386ed280e
export: Extract update_id_map().
...
We also use a vanilla dictionary instead of a defaultdict, so
that we explicitly initialize what tables are being re-mapped.
2016-08-09 16:47:14 -07:00
Steve Howell
217ef8a4d2
export: Split fix_foreign_keys() into two functions.
...
We now have convert_to_id_fields for the simple case, and
re_map_foreign_keys for the more complex case. I also
renamed some parameters and variables.
2016-08-09 16:47:14 -07:00
Tomasz Kolek
4a25b92298
Cleanup result message code in test-js-with-node.
...
Remove duplicate code after quick fix in passing returned code.
Fixes : #1489 .
2016-08-09 16:46:24 -07:00
Umair Khan
e1090118c5
Percent translated should be an integer.
2016-08-09 16:19:07 -07:00
Rag Sagar
5771e2eb25
Move i18n functions from zerver/views/__init__.py to zerver/lib/i18n.py
2016-08-09 16:10:24 -07:00
Rag Sagar
28f0079432
Use a constant to set UserProfile default_language field max_length attribute.
2016-08-09 16:10:24 -07:00
Steve Howell
dd88ffccfd
export: Extract make_raw() in lib/export.py.
2016-08-09 15:58:27 -07:00
Steve Howell
09fa343bdd
export: Use DATE_FIELDS in floatify_datetime_fields.
...
This avoids a little bit of code duplication, plus it should
make it a little easier to add new date fields in the future.
2016-08-09 15:58:27 -07:00
Steve Howell
c14ab3c91f
export: Add annotations to zerver/lib/export.py.
...
I also fixed some small things like removing unnecessary return
statements, and adding a TODO.
In some cases I explicitly cast stuff at run-time to set() or
str() to appease mypy, as well as make it clear to somebody
reading the code that the callee might not respect ordering
or tolerate unicode.
2016-08-09 15:58:27 -07:00
Steve Howell
f18cc4ae3a
export: Added export_avatars_local_helper().
2016-08-09 15:58:27 -07:00
Tim Abbott
9441154316
debug: Fix actual traceback being hidden in blueslip.
...
When in debug mode, previously an explicit `blueslip.error()` call
would not display the original stack trace of the error, making
debugging difficult.
This isn't perfect, in that it seems to display some tracebacks
multiple times, but at least the trace is available.
2016-08-09 11:59:49 -07:00
Tim Abbott
469df75ab7
Fix admin.update_default_streams_table errors if tab not open.
...
It turns out that our logic for updating the default streams table
crashed in the case where the administration tab was not open.
Fixes : #1540 .
2016-08-09 11:59:32 -07:00
Tim Abbott
bb392374b2
travis: unset GEMPATH.
...
Travis CI support suggested this as the correct solution for some
recent changes in their environment that make ruby segfault.
2016-08-09 11:59:01 -07:00
Umair Khan
86920a297c
Mock out loggers in push notification tests.
...
Fixes : #1575
2016-08-09 22:16:09 +05:00
Umair Khan
7a84f12a38
Verify mock calls without strict order.
...
In push notification tests, call assert_has_calls with `any_order=True`
so that the order of the calls does not matter.
2016-08-09 22:15:37 +05:00
Tim Abbott
42b63f5caa
test_templates: Fix failure to report a user-facing error.
2016-08-09 09:54:44 -07:00
Tim Abbott
f3365f4089
test_templates: Add integrations_dict to context.
...
This fixes the fact that this test was (silently) failing.
2016-08-09 09:54:36 -07:00
Umair Khan
25f70ebdaa
Annotate zproject/jinja2/backends.py
2016-08-09 09:19:24 -07:00
Umair Khan
60f30fdb36
Annotate zproject/backends.py.
2016-08-09 09:19:24 -07:00
Umair Khan
fe812a89bf
mypy: Type of remote_username should be text_type.
2016-08-09 09:19:24 -07:00
Brock Whittaker
e34b9be950
Append color picker to #subscriptions_table instead of document.body.
...
Adding the container attribute to the color picker options parameter
modifies the behavior of the spectrum function to allow the color
picker to be attached to the #subscriptions_table element rather than
the default document.body element.
This allows for the color picker to scroll with the subscriptions page,
fixing the bug where the color picker would not scroll up/down the page.
Fixes #1293 .
2016-08-09 09:07:55 -07:00
Brock Whittaker
eda1cdd0c5
third: Add option for which container to append the color picker to.
...
This allows you to select the container that the color picker should
append to and therefore be absolutely positioned in accordance with.
This still defaults to document body, which was the previously default
container to append the color picker to.
2016-08-09 09:07:15 -07:00
Brock Whittaker
77aa43fffb
Prevent the color-picker from appearing above the navbar.
...
The color picker original z-index was set to (2^31)-1 which overrode
everything on the site. This behavior is unwanted as the color picker
should not override the z-index of the navbar.
In changing the z-index to 100 the navbar remains above the color
picker.
2016-08-09 09:07:15 -07:00
Umair Khan
8c249f859e
Push Notification: Add tests for GCM.
2016-08-09 16:13:02 +05:00
Steve Howell
a904222947
Add tools/find-add-class to tools/lint-all.
...
The find-add-class tool, when in lint mode, verifies that we can
understand all calls to addClass from our JS code.
When in non-lint mode, i.e. verbose mode, the tool prints out a
list of tuples of (fn, class) that we can use as we wish in other
tools.
2016-08-08 15:32:48 -07:00
Steve Howell
15f46a142e
Remove obsolete #navbar-spacer style.
2016-08-08 15:24:45 -07:00
Steve Howell
98abe5bb3b
Remove obsolete #left-of-compose style.
2016-08-08 15:24:45 -07:00
Steve Howell
95b19f9765
Add test_validate_django().
2016-08-08 15:20:29 -07:00
Steve Howell
d29e745142
Add test_validate_handlebars().
2016-08-08 15:20:29 -07:00
Steve Howell
70bc932913
Add test_html_tag_tree().
2016-08-08 15:20:29 -07:00
Steve Howell
65147e7368
Add tests for template_parser.tokenize.
2016-08-08 15:20:29 -07:00
Steve Howell
184e45b774
Fix bug with tools/html-grep.
...
We were ignoring singleton tags like "input" tags in
html-grep. This was an artifact of our tokenizer originally
being built to check indentation of templates, for which
singleton tags had been a distraction. This fix actually cleans up
the template checking logic as well, since it can now rely
on the tokenizer to classify special tags and singleton tags.
The tokenizer is more complete and more specific.
2016-08-08 15:20:29 -07:00
Umair Khan
acd76eb604
Annotate push_notifications.py.
2016-08-08 15:17:02 -07:00
Umair Khan
9c13e9a072
Annotate test_push_notifications.
2016-08-08 15:17:02 -07:00
Umair Khan
35dd1ffb13
Pass password as string to authenticate.
2016-08-08 15:17:01 -07:00
Umair Khan
266c791e64
Email should be a unicode.
2016-08-08 15:17:01 -07:00
Umair Khan
503ad774f5
Tokens should be unicode.
2016-08-08 15:17:01 -07:00
Umair Khan
4bc4c39528
Add *args and **kwargs to functions.
...
Arguments are added to:
- SocialAuthMixin.get_email_address
- SocialAuthMixin.get_full_name
2016-08-08 15:15:29 -07:00
Umair Khan
0dd7d0dda1
push_notifications: Change name to 'identifier'.
2016-08-08 15:15:29 -07:00
Umair Khan
fdbd132ba4
Annotate zerver/context_processors.py.
2016-08-08 15:15:29 -07:00
Umair Khan
00eab4e526
Annotate zerver/views/__init__.py.
2016-08-08 15:15:29 -07:00
Umair Khan
25dd1aeb5c
Annotate zerver/lib/actions.py.
2016-08-08 15:13:29 -07:00
Umair Khan
ef62506fb1
Annotate zerver/models.py.
2016-08-08 15:13:29 -07:00
Umair Khan
e34b7a0691
Fix type annotation in message_cache_items.
2016-08-08 15:13:29 -07:00
Umair Khan
a3fd1b5d11
Annotate jinja2/__init__.py.
2016-08-08 15:12:12 -07:00
Umair Khan
ec910d96fc
Annotate zerver/storage.py.
2016-08-08 15:12:12 -07:00
Umair Khan
0dfc757447
Annotate test_auth_backends.py.
2016-08-08 15:12:12 -07:00
Umair Khan
1259bc3057
Annotate jinja2/compressors.py.
2016-08-08 15:12:12 -07:00
Tim Abbott
6264ff7039
Add new Zulip realm import/export tool.
...
The previous export tool would only work properly for small realms,
and was missing a number of important features:
* Export of avatars and uploads from S3
* Export of presence data, activity data, etc.
* Faithful export/import of timestamps
* Parallel export of messages
* Not OOM killing for large realms
The new tool runs as a pair of documented management commands, and
solves all of those problems.
Also we add a new management command for exporting the data of an
individual user.
2016-08-08 14:58:18 -07:00
Tim Abbott
e7adaf8db1
utils: Add mkdir_p implementation.
2016-08-08 14:36:50 -07:00
Tim Abbott
b3a768f4b2
settings: Improve ALLOWED_HOSTS defaults logic and docs.
...
This removes the requirement for the user to put localhost/127.0.0.1
in their ALLOWED_HOSTS list, since it is now added automatically.
Fixes : #1358 .
2016-08-05 21:25:29 -07:00
Tim Abbott
54a6bdc3ad
views: Fix mypy annotations in get_invitee_emails_set.
...
Apparently this buggy annotation slipped through into master.
2016-08-05 15:04:16 -07:00
Tomasz Kolek
192f0f93e2
Change post-invite success message in case when user invites only one user.
...
Fixes : #1412 .
2016-08-05 14:48:10 -07:00
Tomasz Kolek
64b5d0ce64
Add support for inviting emails in "name" <email> format.
...
Often, users will copy email addresses with a name (rather than pure
email addresses) into the Zulip "invite users" UI. Previously, that
would throw an error.
This change also adds a get_invitee_emails_set function for parsing
emails content and a test suite for this new feature.
Fixes : #1419 .
2016-08-05 14:48:04 -07:00
Alexander Trost
8d4896809a
Deduplication of configuration: Database Initialization
...
Comment tweaked slightly by tabbott.
2016-08-05 13:33:22 -07:00
Tim Abbott
5bff72c385
Revert "Use apt-add-repository to setup Zulip PPA."
...
This reverts commit 3f95e567c1 .
Apparently `apt-add-repository` fails periodically in CI. I suspect
this is some sort of silly networking problem, but given that all
we're saving is a few lines of code, the old version was better if
this fails basically ever.
2016-08-05 13:29:17 -07:00
Taranjeet Singh
ba4b06c6de
gitignore: Remove tools/phantomjs.
...
This is now installed under /srv/phantomjs.
2016-08-05 13:28:52 -07:00
Taranjeet Singh
11598484ef
gitignore: Remove zerver/fixtures/test_data1.json.
...
This file seems to no longer exist.
2016-08-05 13:28:43 -07:00
Tim Abbott
b9208affdb
Remove event_log from .gitignore.
...
This was moved to the var/log/ subtree some time ago.
2016-08-05 11:12:23 -07:00
Umair Khan
d33fc0046f
Add APNS feedback server tests.
2016-08-05 10:36:57 -07:00
Umair Khan
33450d1a0b
Add APNS push notification tests.
2016-08-05 10:36:57 -07:00
Umair Khan
40054ce26c
Add APNS response listener test case.
2016-08-05 10:36:57 -07:00
Umair Khan
df8fc30b75
Create MockRedis class.
...
Redis is not available on Travis and creating a mock Redis server looks
easier than using `mock` module.
2016-08-05 10:36:57 -07:00
Umair Khan
2ab796aeb5
Add tests for APNS message.
2016-08-05 10:36:57 -07:00
Umair Khan
882bb5558b
Push to APNS in a loop.
2016-08-05 10:36:57 -07:00
Umair Khan
4e8ca0a326
Make sure apns response code is an integer.
2016-08-05 10:36:57 -07:00
Umair Khan
5c41eae7ec
Don't send connection to apns response listener.
2016-08-05 10:36:57 -07:00
Umair Khan
ffaf7cb2ba
Create get_connection function for APNS.
2016-08-05 10:36:57 -07:00
Umair Khan
1d2bdfdfb1
Save user id instead of user profile.
2016-08-05 10:36:57 -07:00
Umair Khan
0cac1aa135
For APNS frame identifier generate random int.
2016-08-05 10:36:57 -07:00
Umair Khan
0b5dc56b8d
Redis key expiry should be an integer.
2016-08-05 10:36:57 -07:00
Umair Khan
f6b0baef7d
Give default value for APNS_SANDBOX
2016-08-05 10:36:57 -07:00
Umair Khan
cbd53fbac8
Don't import OrderedDict.
2016-08-05 10:36:57 -07:00
Umair Khan
0b88deb640
APNS_SANDBOX should be a bool.
...
Fixes : #1480
2016-08-05 10:36:57 -07:00
Steve Howell
cdd03dec4d
Extract media queries to media.css.
...
Create `media.css` using media queries that had been at the bottom
of `zulip.css`, then update miscellaneous setttings/docs files.
I also add `.screen-medium-show` and `.screen-narrow-show` to
`media.css`, as they seem to be an important part of our
responsive design.
Fixes #1532 .
2016-08-05 10:32:55 -07:00
Tim Abbott
3f95e567c1
Use apt-add-repository to setup Zulip PPA.
2016-08-04 22:17:07 -07:00
Tim Abbott
b50abc5131
npm: Split out production-only dependencies.
2016-08-04 22:17:07 -07:00
Tim Abbott
4d02c6efef
scripts: Purge old deployments on every upgrade.
...
Fixes : #554 .
2016-08-04 17:02:48 -07:00
Tim Abbott
51f069aa18
scripts: Refactor deployment-finished logging.
2016-08-04 17:02:48 -07:00
Tim Abbott
91b1521578
purge-old-deployments: Avoid purging last/next deployments.
2016-08-04 17:02:48 -07:00
Tim Abbott
1158a86ae7
restart-server: Maintain a last symlink.
2016-08-04 17:02:48 -07:00
Tim Abbott
82ad32f058
deploy-zulip-from-git: Update next symlink.
2016-08-04 17:02:48 -07:00
acrefoot
cf41629d80
docs: Fill gaps in New Feature Tuturial.
...
Adds some section headings, and provides a better example for the new
django migration system.
2016-08-04 16:02:08 -07:00
Christie Koehler
4c66bbc1ee
integration guide: Move Hello World walkthrough to end.
2016-08-04 15:59:49 -07:00
Christie Koehler
6cf6341a49
integration guide: Improve readability and navigation.
2016-08-04 15:59:48 -07:00
Christie Koehler
4cd28e5e1f
integration guide: Update Hello World walkthrough.
2016-08-04 15:59:28 -07:00
Tim Abbott
dcb92d41b8
Annotate test_messages.py.
2016-08-04 15:57:04 -07:00
Tim Abbott
39f1024740
test_messages: Fix remaining mypy errors.
2016-08-04 15:57:03 -07:00
Tim Abbott
88550edd9e
Annotate queue_processors.py.
2016-08-04 15:57:03 -07:00
Tim Abbott
4e8054b84a
Refactor queue worker tests to match actual API.
2016-08-04 15:57:03 -07:00
Tim Abbott
0219aba2b2
api: Annotate setup.py and fix import.
2016-08-04 15:57:03 -07:00
Tim Abbott
1e54897ca7
process_queue: Add missing type annotation.
2016-08-04 15:57:03 -07:00
Tim Abbott
4ddc567c50
views/__init__: Add missing annotations.
2016-08-04 15:57:03 -07:00
Tim Abbott
ac86cfcc37
Annotate zephyr_mirror.py.
2016-08-04 15:57:03 -07:00
Tim Abbott
bde3c666a9
zephyr_mirror: Add typing import.
2016-08-04 15:57:03 -07:00
Tim Abbott
3fec3f122f
docs: Add missing annotation to conf.py.
2016-08-04 15:57:03 -07:00
Tim Abbott
641aa08721
compilemessages: Add mypy annotations.
2016-08-04 15:57:03 -07:00
Tim Abbott
a787dee48b
makemessages: Add missing annotations and fix string types.
2016-08-04 15:57:03 -07:00
Tim Abbott
552fc06844
jabber_mirror: Add missing annotation.
2016-08-04 15:57:03 -07:00
Tim Abbott
2da6b6bfd8
views.messages: Add some more annotations.
2016-08-04 15:57:03 -07:00
Tim Abbott
2f13b0b18a
actions: Fix various string annotations.
2016-08-04 15:57:03 -07:00
Tim Abbott
0d39ed82d1
Annotate cron_file_helper.
2016-08-04 15:57:03 -07:00
Tim Abbott
4f782bc186
test_events: Fix annotation gaps.
2016-08-04 15:57:03 -07:00
Tim Abbott
2eb5baa024
zendesk: Add missing type annotation.
2016-08-04 15:57:03 -07:00
Tim Abbott
d7d8d6b4d2
parallel: Add missing annotation.
2016-08-04 15:57:03 -07:00
Tim Abbott
d00719f204
Annotate IFTTT tests.
2016-08-04 15:57:03 -07:00
Tim Abbott
d449f6ba72
Annotate bitbucket2 tests.
2016-08-04 15:57:03 -07:00
Tim Abbott
5253c044e7
test_helpers: Add some missing annotations.
2016-08-04 15:57:03 -07:00
Tim Abbott
a7086d3d8a
trello: Fix accidentally commented type annotation.
2016-08-04 15:57:03 -07:00
Tim Abbott
4840e493b2
decorator: Add missing annotation.
2016-08-04 15:57:03 -07:00
Tim Abbott
ef5b5bb45b
views/streams: Add missing annotations.
2016-08-04 15:57:03 -07:00
Tim Abbott
92062b9526
process_queue: Add missing annotation.
2016-08-04 15:57:02 -07:00
Tim Abbott
89267f926e
Annotate tools/run-dev.py.
2016-08-04 15:57:02 -07:00
Tim Abbott
cc11229377
test_auth_backends: Add missing type annotations.
2016-08-04 15:57:02 -07:00
Tim Abbott
0689485666
Add lint check for malformed type annotations missing :.
...
Also fix the 2 annotations that weren't being checked because of this.
2016-08-04 15:53:23 -07:00
Tim Abbott
af823f7a76
Annotate circleci integration.
2016-08-04 15:53:23 -07:00
Tim Abbott
0ca7af6137
Annotate zilencer tests.
2016-08-04 15:53:23 -07:00
Tim Abbott
1f2b3588d2
Annotate zilencer/models.py and fix str types in zilencer views.
2016-08-04 15:53:23 -07:00
Tim Abbott
55611cd21a
Annotate test_i18n.py.
2016-08-04 15:53:23 -07:00
Tim Abbott
3839a25c74
Annotate generate_secrets.py.
2016-08-04 15:53:23 -07:00
Tim Abbott
028efdcb78
integrations: Add detailed module docstrings.
2016-08-04 12:13:25 -07:00
Tim Abbott
4a7e6e852f
integration guide: Update documentation instructions.
2016-08-04 12:04:12 -07:00
Tim Abbott
6ab09064ac
integration guide: Increase visibility level of hello world guide.
2016-08-04 11:55:19 -07:00
Tim Abbott
613781f034
integration guide: Swap created files above updated files.
2016-08-04 11:53:05 -07:00
Tim Abbott
0691832817
docs: Document new WEBHOOK_INTEGRATIONS API.
2016-08-04 11:52:28 -07:00
Tim Abbott
5f37485e7f
docs: Improve integration guide link to writing documentation.
2016-08-04 11:49:17 -07:00
Tomasz Kolek
09d081d9bd
Replace hardcoded integration-lozenges to generating ones.
2016-08-04 11:41:18 -07:00
Tomasz Kolek
0e33b8bd4d
Add integrations library.
...
Define Integration and WebhookIntegration classes.
Change webhook part of integration's guide.
Replace hardcoded webhook urls to generating
based on WEBHOOKS list.
2016-08-04 11:39:20 -07:00
Taranjeet Singh
cbed266af7
gitignore: Update to remove all_messages_log.*.
2016-08-04 11:34:54 -07:00
Tim Abbott
604e2821f8
Remove tools/deprecated/backup.
2016-08-04 11:34:53 -07:00
Steve Howell
7cc1b1ebc4
Add test coverage for parsers in tools/lib.
...
Now, `tools/test-all` calls a new program called `tools/tests-tools`
that runs unit tests in `test_css_parser.py` and 'test_template_parser.py`.
This puts 100% line coverage on tools/lib/css_parser.py.
This puts about 50% line coverage on tools/lib/template_parser.py.
2016-08-04 10:47:09 -07:00
Steve Howell
5af47e0eef
Make fn param optional with template_parser.validate().
...
The caller can now pass in text directly. This is mostly for
testing, but it could be useful in other situations.
2016-08-04 10:47:09 -07:00
Steve Howell
1f8ba1d1b5
Make minor changes to css_parser.py
2016-08-04 10:47:09 -07:00
Steve Howell
f0c6af2285
Describe events/initial state in new-feature-tutorial.md.
2016-08-04 09:45:37 -07:00
Tim Abbott
03f6cb4b3e
testing: Remove now-unnecessary istanbul install docs.
2016-08-04 09:43:05 -07:00
Tim Abbott
09b677b605
test-js-with-node: Fix istanbul not being in PATH.
2016-08-04 09:29:30 -07:00
Tim Abbott
82b1218af9
test-js-with-node: Fix return status on failure.
2016-08-04 09:27:54 -07:00
Tim Abbott
1d6ebd2b3d
check_fts_update_log: Fix psycopg2 arguments.
...
* Fixes passing a string argument rather than an actual Python
argument.
* Switches to hardcoding the database to connect to rather than the
user, so this check can be run as an arbitrary user.
2016-08-03 14:58:46 -07:00
Tomasz Kolek
c96722b124
Add istanbul cover info to help in test-js-with-node.
2016-08-03 14:57:03 -07:00
Tomasz Kolek
87b554906d
Add clear success message after node tests run.
...
Fixes : #1489 .
2016-08-03 14:56:58 -07:00
Umair Khan
6c248a662d
prod_settings_template.py: Add GitHub team and org.
2016-08-03 12:01:15 -07:00
Umair Khan
b38ca0c690
Add tests for GitHub team and organization auth.
2016-08-03 12:01:15 -07:00
Umair Khan
faa3e9b724
Give logical defaults to social auth settings.
...
Both key and secret settings of team and organization default to
SOCIAL_AUTH_GITHUB_KEY and SOCIAL_AUTH_GITHUB_SECRET respectively.
SOCIAL_AUTH_GITHUB_TEAM_ID and SOCIAL_AUTH_GITHUB_ORG_NAME default
to `None`.
2016-08-03 12:01:15 -07:00
Umair Khan
9bb6d45c06
Add GitHub team and organisation authentication.
...
Fixes : #1473
2016-08-03 12:01:15 -07:00
Umair Khan
fc1d8e217f
Don't pass return_data to mock functions.
...
GitHubAuthBackend already passes the `return_data` keyword argument
to the `do_auth` function.
2016-08-03 12:01:15 -07:00
Steve Howell
0f8d014096
Add tools/html-grep.
...
This tools greps for HTML nodes that have relevants words
pertaining to classes, ids, or tags in themselves or their
parents.
2016-08-03 11:29:37 -07:00
Tim Abbott
5f275c9868
Re-enable mobile app advertisements in /apps.html.
2016-08-02 16:45:11 -07:00
Sumana Harihareswara
99da259130
Add new Electron desktop app to /apps/ page.
...
The Electron-based desktop app should work with all
realms, so it goes outside the voyager-related
conditional block.
2016-08-02 16:45:11 -07:00
Sumana Harihareswara
2d43431ad9
Advertise Electron app in documentation.
2016-08-02 16:41:24 -07:00
Sumana Harihareswara
d97702ead6
De-duplicate testing docs.
...
Addresses comment in #1218 .
2016-08-02 19:26:59 -04:00
Steve Howell
3b5c187f55
Add tools/check-css and tools/lib/css_parser.py.
...
`tools/lint-all` now calls the new `tools/check-css`
The css_parser library parsers CSS into a data structure
that remembers line numbers and columns of semantically
meaningful tokens and adjoining white space/tokens. It
is intended to be used for various linting tasks.
The file `tools/check-css` runs a few files through the
parser and makes sure they round trip. This has some value
right away, as files that fail to parse will cause an
exception to be thrown and thus alert developers to syntax
errors. We expect to grow this into more advanced linting
tasks eventually.
2016-08-02 16:22:46 -07:00
Taranjeet Singh
b82836a901
tools/setup/emoji_dump/emoji_dump.py: Move bitmaps & *.ttx to var/.
...
Also update .gitignore to remove the old .gitignore markings for
these files' old locations.
2016-08-02 15:18:36 -07:00
Taranjeet Singh
4c592bd8d4
.gitignore: Remove event_queues.{json,pickle}.
...
This files are now written under the var/ tree.
2016-08-02 15:15:14 -07:00
Christie Koehler
c95e6d4629
Recommend vagrant provision instead of vagrant reload.
...
Fixes #1520 .
2016-08-02 15:10:59 -07:00
Tim Abbott
1c65508624
puppet: Add postgres user to Zulip group.
2016-08-02 14:59:25 -07:00
Tim Abbott
04fc3ff1e1
pg_backup_and_purge: Don't try to use a virtualenv.
...
This makes this actually work if the postgres server is different from
the Zulip app frontend.
2016-08-02 14:59:25 -07:00
Tim Abbott
4bdd9d3769
check_postgres_backup: Don't try to use a virtualenv.
...
The dependencies for this tool are installed using apt.
2016-08-02 14:59:25 -07:00
Tim Abbott
a5115d54ee
env-wal-e: Rename s3_backup_bucket to s3_backups_bucket.
...
This makes it consistent with the other variables in this file.
2016-08-02 14:59:15 -07:00
Tim Abbott
ff80daef16
puppet: Move zulipsecret into its own file.
...
Apparently puppet doesn't support declaring multiple functions in the
same file.
2016-08-02 14:55:51 -07:00
Tim Abbott
b82230559c
docs: Document new deploy-zulip-from-git deployment process.
2016-08-02 14:31:07 -07:00
Tim Abbott
720e905150
docs: Fix heading levels in maintaining guide.
2016-08-02 14:31:07 -07:00
Tim Abbott
a12909d0d3
deploy-zulip-from-git: Move migrations/puppet skipping options to config.
2016-08-02 14:31:07 -07:00
Tim Abbott
35cd0e122e
docs/maintaining: Switch markdown header format.
2016-08-02 14:31:07 -07:00
Tim Abbott
c4d482e722
upgrade-zulip-stage-2: chdir to deploy_path explicitly.
...
This makes rerunning this manually if it fails much more convenient.
2016-08-02 14:31:07 -07:00
Tim Abbott
7e348df198
deploy-zulip-from-git: Cleanup git_repo_url computation.
...
Now we assume the main GitHub zulip.git if a repo isn't specified.
2016-08-02 14:31:07 -07:00
Tim Abbott
dc4b89fb08
deploy-zulip-from-git: Add a cache directory.
2016-08-02 14:31:07 -07:00
Tim Abbott
0ee3178167
Move update-deployment to scripts/deploy-zulip-from-git.
2016-08-02 14:31:07 -07:00
Tim Abbott
fef32af28c
update-deployment: Switch to using update-zulip-part-2.
2016-08-02 14:31:07 -07:00
Tim Abbott
972b42ee7b
upgrade-zulip-stage-2: Only stop services early when needed.
2016-08-02 14:31:07 -07:00
Tim Abbott
5886d3eeec
upgrade-zulip-stage-2: Add --skip-migrations option.
2016-08-02 14:31:07 -07:00
Tim Abbott
759144232f
upgrade-zulip-stage-2: Add --skip-puppet option.
2016-08-02 14:31:07 -07:00
Tim Abbott
8ce55b9789
upgrade-zulip-stage-2: Use argparse for options.
2016-08-02 14:31:07 -07:00
Tim Abbott
cb842c1b83
Improve su_to_zulip setting of home directory.
2016-08-02 14:31:07 -07:00
Rishi Gupta
948ea7663c
ModelReprMixin: Fix handling of missing __unicode__ function.
...
The old behavior was to raise an exception, but Django was catching
the exception and doing unexpected things. For instance, in the
manage.py shell, printing out a ModelReprMixin object (with
__unicode__ not implemented) would result in nothing being printed,
rather than it raising a error or otherwise alerting the programmer as
to what was going on.
2016-08-02 11:46:01 -07:00
Steve Howell
9151ee42e9
Extract tools/lib/template_parser.py.
2016-08-01 16:27:50 -07:00
Steve Howell
9951e92b3b
Extract tokenize() in tools/check-templates.
2016-08-01 16:05:07 -07:00
Steve Howell
7e772ed644
Clean up code in check-templates.
...
I extracted a few helper methods.
2016-08-01 16:05:07 -07:00
Umair Khan
2f6293027d
Add test for empty email gateway pattern.
2016-07-31 20:39:09 -07:00
Umair Khan
2c07f1b19a
Use NOREPLY_EMAIL_ADDRESS if email gateway not enabled.
...
This fixes a regression where missed message emails would not be sent
at all in the event that EMAIL_GATEWAY_PATTERN was unset.
The overall experience still isn't great, but it's better than crashing.
Fixes : #1411
[commit message expanded by tabbott]
2016-07-31 20:38:18 -07:00
Tim Abbott
25c0710800
prod_settings_template: Fix typo in redis documentation.
2016-07-31 19:45:53 -07:00
Steve Howell
af7e39fde2
Remove spurious whitespace in portico.css.
2016-07-31 19:40:21 -07:00
Tim Abbott
2867c019cb
Don't show special empty narrow messages for complex narrows.
...
Previously we showed an empty narrow error message determined entirely
by the first operator, even though there could have been multiple
operators.
2016-07-31 19:38:19 -07:00
Kartik Maji
cea079279e
Improve error message when narrowed to nonexistant or silent users.
...
Fixes #1418 .
2016-07-31 19:38:17 -07:00
Tim Abbott
3b277c3b1f
install: Give nice error message on installation failure.
2016-07-31 19:24:45 -07:00
Tim Abbott
75b5d021fa
Remove unused puppet-common third-party module code.
2016-07-31 19:24:42 -07:00
Tim Abbott
084d504c39
install: Remove unnecessary cd command at end.
2016-07-31 19:24:38 -07:00
Steve Howell
2af176709a
Put each selector on its own line in zulip.css.
2016-07-31 17:46:21 -07:00
Rag Sagar
b9f2397073
Add validation and tests for default language setting.
2016-07-31 17:44:10 -07:00
Tim Abbott
6158acb41b
nagios: Fix path to check_debian_packages.
2016-07-31 14:25:07 -07:00
Tim Abbott
6954dd84ab
postgres_appdb_tuned: Add SSL certificate path configs.
2016-07-31 14:25:07 -07:00
Tim Abbott
d66f6b8176
Fix postgresql configuration template for Ubuntu Xenial.
...
I incorrectly assumed that this was working because Travis CI passed
the build, whereas in fact Travis CI only tests the Trusty templates.
2016-07-31 14:24:34 -07:00
Tim Abbott
8b285ec0ff
puppet: Read camo key from zulip-secrets.conf.
2016-07-31 00:23:24 -07:00
Tim Abbott
2b40309029
puppet: Add new zulipsecret function.
2016-07-31 00:23:24 -07:00
Tim Abbott
298e040bac
puppet: Strip newlines in zulipconf function.
...
This avoids creating unnecessary extra newlines in config generated
using this.
2016-07-31 00:23:24 -07:00
Tim Abbott
16a4ce1bd2
puppet: Fix Nagios check_disk flagging special filesystems.
2016-07-30 23:57:31 -07:00
Tim Abbott
c764b46cef
puppet: Fix missing base include in nagios manifest.
2016-07-30 23:48:41 -07:00
Tim Abbott
bc9bdd53aa
puppet: Use hostgroup for postgres_other monitoring.
2016-07-30 23:46:05 -07:00
Tim Abbott
6b34bee806
puppet: Remove unused ancient humbug-default apache site.
2016-07-30 23:43:55 -07:00
Tim Abbott
217faed3b3
Update check_postgres plugin to version 2.22.
2016-07-30 23:19:40 -07:00
Tim Abbott
1f549dcfab
check_fts_update_log: Fix use on non-appbd machines.
2016-07-30 21:48:17 -07:00
Tim Abbott
3239197fdb
puppet: Silence puppet warnings about missing hiera.yaml.
2016-07-30 21:25:19 -07:00
Tim Abbott
35edd8c9dd
puppet: Move crudini dependency to base.pp.
...
This allows us to use the new crudini-based zulipconf function in any
of our manifests in the future.
2016-07-30 21:23:12 -07:00
Tim Abbott
922a4acdc5
puppet: Add zulip.conf setting for listen_addresses tuning.
2016-07-30 21:23:12 -07:00
Tim Abbott
b2e32e6e3f
puppet: Add postgres replication option for postgres_appdb_tuned.pp.
...
This adds a setting that controls whether to include the Zulip default
streaming replication configuration in the postgres configuration file.
2016-07-30 21:23:12 -07:00
Tim Abbott
3ab0295061
puppet: Add zulip.conf setting for effective_io_concurrency tuning.
2016-07-30 21:23:12 -07:00
Tim Abbott
f3db368a3c
puppet: Add zulip.conf setting for random_page_cost tuning.
2016-07-30 21:23:12 -07:00
Tim Abbott
63c757eac3
puppet: add zulipconf function for reading settings from zulip.conf.
...
This makes it convenient for us to have optional user-defined settings
in the main Zulip puppet configuration.
2016-07-30 21:23:12 -07:00
Tim Abbott
98ae0516d2
docs: Fix Fedora secondary links in generic installation.
2016-07-30 21:20:54 -07:00
Tim Abbott
b63d83538e
docs: Update manual install documentation for tsearch-extras.
...
* Suggest the PPA when possible.
* Use the `postgresql` meta package to avoid manually specifying version.
* Link to the upstream source code.
2016-07-30 21:16:56 -07:00
Tim Abbott
143575a5bd
provision: Fetch tsearch_extras package from Zulip apt repository.
...
This fixes installing a Zulip development environment on Ubuntu Xenial.
2016-07-30 21:01:07 -07:00
Tim Abbott
af54edcaa7
scripts: Move apt repository setup to its own script.
2016-07-30 21:00:18 -07:00
Tim Abbott
d07bcf060e
install: Cleanup code for PPA setup.
2016-07-30 21:00:01 -07:00
Steve Howell
ebe76dd2c3
Add stub_out_jquery() for node tests.
2016-07-30 14:54:30 -07:00
Steve Howell
6ce8f3da6d
Fix node tests to be able to run standalone.
...
These tests would work as part of the whole suite, but
not standalone, because they were getting objects out
of node's require cache that a previous test had cleaned up.
Now they should work standalone as well, and the tests
are more explicit about their dependencies.
2016-07-30 14:54:30 -07:00
Steve Howell
2fe78dc691
Fix leaky requires between zjsunit tests.
...
Some node tests used to pass as long as prior tests ran,
but then they would fail if you ran them standalone. Now
we are more aggressive about cleaning up node's require
cache after each individual test runs.
2016-07-30 14:54:30 -07:00
Steve Howell
55d8a1e960
Remove unneeded require in node_tests/activity.js
2016-07-30 14:54:30 -07:00
Steve Howell
2e254547b2
Extracted zjsunit/finder.js
...
This introduces a very minor different in behavior if you specify
an invalid filename as a command line argument. We now show
warnings for those *before* running the rest of the tests.
2016-07-30 14:54:30 -07:00
Steve Howell
643f2e03e0
Extracted zjsunit/output.js
2016-07-30 14:54:30 -07:00
Steve Howell
b3bc829f61
Extracted zjsunit/render.js
2016-07-30 14:54:30 -07:00
Steve Howell
9acbff3c83
Extracted zjsunit/namespace.js
2016-07-30 14:54:30 -07:00
Steve Howell
6a65b3482c
Move index.js to frontend_tests/zjsunit.
2016-07-30 14:54:30 -07:00
Tim Abbott
f0bf883772
provision: Retry node_modules setup on failures.
...
`npm install` fails nondeterministically occasionally, and this makes
such failures likely to be automatically resolved in most cases by
simple retrying.
2016-07-30 10:09:23 -07:00
Tim Abbott
315766ae02
provision: Provide a nice success message.
2016-07-30 10:09:23 -07:00
Tim Abbott
ed95c34b83
check-templates: Remove now-removed terms.html.
2016-07-30 09:56:54 -07:00
Steve Howell
85859fb992
Add notes about JS unit test HTML output in testing.md.
2016-07-29 22:07:24 -07:00
Steve Howell
8741903a14
Add comment to STYLESHEETS section of settings.py.
2016-07-29 22:07:24 -07:00
Steve Howell
c57bbf6c77
Introduce index.html for test-js-with-node output.
...
We now have an index.html for test-js-with-node output
that links to specific HTML files for various handlebar
tests.
2016-07-29 22:07:24 -07:00
Steve Howell
1d7a6c9941
Fix output from test_tr_tag_settings().
...
For its HTML output, it was using a wrong label and a CSS
setting that clobbered other output.
2016-07-29 22:07:24 -07:00
Steve Howell
f301ccdb3e
Move source code for settings_tab() in templates.js
2016-07-29 22:07:24 -07:00
Steve Howell
b3553859f9
Move source code for propagate_notification_change() in templates.js
2016-07-29 22:07:24 -07:00
Steve Howell
9e8bff5628
Move source code for message_edit_form() in templates.js
2016-07-29 22:07:24 -07:00
Steve Howell
83a92704ee
Move source code for admin_tab() in templates.js
2016-07-29 22:07:24 -07:00
Steve Howell
ec12ea5773
Consolidate bookend tests in node_tests/templates.js.
...
In templates.js we want to enforce outputting just
one output file per template, and we also keep the source
alphabetical by template name. This isn't a permanent
decision, but it makes organizing the ouput a little
easier for now.
2016-07-29 22:07:24 -07:00
Steve Howell
5a3a4595f1
Move source code for admin_emoji_list() to top of its file.
...
We alphabetize the functions in node_tests/templates.js. This
makes it easier for the test output to be rendered in order.
2016-07-29 22:07:24 -07:00
Steve Howell
87dbdaac68
Extract write_handlebars_output() in node tests.
2016-07-29 22:07:24 -07:00
Steve Howell
6b8e2c406b
Write node test output to var/test-js-with-node/output.html
...
This also fixes some CSS path issues that were regressed
when files were written to 'var.'
2016-07-29 22:07:24 -07:00
Christie Koehler
31efecf03d
Add HelloWorld webhook integration + Walkthough.
...
Improves webhook integration docs and Hello World webhook. Includes
many suggested improvements from @timabbott and @tomaszkolek.
2016-07-29 21:38:40 -07:00
Steve Howell
2a37dafcbb
Write untested_url_report.txt.
2016-07-29 21:26:51 -07:00
Steve Howell
8b13530712
Add tools/analyze-url-coverage
2016-07-29 21:23:33 -07:00
Steve Howell
21f83afe3a
Add --url-coverage option to ./tools/test-backend.
2016-07-29 21:23:33 -07:00
Tim Abbott
297566510c
test_activity: Increase expected query count by 1.
...
This is required because the Zulip UserProfile caching logic has
changed with 8e5e6a06f2 , and sometimes
the current user will not be in the cache.
2016-07-29 21:15:10 -07:00
Tim Abbott
f7083b4079
test_templates: Fix Python 3 compatibility.
2016-07-29 21:11:27 -07:00
Tim Abbott
51672f9ddc
Remove now-unused zulip_com template context variable.
2016-07-29 20:47:42 -07:00
acrefoot
b7ccf64c79
Move Zulip's TOS to TERMS_OF_SERVICE markdown file.
...
This reimplements zulip.com/terms using the new markdown system.
2016-07-29 20:47:42 -07:00
acrefoot
e568dbc76f
Add TERMS_OF_SERVICE setting.
...
This new setting allows the server administrator to add a custom
Terms of Service page by supplying the path to a markdown file.
Also adds a test.
2016-07-29 20:47:31 -07:00
Tim Abbott
700e803840
settings: Add new DEBUG_RATE_LIMITING setting.
...
This exists primarily in order to allow us to mock settings.DEBUG for
the purposes of rate limiting, without actually mocking
settings.DEBUG, which I suspect Django never intended one to do, and
thus caused some very strange test failures (see
https://github.com/zulip/zulip/pull/776 for details).
2016-07-29 19:32:02 -07:00
Eklavya Sharma
5691ca61b0
Add tests for email_mirror management command.
2016-07-29 19:13:52 -07:00
Steve Howell
9fb071947d
Remove expected_run_time from @slow test decorator.
2016-07-29 16:41:21 -07:00
Steve Howell
438a118ea5
Simplify enforce_timely_test_completion().
...
This will lead to minor differences in the warnings that
people see when they run tests that are slow. We call out
the slowness a little more clearly from a visual standpoint,
and we simplify the calculation of the slowness threshold.
We still allow more time for tests with the `@slow` decorator
to run, but we don't use their expected_run_time.
2016-07-29 16:41:21 -07:00
Steve Howell
f67b56702a
Remove @slow decorators for tests that are no longer slow.
...
These tests aren't exactly zippy, but they don't even make
the top 100 slow tests.
2016-07-29 16:41:21 -07:00
Steve Howell
4556bf528f
Add --report-slow-tests option to tools/test-backend.
2016-07-29 16:41:20 -07:00
Tim Abbott
29b04fe654
settings: Cleanup SOCIAL_AUTH_GITHUB_KEY to match documentation.
2016-07-29 15:16:28 -07:00
Tim Abbott
2053c746c1
docs: Document GitHubAuthBackend.
2016-07-29 15:05:24 -07:00
Tim Abbott
3b5629739d
docs: Cleanup typos and language in translating guide.
2016-07-29 14:49:51 -07:00
Tim Abbott
eef66ee031
Document GitHub authentication.
2016-07-29 12:49:10 -07:00
Tim Abbott
6b2b7ab3ff
Rename GitHubBackend to GitHubAuthBackend for consistency.
2016-07-29 12:49:10 -07:00
Umair Khan
d43b031a32
Add tests to verify GitHub backend.
2016-07-29 12:49:10 -07:00
Umair Khan
86125080d1
Create SocialAuthMixin generic class around GitHub auth backend.
...
This will simplify the process of adding new social authentication
backends to Zulip.
2016-07-29 12:49:10 -07:00
Umair Khan
c1d8ad3d9a
Add GitHub login button to login page.
2016-07-29 12:49:10 -07:00
Umair Khan
80d62de40a
Add GitHub authentication.
...
Fixes : #1042
2016-07-29 12:49:10 -07:00
Tim Abbott
d9b5f3089b
prod_settings: Cleanup intro to Google auth documentation.
2016-07-29 12:49:01 -07:00
Umair Khan
7531d9679b
Sort language dropdown list.
2016-07-29 11:58:41 -07:00
Umair Khan
2edb79776e
Calculate translation percentages.
...
Fixes : #1397
2016-07-29 11:58:41 -07:00
Steve Howell
f3962994b5
Fix regression for running migrations during tests.
...
When running ./tools/test-backend, the script to generate
fixtures, ./tools/setup/generate-fixtures, looks for a file
called migration-status to determine whether it can short
circuit doing database migrations. This file got moved as
part of the effort to put files in "var," but the existence
check was still looking for that file in its old location.
2016-07-29 08:57:56 -07:00
Tomasz Kolek
971939caba
Fix extra footer bullet in portico.html when register_link_disabled.
...
Fixes : #1462 .
2016-07-29 08:51:09 -07:00
Tim Abbott
568dd0e142
lint-all: Improve regular expression for json_error.
2016-07-28 16:19:55 -07:00
Umair Khan
0aa72cb347
Point registration to correct url.
...
While logging through GitHub if the realm of the user doesn't
exist then we are redirected to registration page but the action
points to the complete url of the GitHub oAuth overflow.
2016-07-28 15:27:22 -07:00
Umair Khan
2df62d4539
Add socialauth requirements file.
2016-07-28 15:26:00 -07:00
Umair Khan
4bd0ccb6af
Update zocial.
2016-07-28 15:18:18 -07:00
Reid Barton
a45b28e0b8
Don't use sudo in commands to be run as root.
...
It's confusing as it implicitly sends the message that the commands are to be run as a non-root user.
2016-07-28 15:13:48 -07:00
Eklavya Sharma
3b3b5c7c16
Rename management command email-mirror to email_mirror.
...
All other zulip management command names have underscores, so
rename email-mirror to email_mirror.
This will also make it possible to import this module, which will
help in writing tests for it.
2016-07-28 14:52:09 -07:00
Eklavya Sharma
b98b049377
Fix string handling in email_mirror queue_processor.
2016-07-28 14:52:09 -07:00
Eklavya Sharma
80bb27570d
Remove unneeded dependencies.
...
We install service-identity to prevent twisted from giving spammy
warnings. However, we don't need the security features provided
by service-identity. So we can remove most of its cryptographic
dependencies.
2016-07-28 14:52:09 -07:00
Eklavya Sharma
9922ecc7d6
Shift twisted to requirements/py2_dev.txt.
...
Since twisted is only used for running tools/run-dev.py, we only
need it in development. Also twisted is not python 3 compatible.
So it should be shifter to requirements/py2_dev.txt.
2016-07-28 14:52:09 -07:00
Eklavya Sharma
6e9bc44123
Re-implement email-mirror using imaplib.
...
Switch from twisted to imaplib to gain python 3 compatibility and
make code easier to understand.
2016-07-28 14:52:09 -07:00
Eklavya Sharma
af28d026e3
Upgrade coverage.
2016-07-28 14:38:23 -07:00
Eklavya Sharma
68058d6ca0
Upgrade transifex-client and urllib3.
2016-07-28 14:38:23 -07:00
Eklavya Sharma
cdf73ccf84
Upgrade lxml.
2016-07-28 14:38:23 -07:00
Tim Abbott
832951d2dd
Fix IFTTT integration documention on 'content' field.
2016-07-28 14:05:45 -07:00
Steve Howell
ffe364c719
Don't pass UserProfile object to client_put().
...
This was in AdminCreateUserTest.test_create_user_backend().
For end to end tests we are logged in, and we need to verify
that our decorators add UserProfile to the parameters of
the view on our behalf, so that we don't get false positives.
In an upcoming commit, we will want to be able to serialize
the parameters for client_put to produce url coverage reports,
so that is another reason not to pass in the UserProfile
object. (That was how this was discovered.)
2016-07-28 13:57:28 -07:00
Sumana Harihareswara
c0e1e23941
Update copyright year in documentation.
2016-07-28 13:57:05 -07:00
Umair Khan
f20f9ce8c8
Update casper testing documentation.
...
This adds a note that waitFor functions cannot be chained together if
the wait can cause race condition.
2016-07-28 13:55:27 -07:00
Umair Khan
8e5e6a06f2
Delete cache entry for user profile.
...
Our flush functions update user profile cache entries which can cause
confusing race conditions (see e.g. #1257 ). To resolve this, we move
all the user_profile flush functions to delete the entry instead of
updating it -- it will then be fetched as part of the next request
that needs to access the user object.
There are still races here, and there is perhaps an argument that a
better fix for this would be to re-fetch the object and then put it
into the cache, but this resolves the main cache correctness problem
we had with the previous implementation.
Fixes : #1322 .
2016-07-28 13:43:14 -07:00
Umair Khan
1a6e8282c8
Run 'check_send_receive_time' as 'zulip' user.
...
Run '/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_send_receive_time'
script as 'zulip' user so that the connection to the database can be
made correctly.
2016-07-28 13:39:29 -07:00
Tim Abbott
69528790a5
check_worker_memory: Fix handling of no queue workers running.
2016-07-28 13:26:31 -07:00
Tim Abbott
beedfb2939
Revert "[third] Upgrade jquery to version 1.8.3."
...
This reverts commit be93b6ea28 .
Unfortunately, the newer jquery comes with a huge performance
regression affecting the hotkeys code, which has the effect of making
typing super slow.
Fixes : #1449 .
2016-07-28 11:39:06 -07:00
Steve Howell
713797a65c
Add lint checks for self.client.{get,patch,put,post,delete}.
2016-07-27 20:50:54 -07:00
Steve Howell
985de51903
Use self.client_delete() wrapper in more places.
2016-07-27 20:49:33 -07:00
Steve Howell
6937f63fd5
Add client_get() test helper.
2016-07-27 20:49:33 -07:00
Steve Howell
38f2a2f475
Add client_post() test helper.
...
This makes us more consistent, since we have other wrappers
like client_patch, client_put, and client_delete.
Wrapping also will facilitate instrumentation of our posting code.
2016-07-27 20:49:32 -07:00
Eklavya Sharma
eb34c249d7
Upgrade doc-building dependencies.
...
Upgrade alabaster and sphinx to latest version.
commonmark can't be updated because recommonmark uses an old
version of commonmark which is incompatible with latest version.
2016-07-27 14:47:29 -07:00
Steve Howell
51bae8abc4
Remove stub() test helper.
2016-07-27 14:12:10 -07:00
rahuldeve
ec6c9ba436
Add test for removing an uploaded file via message editing.
...
Fixes #1373 .
2016-07-27 14:10:15 -07:00
rahuldeve
4267dcbb68
Change the way referred attachments are removed on message update.
...
This fixes incorrect behavior when two or more attachments are removed
in the same message.
2016-07-27 14:08:59 -07:00
Tim Abbott
65175ef15a
Test upgrading Tornado to 3.1.1.
2016-07-27 13:47:34 -07:00
Tim Abbott
97e0306795
Replace localhost with 127.0.0.1 in casper tests.
2016-07-27 13:47:26 -07:00
Rishi Gupta
e515484c41
Fix typos in the documentation.
...
Pushing this now so as to not create merge conflicts with others working on
the prod docs.
2016-07-27 13:44:27 -07:00
Eklavya Sharma
c51b5bced8
Upgrade regex.
2016-07-27 13:03:31 -07:00
Eklavya Sharma
933d327c1a
Upgrade python-ldap.
2016-07-27 13:03:31 -07:00
Eklavya Sharma
3473891aa5
Upgrade enum34.
2016-07-27 13:03:31 -07:00
Eklavya Sharma
7c37316432
Upgrade pylibmc.
2016-07-27 13:03:31 -07:00
Umair Khan
bede14724d
Fix non-determinism in admin frontend tests.
...
According to http://docs.casperjs.org/en/latest/modules/casper.html#waitfor ,
waitFor functions cannot be chained together. All functions that start with
'waitFor', like `waitForSelector`, use `waitFor` function so they should be
wrapped in a `then`.
Fixes : #1352
2016-07-27 12:32:48 -07:00
Tim Abbott
c2bed83a84
run-dev: Hardcode 127.0.0.1 rather than localhost.
...
Using "localhost" is problematic in Travis CI, where they have
/etc/hosts configured to make `localhost` resolve to both 127.0.0.1
and ::1.
2016-07-27 11:39:12 -07:00
Tim Abbott
df525ad1c5
Remove old MitUser model and related code.
...
The MitUser model caused a constant series of little problems for
users with mit.edu email addresses trying to sign up for different
Zulip servers.
The new implementation just uses conditionals on the realm object when
selecting the confirmation template to use.
2016-07-26 20:30:12 -07:00
Tim Abbott
ed6c134cf4
Clean up and document clean_email code path.
2016-07-26 20:30:12 -07:00
Tim Abbott
375551aaa6
Clean up most hardcoding of mit.edu domain checks.
...
This moves all this code to be gated on a few virtual realm settings.
2016-07-26 20:30:12 -07:00
Tim Abbott
70543e059a
bugdown: Remove hardcoding of mit.edu for zephyr_mirror realm config.
2016-07-26 20:30:12 -07:00
Tim Abbott
c17676b00c
Cleanup MIT hardcoding for disabling presence.
2016-07-26 20:30:12 -07:00
Tim Abbott
884f50cdd7
validate_user_access: Assert user_profile is not None.
...
This function is only called in cases where user_profile isn't None,
and the code reads better if we just check that first rather than
checking it on every line that accesses user_profile.
2016-07-26 20:30:12 -07:00
Tim Abbott
d1adbd798b
get_subscribers_to_streams: Pass through requesting_user.
2016-07-26 20:30:12 -07:00
Tim Abbott
691ad7fcfc
maybe_get_subscriber_emails: Pass user_profile through.
2016-07-26 20:30:12 -07:00
Tim Abbott
f790a04102
Remove unused get_subscriber_ids.
2016-07-26 20:30:12 -07:00
Tim Abbott
1771b8275c
Remove unused get_other_subscriber_ids.
2016-07-26 20:30:12 -07:00
Steve Howell
eb11e02309
Add MirroredMessageUsersTest.
2016-07-26 20:01:36 -07:00
Steve Howell
3fa745ebe3
Remove untested code in is_public_stream().
...
We were calling valid_stream_name(), but more appropriate
validation checks for stream names happen elsewhere in the codepath.
2016-07-26 18:10:00 -07:00
Steve Howell
81cd9d33e4
Add test_non_string_narrow_operand_in_dict().
2016-07-26 18:10:00 -07:00
Tim Abbott
b2d1c18268
views: Move push token views to new push_notification.py.
2016-07-26 14:44:24 -07:00
Tim Abbott
6dc5681171
views: Move presence views to presence.py.
2016-07-26 14:29:32 -07:00
Tim Abbott
62affa53c9
views: Move update_realm to new realm.py views file.
2016-07-26 14:29:24 -07:00
Umair Khan
7c138c6e33
Import is_inactive from proper file.
2016-07-26 12:26:55 -07:00
Eklavya Sharma
408d070170
puppet/: Make subprocess calls unicode-aware.
2016-07-26 12:06:41 -07:00
Eklavya Sharma
51ea5c1602
scripts/: Make subprocess calls unicode-aware.
2016-07-26 12:06:41 -07:00
Eklavya Sharma
97d877f49e
tools/: Make subprocess calls unicode-aware.
2016-07-26 12:06:41 -07:00
Eklavya Sharma
e0dbaf1031
Use universal_newlines=True in subprocess.check_output.
...
In python 3, subprocess uses bytes for input and output if
universal_newlines=False (the default). It uses str for input and
output if universal_newlines=True.
Since we mostly deal with strings, add universal_newlines=True to
subprocess.check_output.
2016-07-26 12:06:41 -07:00
Eklavya Sharma
5ce80eb4ba
Update types of images accepted as avatars.
...
* Reject SVG in frontend because backend doesn't accept it.
* Add JPEG format in backend tests for avatar upload.
2016-07-26 16:36:47 +05:30
Eklavya Sharma
a2a8b54f6e
Upgrade pillow.
...
Update test images because pillow's resize algorithm has changed.
2016-07-26 16:36:07 +05:30
rahuldeve
5ed2b01bc7
upload: Fix single attachments not being claimed on message edit.
...
Fixed an attachments not being claimed if just one new attachment is
added (aka the common case).
2016-07-25 17:56:27 -07:00
rahuldeve
e06d5fbec9
Pass Message object instead of message dict to do_claim_attachments.
2016-07-25 17:54:36 -07:00
rahuldeve
c61d149837
Pass Message object instead of message dict to claim_attachment.
2016-07-25 17:51:17 -07:00
Alexander Trost
6e10236972
Disable auto-service-restart for docker installations.
2016-07-25 16:40:29 -07:00
Steve Howell
57c436b32d
Add TODOs for #1379 (bugdown mutual dependency)
2016-07-25 14:59:32 -07:00
Ashish Kumar
8398dac025
Fix 'Invalid stream' error message in get_subscription_or_die().
2016-07-25 14:48:48 -07:00
Ashish Kumar
56048919f5
Increase test coverage of streams API by covering JSON errors.
2016-07-25 14:48:48 -07:00
Ashish Kumar
84566c750f
Add test_successful_subscriptions_add_with_announce().
2016-07-25 14:45:29 -07:00
Ashish Kumar
a143677ea2
Add test_json_get_subscribers().
2016-07-25 14:45:28 -07:00
Ashish Kumar
9104468926
Add test_existing_subscriptions_autosubscription().
2016-07-25 14:43:27 -07:00
Taranjeet Singh
1328a10069
Move available-migration and migration-status to var/.
2016-07-25 14:39:35 -07:00
Taranjeet Singh
b143d6ca6e
Move test_credentials.js to var/casper.
2016-07-25 14:39:23 -07:00
Taranjeet Singh
a131fc74f0
frontend_tests/run-casper: Move server.log to var/casper.
2016-07-25 14:39:16 -07:00
Tim Abbott
b49b3d5899
Upgrade moto dependency versions.
2016-07-25 12:31:32 -07:00
Tim Abbott
df32750f88
docs: Add a bit of discussion of settings philosophy.
2016-07-25 11:43:41 -07:00
Tim Abbott
488cc547d2
docs: Expand discussion of settings secrets.
2016-07-25 11:43:41 -07:00
Eklavya Sharma
f067c7fb15
Fix email-mirror instructions in prod_settings_template.py.
...
When email mirroring is done via polling, the IMAP account's
password should be stored in zulip-secrets.conf in
email_gateway_password, not in email_gateway_login.
2016-07-25 11:30:17 -07:00
Eklavya Sharma
29af1419db
Make tools/update-deployment pass mypy check.
2016-07-25 22:06:05 +05:30
Eklavya Sharma
fb62e5c7bd
Upgrade Twisted.
2016-07-25 08:45:10 -07:00
Eklavya Sharma
6ed5163795
Upgrade Jinja2.
2016-07-24 19:45:52 -07:00
Steve Howell
2846e23cfc
Extracted test helper: get_and_check_messages().
...
This new helper combines two old helpers, one of which was misnamed
and the other of which was always called after the first, so it
made sense to just combine the helpers.
Fixes : #1386
2016-07-24 19:43:56 -07:00
Eklavya Sharma
b08d6769c1
tools/zulip-export/zulip-export: Fix how files are opened.
...
Instead of using codecs.open, use the builtin open in binary mode
and write data after encoding it in utf-8.
2016-07-24 22:32:08 +05:30
Eklavya Sharma
df7dcdda5f
Annotate tools/get-handlebar-vars.
2016-07-24 22:12:32 +05:30
Eklavya Sharma
61ffd835e1
Annotate tools/minify-js.
2016-07-24 21:58:02 +05:30
Eklavya Sharma
1e0a971178
Annotate tools/test-run-dev.
2016-07-24 21:33:40 +05:30
Eklavya Sharma
7edc38bbf7
Remove tools/test-js-with-casper from mypy exclude list.
2016-07-24 21:07:07 +05:30
Eklavya Sharma
e6264fa6fb
Annotate tools/compile-handlebars-templates.
2016-07-24 21:07:06 +05:30
Eklavya Sharma
1a77b599f6
Make tools/post-receive python 3 compatible.
2016-07-24 21:07:06 +05:30
Eklavya Sharma
00a120c34f
Improve a string in tools/post-receive.
2016-07-24 21:07:02 +05:30
Eklavya Sharma
ab8890b304
Annotate tools/check-templates.
2016-07-24 21:04:32 +05:30
Eklavya Sharma
2f889550cb
tools/check-templates: Use __init__ in Record.
...
Initialize Record by using __init__ instead of setting attributes
in validate. This is needed because mypy complains when we set
new attributes outside __init__.
2016-07-24 21:04:32 +05:30
Eklavya Sharma
ecf2249536
tools/check-templates: Set modified's default to False.
...
Set default value of options.modified to False.
2016-07-24 21:04:31 +05:30
Eklavya Sharma
9c177fcd1b
tools/check-templates: Remove unneeded return.
2016-07-24 21:04:31 +05:30
Eklavya Sharma
bd0fa3e77b
Annotate tools/lint-all.
2016-07-24 21:04:31 +05:30
Eklavya Sharma
ec6b630537
Make tools/run-mypy pass mypy check.
2016-07-24 21:04:22 +05:30
Eklavya Sharma
3d87c376c2
Make zulip-ec2-configure-interfaces pass mypy check.
2016-07-24 12:52:58 +05:30
Eklavya Sharma
0a5aa2ccc7
Make check_send_receive_time pass mypy check.
2016-07-24 12:41:06 +05:30
Eklavya Sharma
1820f961b3
frontend_tests/run-casper: Fix annotations.
2016-07-24 10:52:54 +05:30
Steve Howell
1da9325476
Require non-empty full_name or password in json_change_settings
2016-07-23 14:53:15 -07:00
Steve Howell
14717f414c
Add default for full_name in json_change_settings.
2016-07-23 14:53:15 -07:00
Steve Howell
f27ad0d800
Add test_changing_nothing_still_returns_success().
...
(in ChangeSettingsTest)
2016-07-23 14:53:15 -07:00
Steve Howell
728ac09df9
Remove ChangeSettingsTest.post_with_params().
...
The individual tests now explicitly show all the parameters
they are passing to the endpoint, which makes them easier
to troubleshoot.
2016-07-23 14:53:15 -07:00
Steve Howell
f01b10f97a
Improve test coverage for use_first_unread_anchor parameter.
...
This commit adds these two tests:
test_use_first_unread_anchor_with_some_unread_messages
test_use_first_unread_anchor_with_no_unread_messages
The new tests add coverage to the conditional logic in
get_old_messages_backend() that looks at first_unread_result
when use_first_unread_anchor is set to True.
2016-07-23 14:39:58 -07:00
Steve Howell
08f6ae7c14
Improved and renamed test_use_first_unread_anchor().
...
The test is now called test_use_first_unread_anchor_with_muted_topics().
Before this commit, the test exercised setting
use_first_unread_anchor to True, but it didn't inspect the
most relevant query affected by the flag. Now it does.
This test is still kind of hard to read, and it's far from ideal,
but I'm reluctant to remove it from the test suite.
2016-07-23 14:39:58 -07:00
Steve Howell
ee2007136d
Test "empty list" logic in exclude_muting_conditions().
2016-07-23 14:39:58 -07:00
Eklavya Sharma
196e021a7f
Add automated tests for zerver/lib/type_debug.py.
2016-07-23 14:38:28 -07:00
Eklavya Sharma
ed03619f95
docs/mypy.md: Document zerver/lib/type_debug.py.
2016-07-23 14:38:24 -07:00
Eklavya Sharma
5b06edc402
zerver/lib/type_debug.py: Handle container types better.
2016-07-23 14:35:39 -07:00
Eklavya Sharma
a632c71cce
Add zerver/lib/type_debug.py.
...
This file has a decorator print_types, which makes the decorated
function print the types of its arguments whenever it is called.
2016-07-23 14:35:39 -07:00
Taranjeet Singh
250c617dc8
zulip_tools.py: Fix line with length greater than 120.
2016-07-23 14:33:57 -07:00
Taranjeet Singh
9bea1f46c7
zerver/views/webhooks/bitbucket2.py: Fix line with length greater than 120.
2016-07-23 14:33:11 -07:00
Taranjeet Singh
5e34e5bf40
iframe-bot/show-last-messages: Fix line with length greater than 120.
2016-07-23 14:33:11 -07:00
Taranjeet Singh
3faa5c1dd9
README.dev.md: Fix test suite dev markup formatting.
2016-07-23 14:32:39 -07:00
Eklavya Sharma
11732f9ab0
Make all scripts in scripts/ pass mypy check.
2016-07-24 00:17:21 +05:30
Tim Abbott
eba2d470dc
Fix removing attachments when editing a message.
...
Fixes #1373 .
2016-07-22 14:48:47 -07:00
Tim Abbott
4de203a23f
Fix MIT users joining a Zulip realm.
2016-07-22 14:27:36 -07:00
Eklavya Sharma
09e4e5aea7
Add links after type: ignores.
2016-07-22 13:59:31 -07:00
Tim Abbott
226a57d2c8
travis: Disable test-queue-worker-reload temporarily.
...
It's failing nondetermistically pretty often, and I'd like to cut the
impact to other users' work.
2016-07-22 11:36:52 -07:00
Eklavya Sharma
fb59a07a89
Run mypy on extensionless python scripts in Travis.
2016-07-22 11:16:29 -07:00
Eklavya Sharma
f4c557d2a7
tools/run-mypy: Exclude scripts which don't pass mypy.
2016-07-22 11:16:29 -07:00
Eklavya Sharma
c12db5246d
Use separate exclude list for scripts.
2016-07-22 11:16:29 -07:00
Eklavya Sharma
102fcda4ab
tools/run-mypy: Add option --scripts-only.
...
This option is for checking only extensionless python scripts.
2016-07-22 11:16:29 -07:00
Eklavya Sharma
674f6999e1
Improve annotations of decorators.
2016-07-22 11:14:33 -07:00
Eklavya Sharma
4b7d94564a
zerver/views/streams.py: Annotate variables to help mypy.
2016-07-22 11:14:33 -07:00
Eklavya Sharma
07e36d87a2
Remove return where no return value is expected.
...
zerver.lib.notifications.send_future_email has return type None.
So replace `return send_future_email(...` by `send_future_email(...`.
2016-07-22 11:14:33 -07:00
Krit Karan
a61ef3bc0e
Reformat the content variable in `do_refer_friend()`.
...
Fixes #1162 .
2016-07-22 10:36:35 -07:00
Eklavya Sharma
baa157344c
Patch activate script only in development.
2016-07-21 14:11:41 -07:00
Eklavya Sharma
e7813094d7
Patch activate script to set VIRTUAL_ENV correctly.
...
Patch a virtualenv's activate script to not resolve symlinks when
setting the environment variable VIRTUAL_ENV.
Fixes #1190 .
2016-07-21 14:11:41 -07:00
Eklavya Sharma
c59740385d
zerver/lib/str_utils.py: Replace ValueError by TypeError.
...
When a parameter of a wrong type is passed to a `force_*` method
in str_utils.py, raise a TypeError.
2016-07-21 23:14:00 +05:30
Umair Khan
dce48d58b6
Cache translations.
...
Fixes : #1158
2016-07-21 10:23:31 -07:00
Tim Abbott
30dd8cfd4a
test-queue-worker-reload: Increase sleep resolution.
2016-07-21 10:21:29 -07:00
Umair Khan
7d687b0f79
Increase the timeout in test-queue-worker-reload.
...
May fix #1341 .
2016-07-21 10:19:49 -07:00
Eklavya Sharma
7bd935bef2
Add option to only show extensionless files in lister.
2016-07-21 16:59:52 +05:30
Tim Abbott
2a209e46dd
puppet: Fix remaining hardcoding of postgres 9.1 in manifests.
2016-07-20 21:11:22 -07:00
Tim Abbott
175e9f1593
run-casper: Move remote_debug argument construction earlier.
2016-07-20 20:35:48 -07:00
Tim Abbott
345d7b670a
run-casper: Move list of files to be run_tests arguments.
2016-07-20 20:35:48 -07:00
Tim Abbott
2187ba231e
run_casper: Move run_tests into a function.
2016-07-20 20:35:47 -07:00
Tim Abbott
b58e1fd5fc
run-casper: Add server argument to server_is_up.
2016-07-20 20:24:43 -07:00
Tim Abbott
69a9db17d3
run_casper: Move some setup tasks later in the file.
2016-07-20 20:17:40 -07:00
hackerkid
b6620cfa57
Replace UserProfile with HttpRequest in logged_in_and_active.
2016-07-20 20:08:00 -07:00
Tim Abbott
2bcce28b07
changelog: Clean up some minor text issues.
...
Thanks @rishig for the review! I forgot to apply these before
merging.
2016-07-20 20:01:30 -07:00
Tim Abbott
5b583c7417
Fix django statsd packages.
2016-07-20 19:03:29 -07:00
Tim Abbott
21c30b9fed
Vagrantfile: Update default RAM in development.
2016-07-20 18:40:10 -07:00
Tim Abbott
568a2facce
docs: Fix links to troubleshooting guide.
2016-07-20 18:40:10 -07:00
Christie Koehler
827c015458
Updates Zulip dev setup for first-time contributors
...
Updates Zulip dev setup for first-time contributors as follows:
- Recommends and links to Vagrant version 1.8.4 (from 1.8.1)
- Consolidates Ubuntu 14.04 and Ubuntu 16.04 instructions since they are
now identical.
- Updates memory requirement to 2GB to address out of memory related
errors (see issue #1333 ).
Fixes #1288 .
2016-07-20 18:40:10 -07:00
Tim Abbott
9fb933d456
docs: Fix style issues in life-of-a-request.
2016-07-20 18:31:41 -07:00
Taranjeet Singh
44d23975ed
Move update-prod-static.log to var/log.
2016-07-20 18:27:44 -07:00
Taranjeet Singh
9b31f0a67a
node tests: Move .test-js-with-node.html to var/."
2016-07-20 18:23:56 -07:00
Eklavya Sharma
6548f1dd1c
Factor out venv-installing code into a module.
...
Factor out the code in tools/provision.py which installs a python2
and python3 venv into a module (tools/setup/setup_venvs.py) which
can also be used as a script.
2016-07-20 18:20:37 -07:00
Eklavya Sharma
2930a769a9
Add __init__.py to tools/ and tools/setup/.
...
This will make it possible to import stuff from tools/setup/.
2016-07-20 18:20:37 -07:00
acrefoot
38bf0bf39b
Add Life of a Request doc ( #1302 )
...
This doc follows the different layers that Zulip uses
to handle a request, detailing parts of those layers that
would be most commonly interesting to developers.
2016-07-20 17:12:15 -07:00
acrefoot
c671ae22d1
Error better when handlebars template is missing ( #1338 )
...
Currently if you try to use a non-existent handlebars
template, you get this error:
Uncaught TypeError: Handlebars.templates[name] is not a function
This change makes it a little more clear what the issue is
and what the fix would be.
2016-07-20 15:56:27 -07:00
Tim Abbott
dd6e92a714
setup_venv: Fix missing dependencies on image libraries.
2016-07-20 14:55:45 -07:00
Tim Abbott
a07eca2639
Revert "Factor out venv-installation into a script."
...
This reverts commit 852c49a44e .
I think this may have broken provisioning without a venv.
2016-07-20 14:55:45 -07:00
Eklavya Sharma
f664d00fe8
Add python2 and python3 venv install instructions.
2016-07-20 14:18:51 -07:00
Eklavya Sharma
852c49a44e
Factor out venv-installation into a script.
2016-07-20 14:18:51 -07:00
Tim Abbott
c791037166
narrow: Document BuildNarrowFilterTest.
2016-07-20 14:18:40 -07:00
acrefoot
0dfb76fc5e
Change HTTP verb for create_user_backend to PUT ( #1326 )
2016-07-20 12:57:47 -07:00
Steve Howell
2484d870b4
Add test_build_narrow_filter().
2016-07-20 11:04:00 -07:00
Tim Abbott
14143e2222
roadmap: Fix issue number for upgrading every dependency.
...
The previous issue number corresponded to just the work to move to a
virtualenv, not to actually upgrade the dependency versions.
2016-07-20 10:54:52 -07:00
Umair Khan
9dad92f323
Switch to upstream Talon repository.
2016-07-20 10:47:05 -07:00
Tim Abbott
f4ffae8685
docs: Update roadmap with completed projects, etc.
2016-07-20 10:28:35 -07:00
Tim Abbott
b96a10ec9a
Add draft changelog since Zulip 1.3.13 release.
2016-07-20 10:12:57 -07:00
Eklavya Sharma
576a090499
Add libpq-dev to VENV_DEPENDENCIES.
2016-07-20 22:15:06 +05:30
Tim Abbott
741c21c3ce
update_deployment: Make git repository URL configurable.
2016-07-19 21:02:47 -07:00
Tim Abbott
a5a79280cb
update_deployment: Add symlink for use in voyager installs.
2016-07-19 20:59:59 -07:00
Tim Abbott
35339f5117
Rename local_settings_template to prod_settings_template.
2016-07-19 20:59:59 -07:00
Tim Abbott
19b860ceec
Rename local_settings.py symlink to prod_settings.py.
2016-07-19 20:59:59 -07:00
Tim Abbott
82f9f8f941
update-deployment: Compute ZULIP_COM setting.
2016-07-19 20:52:08 -07:00
Tim Abbott
7348841e65
update-prod-static: Copy static/locale rather than moving.
...
The old behavior results in a large diff when deploying based on a git
commit.
2016-07-19 20:52:08 -07:00
Tim Abbott
28fa4e8346
build_release_tarball: Remove local_settings.py overwrite hack.
2016-07-19 20:52:06 -07:00
Tim Abbott
78a0c7c557
tools: Rewrite install-server to not hardcode configuration.
...
Now install-aws-server is a reusable script for setting up a Zulip
role server in AWS, without any hardcoded configuration.
2016-07-19 20:12:43 -07:00
Tim Abbott
9c9b6176a9
install: Fix feature detection/set -e incompatibility.
...
Previously, the whole script would stop when a feature wasn't
available.
2016-07-19 20:12:27 -07:00
Tim Abbott
8eaa75b90f
setup_venv: Remove unnecessary postgresql-server-dev-all dependency.
...
This package is a dependency for building tsearch_extras, but isn't
needed for building a Zulip virtualenv.
2016-07-19 19:19:42 -07:00
Tim Abbott
d529bc12ef
pg_backup_and_purge: Fix hardcoding of postgres version.
2016-07-19 19:19:42 -07:00
Tim Abbott
bdb1ce04a2
puppet: Move pg_backup_and_purge to main config.
2016-07-19 19:19:42 -07:00
Tim Abbott
81136ff092
env-wal-e: Eliminate hardcoding of AWS keys.
...
Pre-Zulip being open sourced, this file just had the AWS keys for
backups hardcoded.
Instead, these are simply read from zulip-secrets.conf.
2016-07-19 19:19:42 -07:00
Tim Abbott
3023745ed7
puppet: Move env-wal-e to Zulip main distribution.
...
This doesn't yet include the dependencies for env-wal-e.
2016-07-19 19:19:42 -07:00
Tim Abbott
d0dcc8bf26
puppet: Create static_asset_compiler manifest.
2016-07-19 16:38:09 -07:00
Tim Abbott
601ab24d2a
zulip_internal::app_frontend: Remove now-unnecessary dependencies.
...
These Python packages are no longer relevant, since we install all of
our Python dependencies via virtualenvs.
2016-07-19 16:37:50 -07:00
Tim Abbott
e876f12b83
settings: Extract settings.WELCOME_EMAIL_SENDER.
2016-07-19 15:28:41 -07:00
Tim Abbott
7725c62892
Use VERBOSE_SUPPORT_OFFERS in day1 emails.
2016-07-19 15:28:41 -07:00
Tim Abbott
3ea4cbb5c3
settings: Extract settings.VERBOSE_SUPPORT_OFFERS.
2016-07-19 15:28:41 -07:00
Tim Abbott
543311848d
templates: Replace not_voyager check with dropboxAppKey check.
...
Also remove useless/confusing value of DROPBOX_APP_KEY in
DEFAULT_SETTINGS (it's overridden by the get_secret call anyway).
2016-07-19 15:28:41 -07:00
Tim Abbott
ff1faffecd
settings: Extract EMAIL_GATEWAY_EXTRA_PATTERN_HACK.
2016-07-19 15:28:41 -07:00
Tim Abbott
82f78621dd
settings: Extract CUSTOM_LOGO_URL.
2016-07-19 15:28:41 -07:00
Tim Abbott
de679a23c9
settings: Extract settings.REGISTER_LINK_DISABLED.
2016-07-19 15:28:41 -07:00
Tim Abbott
c25b077224
settings: Extract settings.SHOW_OSS_ANNOUNCEMENT.
2016-07-19 15:28:41 -07:00
Tim Abbott
ed285e22f1
settings: Remove ZULIP_COM_STAGING setting.
...
This setting is no longer used outside the local_settings.py file for
zulip.com.
2016-07-19 15:28:41 -07:00
Tim Abbott
fb386da552
settings: Extract settings.SAVE_FRONTEND_STACKTRACES.
2016-07-19 15:28:41 -07:00
Tim Abbott
522ccf8eb2
settings: Extract settings.STAGING_ERROR_NOTIFICATIONS.
2016-07-19 15:28:41 -07:00
Tim Abbott
1f4c9eefe4
settings: Extract settings.ZILENCER_ENABLED.
2016-07-19 15:28:41 -07:00
Tim Abbott
0aaa55fb8f
settings: Extract settings.SHARE_THE_LOVE.
2016-07-19 15:28:41 -07:00
Tim Abbott
afaac85dc6
Move get_sqlalchemy_connection to its own file.
2016-07-19 15:28:41 -07:00
Tim Abbott
6a90dc07dc
docs: Fix headings for possible testing issues.
2016-07-19 15:00:14 -07:00
Sumana Harihareswara
d828ba5688
Move testing instructions to main test suite doc.
...
Also, improve links and headers in testing.md.
2016-07-19 14:57:07 -07:00
Sumana Harihareswara
db6c9702c2
Update links in README and integration guide.
2016-07-19 14:57:07 -07:00
Sumana Harihareswara
e98f24734c
Update developer install docs links and image embed.
...
Sphinx/RTD creates different anchor tags for subheadings than
Markdown does, and treats image embedding differently.
This commit updates hyperlinks to affected anchors,
and fixes an image embed for move to RTD.
2016-07-19 14:57:07 -07:00
Sumana Harihareswara
5473b03e3b
Split out generic UNIX developer install doc.
2016-07-19 14:57:07 -07:00
Sumana Harihareswara
9aba0f84a8
Split non-Vagrant Ubuntu install doc into topic page.
2016-07-19 14:57:07 -07:00
Sumana Harihareswara
cf7b1af508
Split developer environment usage instructions into new page.
2016-07-19 14:57:07 -07:00
Sumana Harihareswara
c40ffd9538
Split out docker setup doc.
2016-07-19 14:57:07 -07:00
Sumana Harihareswara
97ff43e972
Move and rearrange vagrant instructions.
2016-07-19 14:57:07 -07:00
Sumana Harihareswara
b95370f833
Move and rearrange developer setup instructions.
...
We aim to consolidate developer documentation on Read The Docs. As a
start, this commit turns the first part of README.dev.md into a topic
page within /docs/ , and links to it from the doc index.
See #669 .
2016-07-19 14:57:07 -07:00
Alex Dehnert
b0f037eb82
Add support for client certs to the Python API.
...
This adds support for passing a client cert (in the format expected by the
`requests` library) to the `Client` constructor, as well as for specifying
one on the command line or in .zuliprc (through new `client_cert` and
`client_cert_key` options).
2016-07-19 14:40:26 -07:00
Eklavya Sharma
d745f20b1b
Run frontend and backend tests in python3 on Travis.
2016-07-19 14:15:35 -07:00
Eklavya Sharma
fd007c4554
Make tools/test-run-dev python3 compatible.
...
Use universal_newlines=True with subprocess.check_output in
tools/test-run-dev.
2016-07-19 14:15:35 -07:00
Eklavya Sharma
e86539649c
Use tools/travis/activate-venv in test suites.
2016-07-19 14:15:35 -07:00
Eklavya Sharma
5054a8d6c9
tools/run-dev.py: Use twisted venv if on python 3.
2016-07-19 14:15:35 -07:00
Eklavya Sharma
cfed816a52
tools/provision.py: Install a python2 venv with twisted.
...
Twisted is not python 3 compatible. So for now create a python2
venv and install twisted in it when running provision.py in python3
mode and use twisted from the python2 venv.
2016-07-19 14:15:35 -07:00
Eklavya Sharma
9c66cb7130
tools/provision.py: Install both py2 and py3 venvs.
...
Install both python2 and python3 venvs in tools/provision.py by
default. Use old behavior when run with --travis to save time.
2016-07-19 23:39:50 +05:30
Eklavya Sharma
eb43f7f581
tools/provision.py: Factor out "--travis" in sys.argv.
2016-07-19 23:39:50 +05:30
Tim Abbott
13c2effb61
update-deployment: Make zulip-dropbox.png logic conditional.
2016-07-19 10:01:14 -07:00
Tim Abbott
6b0d8ecfba
update-deployment: Run create-production-venv as root.
2016-07-19 09:51:13 -07:00
Tim Abbott
07473f4007
update-prod-static: Use a virtualenv to find dependencies.
...
This is needed to support using update-deployment with a virtualenv.
2016-07-19 09:51:13 -07:00
Umair Khan
62c3751b98
06-settings.js: Rearrange code for readability.
2016-07-19 08:57:42 -07:00
Umair Khan
87dc96b474
Disable casper tests for alert words.
...
As they stand now, alert words tests will cause a race condition with
all subsequent tests which access the UserProfile object these tests
modify. Currently, if we modify alert words, we don't get any
notification from the server, issue reported at #1269 . Consequently, we
can't wait on any condition to avoid the race condition. The best option
is to wait for the fix of #1269 and modify the tests in that issue.
Fixes : #1244
2016-07-19 08:57:42 -07:00
Tim Abbott
139bca720d
Upgrade ipython dependency versions.
2016-07-19 00:00:01 -07:00
Tim Abbott
ef4d11e906
Upgrade Python RSA module.
2016-07-19 00:00:01 -07:00
Tim Abbott
40371422cd
Upgrade to typing 3.5.2.2.
2016-07-19 00:00:01 -07:00
Steve Howell
83679a7775
Test search queries and highlight_string().
...
This increases test coverage by exercising highlight_string().
It also gives deeper test coverage to NarrowBuilder.by_search(),
which had test coverage before, but only in terms of inspecting
the SQL that was generated. This test actually runs the SQL
under the hood.
This partly fixes #1006 .
2016-07-18 16:39:19 -07:00
Tim Abbott
50c3e42f0e
Fix test failure due to recent merge interaction.
...
599b15cb84 broke master because it had
previously only been tested before HomeTest was created.
2016-07-18 16:37:25 -07:00
Kartik Maji
599b15cb84
Allow fetching subscribers for streams the user has never subscribed to.
...
This allows the frontend to fetch data on the subscribers list (etc.)
for streams where the user has never been subscribed, making it
possible to implement UI showing details like subscribe counts on the
subscriptions page.
This is likely a performance regression for very large teams with
large numbers of streams; we'll want to do some testing to determine
the impact (and thus whether we should make this feature only fully
enabled for larger realms).
2016-07-18 16:24:19 -07:00
Taranjeet Singh
5462341cb4
zerver/views/webhooks/github.py: Fix lines with length greater than 120.
2016-07-18 15:10:41 -07:00
Taranjeet Singh
3031214718
zerver/views/messages.py: Fix line with length greater than 120.
2016-07-18 15:05:52 -07:00
Tim Abbott
3c591aa724
compilemessages: Don't try to include zh-CN and zh_CN in language options.
2016-07-18 15:02:43 -07:00
Tim Abbott
55a98a41d8
compilemessages: Improve error handling for unknown locale.
2016-07-18 15:02:43 -07:00
Tim Abbott
6d21a1ec65
Update translations data from Transifex.
2016-07-18 15:02:43 -07:00
Taranjeet Singh
84660a5087
zerver/views/__init__.py: Fix lines with length greater than 120.
2016-07-18 14:51:06 -07:00
Taranjeet Singh
0cafd9268d
zilencer/management/commands/populate_db.py: Fix line with len > 120.
2016-07-18 14:42:39 -07:00
Taranjeet Singh
37ea785b8f
zerver/forms.py: Fix line with length greater than 120.
2016-07-18 14:42:39 -07:00
Taranjeet Singh
9f3f82d06d
zerver/lib/socket.py: Fix line with length greater than 120.
2016-07-18 14:42:39 -07:00
Taranjeet Singh
5499136bfd
zerver/views/webhooks/teamcity.py: Fix line with length greater than 120.
2016-07-18 14:42:39 -07:00
Taranjeet Singh
7199ee8f08
zerver/views/webhooks/taiga.py: Fix line with length greater than 120.
2016-07-18 14:42:39 -07:00
Taranjeet Singh
3e17011f9c
zerver/views/webhooks/pivotal.py: Fix line with length greater than 120.
2016-07-18 14:42:39 -07:00
Taranjeet Singh
c437659cd9
zerver/views/webhooks/pingdom.py: Fix line with length greater than 120.
...
zerver/views/webhooks/pingdom.py: Fix indetation for function args.
2016-07-18 14:42:39 -07:00
Taranjeet Singh
7ddb254d2e
zerver/views/webhooks/circleci.py: Fix line with length greater than 120.
...
zerver/views/webhooks/circleci.py: Fix indentation for function args.
2016-07-18 14:42:39 -07:00
Taranjeet Singh
1323685140
zerver/views/webhooks/beanstalk.py: Fix line with length greater than 120.
...
zerver/views/webhooks/beanstalk.py: Capture string in a temp variable.
2016-07-18 14:42:39 -07:00
Taranjeet Singh
569d14a826
zerver/views/webhooks/airbrake.py: Fix line with length greater than 120.
...
zerver/views/webhooks/airbrake.py: Fix Indentation.
zerver/views/webhooks/airbrake.py: Fix Indentation for args in function.
2016-07-18 14:42:39 -07:00
Taranjeet Singh
10afbc06f9
zerver/views/report.py: Fix line with length greater than 120.
...
zerver/views/report.py: Capture string in temporary variables.
2016-07-18 14:42:39 -07:00
Taranjeet Singh
24ba060421
Fix line with length greater than 120 in deliver_email.py.
2016-07-18 14:34:34 -07:00
Eklavya Sharma
38b1353f42
tools/run-dev.py: Clear memcached.
...
Clear memcached when tools/run-dev.py is run. This prevents
errors on using a different python version because values are
pickled before being stored in memcached and different python
versions implement pickling differently.
Also provide a command-line option --no-clear-mc to prevent
memcached from being cleared.
2016-07-18 14:25:13 -07:00
Tim Abbott
014a13df7c
cache: Fix echoing of mkdir command to console.
2016-07-18 14:25:13 -07:00
Taranjeet Singh
4c805b8757
gitignore: Remove unnecessary files and dirs.
2016-07-18 14:13:33 -07:00
Taranjeet Singh
64332d8816
Update linecoverage directory to linecoverage-report.
...
tools/provision.py: Create directory var/linecoverage-report.
tools/run-mypy: Update coverage dir to var/linecoverage-report.
2016-07-18 14:13:33 -07:00
Taranjeet Singh
4d2cb3754c
Update upload dir to var/uploads.
...
tools/provision.py: Create directory var/uploads.
zproject/local_settings_template.py: Update Upload dir to var/uploads.
zproject/dev_settings.py: Update upload dir to var/uploads.
2016-07-18 14:13:33 -07:00
Taranjeet Singh
d4021fc641
zproject/settings.py: Update path for JSON_PERSISTENT_QUEUE_FULENAME.
...
This commit updates the path for JSON_PERSISTENT_QUEUE_FILENAME
to var directory instead of var/log.
2016-07-18 14:13:33 -07:00
Taranjeet Singh
ba3f9de9a9
zerver/lib/cache.py: Move remote_cache_prefix to var directory.
...
This commit ensures the var directory exists before its needed in both
development and production environments.
2016-07-18 14:13:02 -07:00
Steve Howell
8ac1398b0f
Use topic_name() in to_log_dict().
2016-07-18 14:10:11 -07:00
Steve Howell
e341fe0102
Use topic_name() in do_edit_message_assert_error().
2016-07-18 14:10:11 -07:00
Steve Howell
2bfa763c0b
Use topic_name() in update_message_backend().
2016-07-18 14:10:11 -07:00
Umair Khan
4519efa266
Document frontend translation syntax.
...
Fixes : #1090
2016-07-18 13:59:07 -07:00
Umair Khan
b546391f0b
Move locale to static/locale
2016-07-18 13:59:07 -07:00
Umair Khan
cdf2664030
makemessages command should not remove plurals.
2016-07-18 13:59:07 -07:00
Steve Howell
1a9a630526
Add zerver.tests.tests.HomeTest.test_home.
2016-07-18 12:22:14 -07:00
Steve Howell
3869e6d008
Fix docs path in docs/README.md.
2016-07-18 12:03:18 -07:00
Steve Howell
bf58c06f97
Link to migration-renumbering.html in schema-migrations.md
2016-07-18 12:02:50 -07:00
Steve Howell
4f4092ecce
Add docs/migration-renumbering.md
2016-07-18 12:02:50 -07:00
Steve Howell
5fcbd0a178
Remove muting logic in approximate_unread_count().
...
The muting logic in approximate_unread_count() was confusing
stream/subject and only using the first of many stream/subject
pairs, so it was rarely excluding rows from the count, and when
it did exclude rows, they were the wrong rows.
This fixes part of #1300 , but we may want to keep the issue open.
2016-07-18 11:21:51 -07:00
Steve Howell
dc0a26deab
Unify styles for settings panel.
2016-07-18 11:11:32 -07:00
Steve Howell
7a66d74f8f
Merge common compose_table styles.
2016-07-18 11:11:32 -07:00
Steve Howell
287752ee5f
Consolidate CSS styles with similar background color.
2016-07-18 11:11:32 -07:00
Steve Howell
51e35cbad4
Remove empty CSS blocks.
2016-07-18 11:11:32 -07:00
Steve Howell
0c96d39f2e
Fix whitespace in CSS.
2016-07-18 11:11:32 -07:00
Tim Abbott
fb86d91de2
Add missing django-statsd dependency.
...
This dependency is only needed if USING_STATSD is set, and so had
apparently been missed from our dependency list previously (since few
sites use that setting).
2016-07-18 11:01:13 -07:00
Rishi Gupta
3d1251328e
10-admin.js: Comment out failing casper tests.
...
There is a hard to reproduce race condition causing these tests to
occasionally fail. We believe it is caused by switching to the home tab and
not properly waiting for all the messages to load; see Issue #1243 . The
tests are for the following pathway (not a high priority to test):
1. User starts editing a message.
2. allow_message_editing is turned off for the realm (in this case, by the
user going to the admin page and turning it off).
3. User finishes editing the message and hits send.
2016-07-18 10:44:35 -07:00
Tim Abbott
77ccc0d87f
Patch httpoxy security issue.
2016-07-18 10:24:03 -07:00
Eklavya Sharma
bc901ac6d8
tools/travis/py3-backend: Add tools/test-management.
2016-07-18 09:57:28 -07:00
Eklavya Sharma
e10caf0b65
Gracefully give up when using email-mirror on python 3.
...
Running `./manage.py email-mirror` used to fail on python 3
because twisted.mail.imap4 is not python 3 compatible.
Display a message informing the user that email-mirror is not
available on python 3 instead of failing with a traceback.
Also add tools/test-management to py3-backend.
2016-07-18 09:57:28 -07:00
Steve Howell
6afa22f473
Add LogDictTest.test_to_log_dict().
2016-07-17 11:25:02 -07:00
Eklavya Sharma
da36947400
Change unbuffering strategy in runtornado.py.
...
runtornado unbuffers its output using
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0).
This is not python 3 compatible since we can't specify
buffering on a text stream in python 3. So use the '-u'
option of python when calling runtornado.py to make output
unbuffered.
2016-07-17 10:31:15 -07:00
Eklavya Sharma
3ee15feeb8
Make twitter tests more readable.
2016-07-17 10:23:25 -07:00
Eklavya Sharma
c389d22b5f
Fix twitter mock data.
2016-07-17 10:23:25 -07:00
Eklavya Sharma
fb1d00fc6c
Upgrade python-twitter to latest version.
...
Fixes #1145 .
2016-07-17 10:23:25 -07:00
Eklavya Sharma
4130170da8
bugdown: Fix string handling.
...
Use unicode strings where needed and correctly encode/decode strings.
2016-07-17 10:23:25 -07:00
Eklavya Sharma
abe7faa2f9
bugdown: Annotate some variables.
2016-07-17 10:23:25 -07:00
Steve Howell
60bd20da61
Remove zerver/lib/query.py (dead code).
2016-07-16 14:51:15 -07:00
Rishi Gupta
09754c9861
Remove JsonableErrors from actions.do_update_message.
...
There were a bunch of authorization and well-formedness checks in
zerver.lib.actions.do_update_message that I moved to
zerver.views.messages.update_message_backend.
Reason: by convention, functions in actions.py complete their actions;
error checking should be done outside the file when possible.
Fixes : #1150 .
2016-07-15 13:55:49 -07:00
Rishi Gupta
d529a94e4d
Add realm setting to time-limit editing of message content.
...
This is controlled through the admin tab and a new field in the Realms table.
Notes:
* The admin tab setting takes a value in minutes, whereas the backend stores it
in seconds.
* This setting is unused when allow_message_editing is false.
* There is some generosity in how the limit is enforced. For instance, if the
user sees the hovering edit button, we ensure they have at least 5 seconds to
click it, and if the user gets to the message edit form, we ensure they have
at least 10 seconds to make the edit, by relaxing the limit.
* This commit also includes a countdown timer in the message edit form.
Resolves #903 .
2016-07-15 13:55:49 -07:00
Alex Gaynor
a8a2e13096
Upgrade to the latest cryptography.
2016-07-15 12:25:48 -07:00
Rishi Gupta
d34000b211
prod install docs: Make minor fixes and edits.
2016-07-15 11:19:58 -07:00
Eklavya Sharma
29673411df
Make backend tests (hackishly) pass on python3.4.
...
Replace bot_owner=bot_owner by bot_owner_id=bot_owner.id while
creating a UserProfile object.
2016-07-15 11:13:33 -07:00
Eklavya Sharma
8c0d7311ac
zerver/decorator.py: Use BytesIO to read request.
...
Use BytesIO instead of StringIO to get a file-like object on the
request's body.
2016-07-15 11:13:33 -07:00
Umair Khan
8dabc97d9e
Add tests for frontend i18n regexes.
2016-07-15 14:48:09 +05:00
Umair Khan
a07a810a2e
Fix regex for capturing frontned strings.
...
Fixes : #1155
2016-07-15 14:48:05 +05:00
Steve Howell
9d7716f368
Add message.topic_name() helper function.
...
This little helper will facilitate adding a new Topic
table in the future.
2016-07-14 09:54:56 -07:00
Steve Howell
a5b9e3b893
Add test_patch_bot_avatar().
...
Fixes : #1002
2016-07-13 22:53:46 -07:00
Steve Howell
21fb7693d2
Add test_helpers.client_patch_multipart().
2016-07-13 22:53:40 -07:00
Steve Howell
538962f3ca
Add test_add_bot_with_username_in_use().
2016-07-13 22:53:40 -07:00
Steve Howell
468faf5724
Add test_add_bot_with_bad_username().
2016-07-13 22:53:40 -07:00
Steve Howell
de4cc80aa0
Add test_add_bot_with_too_many_files().
2016-07-13 22:53:40 -07:00
Steve Howell
e9ddf28b2c
Add test_add_bot_with_user_avatar().
2016-07-13 22:53:40 -07:00
Preston Hansen
87e485c89f
Add error message when user attempts to submit empty alert word.
...
Resolves #1194 .
2016-07-13 21:07:20 -07:00
Eklavya Sharma
3894ea0e30
Upgrade mypy version.
2016-07-13 21:05:12 -07:00
Tim Abbott
c7819ed177
Fix broken link to old FoundationDB integration.
2016-07-13 21:00:38 -07:00
Tomasz Kolek
f689fbfa4d
Replace old Trello integration with a webhook integration.
...
Fixes : #709 .
[With tweaks on the documentation by tabbott]
2016-07-13 21:00:27 -07:00
Tim Abbott
f8a83fcb11
integrations: Fix top-of-page instructions appearing on every page.
2016-07-13 20:59:38 -07:00
Steve Howell
701bb7a59f
Remove test_helpers.DummySession
2016-07-13 19:08:28 -07:00
Steve Howell
616e49e2e8
Remove test_helpers.DummyTornadoRequest
2016-07-13 19:08:28 -07:00
Steve Howell
0060ea7903
Remove test_helpers.DummyStream
2016-07-13 19:08:28 -07:00
Steve Howell
191ac80475
Remove callback logic from test_helpers.DummyHandler.
2016-07-13 19:08:28 -07:00
Taranjeet Singh
9db457e8fa
provision.py: Create var/coverage directory to store coverage data.
...
test-backend: Update coverage directory to var/coverage.
This commit updates the coverage directory to var/coverage as a part
of Issue 1132.
2016-07-13 18:58:00 -07:00
Tim Abbott
6254e29ebf
update-deployment: Use the virtualenv in deployment process.
2016-07-13 18:56:44 -07:00
Tim Abbott
599f12f94f
update-prod-static: Fix deploy path for language_options.json.
2016-07-13 18:56:37 -07:00
Tim Abbott
baeaf0f870
check-templates: Fix traceback with missing closing tag at end of file.
...
Previously, this would crash with an unclear traceback in this situation.
2016-07-13 18:55:40 -07:00
Eklavya Sharma
d7ea2b8a67
zerver/tests/test_upload.py: Use byte strings.
...
Some string literals are incorrectly marked as `str` strings.
Change them to byte strings.
2016-07-13 16:00:46 -07:00
Eklavya Sharma
a7d2dab28f
Fix non-deterministic output from Taiga integration.
...
Taiga's webhook integration would give output events in a random
order which caused test failures on python 3 (seems like python
3 is more prone to non-deterministic failures). Fix that by
sorting the outputs obtained from events before concatenating them.
2016-07-13 16:00:46 -07:00
Eklavya Sharma
5382aeb385
Render PagerDuty message using ujson.dumps.
...
Use ujson.dumps to render raw messages sent by the PagerDuty
integration instead of using pprint.pformat. pprint.pformat
gives different results on python 2 and 3.
2016-07-13 16:00:46 -07:00
Eklavya Sharma
4f633bcd0b
zerver/lib/notifications.py: Fix string encoding/decoding.
...
Correctly encode and decode strings in convert_html_to_markdown.
It wasn't possible to use universal_newlines=True since
Popen.communicate doesn't encode/decode strings correctly on
python 2.
2016-07-13 16:00:46 -07:00
Eklavya Sharma
e6502710b6
Change exception.message to str(exception).
...
The 'message' attribute in Exception has been deprecated.
It has been removed in python 3.
2016-07-13 16:00:46 -07:00
Eklavya Sharma
993558c680
Get mogrified SQL queries as text.
...
zerver.lib.test_helpers.queries_captured returns a byte string,
while we want the queries to be text. So decode the captured
queries.
2016-07-13 16:00:46 -07:00
Rishi Gupta
94b68baf2f
10-admin.js: Comment out failing casper tests.
...
There is a hard to reproduce race condition causing these tests to
occasionally fail. We believe it is caused by switching to the home tab and
not properly waiting for all the messages to load; see Issue #1243 . The
tests are for the following pathway (not a high priority to test):
1. User starts editing a message.
2. allow_message_editing is turned off for the realm (in this case, by the
user going to the admin page and turning it off).
3. User finishes editing the message and hits send.
2016-07-13 15:59:44 -07:00
Tim Abbott
c0a6672471
Update path to language_options.json in production.
...
The previous code didn't correctly transport language_options.json to
the production environment.
2016-07-13 12:30:45 -07:00
Umair Khan
9f42fda7f4
Use stripped down version of Talon.
2016-07-13 11:24:18 -07:00
Umair Khan
f45848f62f
Install mypy-lang as egg.
...
It seems that --install-option given in any pip requirement
pollutes the pollutes the global space and causes installation
of mypy-lang to give error.
2016-07-13 11:24:18 -07:00
Umair Khan
395e053ce3
Revert "Revert "Extract reply from email.""
...
This reverts commit f1ba3ded42 .
2016-07-13 11:24:18 -07:00
Umair Khan
f15dfc69fb
Make code Python 3 compatible.
...
Make convert_html_to_markdown function Python 3 compatible.
2016-07-13 11:24:18 -07:00
Tim Abbott
34a251adb1
upload: Fix exception uploaded files with unknown content type.
...
It turns out our detected content_type can actually be None, which
meant calling force_text on it broke uploading some files.
2016-07-13 10:57:55 -07:00
Umair Khan
0aae0eab49
Switch to PyAPNS for sending push notifications.
...
Switch to [PyAPNS](https://github.com/djacobs/PyAPNs ).
Fixes #538 .
2016-07-13 10:55:07 -07:00
Umair Khan
636466ff8b
Fix unreliable tests for missed messages.
...
Generate random token using getrandints.
Resolves the proximal issue discussed in #1212 .
2016-07-13 10:51:21 -07:00
Steve Howell
c069c8f1e7
Add test_update_api_key_for_invalid_user().
2016-07-13 07:51:00 -07:00
Steve Howell
aea79517f5
Test bot_owner logic in /json/users
...
This fixes a small gap in our coverage for get_members_backend.
2016-07-12 23:01:56 -07:00
Tim Abbott
af8047967f
Upgrade ujson to latest version (has indent option).
2016-07-12 22:39:06 -07:00
Steve Howell
108ce82571
Add test_api_with_insufficient_permissions().
2016-07-12 22:16:00 -07:00
Steve Howell
cee47e7f82
Add test_api_with_nonexistent_user().
2016-07-12 22:16:00 -07:00
Steve Howell
f43be3bd8f
Add test_updating_non_existent_user().
2016-07-12 22:16:00 -07:00
Tim Abbott
4c8a0340ef
Update requirements docs with LetsEncrypt mention.
2016-07-12 22:15:01 -07:00
Tim Abbott
564d41644d
deactivated: Fix whitespace around before the . end of sentence.
2016-07-12 20:38:49 -07:00
Taranjeet Singh
5971203864
settings: Store uploaded files under var/ in development environment.
2016-07-12 20:33:31 -07:00
Taranjeet Singh
f18f3f4c1a
settings: Move development logs to var/log for development environment.
...
This updates all the paths in ZULIP_PATHS to store logs in the
zulip/var/log directory.
2016-07-12 20:33:31 -07:00
Taranjeet Singh
03384deb86
provision: Create zulip/var/log directory.
...
The purpose of this is to move a lot of the log and other generated
files used by the Zulip development environment into a consistent
hierarchy.
We also need to create this in tools/build-release-tarball as well,
since that runs a development environment out of a temporary
directory.
2016-07-12 20:33:30 -07:00
Rishi Gupta
a3aebb63b7
casper tests: Increase default viewport size.
...
Changed from 1280x768 to 1280x1024 (from 5:3 to 5:4 aspect ratio) to make
failure screenshots more useful.
2016-07-12 19:26:54 -07:00
Tim Abbott
2338421c6d
lint: Add documentation lint check for JavaScript spelling.
2016-07-12 19:22:21 -07:00
Sumana Harihareswara
8257701dc9
Fix formatting & capitalization in testing doc.
2016-07-12 19:14:31 -07:00
Sumana Harihareswara
850d8d1181
Fix formatting, capitalization, & grammar in mypy doc.
2016-07-12 19:14:31 -07:00
Tim Abbott
647cead0d1
slow queries: Include full log line in slow query log.
...
The extra data is useful, and I think this won't make the lines annoying long.
2016-07-12 19:12:49 -07:00
Tim Abbott
305189956b
update_message_flags: Log number of messages updated.
2016-07-12 19:12:49 -07:00
Tim Abbott
4972154df9
setup-production: Improve debugging of build-release-tarball errors.
2016-07-12 19:09:28 -07:00
Tim Abbott
0b7788be6b
Fix indentation in compose.html.
2016-07-12 18:36:02 -07:00
Tim Abbott
d424813687
Fix indentation in deactivated.html.
2016-07-12 18:34:17 -07:00
Tim Abbott
491e98e457
docs: Document the fact that installer is idempotent.
2016-07-12 18:26:44 -07:00
Jeff Fowler
6102110a1b
timerender: Include year in message interstitials.
...
For longer running servers, searching the backlog can become ambiguous
since the date stamps that demarcate the messages only include the month
and day. This commit changes the behavior to include the year for
messages which are more than a year old.
2016-07-12 18:26:42 -07:00
Eklavya Sharma
e28b038f1d
Use assert_in_response by fixing line-wrapping in templates.
2016-07-12 17:52:47 -07:00
Rishi Gupta
235162e000
admin.js: Rename overloaded variable.
...
We were using data for both the request and response data in
$(".administration").on("submit", "form.admin-realm-form".
Left the request data as data to be consistent with the rest of the
file, renamed the response data to response_data.
2016-07-12 17:41:48 -07:00
Steve Howell
3923f94a2b
Remove unused code path in avatar() endpoint.
2016-07-12 17:37:02 -07:00
Steve Howell
3995a5d8eb
Add test coverage for /avatar/<email>
2016-07-12 17:37:02 -07:00
Tomasz Kolek
d0066c37ff
Add bitbucket2 integration.
...
Bitbucket changed the format of their API. The old format is still
useful for BitBucket enterprise, but for the main cloud verison of
Bitbucket, we need a new BitBucket integration supporting the new API.
2016-07-12 17:34:34 -07:00
Tim Abbott
71b3c116bb
local_settings_template: Improve AUTHENTICATION_BACKENDS comments.
2016-07-12 16:19:13 -07:00
Tim Abbott
6301fd22dc
docs: Turn SSO auth documentation into general auth page.
...
Also remove this page from the breadcrumb.
2016-07-12 16:19:13 -07:00
Sumana Harihareswara
6ed73b430a
Change doc links to point to RTD for prod docs.
2016-07-12 15:46:10 -07:00
Sumana Harihareswara
260baff4db
Move prod postgres details to separate page.
2016-07-12 15:46:10 -07:00
Sumana Harihareswara
3a13cf1865
Move prod remote user SSO auth guide to new page.
2016-07-12 15:46:10 -07:00
Sumana Harihareswara
bfa81a80ad
Move prod maintenance guide to new page.
2016-07-12 15:46:10 -07:00
Sumana Harihareswara
76fea4f4d4
Move prod customization guide to new page.
2016-07-12 15:46:10 -07:00
Sumana Harihareswara
07afc9d34b
Move production health check doc to separate page.
2016-07-12 15:46:10 -07:00
Sumana Harihareswara
ec005726c4
Move prod auth and first login doc to new page.
2016-07-12 15:46:10 -07:00
Sumana Harihareswara
7d092d2cc4
Move production install instructions to new page.
2016-07-12 15:46:09 -07:00
Tim Abbott
a10833f489
Simplify title for production requrements page.
2016-07-12 15:44:48 -07:00
Sumana Harihareswara
3f90f9e29e
Move production installation requirements to separate page.
...
To begin the process of consolidating Zulip documentation on Read
the Docs, the requirements are now their own topic page, and
index.rst links to it.
Fixes : #669 .
2016-07-12 15:43:06 -07:00
Tim Abbott
883e991adf
install: Improve support for non-default puppet rules.
...
Previously, the install script would fail if you passed various
non-default puppet rules, since the code to configure and restart
services that runs later on in the install script largely ran
unconditionally, regardless of whether the relevant service was
actually installed on the target system.
This should make the main install script reusable for installing
e.g. a dedicated Postgres server for use with Zulip.
2016-07-12 14:12:09 -07:00
Tim Abbott
80bf7e32a4
Add option to not create a virtualenv.
2016-07-12 14:12:05 -07:00
Steve Howell
f57a17abdf
Lint-check more Django files for indentation.
...
(This starts to address github ticket #1236.)
2016-07-12 14:08:17 -07:00
Steve Howell
52af46a74b
Fix whitespace in keyboard_shortcuts.html
2016-07-12 14:08:17 -07:00
Eklavya Sharma
c98c3d5f8d
Re-enable some backend tests on python 3.
2016-07-12 14:06:29 -07:00
Eklavya Sharma
d740a87d04
zerver/tests: Use unicode strings.
...
* Use unicode strings for strings containing non-ASCII characters.
* Decode response content when text output is expected.
2016-07-12 14:06:29 -07:00
Eklavya Sharma
161c27d0e9
Add methods to AuthedTestCase to test response content.
...
Add methods assert_equals_response and assert_in_response to
AuthedTestCase. These methods make it convenient to check if
a string equals the contents of an HttpResponse's body or if a
string is a substring of the contents of an HttpResponse's body.
2016-07-12 14:06:29 -07:00
Eklavya Sharma
2080ff6c2a
Decode response.content everywhere except in tests.
...
response.content is binary data, but code usually assumes it to
be text. Fix this by decoding response.content where required.
Don't do this in tests yet.
2016-07-12 14:06:29 -07:00
Steve Howell
97f28f3792
Revert "Close HTML singleton tags in Casper files."
...
This reverts commit 520b255d95 ,
and also blacklists Casper files from our linter.
2016-07-12 13:35:50 -07:00
Steve Howell
45d1eefc52
Add test_create_user_backend().
...
This tests provides full line coverage on the
create_user_backend view.
2016-07-12 12:29:24 -07:00
Sumana Harihareswara
2ece2192d9
Fix misspelling in HTML CSS documentation.
2016-07-12 14:15:23 -04:00
Tim Abbott
5d990c28d0
Fix running run-mypy from any working directory.
2016-07-12 10:39:33 -07:00
Tim Abbott
497142d7b1
Fix running test-backend from any working directory.
2016-07-12 10:39:33 -07:00
Tim Abbott
b39e113fef
settings: Fix path to dev-secrets.conf with arbitrary working directory.
2016-07-12 10:39:33 -07:00
Tim Abbott
ace8ae8301
puppet: Fix supervisor restart rule catching itself in pgrep.
2016-07-12 10:39:33 -07:00
Eklavya Sharma
05c9f09850
Annotate zulip_tools.py.
2016-07-12 10:10:22 -07:00
Eklavya Sharma
934a0f7c6c
Add tools/test-backend to py3-backend test suite.
2016-07-12 09:27:55 -07:00
Eklavya Sharma
73a3c9fa47
On python 3, skip expected failures in backend tests.
2016-07-12 09:27:55 -07:00
Eklavya Sharma
4868cd9969
zerver/lib/test_helpers.py: Add skip_py3 decorator.
2016-07-12 09:27:55 -07:00
Eklavya Sharma
0a9c600c8b
Show skipped tests in test runner.
2016-07-12 09:27:55 -07:00
Eklavya Sharma
5de91c4115
Use subprocess_text_output in tools/provision.py.
2016-07-12 20:25:20 +05:30
Tim Abbott
4f41aa0c0d
Update ipython to version 5.0.0.
...
iPython 5.0.0 has awesome syntax highlighting.
2016-07-11 21:32:11 -07:00
Eklavya Sharma
158d67e702
Run tools/test-migrations in Travis.
2016-07-11 21:30:32 -07:00
Eklavya Sharma
57ce3f4af1
tools/travis/lint-all: Factor out error message.
2016-07-11 21:30:32 -07:00
Eklavya Sharma
958335bdb3
Change all default values in models to unicode.
2016-07-11 21:30:32 -07:00
Eklavya Sharma
51239f225b
Mention build name in docs.
...
Mention in docs that tools/run-mypy and tools/check-py3k are run
in the 'static-analysis' build.
2016-07-11 21:28:01 -07:00
Eklavya Sharma
08a4555e0f
Merge mypy and py3k test suites in Travis.
2016-07-11 21:28:01 -07:00
Eklavya Sharma
0de3b17f19
tools/test-backend: Add option to skip generate-fixtures.
...
Not calling generate-fixtures can reduce running time, which is
especially helpful when running a single test.
2016-07-12 09:34:37 +05:30
Tomasz Kolek
d7c7279523
Add is_status_message method to Message model.
2016-07-11 12:09:06 -07:00
Eklavya Sharma
d139f13e57
Remove output.txt.
...
It was accidentally added in 1f3ce7cf38 .
2016-07-11 22:55:05 +05:30
Tim Abbott
e21bc11cfd
Extract attachment_url_to_path_id.
2016-07-10 18:07:37 -07:00
Tim Abbott
48ae178d0b
Refactor attachment_url_re to be a common value in upload.py.
2016-07-10 18:04:58 -07:00
rahuldeve
c5756e4fa4
Update attachment tracking on message update.
2016-07-10 18:01:59 -07:00
Tim Abbott
3647973069
update_message_backend: Reorganize validation checks.
...
The new organization more clearly does the permission check first.
2016-07-10 18:01:59 -07:00
Tim Abbott
05632b68e1
edit: Add validation for setting empty content.
2016-07-10 18:01:59 -07:00
Tim Abbott
0d418d5695
Add some message editing tests for invalid input.
2016-07-10 18:01:59 -07:00
Tim Abbott
211a166abc
message edit: Move new topic non-empty check to view.
2016-07-10 18:01:59 -07:00
Eklavya Sharma
0900ca5353
Replace assertItemsEqual by assertEqual.
...
This is needed because assertItemsEqual doesn't exist in python 3.
2016-07-10 17:33:11 -07:00
Tim Abbott
f513a68ac9
lint-all: Check for missing whitespace before { in CSS.
...
Also fix the existing violations of this rule.
2016-07-10 17:29:36 -07:00
Rishi Gupta
43c2f35776
Add realm setting to disable message editing.
...
This is controlled through the admin tab and a new field in the Realms
table. This mirrors the behavior of the old hardcoded setting
feature_flags.disable_message_editing. Partially resolves #903 .
2016-07-10 11:57:24 -07:00
Rishi Gupta
07e7230ae1
models.py: Add post_save to Message.
...
Flushes message from cache after a message.save(). Needed for tests
where we directly manipulate Message objects in the database.
2016-07-10 11:42:18 -07:00
Eklavya Sharma
f1ba3ded42
Revert "Extract reply from email."
...
This reverts commit f1f48f305e .
The use of sklearn unfortunately caused a substantial slowdown to the
Zulip provisioning process, which didn't seem worth it for a
relatively minor feature.
2016-07-10 11:30:30 -07:00
Eklavya Sharma
9161ddaee0
zerver/middleware.py: Handle binary data in errors.
...
In write_log_line, error_content can be binary_type and
error_content_iter can be a Sequence of binary_type. Handle
this this in a python 3 compatible way. Also change annotations
to reflect this fact.
2016-07-10 11:30:13 -07:00
Tim Abbott
88368397aa
lint-all: Add Python check for space after if.
2016-07-10 10:58:16 -07:00
Tim Abbott
dfc9e75342
nginx: Enable shared SSL session cache.
2016-07-10 08:30:10 -07:00
Alex Gaynor
ee47da8790
nginx: Disable RC4 and prefer server cipher order.
2016-07-10 08:30:05 -07:00
Steve Howell
c671881713
decorators: Extract is_local_addr().
2016-07-09 17:58:48 -07:00
Steve Howell
8e528569a7
Clean up rate_limit() for deployments that opt out.
...
If settings.RATE_LIMITING is False, short circuit rate
limiting earlier in rate_limit(). This change particularly
avoids inspect request.user and possibly spamming the error
log for sites that don't care about rate limiting.
2016-07-09 17:58:20 -07:00
Eklavya Sharma
801bcdd956
zerver/tests/tests.py: Fix non-deterministic failure.
...
Replace occurences of list(d.keys()) by sorted(d.keys()).
2016-07-09 17:54:54 -07:00
Eklavya Sharma
1f3ce7cf38
zerver/worker/queue_processors.py: Open file in binary.
...
Open a file in binary mode instead of text mode.
2016-07-09 17:54:54 -07:00
Eklavya Sharma
2f2e543a0e
zerver/tests/tests.py: Replace assertItemsEqual.
...
Replace assertItemsEqual(a, b) by assertEqual(sorted(a), sorted(b))
because assertItemsEqual has been removed in python 3.
2016-07-09 17:54:54 -07:00
Steve Howell
a8f11501eb
Add htmlcov directory to .gitignore.
2016-07-09 17:37:30 -07:00
Steve Howell
538bc61c54
Check more html files in check-templates.
...
Instead of just checking .html files in the templates directory,
we now also check them everywhere, including .html files used
for Casper tests and some static files.
2016-07-09 17:34:49 -07:00
Steve Howell
494ea4a4f4
Fix end tags in 404/5xx pages.
2016-07-09 17:34:49 -07:00
Steve Howell
520b255d95
Close HTML singleton tags in Casper files.
2016-07-09 17:34:49 -07:00
Tim Abbott
4d28111178
Move alert_words CSS to settings.css.
2016-07-09 08:01:54 -07:00
Tim Abbott
a43021005a
Remove unused notification-docs CSS.
2016-07-09 08:01:19 -07:00
aakash-cr7
63475a55f3
Add bots and avatars css to settings.css.
2016-07-09 08:01:12 -07:00
aakash-cr7
e37e384dd4
Add notification css to settings.css.
2016-07-09 07:53:51 -07:00
Steve Howell
89105e41d7
Added TestInternalNotifyView.
2016-07-09 07:47:12 -07:00
Steve Howell
ce14a3551d
Added test_get_client_name().
2016-07-09 07:37:13 -07:00
Steve Howell
69f18c26fc
Improve test_api_key_only_webhook_view().
...
This test now covers all lines of api_key_only_webhook_view(),
including the error logic and rate limiting logic.
2016-07-09 07:37:13 -07:00
Steve Howell
3d095beb63
Extracted client_is_exempt_from_rate_limiting().
2016-07-09 07:37:13 -07:00
Steve Howell
49543b9ec4
Added RateLimitTestCase tests.
2016-07-09 07:37:13 -07:00
Steve Howell
c680c6a981
Removed unused to_non_negative_float() function.
2016-07-09 07:37:13 -07:00
Umair Khan
b7ec66fc96
Remove templates, styles and js through storage.
2016-07-09 07:33:35 -07:00
Umair Khan
397da44744
Update documentaton to reflect Django-Pipeline==1.6.8.
2016-07-09 07:09:55 -07:00
Umair Khan
043ae8ad65
Upgrade to Django-Pipeline==1.6.8.
2016-07-09 07:09:55 -07:00
Umair Khan
2d243c0703
get_all_templates should not return __init__.py.
2016-07-09 07:09:55 -07:00
Tim Abbott
1e2d38e790
Move stringify_message_dict into to_dict_uncached.
2016-07-08 17:58:56 -07:00
Tim Abbott
72e948d19a
Remove now-unused message_cache_key message cache.
...
Originally this cache was used to transmit data from Django to Tornado
(and also for general message caching purposes), but now nothing
actually reads from this cache, so we can eliminate it.
2016-07-08 17:58:56 -07:00
Tim Abbott
8d5ec14b31
cache_helpers: Fill to_dict cache instead of old message cache.
...
Apparently, the message cache we were filling was completely useless
and unused, and furthermore, the cache we were filling as part of
restarting the server was also totally useless, since it didn't have
the messages users would be requesting.
2016-07-08 17:58:56 -07:00
Steve Howell
704c57a141
Fix end tag issues in api.html
...
(This fixes a minor style issue with the API keys/bots section,
but the change is mostly to make the HTML have balanced tags.)
2016-07-08 16:30:49 -07:00
Steve Howell
e35b84d438
Have lint-all pass along -m to check-templates.
2016-07-08 16:30:49 -07:00
Steve Howell
6154c73125
Support -m flag to check only modified templates.
2016-07-08 16:30:49 -07:00
Steve Howell
d1964a243e
Use lister module to find files for linting.
2016-07-08 16:30:49 -07:00
Steve Howell
1006b95898
Extract check_handlebar_templates.
2016-07-08 16:30:49 -07:00
Steve Howell
4e326ed138
Extract check_django_templates.
2016-07-08 16:30:49 -07:00
Steve Howell
3e9ceaeaf0
Move templates check to ok() function.
2016-07-08 16:30:49 -07:00
Tim Abbott
ea089518ee
Add Zulip customizations to Postgres 9.5 config file.
...
This includes reasonable tuning of memory usage parameters based on
the values that pgtune would use, roughly.
2016-07-08 16:16:12 -07:00
Tim Abbott
e818dff0b0
postgres: Remove comment matching Puppet ERB syntax.
2016-07-08 16:16:12 -07:00
Tim Abbott
6ba659aeec
Add a stock Ubuntu Xenial Postgres 9.5 configuration file.
2016-07-08 16:16:12 -07:00
Tim Abbott
0f5e62e994
puppet: Don't use pgtune on Linux versions where it doesn't exist.
2016-07-08 16:16:12 -07:00
Tim Abbott
903f728587
Scope postgresql.conf templates by postgres version.
2016-07-08 16:16:12 -07:00
Tim Abbott
ffe79e0d50
Fix EPMD restart being attempted on every puppet apply.
2016-07-08 16:16:11 -07:00
Tim Abbott
b13eeae24c
Remove finbot from Zulip repository.
...
It's been split into its own repository,
https://github.com/zulip/finbot .
2016-07-08 16:15:55 -07:00
Tim Abbott
12028339a3
puppet: Use --detailed-exitcodes to return nonzero exit code on failure.
...
Apparently, puppet has messed up exit codes and doesn't by default
return the usual 0=success, nonzero=failure codes. By default, it
seems to always return 0; and with `--detailed-exitcodes`, it returns
the complicated thing documented in the comments.
We fix this by checking the exit code and translating it to what we
actually care about, namely whether errors occurred.
See https://tickets.puppetlabs.com/browse/PUP-2754 for details.
Fixes #1094 .
2016-07-08 12:11:44 -07:00
Taranjeet
a8a4caf2c0
zerver: Fix lines with length greater than 120.
2016-07-08 11:41:43 -07:00
Tim Abbott
be93b6ea28
[third] Upgrade jquery to version 1.8.3.
...
Also use the modern NPM name of 'jquery' (all lower case), which is
required as part of this migration.
Fixes #1141 .
2016-07-08 11:09:54 -07:00
Tim Abbott
cb18ef07a7
Rename hashchange.zulip event to avoid jquery 1.8 interaction.
2016-07-08 11:09:09 -07:00
Tim Abbott
d5be9e8b2d
Upgrade django-auth-ldap to 1.2.8.
...
The new version is needed for Python 3 support.
Fixes #1175 .
2016-07-08 11:08:08 -07:00
Umair Khan
f1f48f305e
Extract reply from email.
2016-07-08 10:58:25 -07:00
Umair Khan
75bd3541ea
Add tests for new email policy.
...
- Update test_extra_context_in_missed_stream_messages
- Add test_extra_context_in_personal_missed_stream_messages
- Add test_extra_context_in_huddle_missed_stream_messages
2016-07-08 10:58:25 -07:00
Umair Khan
8538ba8ea8
Remove do_send_missedmessage_events function.
2016-07-08 10:58:25 -07:00
Umair Khan
06355105f5
Missed message emails should come from user email.
...
Fixes #448
FIxes #612
2016-07-08 10:58:25 -07:00
Eklavya Sharma
aa68fd1679
Run tools/lint-all on Travis in python 3.
2016-07-08 10:43:48 -07:00
Eklavya Sharma
618410fa1a
.travis.yml: Set BOTO_CONFIG to bogus value.
...
See https://github.com/travis-ci/travis-ci/issues/5246 .
2016-07-08 11:38:57 +05:30
Eklavya Sharma
52129c03c8
requirements/py3_common.txt: Add missing packages.
...
These packages are imported but not used during setup. So it's
okay to include them even if zulip doesn't support them yet.
2016-07-08 11:38:57 +05:30
Tim Abbott
367f6e5bf7
Vagrantfile: Add option for setting the port used on the host.
...
This makes it easier to (for example) run a Zulip development
environment on a host machine and sometimes run a Vagrant guest
inside.
2016-07-07 15:17:44 -07:00
Tim Abbott
3dee8a3dcb
README.dev.md: Use wildcard when copying tsearch data.
2016-07-07 15:12:37 -07:00
Tim Abbott
8b92775daa
README.dev.md: Fix path to emoji_dump scripts.
2016-07-07 15:11:26 -07:00
Tomasz Kolek
581f076d57
Automatically gather logs from provisioning.
...
Fixes : #1156 .
2016-07-07 14:58:16 -07:00
Tomasz Kolek
c15695e514
Add support for running test-js-with-node on particular files.
...
Fixed : #1127 .
2016-07-07 14:32:07 -07:00
Eklavya Sharma
3e9349df4f
zerver/decorator.py: Use force_bytes instead of encode.
...
The value type of request.META is str, not text type.
So use force_bytes on the data instead of encode('utf-8').
2016-07-08 01:24:30 +05:30
Eklavya Sharma
4cf7641ab1
zerver/tests/test_i18n.py: Ignore due to incomplete stubs.
...
In python 3, http.cookies has incomplete stubs.
2016-07-07 12:42:51 -07:00
Eklavya Sharma
6c3f1bb967
beanstalk.py: Encode and decode strings correctly.
2016-07-07 12:42:51 -07:00
Eklavya Sharma
26b8e7357a
zerver/views/messages.py: Operate on bytes in highlight_string.
2016-07-07 12:42:51 -07:00
Umair Khan
53662ccd11
Cache email address hint content.
...
This substantially improves the performance of loading the
/#subscriptions page with 1000+ streams in the realm.
2016-07-07 11:39:52 -07:00
Eklavya Sharma
83640ed0cd
runtornado.py: Ignore due to incorrect stubs.
2016-07-07 10:09:35 -07:00
Eklavya Sharma
6fd8906358
rename_stream.py: Fix broken code.
...
* get_realm returns None if no matching realm is present, but
create_stream.py assumed it raises Realm.DoesNotExist.
* encoded/decode strings properly.
2016-07-07 10:08:29 -07:00
Eklavya Sharma
c679c180f5
enqueue_file.py: Add type hint for mypy.
2016-07-07 10:07:51 -07:00
Eklavya Sharma
896c18a57b
email-mirror.py: Make it pass on mypy in python 3.
...
* Replace filter by list comprehension.
* Add '# type: ignore' to statements which use attributes from
modeule `posix`, since stubs for posix are missing on python 3.
2016-07-07 10:07:28 -07:00
Eklavya Sharma
17cb6e00bd
create_stream.py: Fix broken code.
...
* get_realm returns None if no matching realm is present, but
create_stream.py assumed it raises Realm.DoesNotExist.
* encoded/decode strings properly.
2016-07-07 10:06:39 -07:00
Eklavya Sharma
7956fcbf0d
zerver/lib/str_utils.py: Allow specifying encoding.
2016-07-07 10:06:22 -07:00
Eklavya Sharma
63d55bdd86
zerver/views/__init__.py: decode b64encoded ccache.
...
Convert b64encoded ccache to `str` before passing to
subprocess.check_call.
2016-07-07 10:02:08 -07:00
Eklavya Sharma
628e45defc
zerver/lib/actions.py: Use text_type in truncate_ functions.
...
The functions truncate_content, truncate_body and truncate_topic
are only meant to be used on text strings. So change its
parameter types from AnyStr to text_type.
2016-07-07 10:02:08 -07:00
Eklavya Sharma
976858f536
tornado_ioloop_logging.py: Ignore because of missing stub.
...
There is no stub for select.epoll on python 3. So ignore the
statement which uses it.
2016-07-07 10:02:08 -07:00
Eklavya Sharma
9d2a539aaa
zerver/lib/notifications.py: Add hints for mypy.
...
Add type hints for mypy using isinstance in assert and if.
2016-07-07 10:02:08 -07:00
Tim Abbott
98db1d996f
email_mirror: Fix some indentation issues.
2016-07-07 10:02:08 -07:00
Eklavya Sharma
5e81a4d93f
zerver/lib/email_mirror.py: Improve annotation in python 3.
...
Add asserts and if statements to help mypy.
2016-07-07 10:01:30 -07:00
Eklavya Sharma
4f221c21a0
zerver/lib/email_mirror.py: Improve subject extraction.
...
Improve subject extraction in process_message.
2016-07-07 09:55:23 -07:00
Eklavya Sharma
06a7a6caee
zerver/lib/debug.py: Remove from mypy's exclude_py3.
...
traceback.print_stack doesn't have a stub yet. So ignore the
statement which uses it.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
6bb266d262
bugdown's __init__.py: Add python 3 compatibility.
...
* Use Response.text instead of Response.content.
* Make unescaping work on python 3.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
05046d9288
bugdown's codehilite.py: Fix annotations in python 3 mode.
...
Many stubs in xml.etree.ElementTree use Union[str, bytes] as
return type. Mypy wants us to correctly handle each case. This
is correct, but not useful for us since we know that we'll always
get str. So force the return value to text_type, to supress mypy
errors.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
610f19c791
zerver/lib/camo.py: Type ignore statement with hex encode.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
6a63870136
zerver/decorator.py: Correctly encode/decode strings.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
4e698ab1f6
Remove zerver/lib/parallel.py from mypy's exclude_py3.
2016-07-07 09:52:24 -07:00
Eklavya Sharma
5e8dba4c75
Add mypy in python 3 mode to travis.
...
This helps catch Python 3 compatibility issues.
2016-07-07 09:44:00 -07:00
Kartik Maji
e5a3339725
Add search box for filtering users to add when creating new streams.
...
Fixes : #779 .
2016-07-06 16:01:33 -07:00
Tim Abbott
8fb4e161dd
Disable browser autocomplete adding stream members.
...
We have our own autocomplete, and the two forms of autocomplete
conflict with each other awkwardly.
2016-07-06 16:01:16 -07:00
Rishi Gupta
7ef434ec62
08-edit: Change how we wait for messages to be sent in casper tests.
...
We originally waited for .message_edit_notice to appear, now we wait for
textarea.message_edit_content to disappear.
This is better because the previous code didn't correctly handle
editing the same message twice (the "EDITED" tag would still be there
from the first edit, so it wouldn't wait at all the second time!).
2016-07-06 15:27:13 -07:00
Taranjeet
a137bf15ed
Wrap some lines with length greater than 120.
...
With some tweaks by tabbott.
2016-07-06 14:35:16 -07:00
Eklavya Sharma
e26afeeecf
Add .coverage to .gititnore.
2016-07-06 14:25:09 -07:00
Eklavya Sharma
4f181acb83
Add python 3 mode to provision.py.
...
When provision.py is run using python 2, retain original behavior
of creating a python 2 venv using requirements/py2_dev.txt and
creating a python 3 venv using requirements/mypy.txt.
When provision.py is run using python 3, install a single python 3
venv with requirements/py3_dev.txt.
2016-07-06 13:50:55 -07:00
Eklavya Sharma
cdc067e751
tools/provision.py: Use universal_newlines=True.
2016-07-06 13:50:55 -07:00
Eklavya Sharma
7e020e3dae
scripts/lib/setup_venv.py: Use universal_newlines=True.
...
In python 3, subprocess uses bytes for input and output if
universal_newlines=False (the default). It uses str for input and
output if universal_newlines=True.
Since we're dealing with strings here, add universal_newlines=True
to subprocess.check_output calls.
2016-07-06 13:50:55 -07:00
Eklavya Sharma
ce6ddd574a
zerver/lib/test_helpers.py: Replace os.path.walk by os.walk.
...
os.path.walk has been removed in python 3.
2016-07-06 11:49:55 -07:00
Eklavya Sharma
6505cbf2bf
zerver/lib/timeout.py: Replace isAlive by is_alive.
...
In threading.Thread, isAlive has been removed in python 3.
We should use is_alive instead.
2016-07-06 11:49:48 -07:00
Eklavya Sharma
d8de54abe5
zerver/migrations: Squash an AlterField from 0002 into 0001.
...
Squash the AlterField on UserProfile.groups in 0002 into the
AddField in 0001. This is done to avoid a probable bug in Django,
where running migrations in python 3 sometimes led to a KeyError.
2016-07-06 11:40:12 -07:00
Umair Khan
05d36626e8
Revert "Revert "Add casper tests for default language setting.""
...
This reverts commit ce1676e219 .
Now that we've fixed the English locale being missing, these tests
should work again.
2016-07-06 11:35:17 -07:00
Umair Khan
47fb293f8a
i18n: Add English locale to language list if missing.
...
The English locale data is only present if the user has run `manage.py
makemigrations` on the system.
2016-07-06 11:34:28 -07:00
Tim Abbott
84dac8950f
Add language_options.json to .gitignore.
2016-07-06 10:30:45 -07:00
Tim Abbott
ce1676e219
Revert "Add casper tests for default language setting."
...
This reverts commit e4b32905bf .
This new test was failing in Travis CI.
2016-07-04 12:45:18 -07:00
Eklavya Sharma
2d4dcd1698
Replace bytes by strings in zerver migrations 2, 13, 18.
2016-07-04 12:08:37 -07:00
Eklavya Sharma
6553e16b89
Replace bytes by strings in zerver/migrations/0001.
2016-07-04 12:08:37 -07:00
Eklavya Sharma
90f306421f
Replace bytes by strings in zilencer/migrations.
2016-07-04 12:08:37 -07:00
Umair Khan
e4b32905bf
Add casper tests for default language setting.
...
Fixes #1076 .
2016-07-04 11:56:31 -07:00
Umair Khan
054d14bb96
Add documentation to announce default language setting.
2016-07-04 11:56:24 -07:00
Umair Khan
4c178bc00f
Improve the alert messages for display settings.
2016-07-04 11:56:02 -07:00
Umair Khan
035fceb814
Add dynamically loaded language dropdown.
2016-07-04 11:56:02 -07:00
Conrad Dean
bbf7a9c801
Annotate zerver/lib/event_queue.py.
2016-07-04 03:01:33 +05:30
Conrad Dean
9812e676f0
Annotate zerver/lib/queue.py.
2016-07-04 03:01:32 +05:30
Eklavya Sharma
192663edcf
zerver/lib/narrow.py: Fix annotations.
2016-07-04 03:01:32 +05:30
Eklavya Sharma
95b6e668a7
zerver/lib/actions.py: Fix annotations.
...
Change queue_ids from text_type to str.
2016-07-04 03:01:32 +05:30
Eklavya Sharma
9772a512cb
Use abstract types in annotations.
2016-07-04 03:01:32 +05:30
Eklavya Sharma
fdf4d67cde
zerver/tornado.py: Convert queue_id to str.
2016-07-04 02:58:57 +05:30
Eklavya Sharma
de19b24f74
zerver/lib/handlers.py: Fix an annotation.
2016-07-04 02:20:25 +05:30
Eklavya Sharma
4761cc27dd
zerver/middleware.py: Fix annotations.
...
* Use abstract types where relevant.
* Fix string types.
* Fix annotation of args and kwargs.
2016-07-04 02:14:42 +05:30
Eklavya Sharma
f1b72c5f41
Upgrade wheel before installing venv requirements.
...
This is required because an older wheel version causes problems
when building wheels on python 3.
2016-07-02 11:53:26 -07:00
Eklavya Sharma
7daa40bf4f
Add python3-specific requirements files.
2016-07-02 11:53:26 -07:00
Eklavya Sharma
fea6c56978
Move packages from prod.txt to py2_prod.txt.
2016-07-02 11:53:26 -07:00
Eklavya Sharma
bf345a0b30
Move packages from common.txt to py2_common.txt.
2016-07-02 11:53:26 -07:00
Eklavya Sharma
0b714ea6c6
Use python2-specific requirements files.
2016-07-02 11:53:26 -07:00
Eklavya Sharma
146dc310a7
Add python2-specific requirements files.
...
For now just make these files point to their non-specific
counterparts.
2016-07-02 11:53:26 -07:00
Eklavya Sharma
6d8ba90db9
zerver/models.py: Modify imports for mypy in py3 mode.
...
Change 'from zerver.lib import bugdown' to
'import zerver.lib.bugdown as bugdown' to make zerver/models.py
pass mypy check in python 3 mode.
2016-07-02 10:38:48 -07:00
Eklavya Sharma
dcd568960b
Add files to mypy's python 3 exclude list.
2016-07-02 10:38:48 -07:00
Eklavya Sharma
5879e18bad
Add a 'type: ignore' in zulip_tools.py.
...
Subprocess.CalledProcessError's __init__ takes 4 arguments out
of which 2 are optional. It is being passed 2 arguments in
zulip_tools.py. However, python 3 stubs are incorrect and only
1 argument has been marked as default.
See https://github.com/python/typeshed/pull/329 .
Add '# type: ignore' to that line so that mypy check passes in
python 3 mode.
2016-07-02 10:38:48 -07:00
Eklavya Sharma
b44ae38bff
tools/run-mypy: Add Python 3 mode.
2016-07-02 10:38:48 -07:00
Eklavya Sharma
b902c1ae45
bugdown: Replace raw unicode literal with non-raw.
...
Raw unicode literals are disallowed in python 3.
2016-07-02 10:38:48 -07:00
Eklavya Sharma
3177cee740
Upgrade pyflakes.
2016-07-02 08:01:53 +05:30
Eklavya Sharma
766e055229
Upgrade six.
2016-07-02 08:01:48 +05:30
Krit Karan
406cce7027
README: Repoint translating documentation at RTD.
2016-07-01 10:11:48 -07:00
Krit Karan
6c38023cbb
REAMDE: Fix (transifex) to [transifex].
...
This caused the Transifex link to be broken.
2016-07-01 10:11:33 -07:00
Eklavya Sharma
61d052ae41
Upgrade mypy version.
2016-07-01 20:16:36 +05:30
Tim Abbott
3b16daad18
provision: Add a shebang line.
2016-06-30 22:34:58 -07:00
Kartik Maji
f8bb7503e6
Add ability to pin streams to top of the streams sidebar list.
...
Based on work by Lauren Long, with some tweaks by tabbott.
2016-06-30 22:26:09 -07:00
Kartik Maji
a32167d921
test_events: Sort subscribers list.
...
The subscribers list is appended to in `peer_add` events with not
regard for preserving the ordering, and ordering isn't really
important here, so it seems best to just sort it in these checks.
2016-06-30 16:52:51 -07:00
Vishnu Ks
1cbd39b768
Unique link generator for realm creation.
2016-06-30 15:52:41 -07:00
Alex Wilson
8c62cff1b7
bugdown: Clean up paths to emojis.
2016-06-30 15:48:02 -07:00
Alex Wilson
2f47945981
Separate unicode emojis from named emojis.
2016-06-30 15:48:02 -07:00
Alex Wilson
b040839c76
Add unicode emoji to frontend markdown parser.
...
Fixes 2nd half of #1011 .
2016-06-30 15:48:02 -07:00
Alex Wilson
5ec29101eb
Add unicode emoji support to bugdown.
...
Fixes half of #1011 .
2016-06-30 15:48:02 -07:00
Alex Wilson
434c8d4b08
Add codepointat.js, a polyfill for String.prototype.codePointAt().
2016-06-30 15:48:02 -07:00
Tim Abbott
ee8ce48d63
settings: Make STATIC_ROOT always an absolute path.
2016-06-30 15:48:02 -07:00
Tim Abbott
cccf748244
index.html: Fix webpack URL.
...
This was accidentally changed in
a78c1b9750 .
2016-06-30 15:48:02 -07:00
Tim Abbott
0397855fdd
test_hooks: Use send_json_payload for private message tests.
2016-06-30 15:12:03 -07:00
Tim Abbott
a78c1b9750
Fix casper tests hanging while development server is running.
...
This works around a nasty problem with Webpack that you can't run two
copies of the Webpack development server on the same project at the
same time (even if on different ports). The second copy doesn't fail,
it just hangs waiting for some lock, which is confusing; but even if
that were to be solved, we don't actually need the webpack development
server running to run the Casper tests; we just need bundle.js built.
So the easy solution is to just run webpack manually and be sure to
include bundle.js in the JS_SPECS entry.
As a follow-up to this change, we should clean up how test_settings.py
is implemented to not require duplicating code from settings.py.
Fixes #878 .
2016-06-30 14:18:50 -07:00
Rishi Gupta
17b6d136d5
Add Semaphore webhook integration.
2016-06-29 16:36:19 -07:00
Vishnu Ks
e4b72c3a65
Move respond_to_message to compose.js.
2016-06-29 13:04:02 -07:00
Eklavya Sharma
def8cd8e78
Annotate zerver/lib/timeout.py.
2016-06-29 10:41:01 -07:00
Eklavya Sharma
88354ad1fc
zilencer's populate_db.py: Remove unnecessary cast to text_type.
2016-06-29 10:36:50 -07:00
Eklavya Sharma
21f789eb05
zerver/lib/session_user.py: Replace Dict by Mapping.
2016-06-29 10:36:50 -07:00
Eklavya Sharma
b76dc9bf4e
zerver/lib/upload.py: Fix string types.
2016-06-29 20:43:28 +05:30
Tim Abbott
f094123fd3
install: Add support for installing Xenial systems.
...
This isn't fully supported yet, but merging this makes it more
convenient to test Zulip on Ubuntu Xenial.
2016-06-28 23:05:38 -07:00
Tim Abbott
4ea75528ea
docs: Expand instructions for Zulip localhost SSO.
...
In particular, this makes it clear how to set the basic HTTP auth
version quickly.
2016-06-28 23:05:38 -07:00
Tim Abbott
abc2c03b0f
Fix missing 'current_url' value in registration flow.
...
This fixes some tracebacks I got while testing the Zulip htpasswd SSO
functionality.
I think that this stopped working as a result of the Jinja2 migration.
2016-06-28 23:05:38 -07:00
Tim Abbott
809a45394f
puppet: Start supervisord if it isn't running on restart.
2016-06-28 22:09:36 -07:00
Tim Abbott
058d0ab0ec
README.prod.md: Cleanup letsencrypt installation instructions.
...
Installing `nginx` is problematic, because it means something is using
port 80 and thus `letsencrypt-auto --standalone` doesn't work. But we
do want `openssl` so that the directory trees we create symlinks in
will exist.
2016-06-28 22:08:56 -07:00
Tim Abbott
5ce0637da9
run-mypy: Explode exclude lists to specific files.
2016-06-28 16:42:59 -07:00
Tim Abbott
56e7a2f6f3
Annotate zerver.migrations.
2016-06-28 16:38:33 -07:00
Tim Abbott
c8aae360be
test-backend: Fix spelling of an example in usage text.
2016-06-28 16:24:58 -07:00
Eklavya Sharma
2cba2caa7f
zerver/lib/test_helpers.py: Fix string annotations.
2016-06-29 01:54:17 +05:30
Eklavya Sharma
d9eb711e5e
zerver/tests/test_helpers.py: Use text_type for api_keys.
...
Also encode/decode strings appropriately when using api_keys to generate
basic auth header.
Also fix clashing annotations in zerver/tests/test_external.py.
2016-06-29 01:50:38 +05:30
Eklavya Sharma
eb3bde40a0
zerver/lib/test_helpers.py: Improve type annotations.
2016-06-29 01:35:34 +05:30
Eklavya Sharma
97760702a8
zerver/lib/actions.py: Use Sequence as parameter type.
2016-06-29 01:11:41 +05:30
Eklavya Sharma
dca9256f3c
zerver/lib/socket.py: Improve annotations.
...
* Add Optional where required.
* Set type of req_redis_key as `(text_type) -> text_type` for consistency.
Almost all our cache keys and redis keys use this signature.
2016-06-29 00:45:13 +05:30
Tim Abbott
4aae4de294
Properly cache production virtualenvs in Travis CI.
...
Previously, the --travis argument wasn't available to the `setup_venv`
code when creating the production virtualenv.
2016-06-28 12:04:11 -07:00
Tim Abbott
7ed0ab8c4a
Ensure Zulip virtualenvs are world-readable.
...
This is important for both ensuring the Nagios checks work correctly
in production, as well as making sure the `zulip` user can access the
virtualenv (owned by the `travis` user) in Travis CI.
2016-06-28 12:03:01 -07:00
Eklavya Sharma
b305af05b3
Fix string annotations in custom cursors.
2016-06-28 15:58:57 +05:30
Eklavya Sharma
1a00b08a11
zerver/lib/db.py: Use a type alias to shorten annotations.
2016-06-28 15:57:43 +05:30
Tim Abbott
4a7913bc22
setup_venv: Use correct VENV_CACHE_PATH for production suite.
2016-06-27 21:16:22 -07:00
Tim Abbott
fd7cb3fc2b
docs: Fix hardcoding of links to zulip.readthedocs.io.
...
This makes things work better if you're testing the documentation
locally.
2016-06-27 20:54:21 -07:00
Tim Abbott
31f7fb2fa0
docs: Fix new feature tutorial link to testing docs.
2016-06-27 20:52:20 -07:00
Tim Abbott
40aa8a2336
clean-venv-cache: Fix python 3 compatibility.
2016-06-27 20:39:22 -07:00
Tim Abbott
404c61ba97
clean-venv-cache: Use better approach to pruning caches.
...
Rather than looking at which venvs are used by this particular build,
we instead look at which venvs have a hash that is the hash_reqs value
of a current requirements.txt file.
2016-06-27 20:30:39 -07:00
Tim Abbott
7d5c1864f7
clean-venv-cache: Avoid cleaning production venvs.
2016-06-27 20:08:45 -07:00
Katerina Kampardi
707df7b55b
README.dev.md: Clarify location of Zulip's root directory.
...
This adds some specifications for noobies - like me - while installing
the dev environment with vagrant on Ubuntu 14.04
2016-06-27 20:04:31 -07:00
Eklavya Sharma
7a98d7bd24
manifests/base.pp: Remove apt python package dependencies.
2016-06-27 19:55:35 -07:00
Eklavya Sharma
ebad1415c0
app_frontend_base.pp: Remove apt python package dependencies.
2016-06-27 19:55:35 -07:00
Eklavya Sharma
a9835c0ab2
Activate virtualenv in production Python code.
...
The manage.py change effectively switches the Zulip production server
to use the virtualenv, since all of our supervisord commands for the
various Python services go through manage.py.
Additionally, this migrates the production scripts and Nagios plugins
to use the virtualenv as well.
2016-06-27 19:55:35 -07:00
Eklavya Sharma
64affb83f9
Create a virtualenv when installing/upgrading production instances.
2016-06-27 19:55:11 -07:00
Eklavya Sharma
bbd24168b6
requirements/prod.txt: Add netifaces, flup and python-dateutils.
...
netifaces is used in puppet/zulip_internal/files/zulip-ec2-configure-interfaces.
flup is used for fastcgi.
python-dateutils is used in some puppet scripts.
2016-06-27 19:12:32 -07:00
Tim Abbott
beb8b50623
Move provision.py under tools/.
2016-06-27 19:04:32 -07:00
Tim Abbott
e1860e5b46
Remove tools/provision/zulip-dev.conf.
...
This was originally supervisord configuration for the Zulip
development environment; it never really worked how we wanted it to.
2016-06-27 19:04:32 -07:00
Tim Abbott
32eb021434
Make provision.py executable.
2016-06-27 19:04:23 -07:00
acrefoot
7ff89dc137
Add markdown-specific whitespace lint rule to /tools/lint-all.
...
Match one space or three+ spaces after content, or positive
number of spaces on an empty line.
2016-06-27 18:43:20 -07:00
acrefoot
acd7ff7aff
Fix typo in Recipient comment.
2016-06-27 18:34:02 -07:00
acrefoot
a36e5d4987
Add get_auth_backends endpoint to API.
...
We would like to know which kind of authentication backends the server
supports.
This is information you can get from /login, but not in a way easily
parseable by API apps (e.g. the Zulip mobile apps).
2016-06-27 18:30:34 -07:00
Umair Khan
3115e13caf
Remove extra call to i18n.t.
2016-06-27 14:17:47 -07:00
Aakash Tyagi
7a9a7189ae
Added help text for running single casper tests.
...
[formatting tweaked by tabbott]
2016-06-27 14:15:32 -07:00
Aakash Tyagi
9154d93669
Added help text for running single backend tests.
2016-06-27 14:15:30 -07:00
Tim Abbott
e72f41cdec
Remove old prototype data import/export tool.
...
This prototype from Dropbox Hack Week turned out to be too inefficient
to be used for realms with any significant amount of history, so we're
removing it.
It will be replaced by https://github.com/zulip/zulip/pull/673 .
2016-06-27 13:47:08 -07:00
Tim Abbott
101820bc29
Move docker development environment scripts to tools/.
...
scripts/ is for scripts which are used in production.
2016-06-27 13:38:06 -07:00
Tim Abbott
879ca4b9ea
docs: Add documentation on HTML and CSS.
2016-06-27 12:38:53 -07:00
Tim Abbott
74d86449e4
README.dev.md: Cleanup docs on testing.
2016-06-27 12:38:53 -07:00
Tim Abbott
292556c846
docs: Expand RTD testing section.
2016-06-27 12:38:53 -07:00
Tim Abbott
b2a24e0306
Revert "Add authorization check before serving files."
...
This reverts commit e985b57259 .
This commit will break production when we next do a release, because
we haven't done a migration to create Attachment objects for
previously uploaded files.
2016-06-27 12:09:56 -07:00
Tim Abbott
f7e87bc1f0
test_helpers: Require that login calls actually succeed.
...
This caught several bugs where test code wasn't doing what it's author
intended.
2016-06-27 11:51:04 -07:00
Tim Abbott
4cac7bbb32
test_helpers: Refactor login test helpers.
...
We now have a separate login helper for the case where the return
value is desired.
2016-06-27 11:50:43 -07:00
Tim Abbott
a05c03d3b5
test_messages: Fix trying to login as a bot user.
...
Due to a recent refactoring, the first user in the subscribers list is
now a bot.
2016-06-27 11:48:39 -07:00
Tim Abbott
370b38696a
test_messages: Fix broken huddle messages test.
...
The second login call was failing because the user didn't exist.
2016-06-27 11:48:36 -07:00
rahuldeve
e985b57259
Add authorization check before serving files.
2016-06-27 11:24:35 -07:00
rahuldeve
674def30ee
Add support for serving files using API authentication.
...
Also remove 'get_uploaded_file' view function and the corresponding
old '/user_upload/' url pattern.
2016-06-27 11:00:41 -07:00
rahuldeve
2bf15603f3
Modify rest_dispatch to support method specific flags.
...
[simplified substantially by tabbott]
2016-06-27 10:53:15 -07:00
rahuldeve
823bf15c6e
Add API route for uploading files.
2016-06-27 10:30:58 -07:00
Tim Abbott
79570f99c2
json_upload_file: Remove unnecessary has_request_variables.
2016-06-27 10:29:30 -07:00
Tim Abbott
8272fb4a94
zerver.views.upload: Move upload functions later in file.
2016-06-27 10:28:09 -07:00
Eklavya Sharma
e155573a1c
zilencer's populate_db.py: Type annotate all variables.
2016-06-27 10:22:49 -07:00
Eklavya Sharma
8cacd5fcf8
zilencer's populate_db.py: Type annotate some variables.
2016-06-27 21:00:10 +05:30
Eklavya Sharma
ea3c671494
zilencer's populate_db.py: Improve an annotation.
2016-06-27 21:00:10 +05:30
Eklavya Sharma
66d1867869
zilencer's populate_db.py: Fix string types.
2016-06-27 21:00:10 +05:30
Eklavya Sharma
a9fa78fc4a
api/zulip/__init__.py: Make compatible with newer mypy.
2016-06-27 21:00:09 +05:30
Eklavya Sharma
f20699b615
zerver/lib/statistics.py: Fix annotations.
...
Add type annotation to a variable.
Use abstract base container types where suitable.
Add missing imports from typing.
2016-06-27 18:03:29 +05:30
Eklavya Sharma
3917b822e5
zerver/lib/bulk_create.py: Type annotate variables.
2016-06-27 17:52:37 +05:30
Eklavya Sharma
d7a83ed019
zerver/views/__init__.py: Type annotate a variable.
2016-06-27 17:52:37 +05:30
Eklavya Sharma
63a5323259
zerver/views/streams.py: Type annotate variables.
2016-06-27 17:52:22 +05:30
Eklavya Sharma
9aa6fd988a
zerver/lib/actions.py: Type annotate variables.
2016-06-27 17:52:07 +05:30
Eklavya Sharma
7ca1e658b5
zerver/lib/cache.py: Change some TypeVars to Any.
...
Change ItemT and CompressedItemT to Any.
See https://github.com/python/mypy/issues/1721 .
2016-06-27 16:50:50 +05:30
Tim Abbott
f8c710b70e
Update documentation on development auto-reloading.
...
Now that queue workers auto-reload, we need to document that fact.
And we make a few tweaks to the relevant discussion, while we're at
it.
2016-06-26 20:20:13 -07:00
rahuldeve
3ca53df152
Add test for worker queue autoreloading.
2016-06-26 20:12:37 -07:00
rahuldeve
a3745178e5
Use django.utils.autoreload to restart queue workers at code change.
...
Fixes #621 , #1045 .
2016-06-26 20:12:11 -07:00
Tim Abbott
61d1de19cf
docs: Don't require typing module to be installed.
2016-06-26 10:10:59 -07:00
Tim Abbott
dc014b0866
docs: Add link to documentation building docs.
2016-06-26 10:04:07 -07:00
Tim Abbott
74c23d71e2
docs: Add details on viewing/editing these docs.
2016-06-26 10:04:06 -07:00
Tim Abbott
1838cd4d8f
docs: Split out version control guidelines.
2016-06-26 10:04:06 -07:00
Tim Abbott
96fef7a0a1
docs: Reorganize RTD table of contents.
2016-06-26 10:04:05 -07:00
Tim Abbott
9aea3cdc9b
docs: Add current Zulip release version to docs.
2016-06-26 10:03:56 -07:00
Tim Abbott
89b5eaaa7d
docs: Improve several headings.
2016-06-26 09:54:19 -07:00
Tim Abbott
149fd88733
docs: Add missing link in schema-migrations.md.
2016-06-26 09:54:19 -07:00
Tim Abbott
ea611c0dcd
docs: Add some full-text search documentation.
2016-06-26 09:32:54 -07:00
Tim Abbott
199e2df1e3
Split styles/settings.css out of zulip.css.
2016-06-26 08:21:39 -07:00
dhanus
1169329a71
Annotate zerver/views/webhooks/github.py.
2016-06-26 08:13:49 -07:00
Eklavya Sharma
85cb3e6103
zerver/views/webhooks/github.py: Make exception string str.
...
Passing a unicode string to Exception can sometimes fail.
Convert it to str to prevent that.
2016-06-26 08:13:49 -07:00
Eklavya Sharma
a32f83b182
zerver/views/webhooks/github.py: Fix string literals.
...
Change some string literals to unicode.
2016-06-26 08:13:49 -07:00
Eklavya Sharma
fa4adf0c62
zerver/views/webhooks/bitbucket.py: Fix an annotation.
2016-06-26 08:13:49 -07:00
Eklavya Sharma
36c2214d94
zerver/views/webhooks/bitbucket.py: Fix string literals.
...
Convert some strings literals to unicode.
2016-06-26 08:13:49 -07:00
Max
9b6205d0ed
Annotate zerver/decorator.py.
2016-06-26 08:13:49 -07:00
Max
daab2ca475
zerver/tornadoviews.py: Improve an annotation.
...
Use django.core.handlers.base.BaseHandler instead of Any.
2016-06-26 19:05:54 +05:30
Tim Abbott
7d3b451902
lint: Check for extremely long lines.
...
Currently, we check for lines longer than 180 characters; we can lower
this as we clean up or wrap longer strings.
2016-06-25 10:52:03 -07:00
Tim Abbott
ce7c7d3510
Wrap youtube_re.
2016-06-25 10:52:03 -07:00
Tim Abbott
c25c8d8c98
forms: Wrap some very long lines.
2016-06-25 10:52:03 -07:00
Vishnu Ks
7d654a26c8
Casper test for realm creation.
2016-06-25 10:50:12 -07:00
Vishnu Ks
eb9798027c
Move development URLs into dev_urls.py.
2016-06-25 10:50:12 -07:00
Tim Abbott
28b6f1d850
urls: Move non-legacy URLs back out of legacy_urls.py.
...
Only the old API endpoints were actually legacy URLs.
2016-06-25 10:49:56 -07:00
Tim Abbott
982cd5005b
requirements: Remove duplicate coverage dependency.
2016-06-24 21:50:31 -07:00
Taranjeet
71c02c3391
Requirements: Add comments in common.txt.
...
Sourced primarily from puppet/zulip/manifests/app_frontend_base.pp.
[with some additions by tabbott]
2016-06-24 21:49:55 -07:00
Rishi Gupta
8070be4a93
admin_tab: Add a missing translation tag.
2016-06-24 21:22:36 -07:00
Rishi Gupta
ec996c7fb2
admin_tab: Clean up line-wrapping in admin-realm-form.
2016-06-24 21:21:43 -07:00
Rishi Gupta
6c6f70dd96
Change checked=yes/true to checked=checked in handlebars files.
...
Only checked="checked" is actually valid according to w3c standards.
2016-06-24 21:16:20 -07:00
Vishnu Ks
20adcbc64b
Make send_registration_completion_email return the Confirmation object.
2016-06-24 17:47:56 -07:00
Vishnu Ks
420ee968f7
Renumber the casper tests to make space for realm-creation test.
...
And also fix the mysterious gaps at 6 and 8.
2016-06-24 17:47:56 -07:00
Vishnu Ks
8350b89798
Add support for custom error message in realm-creation-failed template.
2016-06-24 17:47:56 -07:00
Tim Abbott
6d71c25a0f
accounts_register: Stop using _ as dummy variable.
...
This conflicts with internationalization.
2016-06-24 17:47:31 -07:00
Preston Hansen
57dec15c6c
Update alert word UI to match the style of bots.
...
Resolves #1075 .
2016-06-24 16:43:19 -07:00
Taranjeet
122fb8eb62
Requirements: Add comments in dev.txt.
2016-06-24 16:25:09 -07:00
Taranjeet
c52049a85b
Requirements: Add comments in docs.txt.
2016-06-24 16:25:08 -07:00
Taranjeet
c5ceac9739
Requirements: Add comments in ipython.txt.
2016-06-24 16:24:05 -07:00
Taranjeet
c9720f9b74
Requirements: Add comments in moto.txt.
2016-06-24 16:24:03 -07:00
Akash Nimare
8c06c234d3
Improve reset email password link formatting.
2016-06-24 16:22:04 -07:00
acrefoot
e4ed9195dc
Remove rest_dispatch hack and optimize imports.
...
For a long time, rest_dispatch has had this hack where we have to
create a copy of it in each views file using it, in order to directly
access the globals list in that file. This removes that hack, instead
making rest_dispatch just use Django's import_string to access the
target method to use.
[tweaked and reorganized from acrefoot's original branch in various
ways by tabbott]
2016-06-24 16:11:03 -07:00
Tim Abbott
aebd84cb1b
urls: Clarify comment on mobile device credentials.
2016-06-24 16:04:14 -07:00
Tim Abbott
6f06101b73
urls: Add comments on sections of REST URLs.
2016-06-24 16:01:35 -07:00
Tim Abbott
71313fbbdf
urls: Move users/me urls further down.
2016-06-24 16:00:32 -07:00
acrefoot
788853a632
urls: Fix over-broad /users/email regexs in urls.py.
...
/users/me could get captured as an email--our urls shouldn't be so
sentitive to ordering.
2016-06-24 15:53:12 -07:00
Tim Abbott
5235ad5416
urls: Rearrange a few REST URL entries.
2016-06-24 15:51:54 -07:00
Tim Abbott
810d392947
urls: Fix mis-indented URLs entries.
2016-06-24 15:45:26 -07:00
Tim Abbott
16d260d36a
urls: Cleanup unnecessary use of 'patterns` calls.
2016-06-24 15:42:04 -07:00
Tim Abbott
aa228c9719
urls: Update some comments.
2016-06-24 15:39:14 -07:00
Tim Abbott
6dc416b6c3
urls: Wrap some comments better.
2016-06-24 15:39:14 -07:00
Tim Abbott
92f5e38171
urls: Move the dual-use patterns config up.
2016-06-24 15:39:14 -07:00
Tim Abbott
169810b874
urls: Move development avatars config further down.
2016-06-24 15:39:09 -07:00
acrefoot
0c799dc6b8
Add comments to label important sections of urls.py.
2016-06-24 15:21:36 -07:00
acrefoot
b36bc051af
Move old-style API endpoints to legacy_urls.py.
2016-06-24 15:14:03 -07:00
acrefoot
5a49c5e280
Denormalize urls in routes file.
...
Currently we use the deprecated django pattern() prefix pattern.
This make it hard to read the router logic in zproject/urls.py
This commit denormalizes the urls so that they can be read
more easily, at the expense of some verbosity. This also makes it
easier to reorganize urls in that file.
We skip denomalizing rest_dispatch due to its unique complications.
2016-06-24 15:12:51 -07:00
acrefoot
5d21fb0681
Remove unused imports from tornadoviews.py.
2016-06-24 14:53:13 -07:00
acrefoot
bca5613551
Add PyCharm files to .gitignore.
2016-06-24 14:53:11 -07:00
acrefoot
be484b25c6
Add comments on how rest_dispatch authenticates.
2016-06-24 14:52:22 -07:00
Tomasz Kolek
e6861636c8
Fix editing messages by adding or removing leading /me.
...
Previously, this did not correctly rerender the message to be (or not
to be) rendered as a /me style message.
Fixes : #835 .
2016-06-24 11:18:29 -07:00
Tim Abbott
dfd8fede4a
setup_venv: Add missing build essential dependencies.
...
Apparently, c74a74dc74 introduced a bug
where we are no longer correctly depending on build-essential as part
of the Zulip development environment installation process.
Fixes #1111 .
2016-06-24 09:11:10 -07:00
rahuldeve
8cecb37743
Modify Attachment model to track file access permissions.
2016-06-23 17:46:16 -07:00
Michael Cordover
a51ec44005
Search streams from left sidebar ( resolves #565 ).
...
Assigns hotkey 'w' to search streams.
Only show search box when active. Activate with hotkey or by clicking
STREAMS.
Filter matches at the beginning of words in stream name.
Behaviour is otherwise almost identical to user search.
Casper tests.
2016-06-23 17:21:57 -07:00
Vishnu Ks
574a304b12
Mention invite emails are printed in console in dev.
...
This is part 2 of #1046 .
2016-06-23 17:07:11 -07:00
Umair Khan
a70d5041d2
Don't allow literal strings in report_error.
2016-06-23 16:23:01 -07:00
Umair Khan
939ebbbc98
Mark report_error arguments translatable.
2016-06-23 16:23:01 -07:00
Umair Khan
b7bb49c6f5
Don't allow literal string in report_success.
2016-06-23 16:23:01 -07:00
Umair Khan
4da1a3ecd6
Mark report_success arguments translatable.
2016-06-23 16:23:01 -07:00
krtkmj
734ab8d5e3
Correctly narrow to stream using search box from subscription page.
...
Fixes #1012 .
2016-06-23 15:20:57 -07:00
Eklavya Sharma
9482cdccf4
scripts/lib/setup-venv.py: Accept None as target_venv_path.
...
If target_venv_path in setup_virtualenv is None, create a virtualenv
named 'venv' but don't make a symlink to it. Also return
cached_venv_path.
2016-06-23 14:17:17 -07:00
Eklavya Sharma
0365a4a9f2
Factor out apt dependencies for setting up virtualenv.
...
Move apt dependencies for creating a virtualenv from provision.py
to scripts/lib/setup_venv.py.
2016-06-23 14:17:17 -07:00
Taranjeet
3ca76b63c9
Remove use of $(document).data('events') to enable jQuery 1.8 upgrade.
...
jQuery renamed this (not supported) API in jQuery 1.8.
Fixes #1034 .
2016-06-23 14:06:47 -07:00
Tim Abbott
85798e2b2c
Dramatically expand directory structure docs.
2016-06-23 14:01:54 -07:00
Tim Abbott
c8a1c3a86b
docs: Reorder directory structure doc.
2016-06-23 13:58:41 -07:00
Tim Abbott
b0e1ae4245
docs: Make directory structure headings linkable.
2016-06-23 13:58:41 -07:00
Tim Abbott
5a1a540377
Expand directory structure details on scripts.
2016-06-23 13:58:41 -07:00
Tim Abbott
2080038e7c
Fix Jinja2 conversion bug in placeholder email value.
...
The `email` parameter to this template is only set if the user is
redirected to the login form after attempting to register for a new
account with an email address that already has an account.
2016-06-22 17:07:02 -07:00
James Porter
25a13cb09b
Defer loading zxcvbn in main webapp until necessary.
...
We only use zxcvbn in the main webapp for checking the user's password
in the change password form. Since zxcvbn is a very large javascript
library (~700KB), loading it asynchronously only when a user is trying
to change their password results in a significant performance
improvement for loading the Zulip webapp on a slow network.
Fixes #263 .
2016-06-22 17:06:37 -07:00
Tim Abbott
039c175d68
production-helper: Hold tons of packages.
...
This saves almost a minute doing apt upgrades in the production test
suite.
2016-06-22 10:41:09 -07:00
Tim Abbott
9b436c7190
setup-production: Remove more irrelevant postgres packages.
2016-06-22 10:41:09 -07:00
Tim Abbott
4b2e661705
travis: Skip development service restarts in production tests.
2016-06-22 10:41:09 -07:00
Tim Abbott
5a109cf816
travis: Skip development database setup in production tests.
...
This saves about 20s on the runtime of the production build.
2016-06-22 10:41:09 -07:00
Tim Abbott
0f2729f5fb
production-helper: use dist-upgrade to match install script.
...
Previously, we were wasting time every time we installed packages,
because `apt-get upgrade` would only install most of the packages
`apt-get dist-upgrade` would.
2016-06-22 10:38:27 -07:00
Tim Abbott
c74a74dc74
provision: Use --no-install-recommends when installing deps.
2016-06-22 09:34:49 -07:00
Umair Khan
33e6b471e2
Fix spelling of mesage_count_by_recipient_subject.
2016-06-22 09:02:35 -07:00
Tim Abbott
d3f3046629
Add python-six to early installer dependencies.
...
Since we're now using python-six in zulip-puppet-apply, we need to
install python-six before calling into zulip-puppet-apply.
2016-06-22 08:11:34 -07:00
Eklavya Sharma
b30690e760
Move prod.txt to requirements/.
...
In 81ecfc5 , prod.txt was unintentionally placed in Zulip's root directory
instead of requirements/.
2016-06-22 18:41:58 +05:30
Eklavya Sharma
121a5f26fb
Move hash_reqs.py from tools/ to scripts/lib/.
...
This is needed because hash_reqs.py is used to create a virtualenv.
Currently we only use virtualenv in development, but we will soon
start using it in production. Scripts used in production should be
put in scripts/.
2016-06-22 18:12:08 +05:30
Tim Abbott
c668f1e299
roadmap: Add strikethrough for completed projects.
2016-06-21 17:30:33 -07:00
Tim Abbott
6b8e9c7254
Exclude static/locale from linters.
2016-06-21 17:17:34 -07:00
Tim Abbott
4958828747
Add changelog for Zulip 1.3.13 release.
2016-06-21 16:59:48 -07:00
Tim Abbott
1d2d147a62
Update translations data from Transifex.
2016-06-21 16:45:55 -07:00
Tim Abbott
250781e843
Fix HTTP Basic Auth popups caused by auth failures.
...
If a user's session cookie expired, the next REST API request their
browser did would go into the json_unauthorized code path. This
returned a response with a WWW-Authenticate tag for HTTP Basic Auth
(since that's what the REST API uses), even for /json requests which
should only be authenticated using session auth.
We fix this by explicitly passing the desired WWW-Authenticate state.
Fixes : #800 .
2016-06-21 16:18:36 -07:00
Tim Abbott
45beac7d6c
test_decorators: Add test for /json/fetch_api_key.
2016-06-21 16:14:22 -07:00
Tim Abbott
f39c9161fe
Fix fetching user API keys via settings page when using LDAP backend.
...
Previously, json_fetch_api_key was hardcoding a check using Zulip's
built-in password functionality, rather than using authenticate().
2016-06-21 14:58:25 -07:00
Tim Abbott
1565ee8453
Fix using LDAP backend with Zulip mobile apps.
...
The recent changes to api_fetch_api_key to receive detailed data via
the "return_data" object did not properly update the LDAP backend to
accept that argument, causing mobile password authentication to not
work with the LDAP backend.
2016-06-21 14:57:54 -07:00
akashnimare
42ebf6acb7
Update Zulip /hello page to match zulip.org.
...
[with rebasing tweaks by tabbott].
2016-06-21 14:54:46 -07:00
Tomasz Kolek
7aa45ffa45
Increase send_message_backend coverage.
2016-06-21 14:33:21 -07:00
Vishnu Ks
055c7eed04
Tweak the CSS of skip-tutorial button.
2016-06-21 14:23:17 -07:00
Tim Abbott
50f723f50b
Split test_narrow.py out of test_messages.py.
2016-06-21 12:25:08 -07:00
Tomasz Kolek
e3e03e2946
Add NarrowBuilder test cases.
...
Refactor existing add_term test cases.
2016-06-21 11:53:31 -07:00
Tomasz Kolek
f8c368c07f
Add default-bot during populate_db.
2016-06-21 11:47:38 -07:00
Tomasz Kolek
9ae68ade8b
Add is_webhook option to authentication decorats.
...
Modified:
authenticated_rest_api_view
authenticated_api_view and validate_api_key.
2016-06-21 11:47:38 -07:00
Tim Abbott
80d92c1651
Add comment documenting confusing list_to_streams code.
2016-06-21 11:45:35 -07:00
Eklavya Sharma
fc8d4f9ef5
Factor out venv-creating code from provision.py.
...
Move setup_virtualenv and do_setup_virtualenv from provision.py to
scripts/lib/setup_venv.py.
2016-06-21 11:25:41 -07:00
Alex Wilson
f68a392250
Run django.setup() after coverage.start() in tests to fix coverage report.
...
Fixes #1007 .
2016-06-21 10:37:45 -07:00
Tim Abbott
2640cc44c7
Move coverage to dev requirements.txt.
2016-06-21 07:48:58 -07:00
Tim Abbott
5f958f46a5
Move pyflakes to dev requirements.txt.
2016-06-21 07:48:58 -07:00
Tim Abbott
1a876310bc
Move ipython dependencies to their own requirements file.
2016-06-21 07:48:58 -07:00
Tim Abbott
09fcc079b4
Move moto dependencies to new requirements file.
2016-06-21 07:48:58 -07:00
Tim Abbott
fd1a134bef
Move transifex dependencies to dev.txt.
2016-06-21 07:48:58 -07:00
Tim Abbott
b43bf10a93
Move recommonmark requirement to docs.txt.
2016-06-21 07:48:58 -07:00
Eklavya Sharma
be70907eaa
Remove references to requirements.txt.
2016-06-21 07:48:24 -07:00
Eklavya Sharma
b5d08bb5de
README.dev.md: Improve pip instructions.
...
Recommend using a virtualenv.
Add instruction to do `pip install --upgrade pip` before installing
python packages.
2016-06-21 07:35:26 -07:00
Umair Khan
4149b0bb56
Fix path to hash_req.py in provision.py.
...
Fixes #1081 .
2016-06-21 07:01:45 -07:00
Akash Nimare
8939dc1cdd
Fixed broken Docker linux installation link.
...
[This](https://docs.docker.com/engine/started/ ) link is broken. Updated to the latest.
2016-06-21 08:36:40 +05:30
krtkmj
9dadab6eac
Replace placeholder variables x with more meaningful ones.
2016-06-20 19:36:07 -07:00
Tim Abbott
7370fd69d7
Move doc building dependencies to requirements/docs.txt.
2016-06-20 16:05:42 -07:00
medullaskyline
e2eb4e0b7e
Annotate zerver/lib/email_mirror.py.
...
[With some fixes from @sharmaeklavya2].
2016-06-20 15:58:40 -07:00
Eklavya Sharma
a2668a2853
zerver/lib/notifications.py: Fix an annotation.
2016-06-21 02:20:36 +05:30
Umair Khan
c61a3dfbcc
Ensure translations are loaded.
...
Since i18next loads translations asynchronously we need to make sure
that they are loaded before we call the JS code which depends on them.
Fixes #982
2016-06-20 11:31:28 -07:00
Umair Khan
d29ab6651b
Mark strings translatable in the frontend.
2016-06-20 11:31:28 -07:00
Umair Khan
134b165b1a
Fix frontend translation string bug.
...
The translation string which contain \n are not captured
within {{#tr}}{{/tr}} blocks. Fix is to escape the slash.
2016-06-20 11:31:28 -07:00
Eklavya Sharma
81ecfc5a43
Split requirements.txt into multiple files.
2016-06-20 11:09:20 -07:00
Eklavya Sharma
500cc32e64
provision.py: Use tools/hash_reqs.py.
...
Use tools/hash_reqs.py to generate hash of requirements.txt in
provision.py while setting up virtualenv.
2016-06-20 11:09:20 -07:00
Eklavya Sharma
8148cbe173
Add tools/hash_reqs.py.
...
tools/hash_reqs.py generates a hash of a requirements file. It
does that by generating a sorted list of unique dependencies referred
to by that requirements file. To do that, it also recurses into other
requirements files specified inside that requirements file.
2016-06-20 11:09:20 -07:00
Vishnu Ks
ff66ce780a
Mention emails are printed in run-dev.py console.
...
Fixes : #1046
2016-06-20 11:07:20 -07:00
Tim Abbott
f7ce5fc179
generate_secrets: Silence mypy error with configparser.
...
See https://github.com/python/typeshed/issues/307 .
2016-06-20 09:03:09 -07:00
Tim Abbott
eb71173be3
lint: Fix warnings under confirmation/.
2016-06-20 08:19:54 -07:00
Umair Khan
a9a6687b7d
Make generate-secrets script use existing values.
...
Fixes #1035
2016-06-20 17:00:27 +05:00
Eklavya Sharma
aceee3da11
zerver/lib/rate_limiter.py: Annotate rate_limiter.rules.
...
After annotating rate_limiter.rules, mypy complained that rules does
not support cmp. So use key to customize sort instead of cmp.
Python docs also recommend using key over cmp.
2016-06-18 16:41:41 -07:00
Eklavya Sharma
13f62da4ce
zerver/lib/rate_limiter.py: Fix annotations.
2016-06-18 16:41:40 -07:00
Eklavya Sharma
6097f6eed5
zerver/lib/initial_password.py: Encode return value.
...
zerver.lib.initial_password.initial_password is supposed to return an
Optional[text_type], but it returns an Optional[binary_type] instead.
Encode the return value to make sure it returns an Optional[text_type].
2016-06-18 16:41:40 -07:00
Eklavya Sharma
018041625c
zerver/lib/html_diff.py: Fix annotations.
2016-06-18 16:41:40 -07:00
Eklavya Sharma
68823767e2
zerver/lib/digest.py: Fix annotations.
2016-06-18 16:41:40 -07:00
Eklavya Sharma
64ccb390ff
Annotate zerver/lib/create_user.py.
2016-06-18 16:41:40 -07:00
Tim Abbott
3899b4c913
Move py3k requirements to requirements/py3k.txt.
2016-06-18 16:41:40 -07:00
Tim Abbott
5c92639f81
Move mypy requirements to requirements/ directory.
2016-06-18 16:41:40 -07:00
Eklavya Sharma
666041e1b2
Remove wsgiref, argparse and South from requirements.txt.
...
wsgiref and argparse are part of the Python 2.7 standard library, and
South ceased being relevant in Django 1.6.
2016-06-18 15:50:06 -07:00
Tim Abbott
46c2416cc8
puppet: Add postgres version map for xenial.
...
This is an early step towards Ubuntu Xenial support in production.
2016-06-17 16:41:42 -07:00
Vishnu Ks
ad1c3894d9
Add interface for creating new realms.
...
This is controlled by settings.OPEN_REALM_CREATION; if that setting is
off, this feature doesn't do anything.
2016-06-17 16:15:28 -07:00
Vishnu Ks
8213ca135a
Move default_stream list to settings.
2016-06-17 16:01:38 -07:00
Rishi Gupta
ce5e7d3ba6
Make minor edits to new settings documentation.
2016-06-17 12:15:15 -07:00
Tim Abbott
b5e92f541a
Add new documentation on Zulip settings system.
...
Fixes : #962 .
2016-06-17 12:15:15 -07:00
Tim Abbott
6d1d7471e6
Refactor out zproject/dev_settings.py.
2016-06-17 12:15:15 -07:00
Taranjeet
964ff027bd
Dockerfile: Create symlink in home folder for project.
2016-06-17 11:48:59 -07:00
Taranjeet
3fae7a69b3
VagrantFile: Create symlink in home folder for project.
...
Fixes : #922 .
2016-06-17 11:48:55 -07:00
Eklavya Sharma
14c4ff2d25
docs/code-style.md: Use ASCII spaces consistently.
...
At some places, '\xc2\xa0' was used instead of ' '. This characters looks
identical, but can hamper searches and lint checks.
2016-06-17 11:33:41 -07:00
Tim Abbott
07abfc189b
Update docs/README.md to reflect the current state of the world.
...
Fixes #1050 .
2016-06-17 11:30:22 -07:00
kunall17
007eee6061
Add route to fetch emails for mobile passwordless login.
...
[Tweaked by tabbott to rename API to explicitly support not just
Android]
2016-06-17 11:03:19 -07:00
kunall17
7ea0eaed1c
Add passwordless login for mobile app development.
...
[Tweaked by tabbott to rename API to explicitly support not just
Android].
2016-06-17 10:58:33 -07:00
Tim Abbott
d117ec8664
lint: Fix redundant stripping of strings.
2016-06-17 10:41:39 -07:00
Tim Abbott
267a71cf20
Run Python custom RE checks in parallel with non-python.
...
This saves about 1s (out of originally 3.3s) of time running all the
linters in my development environment.
2016-06-17 10:26:50 -07:00
Vishnu Ks
01c9bb2d5e
Make name_changes_disabled() work with no argument.
2016-06-16 17:13:59 -07:00
Tim Abbott
e109b50152
Fix alignment of airbrake integration in urls.py.
2016-06-16 15:30:45 -07:00
Tomasz Kolek
76cbe89613
Add IFTTT integration.
2016-06-16 15:30:45 -07:00
Eklavya Sharma
598fb1ff28
zerver/lib/bugdown/fenced_code.py: Add BaseHandler.
...
Add a class 'BaseHandler' and make it a base class of OuterHandler,
QuoteHandler and CodeHandler. This will help annotate some functions
and improve type checking.
2016-06-16 15:21:17 -07:00
Eklavya Sharma
142bcadb68
Annotate zerver/lib/bugdown/fenced_code.py.
2016-06-16 15:21:17 -07:00
Eklavya Sharma
9b72b7b37e
Annotate zerver/lib/bugdown/codehilite.py.
...
Also change some string literals to unicode.
2016-06-16 15:21:17 -07:00
Eklavya Sharma
744007f33f
zerver/lib/bugdown/__init__.py: Fix string types.
...
Change important string constants from str to text_type.
Replace str by text_type in annotations where relevant.
2016-06-16 15:21:17 -07:00
Eklavya Sharma
04f44b12ad
zerver/lib/bugdown/testing_mocks.py: Fix types.
...
Also fix clashing annotations in zerver/lib/bugdown/__init__.py.
2016-06-16 15:21:17 -07:00
Eklavya Sharma
7db0765a18
zerver/lib/bugdown/fenced_code.py: Fix types.
...
Change some important string literals from str to unicode.
Annotate format_code and codehilite_conf in FencedBlockProcessor.
2016-06-16 15:21:17 -07:00
Eklavya Sharma
48c5b299b6
zerver/lib/bugdown/codehilite.py: Add type annotation.
...
Mypy incorrectly infers a dict's type as `Dict[str, List[object]]`.
Change that to `Dict[str, List[Any]]`.
2016-06-16 15:21:17 -07:00
Eklavya Sharma
a485d63975
zerver/lib/bugdown/__init__.py: Fix non-string annotations.
2016-06-16 15:21:17 -07:00
Tim Abbott
eafb91719c
get_tweet_id: Fix return type to by None.
2016-06-16 15:21:01 -07:00
Tim Abbott
33df0b29d3
Annotate zerver/tests/test_hooks.py.
2016-06-16 14:07:34 -07:00
Tim Abbott
49ae0052b2
send_json_payload: payload arg can be text_type.
2016-06-16 14:07:34 -07:00
Tim Abbott
df9f89fe2c
test_helpers: Change send_json_payload to use text_type.
2016-06-16 14:07:34 -07:00
Tim Abbott
b14eacd552
test_helpers: Change fixture_data to text_type.
2016-06-16 14:07:34 -07:00
Tim Abbott
5b05644c95
Run mypy on zerver/tests/test_hooks.py.
2016-06-16 14:07:34 -07:00
Tim Abbott
6723525fd3
Annotate zerver/tests/tests.py.
2016-06-16 14:07:34 -07:00
Tim Abbott
45883386ce
AlertWordTests: Cleanup confusing message variable reuse.
2016-06-16 13:55:58 -07:00
John Hergenroeder
16a19226f6
Add linter check for redundant REQ whence argument.
2016-06-16 13:53:39 -07:00
Christie Koehler
a9b277368a
requirements: Add dependencies required by Sphinx.
...
Since `pip install` is passed `--no-deps`, we need to explicitly list
it's dependencies in requirements.txt in order for docs generation to
work.
2016-06-16 09:39:47 -07:00
Taranjeet
219ecfff99
Readme.dev.md: Update broken link for docker architecture.
2016-06-16 09:02:02 -07:00
Tim Abbott
0071731915
test-run-dev: Display original error messages on failures.
...
This helped with debugging a failure recently.
2016-06-15 22:44:04 -07:00
Tim Abbott
b65c187398
Fix docker instructions using port 80 on localhost.
...
This was confusing, because we otherwise suggest consistently to users
that they should connect to their development environment on port
9991.
Fixes #1032 .
2016-06-15 16:41:47 -07:00
Eklavya Sharma
98553e8caa
zerver/lib/push_notifications.py: Fix strings.
...
Use appropriate string encode/decode operations and fix annotations.
2016-06-15 15:25:28 -07:00
Eklavya Sharma
78565a96c9
zerver/lib/notifications.py: Fix string annotations.
2016-06-15 15:25:28 -07:00
Tim Abbott
39a8c82957
travis: Remove verbose coverage report from end of build output.
2016-06-15 15:05:38 -07:00
Tim Abbott
10dd9addb7
Fix ChangeSettingsTest caching issue causing test failures.
2016-06-15 14:57:58 -07:00
Tim Abbott
06079042d4
ChangeSettingsTest: Move login to test helper method.
2016-06-15 14:28:24 -07:00
Tim Abbott
8f67b7e498
Simplify check_for_toggle_param.
2016-06-15 14:23:51 -07:00
Ashish Kumar
0a98d9edcf
Add test_enter_sends_setting.
2016-06-15 14:23:51 -07:00
Ashish Kumar
8a55098ca7
Add test_time_setting.
2016-06-15 14:23:51 -07:00
Ashish Kumar
345df3538f
Add test_toggling_left_side_userlist.
2016-06-15 14:23:51 -07:00
Ashish Kumar
24767302c4
Update test_ui_settings to use new abstraction.
2016-06-15 14:23:51 -07:00
Ashish Kumar
006e528e18
Update test_notify_settings to use new abstraction.
2016-06-15 14:23:51 -07:00
Ashish Kumar
5ae06e8c33
Added test helper function: check_for_toggle_param
2016-06-15 14:18:55 -07:00
Tim Abbott
ce938ca39c
Annotate provision.py.
...
Annotations aren't particularly important here, but it will prevent
coveralls from complaining whenever someone patches provision.py.
2016-06-15 12:12:23 -07:00
Eklavya Sharma
553a9d0b75
tools/run-mypy: Exclude py files which have a pyi.
...
If a .py file has a corresponding .pyi stub file, exclude that
.py file from mypy.
2016-06-15 22:40:31 +05:30
Umair Khan
7d3dc5d0b3
Cache npm for Travis CI.
...
This should speed up all the major Zulip builds in Travis CI.
Fixes #712 .
2016-06-15 09:32:50 -07:00
Tim Abbott
9e6b9dacf6
test-migrations: Fix missing exit status on error.
...
Previously this test was correctly detecting missing migrations, but
not causing the build to fail.
2016-06-15 09:26:04 -07:00
Tim Abbott
f88e5b7438
Add missing no-op migration for realm_emoji.
...
Because of how Django's migration system works, changing the error
message attached to a model field's validator results in an extra
migration.
2016-06-15 09:26:01 -07:00
Tim Abbott
7f06fec9d5
Fix spelling of _streams_deferred.
2016-06-14 16:36:54 -07:00
Tim Abbott
c7f0e66f7e
Replace deprecated jQuery deferred.isResolved().
2016-06-14 16:36:54 -07:00
Tim Abbott
c0e8f3f2bf
[third] Upgrade underscore.js to version 1.8.3.
...
This seems to have no backwards-incompatible changes affecting us, and
likely brings a number of performance and compatibility improvements.
2016-06-14 16:36:54 -07:00
Tim Abbott
02e6d267f1
[third] Replace jquery-caret with newer implementation.
...
Apparently, there are like 5 independently developed jquery-caret
plugins, none of which are great. The previous one we were using was
last modified in 2010. This new one comes from
https://github.com/acdvorak/jquery.caret and at least doesn't use
deprecated jQuery syntax and has a repository on GitHub.
This plugin is way larger than it needs to be for what it does, but we
can deal with that later.
2016-06-14 16:36:51 -07:00
Umair Khan
a976ccefbf
[third] Urlencode name of the uploaded file.
...
Update jquery-filedrop to send urlencoded filenames.
As discussed in https://github.com/zulip/zulip/pull/1023 , this fix is
already in jquery-filedrop upstream.
Fixes #981 .
2016-06-14 15:32:41 -07:00
Tomasz Kolek
4e51a86ea4
Add updownio integration.
2016-06-14 12:14:07 -07:00
Tomasz Kolek
14d69348d3
Add Airbrake integration.
2016-06-13 20:36:40 -07:00
Eklavya Sharma
72ed1f4187
Fix python 3 pyflakes error.
...
Change raw unicode literal to non-raw. A raw unicode literal is a
syntax error in python 3. This error was detected by pyflakes.
2016-06-13 19:44:56 -07:00
Tim Abbott
2219ef7bef
bugdown: Rename upload_re to upload_title_re for clarity.
2016-06-13 19:44:56 -07:00
Tim Abbott
6c78036811
Add tests for upload title functionality.
2016-06-13 19:44:56 -07:00
Tim Abbott
5b1cfbc977
bugdown: Fix extraction of titles for uploaded files.
...
The previous code was associated with a previous version of the upload
URL naming scheme, and thus never triggered in practice.
2016-06-13 19:44:51 -07:00
Michael Cordover
b401ec0af7
Warn on postgres-init-db if >200 messages exist.
...
Closes #548 .
2016-06-13 15:57:51 -07:00
Michael Cordover
53e23743ca
Refactor hotkey logic.
...
Place all hotkey names into a set of three objects in hotkeys.js:
* hotkeys_shift_insensitive
These are keys where the behaviour is the same whether they are
pressed with shift or not.
* hotkeys_no_modifiers
These are keys where the event should only be fired when shift
is not being pressed.
* hotkeys_shift
These are keys where the event should only be fired when the key
is pressed simultaneously with shift.
Each object is a dictionary of key value pairs, with the key being
the keyscan code (e.which) for the key. This is normally the ASCII
key code. The value is an object with two properties, name (which
is the event name) and message_view_only, a boolean. Hotkeys with
message_view_only set to true will not be fired when the home tab
is obscured.
2016-06-13 15:43:49 -07:00
Tim Abbott
0f8d33c488
Fix URL for zulip_main.png for i18n site.
2016-06-13 09:12:52 -07:00
Umair Khan
c8d139b2b1
Fix emoji urls interaction with i18n.
...
When accessing emojis with relative urls we should start the urls with
a slash so that language code doesn't become part of these urls.
Fixes #1014 .
2016-06-13 09:10:11 -07:00
Umair Khan
c1f5ac375c
Add linter checks for javascript strings and HTML placeholders.
...
Checks are added for:
- i18n.t
- placeholder
- compose_error
2016-06-13 09:05:27 -07:00
Umair Khan
6fcfed8d9e
Update regexes to capture translation strings.
...
Strings are captured from:
- i18n.t
- compose_error
- placeholder
2016-06-13 09:03:56 -07:00
Umair Khan
6fb0baaa25
Mark strings translatable.
...
Following strings are marked translatable:
- All strings which are passed to `button.text` or which affect the
text of buttons.
- All strings passed to `placeholder`.
- All strings passed to `compose_error`.
Fixes #969
2016-06-13 09:03:56 -07:00
Eklavya Sharma
7ec9cb7e93
Annotate model fields: Attachment.
...
Also fix clashing annotations.
2016-06-13 20:01:03 +05:30
Eklavya Sharma
86978cb2a3
Annotate model fields: Stream.
2016-06-13 20:01:03 +05:30
Eklavya Sharma
6f5ed6e7c9
Fix annotations clashing with Stream model fields.
2016-06-13 20:01:02 +05:30
Eklavya Sharma
1ec7e124c7
Annotate model fields: Message.
2016-06-13 20:01:02 +05:30
Eklavya Sharma
5a5934a76f
Fix annotations clashing with Message model fields.
2016-06-13 20:01:02 +05:30
Eklavya Sharma
f27cff57c3
Annotate model fields: UserProfile.
2016-06-13 20:01:02 +05:30
Eklavya Sharma
71e613424b
Fix annotations clashing with UserProfile's model fields.
2016-06-13 20:01:01 +05:30
Eklavya Sharma
9d7a2fdf9d
zerver/views/streams.py: Fix annotations.
...
Mainly fix `str` to `text_type` and use abstract containers.
2016-06-13 20:01:01 +05:30
Eklavya Sharma
9f39c9276f
Annotate model fields: DefaultStream, Referral, ScheduledJob.
2016-06-13 19:37:07 +05:30
Eklavya Sharma
4f890cca2a
Annotate model fields: UserActivity, UserActivityInterval, UserPresence.
2016-06-13 19:37:07 +05:30
Eklavya Sharma
7290f9cb83
Annotate model fields: Subscription and Huddle.
2016-06-13 19:37:07 +05:30
Eklavya Sharma
ddaaa98b25
Annotate model fields: UserMessage.
2016-06-13 19:30:58 +05:30
Eklavya Sharma
acd1767398
Annotate model fields: Recipient and Client.
2016-06-13 19:30:57 +05:30
Eklavya Sharma
c0004a5874
Annotate model fields: PushDeviceToken and MitUser.
2016-06-13 19:30:57 +05:30
Eklavya Sharma
04740fb620
Annotate model fields: PreregistrationUser.
2016-06-13 19:30:56 +05:30
Eklavya Sharma
d666e00833
Annotate model fields: RealmEmoji and RealmFilter.
2016-06-13 19:30:56 +05:30
Eklavya Sharma
6c7dd07ec2
Annotate model fields: Realm and RealmAlias.
2016-06-13 19:30:56 +05:30
Eklavya Sharma
d169cc5376
zerver/lib/bulk_create.py: Fix string annotations.
...
Change string type from `str` to `text_type` where required.
Also fix clashing annotations.
2016-06-13 10:08:14 +05:30
Eklavya Sharma
c654c4032d
zerver/models.py: Annotate get_display_recipient.
...
get_display_recipient's annotation clashes with other wrong annotations.
Fix those wrong annotations.
Since get_display_recipient returns a Union, use isinstance checks and
casts to make mypy checks succeed.
2016-06-12 23:34:57 +05:30
Tim Abbott
9f980c64b6
Add detailed LetsEncrypt instructions.
...
We'll likely want to follow this up with:
(1) Making Let's Encrypt the default instructions for getting a cert.
(2) Moving the "how to get an SSL cert" discussion to its own page.
(3) Eliminating the duplicate content in zulip.org/server.html
But this is definitely an improvement!
2016-06-12 10:35:07 -07:00
Eklavya Sharma
ed61c4c581
Improve model string representation.
...
Define __str__, __repr__ and __unicode__ correctly on models.
This will help in python 3 compatibility.
2016-06-12 09:55:12 -07:00
Eklavya Sharma
17b9422546
zerver/models.py: Fix regex strings.
...
Some regex strings were not declared as raw, even though they used
a lot of backslashes.
2016-06-12 09:31:19 -07:00
Eklavya Sharma
81759d56be
zerver/models.py: Fix string annotations in UserPresence.
2016-06-12 09:30:53 -07:00
Eklavya Sharma
e11bec28c2
zerver/models.py: Fix annotations (str -> text_type).
...
Change str to text_type where appropriate in annotations related to
Attachment, PreregistrationUser and Huddle.
2016-06-12 09:30:53 -07:00
Eklavya Sharma
d76bea8f25
zerver/models.py: Identify functions returning QuerySets.
...
Identify functions which return QuerySets and give them a return type
`Sequence` with appropriate parameter. Typing them as QuerySet will
not be useful since generic stubs for QuerySets are not available and
not knowing the type of QuerySets is hardly useful for type checking.
2016-06-12 09:30:53 -07:00
Eklavya Sharma
39060aa221
zerver/models.py: Fix annotations related to Message.
2016-06-12 09:30:53 -07:00
Eklavya Sharma
2841aa642d
Fix annotations related to make_safe_digest and hashes.
2016-06-12 09:30:53 -07:00
Eklavya Sharma
9020177418
zerver/models.py: Add annotations related to Stream and Client.
2016-06-12 09:30:53 -07:00
Eklavya Sharma
10f2ec043d
Fix zerver.lib.utils.generate_random_token.
...
generate_random_token used to return a value of type six.binary_type
and its return type was annotated as `str`. This commit fixes that
by making it return a value of type `six.text_type` and updating
the annotation accordingly.
Also fix clashing annnotations.
2016-06-12 09:30:53 -07:00
Eklavya Sharma
56d5785c2e
zerver/models.py: Change some constants to unicode literals.
...
Change choices of UserProfile.avatar_sources and UserProfile.tutorial_status
from str literals to unicode literals. This is done because these fields
are CharFields, which are of type `six.text_type`. So the set of values
which they can take should also be of the type `six.text_type`.
Also fix clashing annotations.
2016-06-12 09:30:53 -07:00
Eklavya Sharma
0cc7a6583c
zerver/models.py: Fix last_reminder_tzaware annotation.
...
Fix annotated return type of UserProfile.last_reminder_tzaware from
`str` to `Optional[datetime.datetime]`.
2016-06-12 09:30:33 -07:00
Eklavya Sharma
8acc51218e
Fix realm emoji and realm filter annotations.
...
Change `str` to `text_type` in annotations in zerver/models.py
related to realm emoji and realm filters.
Also fix clashing annotations in zerver/lib/bugdown/__init__.py.
2016-06-12 09:25:42 -07:00
Eklavya Sharma
e68d99eb2e
zerver/models.py: Make cache_keys text_type.
2016-06-12 09:25:32 -07:00
Babak
ad895eb690
Annotate zerver/views/report.py.
2016-06-11 18:42:37 -07:00
Vishnu Ks
77ec6217eb
Add validation for private message recipients.
...
The function will reject messages where recipients aren't either a
member of the realm or a member of cross_realm_user_emails.
Fixes : #930 .
2016-06-11 11:24:45 -07:00
Vishnu Ks
a717c7df18
Seperate extract PM recipients as function.
2016-06-11 11:22:22 -07:00
Tim Abbott
f44b227b85
Refactor getting cross-realm users into a function.
2016-06-11 11:22:22 -07:00
Eklavya Sharma
f82b28e835
zerver/lib/cache.py: Fix get_cache_backend's annotation.
2016-06-11 09:12:58 -07:00
Eklavya Sharma
0b2d1c30e9
zerver/lib/cache.py: Replace Any with appropriate models.
...
Due to a cyclic dependency issue, functions having models as parameters
were annotated as Any.
That issue is fixed by importing models inside an `if False:` block,
so that mypy sees them but they are not imported at runtime.
2016-06-11 09:12:58 -07:00
Eklavya Sharma
ff4e95d941
Improve generic_bulk_cached_fetch annotation using TypeVars.
2016-06-11 09:12:42 -07:00
Eklavya Sharma
d27a0e162a
zerver/lib/cache.py: update_user_profile_caches return type is None.
...
In update_user_profile_caches, the return type in annotation was
marked as Any. Change that to None because, nothing is being returned
in that function.
2016-06-11 09:11:52 -07:00
Eklavya Sharma
53084fe03c
Use text_type as type of cache keys and update users.
...
This changes the type annotations for the cache keys in Zulip to be
consistently text_type, and updates the annotations for values that
are used as cache keys across the codebase.
2016-06-11 09:10:34 -07:00
Eklavya Sharma
d3b80d94a2
Use appropriate string types and correctly encode/decode them.
2016-06-11 17:34:23 +05:30
Eklavya Sharma
f18493f922
Add documentation about zerver/lib/str_utils.py.
2016-06-11 17:31:56 +05:30
Eklavya Sharma
6d29da8cee
Add zerver/lib/str_utils.py.
...
str_utils.py has functions for converting strings from one type to
another. It also has a TypeVar called NonBinaryStr, which is like AnyStr
except that it doesn't allow bytes.
2016-06-11 16:17:47 +05:30
Tim Abbott
ddd44189a9
Fix coverage reporting on GitHub homepage.
...
The previous Markdown syntax didn't work correctly on ReadTheDocs, and
now that we have Coveralls reporting backend test coverage as well,
describing our coverage as just "mypy static type" is no longer accurate.
Fixes #964 .
2016-06-10 18:48:14 -07:00
Tim Abbott
062287d0b0
Coveralls: Add coverage reporting to backend test suite.
2016-06-10 17:20:00 -07:00
Tim Abbott
8b9c66aac5
Fix missing $ at end of webhook URL patterns.
2016-06-10 17:12:05 -07:00
Vishnu Ks
b926826ea1
Remove default_stream addition and deletion from update_stream_backend.
...
Default stream addition/removal is done via the /default_stream REST
endpoints.
2016-06-10 16:59:15 -07:00
Eklavya Sharma
85ef5900b4
docs/mypy.md: Add section on annotating strings.
2016-06-10 16:30:14 -07:00
Tim Abbott
c9ef726048
docs/mypy: Add note about Zulip's annotation goals.
2016-06-10 16:30:14 -07:00
Eklavya Sharma
a4c14cd448
Improve docs/mypy.md.
...
Add link to mypy cheat sheet.
Warn against modifying annotations to somehow make them pass on buggy code.
[Description expanded by tabbott]
2016-06-10 16:30:00 -07:00
Tim Abbott
110d278b86
Fix api/endpoints.html template.
...
This was apparently broken in the Jinja2 migration.
2016-06-10 15:14:50 -07:00
Tim Abbott
ec8b8cc5c0
Add warning at top of zulip.js about adding new things.
2016-06-10 10:22:24 -07:00
Tim Abbott
7c80456321
Fix and re-enable test_file_upload_authed.
...
Now that we have a working S3 mock and an effective way to toggle the
upload backend that Zulip is using, we can re-enable this important
end-to-end test of the Zulip S3 upload backend.
2016-06-09 23:07:24 -07:00
rahuldeve
fa13582ffb
Serve uploaded files through get_uploaded_file in development.
...
Previously, uploaded files were served:
* With S3UploadBackend, via get_uploaded_file (redirects to S3)
* With LocalUploadBackend in production, via nginx directly
* With LocalUploadBackend in development, via Django's static file server
This changes that last case to use get_uploaded_file in development,
which is a key step towards being able to do proper access control
authorization.
Does not affect production.
2016-06-09 22:58:25 -07:00
Tim Abbott
719e5487b9
upload: Use classes to define S3/Local upload backends.
...
This has no functional changes; we just replace the old hacky
assignment of functions with assignment of the upload backend to a
variable.
I'm not totally happy with this, because we end up having to copy the
type annotations of the three methods 4 times each, but this should
make it a lot easier to test the (non-default-in-tests) S3 backend
using end-to-end tests, which would have caught
13bac1cc2a .
I expect we'll iterate on the interface over time; ideally, I'd like
all the code that checks LOCAL_UPLOADS_DIR to be inside upload.py, and
primarily in these classes.
2016-06-09 22:45:03 -07:00
Tim Abbott
13bac1cc2a
Fix serving files uploaded to S3.
...
This was broken by the refactoring to realm_id_str in:
a261a6bbac .
2016-06-09 21:55:50 -07:00
rahuldeve
3e3462da0d
Refactor zerver.lib.upload.upload_message_image_through_web_client.
...
upload_message_image_through_web_client -> upload_message_image_from_request
2016-06-09 21:09:12 -07:00
medullaskyline
39eaf02b40
Annotate zerver.views.webhooks.taiga.
2016-06-09 17:08:55 -07:00
Eklavya Sharma
286d23734a
zerver/lib/cache.py: Remove unneeded return statements.
2016-06-09 16:57:11 -07:00
Vishnu Ks
f9f31b79d0
Make default_streams web controllable.
...
Fixes : #665
2016-06-09 15:24:32 -07:00
Caroline Liu
0c322403a6
Create common test function for select_item_via_typeahead.
2016-06-09 14:55:31 -07:00
Caroline Liu
60e5140406
Add warning for @all / @everyone.
...
* The warning contains a count of the number of people in the stream.
* An error appears if the warning is ignored and the user tries to
send the message anyway.
* The message cannot be sent until the warning is acknowledged or @all
/ @everyone is removed.
* This only applies to stream messages and not private messages.
Fixes #853 .
2016-06-09 14:38:58 -07:00
Umair Khan
08045241a7
Cache node_modules in Travis.
...
Fixes : #712
2016-06-09 14:36:22 -07:00
Tim Abbott
584887e588
lint: Require folding of } on same line in else if statements.
2016-06-09 14:05:34 -07:00
Tim Abbott
c35781d505
lint: Require folding of } on same line as else statements.
2016-06-09 14:02:49 -07:00
Tim Abbott
0c1b5006f7
lint: Check for space after if in javascript.
2016-06-09 13:47:12 -07:00
Tim Abbott
eba0d6339f
lint: Require space after // in JS comments.
2016-06-09 13:44:24 -07:00
Tim Abbott
a09b950097
lint-all: Check for relative URLs in JSON calls from JS.
2016-06-09 11:59:40 -07:00
Tim Abbott
f9951bb1ca
Fix uploading files when using Zulip in another language.
...
Apparently, relatively URLs in our javascript no longer work.
2016-06-09 11:57:29 -07:00
rahuldeve
ed83bb7f54
Refactor zerver.views.upload.
2016-06-08 09:49:14 -07:00
rahuldeve
e1a2660e70
Refactor realm_id to realm_id_str in url.py.
2016-06-08 09:49:14 -07:00
rahuldeve
23ff717bee
Fix annotations: zerver.lib.upload.
2016-06-08 09:49:14 -07:00
Umair Khan
938291a922
Add run-dev.py test to Travis CI test suites.
...
Fixes #919
2016-06-08 14:10:37 +05:00
Tim Abbott
a829366733
util: Create and use is_pm_recipient helper function.
2016-06-07 21:58:45 -07:00
Tim Abbott
60f6616030
people.js remove: Fix case-sensitive email matching.
2016-06-07 21:58:45 -07:00
Tim Abbott
567c0796f9
Filter: Fix case-sensitive comparisons of email addresses.
...
Previously, a query containing capital letters might match nothing if
these code paths were ever activated.
2016-06-07 21:58:45 -07:00
Tim Abbott
b25562ca1d
Add and use util.is_current_user helper function.
...
Previously, we were checking if a particular user was the current user
in dozens of places in the codebase, and correct case-insensitive
checks were not used consistently, leading to bugs like #502 .
2016-06-07 21:58:44 -07:00
Givorenon
0bf2d171ae
Fix fading of messages in dialog and users in side-bar.
...
Make comparison of emails in compose_fade.js and util.js
case-insensitive to fix fading of users and messages respectively.
2016-06-07 21:31:47 -07:00
Tim Abbott
e14732a12c
Remove unused test_beankstalk_message function.
2016-06-07 21:27:29 -07:00
Tomasz Kolek
2ac9c792f3
test_hooks: Use an incoming webhook bot for webhook tests.
2016-06-07 21:27:04 -07:00
Tomasz Kolek
999093b227
Add new is_incoming_webhook bot type.
...
This type of bot is only able to send messages via webhook endpoints.
2016-06-07 21:23:35 -07:00
Hyunchel Kim
b0702c62fc
Annotate zerver.views.messages partially.
2016-06-07 21:09:30 -07:00
Nathan Florea
6bcb6c3192
Removed some unused imports.
2016-06-07 18:13:58 -07:00
Nathan Florea
f11eee8b41
Remove redundant file open.
...
Calling open() with mode 'w' or 'a' will create a file if it doesn't exist,
while mode 'r' will cause an exception. This can be easily tested with:
python -c 'open("test.tmp", "w")'
ls test.tmp
2016-06-07 18:10:44 -07:00
Vishnu Ks
d30ea0bc44
Move recent_subjects to stream_data.
2016-06-07 17:50:16 -07:00
Tim Abbott
760ff216ad
realm emoji: Add description of the custom emoji feature in settings.
2016-06-07 16:24:07 -07:00
Evan Palmer
bd0fd61821
Annotate zilencer.error_notify.
...
Also fix the annotation of zilencer.views.report_error.
The `report` arguments are a Dict containing both strings and the
`more_info` sub-dictionary, so we type them as Dict[str, Any].
[tweaked by tabbott]
2016-06-07 13:44:56 -07:00
Conrad Dean
fe2c352ac0
ClientDescriptor: Pass inline sets, not lists, to do_gc_event_queues.
...
This allows us to more precisely type do_gc_event_queues.
2016-06-07 13:28:45 -07:00
Conrad Dean
d77c70220c
send_event: Remove useless return value and annotate.
...
Detected by mypy.
[tweaked by tabbott to pass mypy check and remove annotations]
2016-06-07 13:27:40 -07:00
Conrad Dean
a4704ba8b2
event_queue: Fix deque values type annotation.
...
Event IDs in here are ints, as shown by the prune operation.
2016-06-07 13:05:46 -07:00
Tomasz Kolek
29ec2a328b
Fix save in topic edit also saving message content edit box.
...
Fixes #932 .
2016-06-07 12:55:58 -07:00
Umair Khan
5becd53414
Add tests for json_error and JsonableError.
2016-06-07 12:41:59 +05:00
Tim Abbott
bc2961d3ac
Refactor file upload routes to their own file.
2016-06-06 16:09:05 -07:00
Vishnu Ks
f3a8962612
Replace make_dict() with stream.to_dict().
2016-06-06 14:46:12 -07:00
gregmccoy
1844f1b054
Add button to exit the Zulip tutorial.
...
Fixes : #872 .
[Tweaked by tabbott to fix focus and rename to "Exit tutorial".]
2016-06-06 14:38:11 -07:00
Tim Abbott
2595ce4a35
Annotate frontend_tests/run-casper.
2016-06-06 13:41:44 -07:00
Tim Abbott
be53c9e39e
tests: Check for presence of typing in venv guard.
...
Since relatively few systems have the typing module, this makes the
checks for whether the user is properly running our test scripts in
the virtualenv more likely to trigger well.
2016-06-06 13:41:34 -07:00
Ernesto Vargas
ffb2f9e84b
lint/tests: Give nice error message for common import failures.
...
This should make users much more likely to be able to debug issues
where they ran Zulip outside the Vagrant environment or virtualenv.
[error messages tweaked by tabbott]
2016-06-06 13:39:26 -07:00
Umair Khan
0ab6b99cbb
Fix backend i18n bug.
...
`makemessages` escapes the `%` sign in `.po` files, but Jinja2 does
not unescape it while replacing the tranlation strings. In Jinja2,
there is an updated implementation of gettext available called
new-style gettext which handles escaping better; this commit switches
to using that.
Fixes #906 .
2016-06-06 09:34:51 -07:00
Umair Khan
3092f509b0
Fix Handlebars translations.
...
Change file mapping between Transifex and Zulip. Fix the typo
in the translation file resource url for Chinese.
2016-06-06 09:30:56 -07:00
Evan Palmer
8afeb7d8ce
Annotate webhooks/transifex.py, webhooks/yo.py.
2016-06-05 17:01:53 -07:00
Daw-Ran Liou
7f0709b65c
Annotate zerver.views.webhooks.freshdesk
...
Change the comments into docstrings.
Modified the return type of parse_freshdesk_event to always return a
list of str.
2016-06-05 15:56:27 -07:00
Dalek-Sec
c457f551ea
Annotate zerver/views/webhooks/crashlytics.py
2016-06-05 15:54:13 -07:00
medullaskyline
7e30de04ca
Annotate zerver.views.webhooks.pingdom.
2016-06-05 15:52:53 -07:00
medullaskyline
4c1da236ad
Annotate zerver.views.webhooks.pagerduty.
2016-06-05 15:47:33 -07:00
Daw-Ran Liou
4428287846
Annotate zerver.views.webhooks.stash.
2016-06-05 15:42:25 -07:00
Hyunchel Kim
b79cad0404
Annotate zerver.views.webhooks.teamcity
2016-06-05 15:11:45 -07:00
Hyunchel Kim
f226456675
Add type annotations for analytics/views.py.
...
Type of parameter for function `is_recent`(line no.812) is `datetime`.
MyPy errors out, however, when the parameter is defined as `datetime`.
To get around, type `Any` is used.
2016-06-05 15:04:24 -07:00
Daw-Ran Liou
26d067fc97
Annotate zerver.views.webhooks.pivotal.
2016-06-05 14:57:53 -07:00
medullaskyline
2369d48a9b
Annotate zerver.views.webhooks.newrelic.
2016-06-05 14:52:20 -07:00
Evan Palmer
4bf81b58b4
Annotate zerver/views/webhooks/zendesk.py.
2016-06-05 14:50:52 -07:00
Hyunchel Kim
de34dd1187
Annotate travis webhoook function.
2016-06-05 14:46:26 -07:00
medullaskyline
158914aa98
Annotate zerver.views.webhooks.jira.
2016-06-05 14:36:39 -07:00
Hyunchel Kim
bc87685ea6
bitbucket: Correct return type in annotation.
2016-06-05 14:33:31 -07:00
Daw-Ran Liou
70f44c00b0
check_send_message: Replace args/kwargs with explicit args.
...
This lets us actually type-checks the various views that are using
check_send_message.
2016-06-05 14:30:38 -07:00
Tim Abbott
553ef81f92
Add lint rules for mypy type annotations.
2016-06-05 13:00:55 -07:00
Max
86fb6467e7
Add annotations to avatar.py, db.py, logging_util.py, unminify.py.
...
Also, fixed a a small type annotation in users.py because email must
be a string because emails don't support UTF-8 at this time (according
a comment in gravatar_hash in avatar.py).
2016-06-05 12:38:20 -07:00
medullaskyline
2855c285b4
Annotate zerver.forms.
2016-06-05 12:02:19 -07:00
Daw-Ran Liou
90a2dead46
Annotate zerver/views/webhooks/deskdotcom.py.
2016-06-05 11:53:44 -07:00
Deborah Hanus
a261a6bbac
Annotate zerver/views/__init__.py.
...
Also fix typing errors in a few related files.
[with tweaks from tabbott]
2016-06-05 11:34:19 -07:00
Daw-Ran Liou
c9bb93b0d2
Annotate zerver/views/webhooks/beanstalk.py.
2016-06-05 10:54:23 -07:00
Tomasz Kolek
c5b56c15de
Fix placement of EDITED in one line status messages.
...
Fixes #836 .
2016-06-05 10:11:05 -07:00
Tim Abbott
15b2dd085e
Annotate zerver.lib.test_runner.
2016-06-04 23:23:31 -07:00
Tim Abbott
1ca7c3378b
Annotate zerver.lib.testing_mocks.
...
Also fix some annotations in bugdown to match.
2016-06-04 22:54:49 -07:00
Tim Abbott
157a3efb78
Annotate zerver.exceptions, zerver.filters, zerver.logging_handlers.
2016-06-04 22:51:18 -07:00
Conrad Dean
33dee43179
Annotate zerver/lib/socket.py.
...
Currently this uses a Union type for connection_id; we need to figure
out what actually sets that and what its type is and fix that later
(see https://github.com/zulip/zulip/issues/896 ).
2016-06-04 22:36:03 -07:00
Sumana Harihareswara
45b1893284
Convert architecture overview from rST to md for consistency.
...
Fixes : #668 .
2016-06-04 22:27:00 -07:00
Sumana Harihareswara
6f59683324
Fix and clarify architecture overview.
2016-06-04 22:27:00 -07:00
pxhanus
e247d9783f
Annotate zilencer/views.py.
2016-06-04 22:07:01 -07:00
Dalek-Sec
2bcf313a85
Added MyPy types to zerver/views/webhooks/codeship.py
2016-06-04 22:03:41 -07:00
acrefoot
7a5bbe040b
Fix flaky casper test for messsage edits
...
.message_edit_notice is too broad of a selector to
test if your most recent edit has posted. Also
check if the currently selected message is the one
that's been edited.
2016-06-04 22:02:18 -07:00
medullaskyline
47c3ec1283
Annotate zerver.lib.upload.
2016-06-04 19:13:03 -07:00
Umair Khan
1bfe566c8d
[i18n] Make Json error messages translatable.
2016-06-04 18:48:36 -07:00
Umair Khan
7057b2ae37
Add documentation for json_error and JsonableError.
...
Add documentation on how to make the strings passing through
json_error and JsonableError translatable.
2016-06-04 18:48:32 -07:00
acrefoot
0f960e04c4
Fix flaky casper test in admin page.
...
When you deactivate a user, visit another page, and then
come back, the user shows up in another table (the
"Deactivated Users" table), and no longer has the
strikeout styling of a recently deactivated user.
Using the strikeout class as a selector to test if the
user has been reactivated will of course not be a good
test, and if you have a slow machine, lose a
race condition.
When you deactivate a user, visit another page,
and then come back, the user shows up in another
table, and no longer has the strikeout styling
of a recently deactivated user. Using strikeout
class to test if the user has been reactivated
will of course not be a good test, and if you
have a slow machine, lose a race condition.
2016-06-04 18:34:27 -07:00
medullaskyline
c5f0d5b40a
Annotate zerver.middleware.
2016-06-04 18:32:06 -07:00
Tim Abbott
9c5f15e89b
models: Fix use of non-lazy ugettext at import time.
...
Was introduced in 03debdf82f .
2016-06-04 17:46:03 -07:00
Daw-Ran Liou
0265968ea2
Annotate zerver/views/user_settings.
2016-06-04 17:41:59 -07:00
James Porter
2a8e8129d1
Make emoji_dump delete old ttx files on start.
2016-06-04 17:05:48 -07:00
James Porter
f5f2d72178
Wrap main bit of emoji_dump.py in a main function.
2016-06-04 17:05:48 -07:00
James Porter
9d58624359
Minor reformatting of emoji_dump.py.
2016-06-04 17:05:48 -07:00
James Porter
d008d96597
Update Emoji set.
2016-06-04 17:05:48 -07:00
Reid Barton
cf93c8bce0
Annotate zerver/views/webhooks/bitbucket.py.
2016-06-04 17:02:59 -07:00
Daw-Ran Liou
8bbd93011d
Annotate zerver/views/users.py.
2016-06-04 17:00:53 -07:00
medullaskyline
fcdcccb5df
Annotate zerver.lib.digest.
2016-06-04 16:20:18 -07:00
Tim Abbott
d9d0515d3b
Add mypy bug number for check_redis type: ignore.
2016-06-04 16:11:18 -07:00
Tim Abbott
f2320bf27f
Fix populate_db send_messages annotation.
2016-06-04 16:11:14 -07:00
medullaskyline
7c2c7fb31c
Annotate zerver/lib/bulk_create.py.
2016-06-04 15:51:05 -07:00
Tomasz Kolek
8411b2e574
Add Crashlytics integration.
2016-06-04 15:18:42 -07:00
Tomasz Kolek
093e5a96d4
Add Transifex integration.
...
Fixes : #810 .
2016-06-04 14:52:57 -07:00
Taranjeet
c6cfd21bd4
Readme: Fix links for readme.dev and readme.prod.
...
Absolute links is necessary for readthedocs to properly
link to the files.
2016-06-04 14:15:08 -07:00
Tim Abbott
697125eeae
Fix coveralls badge to point to the right branch.
2016-06-04 14:11:21 -07:00
Reid Barton
a0f906edf9
Add mypy coverage status to README.md.
2016-06-04 13:01:19 -07:00
Reid Barton
0b7852f081
Generate mypy coverage report for travis + coveralls.
2016-06-04 13:01:19 -07:00
Max
04e2745136
Annotate debug.py, initial_password.py, narrow.py, response.py.
...
Also, fixed up the annotations for tornadoviews to better align with
how narrows was defined as `Iterable[Sequence[str]]` rather than
`List[Tuple[str, str]]`.
2016-06-04 12:56:36 -07:00
medullaskyline
7b2db95d02
Annotate zerver/lib/ccache.py.
2016-06-04 12:19:34 -07:00
Tim Abbott
6fba0879a4
Annotate much of the rest of zerver/tests.
2016-06-04 11:53:20 -07:00
Tim Abbott
27e9d3f06b
Annotate test_external and test_signup.
2016-06-04 11:53:20 -07:00
Tim Abbott
966375d74c
Annotate test_events, test_realm_emoji, test_uploads.
2016-06-04 11:53:20 -07:00
Tim Abbott
f1d58e767b
Annotate zerver/tests/test_subs.py.
...
This required a number of unique-related changes to test_helpers.
2016-06-04 11:53:10 -07:00
Tim Abbott
6f69053911
Annotate most of the rest of bugdown.
2016-06-04 11:35:29 -07:00
Max
c8dc033c3c
Annotate camo.py, mandrill_client.py, query.py, session_user.py
2016-06-04 11:28:42 -07:00
Tim Abbott
a1a27b1789
Annotate most Zulip management commands.
2016-06-04 10:12:06 -07:00
Tim Abbott
c2bea0fa08
zulip_finish: Remove useless return statement.
2016-06-04 10:06:31 -07:00
Tim Abbott
ac3989c114
models: Add most missing type annotations.
2016-06-04 00:03:54 -07:00
David Adamec
9e8ea93d3d
Add annotations for zerver/lib/validator.
2016-06-03 23:53:49 -07:00
David Adamec
4f3c85a20c
Add type annotations to zerver/lib/rest.
2016-06-03 23:48:46 -07:00
Conrad Dean
e7f0698884
Annotate zerver/lib/notifications.py.
2016-06-03 23:45:29 -07:00
Tim Abbott
7fd2956f29
clear_followup_emails_queue: Rename confusing local variable.
2016-06-03 23:45:29 -07:00
medullaskyline
cb84f72f2d
Annotate zerver/lib/html_diff.py.
2016-06-03 23:21:26 -07:00
Tim Abbott
2ec0114079
test_bugdown: Add tests for mentions.
2016-06-03 23:18:39 -07:00
Tim Abbott
cfff4f1d49
test_bugdown: Add a bugdown test for alert_words functionality.
2016-06-03 23:18:39 -07:00
Tim Abbott
8c757292cf
test_bugdown: Add test for nonmatching realm filters.
2016-06-03 23:18:39 -07:00
Tim Abbott
3a0eb01dda
test_messages: Fix huddle test failing when not on Internet.
2016-06-03 23:18:39 -07:00
Tim Abbott
e89730dc8f
subject_links: Remove useless RealmFilter.DoesNotExist case.
2016-06-03 23:18:39 -07:00
Tim Abbott
68fba3579d
test_bugdown: Add testing of subject_links feature.
2016-06-03 23:18:39 -07:00
gregmccoy
d77e8df3fa
Add tests for zerver/views/realm_emoji.py.
2016-06-03 23:12:53 -07:00
Tim Abbott
03debdf82f
Fix malformed error message when creating invalid Realm Emoji.
...
Thanks to Greg McCoy for his help finding this bug.
2016-06-03 23:12:36 -07:00
David Adamec
8ad20e9775
mypy type annotations for zerver/lib/utils
2016-06-03 22:58:15 -07:00
Tim Abbott
a0b332d6cf
Add missing dependency decorator of ipython.
2016-06-03 19:29:54 -07:00
Tim Abbott
1552b9308b
Fix apnsclient import to match version 0.1.8 used in production.
...
Apparently, apnsclient moved Connection to a different module between
0.1.8 and 0.2.1.
2016-06-03 19:28:36 -07:00
Tim Abbott
9b86fa96e7
Downgrade python-apnsclient in development to match prod.
2016-06-03 19:27:34 -07:00
Tim Abbott
e7d9b28dfc
install-mypy: Pass --upgrade to correctly handle new mypy versions.
2016-06-03 19:11:32 -07:00
Max
0f4673ae3b
Add type annotation to mention.py, redis_utils.py, timestamp.py, user_agent.py
...
Some functions in models.py had input typed as int when they needed to be typed as datetime.datetime
2016-06-03 19:00:16 -07:00
Max
1148f6ff8a
Rename timestamp kwarg in to_presence_dict to dt
...
It is not a timestamp, it is a datetime object. This is better ducktyping
2016-06-03 19:00:16 -07:00
Tim Abbott
5d5f1f46dc
Upgrade mypy and typed_ast to latest versions.
2016-06-03 18:59:55 -07:00
Tim Abbott
654bd663aa
bugdown: Add annotations for a few more functions.
...
This resolves the issue with Typeshed #244 by making `upload_re` start
with `ur`.
2016-06-03 18:11:53 -07:00
Tim Abbott
f97b025a33
push_notifications: Fix incorrect Connection import.
2016-06-03 18:11:53 -07:00
medullaskyline
303bd21068
Annotate zserver.lib.push_notifications.
2016-06-03 17:45:54 -07:00
Oren Leaffer
2916fb30cb
bugdown: add some type annotations.
...
Had to add some "type: ignore" because the pattern used in match
doesn't affect the type returned. A fix for this issue has been pushed
to typeshed - https://github.com/python/typeshed/pull/244
2016-06-03 17:03:52 -07:00
medullaskyline
2213a9f41f
Annotate zerver/lib/cache_helpers.py
2016-06-03 16:34:30 -07:00
Sumana Harihareswara
8c2382deeb
De-duplicate three sections of architecture overview.
2016-06-03 12:56:31 -07:00
Conrad Dean
7f61a5e862
Add type annotations to zerver.lib.test_helpers.
2016-06-03 12:17:26 -07:00
Sumana Harihareswara
4a10923bf1
Add architectural overview documentation.
...
Fixes : #453 .
2016-06-03 11:54:02 -07:00
Max
a6e60419c4
Add types to confirmation/views.py and zerver/tornadoviews.py
2016-06-03 11:26:30 -07:00
Vishnu Ks
4fd569f910
Change add_default_stream method from PATCH to PUT.
...
This is more consistent with our other routes.
2016-06-03 09:52:51 -07:00
Nathan Florea
85c0da67a4
Changed make_request lambda to more readable function.
2016-06-03 09:17:04 -07:00
Nathan Florea
04c71fadc6
More removal of mutable default arguments.
...
I've left a few that clearly aren't being passed and aren't being mutated, but
I think I've gotten the rest of them.
2016-06-03 09:17:04 -07:00
Nathan Florea
5fe9076631
Remove some mutable default arguments.
...
These ones don't fix any bugs, because the mutable arg is never passed
outside of the callable or mutated. But it's good practice to not use
them in case those invariants are changed in the future.
2016-06-03 09:16:56 -07:00
Nathan Florea
2e4283f60a
api: Remove some mutable default arguments.
...
This could be more succinct with a conditional expression, but this is
easier to read.
2016-06-03 09:16:52 -07:00
Ashish Kumar
9b990e3bd0
Type annotation of zerver/views/alert_words.
...
[Tweaked by tabbott to annotate the REQ variables the new way]
2016-06-03 08:07:58 -07:00
Ashish Kumar
31bf6b8259
Type annotation of zerver/models.py
...
[Substantially revised by tabbott]
This probably still has some bugs in it, but having mostly complete
annotations for models.py will help a lot for the annotations folks
are adding to other files.
2016-06-02 23:28:34 -07:00
Tim Abbott
37015fd7c5
Run mypy on zerver/lib/test_auth_backends.py.
2016-06-02 23:01:15 -07:00
Tim Abbott
8cef9675c8
Run mypy on zerver/lib/test_events.py.
2016-06-02 23:00:04 -07:00
Tim Abbott
e6d2b0cdbc
Run mypy on zerver/lib/test_unread.py.
2016-06-02 22:59:00 -07:00
Tim Abbott
f3b07ee9aa
Run mypy on zerver/lib/test_subs.py.
2016-06-02 22:57:07 -07:00
Tim Abbott
1bdbdd1110
Run mypy on test files where it already passes.
2016-06-02 22:53:28 -07:00
Umair Khan
072551a94e
Fix most redownloading in 'vagrant reload --provision'.
...
Fixes #264 .
2016-06-02 22:32:56 -07:00
Oren Leaffer
c2ce5119c6
Annotate zerver.views.tutorial.
2016-06-02 18:49:27 -07:00
Conrad Dean
f8f2f45410
run-mypy: Add --linecount-report and --disallow-untyped-defs flags.
2016-06-02 18:45:52 -07:00
acrefoot
cf15b0b4e6
Fix hanging nc and 'invalid wait time' error on Trusty.
...
Apparently, 0 isn't a supported wait time value in some versions of nc.
2016-06-02 18:02:13 -07:00
Rachel Kelly
df36216914
Change instances of 'coworkers' to 'users'.
...
In order to genericize use of Zulip outside companies,
all instances of coworkers have been changed to users.
NOTABLE EXCEPTION: When the Zulip instance is domain-
locked, the reference to coworkers remains. The reason
for this is twofold: first, the majority of Zulip instances
which require a particular domain will be locked to a
company, and second, the template variable for the domain
necessary should be added to the alert so it is clear
to the user what the domain needs to be for access.
Fixes : #861 .
2016-06-02 16:05:27 -07:00
Pei-Wei Wu
8d2733ae8c
Add mypy type annotations to zerver/views/streams.py.
2016-06-02 15:44:43 -07:00
Ashley Dunn
7826aa7e7f
Type annotation of zerver/views/realm_emoji.
2016-06-02 14:01:28 -07:00
John Hampton
d4dbcb80cc
README.prod.md: Remove redundant unpacking of the tarball.
2016-06-02 10:32:52 -07:00
Taranjeet
a45bde7822
Docs: Fix typos in docs.
2016-06-02 10:31:41 -07:00
Ashish Kumar
cad342aff6
Correct annotation of generic_bulk_cached_fetch in zerver/lib/cache.py.
...
Previously, object_ids was tagged as an int, but it is called from
models.py with a string, so we make it an Any.
2016-06-01 14:00:49 -07:00
Tim Abbott
44929523d6
Harden extraction of AUTH_LDAP_BIND_PASSWORD.
2016-05-31 15:06:43 -07:00
Tim Abbott
dac8f7d923
Fix buggy extraction of EMAIL_GATEWAY_PASSWORD.
...
EMAIL_GATEWAY_PASSWORD has a value of None in the defaults list, so it
will never fail to be in vars().
2016-05-31 15:06:17 -07:00
Tim Abbott
fbc30c2914
test-all: Add a call to run-mypy.
...
Using mypy to check the codebase is stable and useful enough that it's
worth including it in the default tests run locally.
2016-05-31 15:00:15 -07:00
Tim Abbott
c5b495b775
Update changelog with important changes since last release.
2016-05-31 11:39:47 -07:00
Sumana Harihareswara
cb6ae3a766
Add anchor tags to README.md.
2016-05-31 11:27:21 -07:00
Tim Abbott
d056b5601b
docs: Add python-tyoing to RTD dependencies.
...
This should fix the RTD build having been broken since
d9c4be87d1 .
2016-05-31 11:19:49 -07:00
Sumana Harihareswara
337155f280
Remove rST files to replace with Markdown.
...
Currently (https://github.com/rtfd/recommonmark/issues/3 )
the recommonmark bridge (which allows Sphinx to read
Markdown) does not support tables, so the directory structure
doc is now a bulleted list instead of a set of tables.
2016-05-31 10:55:49 -07:00
Sumana Harihareswara
e0bc57ddb1
Rearrange docs table of contents for coherence.
...
The order and structure of the Read The Docs documentation
was fairly arbitrary; here's a suggestion for how to change
its information architecture so it's more useful to a new
contributor. This adds a short Zulip overview, and a table
of contents and code contribution intro for new contributors.
Fixes : #668 .
Signed-off-by: Sumana Harihareswara <sumanah@panix.com >
2016-05-31 09:07:09 -07:00
Sumana Harihareswara
3029b3681f
Rearrange sections of testing doc for coherence.
2016-05-31 09:05:38 -07:00
Sumana Harihareswara
f65778f1e2
Improve sub-headings in documentation.
...
Signed-off-by: Sumana Harihareswara <sumanah@panix.com >
2016-05-31 09:05:38 -07:00
Sumana Harihareswara
86f7695b8c
Fix style, formatting in Bugdown docs.
2016-05-31 08:56:58 -07:00
Sumana Harihareswara
ad644afa97
Improve code style guidelines.
2016-05-31 08:56:58 -07:00
Sumana Harihareswara
3631cf3078
Add links in front end build process doc.
...
Signed-off-by: Sumana Harihareswara <sumanah@panix.com >
2016-05-31 08:56:58 -07:00
Tomasz Kolek
0820ab591a
Refresh page when message with /me is edited.
...
Fixes : #163 .
Thanks to Catherine Nguyen (@cnguye11) for her work on this.
2016-05-31 08:29:07 -07:00
Tim Abbott
3ed78eb746
docs/testing: Clean up discussion of rebuilding database.
2016-05-31 07:48:00 -07:00
Christie Koehler
e06492ec3a
Improve first-time contributor docs.
...
Fixes #747 . Fixes #748 .
This updates README.dev.md to include clear, step-by-step instructions
for setting up the Zulip dev environment Windows 10, OS X El Capitan,
Ubuntu 14.04 Trusty, and Ubuntu 16.04 Xenial. It is aimed at first-time
contributors.
I tested these instructions multiple times on each of the target
systems.
Also added is a "trobleshooting and common errors" section which
documents the most common errors contributors are likely to encounter
during setup and how to fix them.
Improvements based on feedback from @timabbott.
- Fixes whitespace issues so linter will pass.
- Updates memory requirement.
- Re-orders so operating systems are listed alphabetically.
- Updates headings to be clearer.
- Updates and adds ToC entries for clarity.
- Adds screen shot of Zulip dev environment running in browser.
- Adds details about using dev environment, including about logging.
- Misc other minor changes for clarity.
- Adds a stub for docs/logging.md
- Adds details about configuring Cygwin for native symlinks.
2016-05-31 07:47:45 -07:00
Umair Khan
bd4e471706
Check json_error and JsonableError in linter.
...
Mainly the check is to ensure that all the strings that pass through
these two functions are captured by `makemessages`.
2016-05-31 07:40:42 -07:00
Umair Khan
08fbd57245
[i18n] Make error messages translatable.
...
Make all strings passing through `json_error` and `JsonableError`
translatable.
Fixes #727
2016-05-31 07:40:42 -07:00
Umair Khan
4b28fcd2f3
Add option to linter to exclude lines from files.
2016-05-31 07:40:42 -07:00
Tim Abbott
ab2d325a08
Update production default streams to be less engineering-centric.
2016-05-31 07:38:25 -07:00
Vishnu Ks
100d885f23
Change default announcement stream to announce.
...
Fixes #788 .
2016-05-31 07:38:07 -07:00
Tim Abbott
960144a49e
Desupport using uninstantiated REQ with has_request_variables.
...
This makes life difficult for doing static type annotations, and
didn't make the code look that much better anyway.
2016-05-31 07:31:15 -07:00
Tim Abbott
41336f3782
lint-all: Check for use of '== None'.
2016-05-31 07:02:04 -07:00
Umair Khan
9a57176ad6
Do shallow testing of backend templates.
...
Just render the templates without the actual workflow to see if they
don't return a 500 error; this lets us catch various classes of
template bugs automatically.
Fixes #784 .
2016-05-31 05:42:17 -07:00
Umair Khan
c884559ec6
Show templates rendered report.
...
Add two options to the `test-backend` script:
1. verbose
If given the `test-backend` script will give detailed output.
2. no-shallow
Default value is False. If given the `test-backend` script will
fail if it finds a template which is shallow tested.
2016-05-31 16:46:11 +05:00
Umair Khan
daf3d51d4b
Send 'template_rendered' signal from Jinja2.
...
Send the signal only under DEBUG=True just like Django.
2016-05-31 14:31:13 +05:00
Umair Khan
29859c191d
Call url correctly from password_reset_email.txt.
...
In Jinja2 the url function is called differently. We can't give keyword
arguments directly instead we need to pass them through kwargs argument.
2016-05-30 21:05:03 -07:00
Tomasz Kolek
ff4e92dc3d
settings: change tab indentation to space.
2016-05-30 20:16:00 -07:00
Greg Price
436499a129
Clean up some relative-path handling in lister using Git magic
...
This lets us cut out the line which hard-codes how deeply nested in
the tree the `run-mypy` script is, making it simpler to borrow these
scripts in other projects.
2016-05-30 20:01:37 -07:00
Tomasz Kolek
8e144a1f57
Add zip and absoulte_import to pass py3k test.
2016-05-30 22:28:05 +02:00
Tim Abbott
baec0f12cf
Add a proper annotation for REQ in streams.py.
2016-05-30 11:41:16 -07:00
Reid Barton
8c6afac7cd
Add a stub file for request.py.
...
This stub file allows us to annotate view functions using the actual
types present in the bodies of the functions, rather than everything
having the type REQ.
2016-05-30 11:28:53 -07:00
Tim Abbott
572c69f3c2
Move REQ and friends to their own module.
2016-05-30 11:24:17 -07:00
Eklavya Sharma
48e7e1a2a1
zerver/lib/actions.py: Rename stream_name to stream.
...
In function bulk_add_subscriptions, some variables were named
`stream_name` but their type is Stream, not a string. Rename
those variables to `stream`.
2016-05-30 09:52:59 -07:00
Reid Barton
ff845ebb96
Make tools/install-mypy exit on error.
2016-05-30 09:49:45 -07:00
Tim Abbott
1b59b6826a
docs/code-style.rst: Update and clarify shebang rules.
2016-05-29 05:07:50 -07:00
Eklavya Sharma
94e4b39112
Replace python2.7 by python everywhere.
2016-05-29 05:03:08 -07:00
Eklavya Sharma
149938d468
Change shebangs from python2.7 to python.
2016-05-29 05:03:08 -07:00
Eklavya Sharma
1bb6a0db4c
Annotate zerver/lib/actions.py.
2016-05-29 04:26:17 -07:00
Eklavya Sharma
2308107805
zerver/lib/actions.py: Use unicode literals.
...
Convert some strings literals to unicode strings by prefixing with `u`.
2016-05-29 04:26:17 -07:00
Eklavya Sharma
b74f603682
zerver/lib/actions.py: Rename variables and add/edit comments.
2016-05-29 04:26:17 -07:00
Eklavya Sharma
efab224bd1
zerver/lib/actions.py: Remove unneeded return {} statements.
2016-05-29 04:26:17 -07:00
Eklavya Sharma
a2b48f05e5
zerver/lib/actions.py: Fix return values.
2016-05-29 04:26:17 -07:00
Vishnu Ks
dc060248b4
Add instruction to check screenshot of failed tests.
2016-05-28 23:27:24 +05:30
Vishnu Ks
31968f668c
Correct frontend_test script path.
2016-05-28 23:23:39 +05:30
Vishnu Ks
fea5ed5b60
Remove unread_subjects from check-all.js
...
unread_subjects is not used by other modules.
2016-05-27 01:03:21 -07:00
Vishnu Ks
51c86a8e2e
Move get_private_message_recipient to message_store.js
2016-05-27 01:03:21 -07:00
Vishnu Ks
89d743787e
Move recenter_view to viewport.js.
2016-05-27 01:03:21 -07:00
Vishnu Ks
4be20c4b4a
Move scroll_to_selected to navigate.js.
2016-05-27 01:03:21 -07:00
Vishnu Ks
e329c9e0f5
Move maybe_scroll_to_selected to navigate.js.
2016-05-27 01:03:21 -07:00
Vishnu Ks
dc577343fe
Move last_viewport_movement_direction to viewport.
2016-05-27 01:03:21 -07:00
Umair Khan
0278ce9102
Move tools/py3_test_reqs.txt to tools/setup/.
...
Fixes #708
2016-05-26 18:43:24 +05:00
Umair Khan
57f477dd8b
Move tools/install-phantomjs to tools/setup/.
2016-05-26 18:28:14 +05:00
Umair Khan
1161862b07
Move tools/emoji_dump to tools/setup/.
2016-05-26 18:28:14 +05:00
Umair Khan
b85526576a
Move tools/postgres-init-dev-db to tools/setup/.
2016-05-26 18:28:10 +05:00
Umair Khan
b0991966ab
Move tools/postgres-init-test-db to tools/setup/.
2016-05-26 18:28:05 +05:00
Umair Khan
d425e05a02
Move tools/generate-fixtures to tools/setup/.
2016-05-26 17:54:32 +05:00
Umair Khan
8335bd672f
Move tools/generate-test-credentials to tools/setup/.
2016-05-26 17:54:28 +05:00
Umair Khan
d5f3a82284
Move tools/download-zxcvbn to tools/setup.
2016-05-26 16:05:23 +05:00
Eklavya Sharma
09400a7e50
End compile-handlebars-templates gracefully.
...
Catch KeyboardInterrupt from tools/compile-handlebars-templates,
print a message and exit when running in forever mode.
2016-05-25 16:06:35 -07:00
Eklavya Sharma
1ea6171179
Fix an annotation in zerver/lib/cache.py.
...
This is done to make annotations in zerver/lib/actions.py work correctly.
2016-05-25 15:11:48 -07:00
Eklavya Sharma
d9c4be87d1
Make docs/conf.py pass mypy check.
2016-05-25 15:04:39 -07:00
Eklavya Sharma
30892b2f99
Make makemessages.py pass mypy check.
2016-05-25 15:04:39 -07:00
Eklavya Sharma
ea52fc05ed
Make zproject/urls.py pass mypy check.
2016-05-25 15:04:39 -07:00
Eklavya Sharma
1c04560def
Re-enable pyflakes in linter and remove python 3 pyflakes errors.
2016-05-25 19:25:13 +05:30
Eklavya Sharma
1a6257394c
Make tools/lint-all run on python 3.
...
Since pyflakes catches some extra errors in python 3, disable
pyflakes for now.
2016-05-25 19:23:13 +05:30
Eklavya Sharma
3185b7e750
Remove unneeded imports from tools/lint-all.
2016-05-25 19:12:09 +05:30
Eklavya Sharma
459c6640bf
Fix type annotations in zerver/lib/alert_words.py.
2016-05-24 14:12:11 -07:00
Eklavya Sharma
95d059bfb3
Fix typo in zerver/lib/actions.py.
2016-05-24 14:12:11 -07:00
Eklavya Sharma
c800c87d2d
Remove __pycache__ in tools/clean-repo.
2016-05-24 13:43:49 -07:00
Eklavya Sharma
b6bd5445bc
End puppet/.../process_fts_updates gracefully.
...
Catch KeyboardInterrupt in puppet/zulip/files/postgresql/process_fts_updates,
print a message and exit.
2016-05-24 13:28:05 -07:00
Eklavya Sharma
b210727e5c
Enable running tools/run-mypy on a subdirectory.
...
Previously tools/run-mypy could not run on a subdirectory properly
because run-mypy assumed exclude files to be in that subdirectory.
2016-05-24 13:24:15 -07:00
Eklavya Sharma
bd63caed96
Fix exclude startegy in tools/lister.py.
...
Previously lister.py used to check whether the exclude path is a
substring of a path being considered. So it would fail when the
exclude path is an absolute path or uses '..' or '.'.
2016-05-24 13:24:15 -07:00
Eklavya Sharma
508a080e08
do_change_bot_type: Add update_fields to user_profile.save().
2016-05-24 13:21:44 -07:00
Eklavya Sharma
f3e25c68c7
Prevent tools/travis/mypy from failing silently.
...
Also improve the format of tools/travis/mypy's output.
Also add those files to the exclude list which are failing mypy check.
2016-05-21 12:37:04 +05:30
Umair Khan
ac13187d76
Add translation tags to the templates.
...
Fixes #726
2016-05-19 22:58:26 -07:00
Umair Khan
82b5d9304b
[third] Integrate i18next with Handlebars
2016-05-19 22:58:25 -07:00
Tim Abbott
da69949ccd
requirements: Add ipython dependencies.
2016-05-19 22:55:55 -07:00
Tomasz Kolek
8c18b8947f
Add bot_type field to UserProfile.
...
This is intended to support creating different types of bots with
potentially limited permissions.
2016-05-19 22:37:37 -07:00
Paul Traylor
06bc1007fd
Add missing \ in CentOS setup instructions.
2016-05-19 19:47:53 -07:00
Tim Abbott
cadbe64265
Fix venv files being included in coverage reports in CI.
...
e4707af2e2 didn't correctly deal with
the different path for the venv cache in Travis CI.
2016-05-19 10:25:56 -07:00
Tim Abbott
e4707af2e2
test-backend: Fix venv files being included in coverage reports.
2016-05-19 09:36:53 -07:00
Umair Khan
f9bbc5d6ff
Enable i18n support in URL configuration.
...
This supports i18n using all of the following:
- I18N urls
- Session
- Cookie
- HTTP header
2016-05-19 08:33:30 -07:00
Umair Khan
94b2af76f9
Add language mapping for Transifex, Django recognizes zh_CN.
...
See https://code.djangoproject.com/ticket/18419 for furhter details.
2016-05-19 08:30:56 -07:00
Vishnu Ks
425363ced4
Fix non determinism bug in casper tests.
...
This manifested as "ReferenceError: Can't find variable: message_list"
on random tests in the Casper test suite.
2016-05-19 08:27:46 -07:00
Tim Abbott
b01196db86
to_log_dict: Add sender_id to logged fields.
2016-05-18 23:02:43 -07:00
Kartik Maji
3d77aa49db
Add subscribe button in narrowed view when stream has no messages.
...
A temporary message appears on successful subscription, with a button
offering to unsubscribe in case the user subscribed by accident.
2016-05-18 20:06:30 -07:00
Kartik Maji
206452c867
Add stream subscription button added narrowed views.
...
Fixes : #273
2016-05-18 20:06:23 -07:00
Umair Khan
e56d3196ef
Update provisioning/release scripts to build .mo files.
...
We need to update provision.py to compile the messages files, since
they are needed for the new i18n tests. And of course we need to
include the .mo files in release tarballs; there's a bit of complexity
there around how the tarball archives are created.
2016-05-18 19:30:00 -07:00
Tim Abbott
f35327d148
Add po files imported from Transifex.
2016-05-18 19:03:56 -07:00
Umair Khan
b170b47465
Remove dot from django.po in .tx/config.
2016-05-18 18:59:30 -07:00
Umair Khan
e6d33e8834
jslint: Fix typo.
2016-05-18 18:58:06 -07:00
Aristeidis Fkiaras
3ee210d9e8
Add setting to only allow admins create new streams.
...
Fixes : #691 .
Thanks to Preston Hansen for work on this feature!
2016-05-18 18:53:13 -07:00
Tim Abbott
e781136132
Fix subscribing to existing streams when can_create_streams=False.
...
Previously, a user with can_create_streams=False would be incorrectly
unable to subscribe to streams, whether the streams previously existed
or not.
2016-05-18 18:47:24 -07:00
Tomasz Kolek
c4254497b2
Add WebhookTestCase abstract class for writing webhook tests.
...
This cuts a ton of code duplication and semi-duplication between the
webhook tests, and thus should make it a lot easier to write new ones.
2016-05-18 14:37:31 -07:00
Eklavya Sharma
016a2faa23
Make zproject/local_settings.py pass mypy check.
2016-05-18 17:10:18 +05:30
Eklavya Sharma
54759be785
Make zproject/local_settings_template.py pass mypy check.
2016-05-18 17:10:18 +05:30
Eklavya Sharma
70a94a5b23
Expand zproject/ in mypy exclude list.
2016-05-18 17:10:18 +05:30
Eklavya Sharma
6606c30355
Remove zilencer/models.py from mypy exclude list.
...
zilencer/models.py no longer gives an error on type checking with
mypy.
2016-05-18 17:10:18 +05:30
Eklavya Sharma
7c77522ce4
Make zerver/middleware.py pass mypy check.
...
This was done by reporting python/mypy#1540 and upgrading to the
latest version of mypy which has the fix for this.
2016-05-18 17:10:18 +05:30
Eklavya Sharma
98afe000ee
Make zerver/lib/statistics.py pass mypy check.
2016-05-18 17:10:18 +05:30
Eklavya Sharma
0dcd8b387d
Make zerver/lib/bugdown/fenced_code.py pass mypy check.
2016-05-18 17:10:17 +05:30
Eklavya Sharma
3441f0848c
Annotate pg_backup_and_purge.py.
2016-05-18 17:10:17 +05:30
Eklavya Sharma
66bb6394e5
Make api/zulip/__init__.py pass mypy check.
2016-05-18 17:10:17 +05:30
Eklavya Sharma
46757f07bf
Make zerver/lib/actions.py pass mypy check.
2016-05-18 17:10:17 +05:30
Eklavya Sharma
16067b7013
Make zerver/views/webhooks/jira.py pass mypy check.
2016-05-18 17:10:17 +05:30
Sumana Harihareswara
5f053e0047
Add remaining codebases to README.md.
...
The README should link to all the Zulip codebases. Also, it makes
sense to split up app code from integration and other glue code.
Fixes : #674 .
2016-05-17 16:56:46 -07:00
Sumana Harihareswara
3d267a5438
Add doc-building dependencies to requirements.txt.
...
Fixes : #794 .
2016-05-17 12:21:25 -07:00
Tim Abbott
b38913c8f9
Upgrade sphinx version used in ReadTheDocs.
...
According to https://github.com/spatialaudio/nbsphinx/issues/26 , this
should fix support for mixing rST and markdown in our docs.
Fixes #668 .
2016-05-14 14:27:21 -07:00
Sumana Harihareswara
34d2c505e9
Fix typos in README.md.
2016-05-13 22:18:20 -07:00
Tim Abbott
c3985520e5
webhooks: Remove unnecessary get_client imports.
2016-05-13 12:25:12 -07:00
Tomasz Kolek
db7ea8b484
Move getting client to api_key_only_webhook_view.
...
This decreases the amount of convention developers need to understand
in order to write a new webhook integration.
2016-05-13 12:22:38 -07:00
Tim Abbott
d55c3bd142
Add npm-debug.log to gitignore.
2016-05-12 16:32:51 -07:00
Tim Abbott
12b32d3889
check-py3: Display git status --porcelain output.
2016-05-12 16:30:58 -07:00
Tim Abbott
aa7ff158b6
Reduce development environment RAM requirements by 750MB.
...
Since we merged cd2348e9ae more than a
month ago and haven't seen any noticable regresions as a result, it's
reasonable at this point to do a corresponding decrease in our
documented RAM requirements for the Zulip development environment.
2016-05-12 16:12:43 -07:00
Tim Abbott
e7cb1e3f92
README.dev: Make 'official Zulip PPA' link to the PPA.
2016-05-12 15:38:02 -07:00
Tim Abbott
efd24b374e
analytics: Fix cnts variable reuse with different type.
...
Found using mypy.
2016-05-12 14:07:32 -07:00
Sumana Harihareswara
038c1ea20f
Add integration project links to README.
...
The README should link to all Zulip-specific open source projects
so users know where to file bugs and code contributors can pitch
in.
Fixes : #674 .
2016-05-12 13:45:20 -07:00
Tomasz Kolek
f486e47d4d
Change CircleCI logo on /integrations to leave off the name.
...
The name is already present in the label just below.
2016-05-12 13:14:18 -07:00
Umair Khan
99b73c2728
digest emails: Fix typo in remaining_unread_pms_count.
...
This error likely caused this feature to never trigger.
2016-05-12 13:09:37 -07:00
Umair Khan
dfc58b0ed0
Upgrade digest email templates to Jinja2.
...
Fixes : #780
2016-05-13 01:01:28 +05:00
Tim Abbott
60722a8fce
Integration guide: Add a note about spelling integraiton names.
2016-05-11 21:19:15 -07:00
Tomasz Kolek
eeeb4d0c92
Add CircleCI integration.
...
Fixes : #617 .
2016-05-11 21:17:37 -07:00
Tom
014fcf7570
README.dev.md: Add PPA instructions to get tsearch-extras.
...
Fixes #109 .
2016-05-11 16:22:53 -07:00
Sumana Harihareswara
c270b94b21
Fix formatting, grammar, and style in Yo integration docs.
2016-05-10 21:34:05 -07:00
Sumana Harihareswara
4c529cdf37
Update Getting Started With Hubot doc link.
2016-05-10 20:54:28 -04:00
Bert Muthalaly
261dac25a5
Fix skipping to latest messages (fast_forward_pointer).
...
The refactoring in b8ec8f5ef0 had a
slightly wrong URL.
2016-05-10 17:24:42 -07:00
Tim Abbott
2409ac9b2f
cache: Add type annotations to active_*_dict_fields.
2016-05-10 11:48:03 -07:00
Tim Abbott
f2aee961e1
test_auth_backends: Fix unused variables.
2016-05-10 11:46:39 -07:00
Tim Abbott
92bec8cfea
Merge Zulip 1.3.12 security release.
2016-05-10 11:32:26 -07:00
Tim Abbott
90634356cb
Add changelog for Zulip 1.3.12 release.
2016-05-10 09:51:49 -07:00
Tim Abbott
9b65464b6b
logout_all_users: Add option to logout deactivated users.
2016-05-10 09:50:57 -07:00
Tim Abbott
393159bbd8
queue: Disable RabbitMQ heartbeat in BlockingConnection.
...
Fixes #741 .
2016-05-10 09:50:57 -07:00
Tim Abbott
6f282581f7
requirements: Upgrade pika to version 0.10.0.
...
This is needed to fix RabbitMQ heartbeat issues that cause connections
to drop (#741 ). It's also relevant for Python 3 support.
2016-05-10 09:50:57 -07:00
Tim Abbott
d82e44ecd0
queue: Refactor Pika credentials code to be a bit cleaner.
2016-05-10 09:50:57 -07:00
Tim Abbott
620debc5fd
Change PrincipalError to return status code 403 by default.
2016-05-10 09:50:57 -07:00
Tim Abbott
85c64c9f93
zulip_login_required: Add checks for active users and realms.
...
Like the recent change blocking JSON endpoints for deactivated users
and users in deactivated realms, this change is a hardening
improvement. Those users should be unable to get an active session
anyway, but if somehow one is leaked, this means they won't be able to
access any user data.
2016-05-10 09:50:57 -07:00
Tim Abbott
be216506a9
Improve api_fetch_api_key error messages.
...
Previously, api_fetch_api_key would not give clear error messages if
password auth was disabled or the user's realm had been deactivated;
additionally, the account disabled error stopped triggering when we
moved the active account check into the auth decorators.
2016-05-10 09:50:57 -07:00
Tim Abbott
52ddd500f0
Add tests for authentication backends.
2016-05-10 09:50:57 -07:00
Tim Abbott
38c82083de
Add test suite for deactivated users.
2016-05-10 09:50:57 -07:00
Tim Abbott
df7466e893
Add test suite for deactivate realms.
2016-05-10 09:50:57 -07:00
Tim Abbott
76814f37a3
decorators: Block access to JSON endpoints for deactivated users.
...
While in theory users should be unable to get a valid session in order
to access these endpoints in the first place, this provides an extra
layer of hardering to prevent a deactivated user with a session from
accessing data via the old-style JSON API.
2016-05-10 09:50:57 -07:00
Tim Abbott
b28b3cd65c
CVE-2016-4427: Fix access by deactivated realms/users.
...
The security model for deactivated users (and users in deactivated
realms) being unable to access the service is intended to work via two
mechanisms:
* All active user sessions are deleted, and all login code paths
(where a user could get a new session) check whether the user (or
realm) is inactive before authorizing the request, preventing the
user from accessing the website and AJAX endpoints.
* All API code paths (which don't require a session) check whether the
user (and realm) are active.
However, this security model was not implemented correctly. In
particular, the check for whether a user has an active account in the
login process was done inside the login form's validators, which meant
that authentication mechanisms that did not use the login form
(e.g. Google and REMOTE_USER auth) could succeed in granting a session
even with an inactive account. The Zulip homepage would still fail to
load because the code for / includes an API call to Tornado authorized
by the user's token that would fail, but this mechanism could allow an
inactive user to access realm data or users to access data in a
deactivated realm.
This fixes the issue by adding explicit checks for inactive users and
inactive realms in all authentication backends (even those that were
already protected by the login form validator).
Mirror dummy users are already inactive, so we can remove the explicit
code around mirror dummy users.
The following commits add a complete set of tests for Zulip's inactive
user and realm security model.
2016-05-10 09:50:48 -07:00
Tim Abbott
b31ac1eca9
Fix users in deactivated realms sending webhook messages.
...
In a deactivated realm, webhooks would still successfully send
messages, since there was no check for whether the realm was active in
api_key_only_webhook_view.
2016-05-10 09:50:48 -07:00
Tim Abbott
9da73b22d3
assert_json_error_contains: Support passing a status code.
...
Previously this test helper function hardcoded 400.
2016-05-10 09:50:48 -07:00
Tim Abbott
3cde06ea33
Add support for setting HTTP status codes in JsonableError.
2016-05-10 09:50:48 -07:00
Tim Abbott
b38c50c6bb
docs: Document possible auditing features in security model.
2016-05-10 09:50:47 -07:00
Tim Abbott
44fae09a48
docs: Clarify security model around bots and invite-only streams.
2016-05-10 09:50:47 -07:00
Tim Abbott
b4ccca300b
Add tests for whether API keys appear in initial state data.
2016-05-10 09:50:47 -07:00
Tim Abbott
07fc47f953
CVE-2016-4426: Fix non-admin users having access to all bot API keys.
...
Long ago, there was work on an experimental integration model where
every user in a realm would have administrative control over all bots,
with the goal of simplifying the process of setting up communally
administered bots for smaller teams. While that new model was never
fully implemented (and thus never setup as an option), an error in
that original implementation meant that the data on all bots in a
realm, including their API keys, was sent to the browsers of users via
the `realm_bots` variable in `page_params`. The data wasn't displayed
in the UI for non-admin users, but was available via e.g. the
javascript console.
This commit updates this behavior to only send sensitive bot data like
API keys to the owner of the bot (and realm admins).
We may in the future implement a model simplifying communally
administered integrations, but if we do that, those bots should be
limited in their capabilities (e.g. only able to send webhook
messages).
This bug has been present since Zulip was released as open source.
2016-05-10 09:50:02 -07:00
Tim Abbott
b869be9301
style: Use 'not in' consistently rather than not foo in.
2016-05-09 17:00:10 -07:00
Tim Abbott
9cf18f8535
settings: Fix whitespace errors.
2016-05-09 16:53:12 -07:00
Tim Abbott
624258750c
confirmation: Fix trailing whitespace.
2016-05-09 16:49:33 -07:00
Tim Abbott
43f167849b
queue: Disable RabbitMQ heartbeat in BlockingConnection.
...
Fixes #741 .
2016-05-09 10:23:28 -07:00
Tim Abbott
2dfa7562e2
requirements: Upgrade pika to version 0.10.0.
...
This is needed to fix RabbitMQ heartbeat issues that cause connections
to drop (#741 ). It's also relevant for Python 3 support.
2016-05-09 10:23:28 -07:00
Tim Abbott
0c42fc2f8f
queue: Refactor Pika credentials code to be a bit cleaner.
2016-05-09 10:23:28 -07:00
Tim Abbott
0161d2fddd
Cleanup guardian-based complexity in get_realm_user_dicts.
...
The old code for this lookup was unnecessarily complicated because we
were working around Guardian, where the `is_realm_admin` check was
extremely expensive.
2016-05-09 10:12:35 -07:00
Tim Abbott
2a2cbd60c3
cache: Fix fragile active_bot_dicts_in_realm caching model.
...
The issue here is similar to that in the previous commit.
2016-05-09 10:12:35 -07:00
Tim Abbott
fbc7e977ac
cache: Fix fragile active_user_dicts_in_realm caching model.
...
Previously we relied on having two matching list of fields for the
get_active_user_dicts_in_realm, one in the actual code and the other
in the caching system. By unifying these lists to have a single
source, we eliminate a class of caching bugs we might otherwise
regularly introduce.
2016-05-09 10:12:35 -07:00
Tim Abbott
f02571202a
EventsRegisterTest: display full error diffs.
2016-05-09 10:12:35 -07:00
Tim Abbott
6c744564a7
travis: Add debugging code for rabbitmq nagios failures.
2016-05-09 09:55:18 -07:00
Umair Khan
0d324925b5
Add documentation on translation tags.
...
[substantially modified by tabbott]
2016-05-09 09:55:18 -07:00
Umair Khan
5359e6b0d4
Convert Zulip to use Jinja2 templates.
...
This results in a substantial performance improvement for all of
Zulip's backend templates.
Changes in templates:
- Change `block.super` to `super()`.
- Remove `load` tag because Jinja2 doesn't support it.
- Use `minified_js()|safe` instead of `{% minified_js %}`.
- Use `compressed_css()|safe` instead of `{% compressed_css %}`.
- `forloop.first` -> `loop.first`.
- Use `{{ csrf_input }}` instead of `{% csrf_token %}`.
- Use `{# ... #}` instead of `{% comment %}`.
- Use `url()` instead of `{% url %}`.
- Use `_()` instead of `{% trans %}` because in Jinja `trans` is a block tag.
- Use `{% trans %}` instead of `{% blocktrans %}`.
- Use `{% raw %}` instead of `{% verbatim %}`.
Changes in tools:
- Check for `trans` block in `check-templates` instead of `blocktrans`
Changes in backend:
- Create custom `render_to_response` function which takes `request` objects
instead of `RequestContext` object. There are two reasons to do this:
1. `RequestContext` is not compatible with Jinja2
2. `RequestContext` in `render_to_response` is deprecated.
- Add Jinja2 related support files in zproject/jinja2 directory. It
includes a custom backend and a template renderer, compressors for js
and css and Jinja2 environment handler.
- Enable `slugify` and `pluralize` filters in Jinja2 environment.
Fixes #620 .
2016-05-09 09:55:18 -07:00
Umair Khan
cec0530fd8
analytics: Fix reference to potentially null row.hours_per_user.
2016-05-09 09:54:39 -07:00
Umair Khan
f20b907f96
base.html: Add check for undefined user_profile.
...
The previous code that neglected this check worked with the Django
templating engine but will not work with Jinja2.
2016-05-09 09:48:37 -07:00
Tim Abbott
804dad42e6
travis: Run various Nagios checks in production tests.
2016-05-08 17:35:50 -07:00
Tim Abbott
00ccf147cd
check_nagios_send_time: Add --insecure option for use in tests.
2016-05-08 17:35:50 -07:00
Tim Abbott
744e8ad0e3
travis: Set prod EXTERNAL_HOST to resolve correctly.
...
This is needed to use check_send_receive_time in the tests.
2016-05-08 17:35:50 -07:00
Tim Abbott
e4c098fba4
travis: Verify all supervisord jobs are running in production test.
...
This requires a bit of complexity since supervisord automatically
restarts failing jobs.
2016-05-08 17:35:50 -07:00
Tim Abbott
40de75d9e6
travis: Verify the server doesn't 500 in production test.
2016-05-08 17:35:50 -07:00
Tim Abbott
c0d38f42f1
supervisor: Use 127.0.0.1 rather than localhost for tornado.
...
In theory these should be the same, but in misconfigured environments
(such at Travis CI) where /etc/hosts has multiple entries for
"localhost", 127.0.0.1 is safer than "localhost".
2016-05-08 17:35:50 -07:00
Vladislav Manchev
52e96915e2
check-templates: Allow HTML tag brackets inside tag attributes.
2016-05-08 16:33:03 -07:00
Preston Hansen
635828069f
Add feature to mark all in stream/topic as read with mouse.
...
Fixes #736 .
2016-05-08 09:02:46 -07:00
Tim Abbott
34fb276b7b
changelog: Add some items since the last release.
2016-05-07 20:34:14 -07:00
Tim Abbott
c5a44043a8
Cleanup changelog.md to be better documentation.
2016-05-07 20:34:06 -07:00
Tim Abbott
1c24cb32a5
Move changelog.md to docs/ and add to ReadTheDocs.
2016-05-07 20:26:44 -07:00
Tim Abbott
e5e133eccc
Update docs to reflect the elimination of /bin.
2016-05-07 19:37:06 -07:00
Tim Abbott
6e1872987d
Move bin/get-django-setting to scripts/.
2016-05-07 19:37:06 -07:00
Tim Abbott
a315849a9e
Move bin/log-management-command to scripts/lib/.
...
We're in the process of eliminating the bin/ subdirectory in favor of
the scripts/ tree, and this one isn't user-facing.
2016-05-07 19:37:06 -07:00
Tim Abbott
cb81a59e38
Move write-rabbitmq-consumers-state-file to scripts/nagios/.
2016-05-07 19:37:06 -07:00
Tim Abbott
2761c012e5
Move rabbitmq consumer checks from bots/ to scripts/nagios/.
2016-05-07 19:37:06 -07:00
Tim Abbott
be6566dc5c
nagios: Move cron_file_helper from bots/ to scripts/lib.
...
This ensures the tool is available in Zulip production deployments.
2016-05-07 19:37:06 -07:00
Tim Abbott
73b3f7a26e
settings: Fix new-style template LOADERS syntax.
2016-05-07 19:35:16 -07:00
Tim Abbott
4c7b4fcea1
requirements: Downgrade Jinja2 and MarkupSafe to match Trusty apt.
...
The moto-based tests still pass with the older version, and this will
safe some trouble when we migrate Zulip to the Jinja2 templating system.
2016-05-07 17:38:26 -07:00
Tim Abbott
d20791eb6a
docs/new-feature-tutorial: Fix typos in templates path.
2016-05-07 17:37:01 -07:00
Umair Khan
6a0c7fec72
analytics: Add at_risk_count to Totals row in realm summary.
...
This fixes reading from an unset value in realm_summary_table, which
is fine with the Django template engine but will be problematic with
jinja2.
2016-05-07 17:30:06 -07:00
Umair Khan
4620cd8483
settings: Migrate template settings to using TEMPLATES.
...
This is cleaner and also is necessary preparation for supporting
Jinja2.
2016-05-07 17:29:51 -07:00
Umair Khan
a3acd5e8e9
settings: Add LocaleMiddleware to MIDDLEWARE_CLASSES.
...
This is needed for internationalization.
2016-05-07 17:00:10 -07:00
Tim Abbott
c1c1be1d36
Add Transifex config file and Transifex client dependency.
...
This makes it easy to download translations from Transifex.
2016-05-07 16:59:59 -07:00
Tim Abbott
5efb38f093
Add compiled translation messages files (.mo) to gitignore.
2016-05-07 16:59:45 -07:00
Tim Abbott
bfdde2e9b9
provision: Add missing dependency on python3-dev.
...
This fixes an issue introduced by
b21454d05e , where the typed_ast module
wouldn't build properly when provisioning, because we didn't have the
necessary headers installed.
2016-05-07 13:31:26 -07:00
Tim Abbott
6139e8948a
travis: User REQ framework for extracting JSON payload.
2016-05-07 11:54:14 -07:00
Tim Abbott
678adc2048
webhooks: Use REQ more consistently in stream name parsing.
...
To avoid the potential for introducing regressions here, we carefully
pass a default to REQ or not based on how the existing webhook's
parsing code worked. In the longer term, we'll want to make the
behavior consistent.
2016-05-07 11:54:14 -07:00
Tomasz Kolek
c2de38239e
Add payload validation to has_request_variables and REQ tasks.
...
[with tweaks by tabbott]
2016-05-07 11:54:09 -07:00
Tim Abbott
c1a680e2a9
rate_limiter: Fix misplaced type annotation and cleanup code.
...
You don't put type annotations on return values.
2016-05-06 13:38:12 -07:00
Tim Abbott
3a0e7c217f
mypy: Move verbose error output to travis CI wrapper.
...
This makes it easier to pipe the output of tools/run-mypy to tools
like grep.
2016-05-06 13:38:12 -07:00
Tim Abbott
b21454d05e
mypy: Use the new --fast-parser option.
...
This makes mypy about 15% faster running on the Zulip codebase (from
7s=>6s on my laptop), which seems worth it for losing a couple files.
This option requires a new dependency, which we add to the
mypy-specific requirements.txt file.
2016-05-06 13:38:12 -07:00
Tim Abbott
1807e855e7
Upgrade mypy to the new 0.4.0 release.
...
Also update the mypy command line to not use deprecated argument names.
This introduces a few errors, so we exclude the relevant files to keep
the mypy output clean.
2016-05-06 13:38:12 -07:00
Tim Abbott
4219a6779f
socket: Initialize client_id to None by default.
...
This fixes an exception where client_id was never set in an error code
path. It shouldn't be needed, but I think this makes the code clearer
and this will help in debugging the actual problem.
Related to #753 .
2016-05-05 14:49:26 -07:00
Tim Abbott
542af0d6b6
lint: Add option to print verbose timing output.
2016-05-04 14:22:52 -07:00
Tim Abbott
e2aeee0c35
lint: Add check for unnecessary whitespace between % and (.
2016-05-04 14:22:52 -07:00
Tim Abbott
191201bd10
Fix unnecessary whitespace between % and (.
2016-05-04 14:22:52 -07:00
Tim Abbott
72ee9f5137
lint: Check for unnecssary whitespace after ','s.
2016-05-04 14:17:27 -07:00
Tim Abbott
54022ac204
Fix unnecessary whitespace between , and ).
2016-05-04 14:16:53 -07:00
Tim Abbott
dd40f51fee
Add code to clean the venv cache of old venvs.
2016-05-03 15:04:03 -07:00
Tim Abbott
6a335fc090
Travis: Use /srv/zulip-venv-cache cache.
2016-05-03 14:48:21 -07:00
Tim Abbott
9970341ede
Fix caching of install-phantomjs library in Travis CI.
2016-05-03 14:48:21 -07:00
Tim Abbott
ae6037668a
test_runner: Add debugging tips for missing test modules.
2016-05-03 12:33:47 -07:00
Tim Abbott
bab267f332
test_runner: Improve error handling when importing test files.
...
The error message for a test file that doesn't import properly was
previously pretty difficult to understand and it wasn't clear how to
debug the issue.
2016-05-03 12:17:10 -07:00
Tim Abbott
9f786a5131
provision: Add caching of virtualenvs by sha1sum of requirements.txt.
...
This should save a couple minutes on the time it takes to provision a
Zulip environment on a machine that has provisioned with the same
requirements.txt file content before.
We can't yet use this in Travis CI because Travis CI doesn't support
using both sudo and caching in the same build.
2016-05-02 23:08:59 -07:00
Tim Abbott
ef95917da5
provision: Refactor virtualenv creation into a function.
2016-05-02 22:35:18 -07:00
rahuldeve
899bfb97ee
Add tests for managing uploads in S3.
2016-05-02 22:14:47 -07:00
rahuldeve
01fb6c77a2
Add test for managing files in Local Storage.
2016-05-02 22:14:47 -07:00
rahuldeve
c9b242b5d1
Modify requirements.txt for adding moto package and its dependencies.
2016-05-02 22:14:47 -07:00
rahuldeve
dde832b158
Add Attachment model to keep track of uploads.
...
This commit adds the capability to keep track and remove uploaded
files. Unclaimed attachments are files that have been uploaded to the
server but are not referred in any messages. A management command to
remove old unclaimed files after a week is also included.
Tests for getting the file referred in messages are also included.
2016-05-02 22:14:47 -07:00
Tim Abbott
391a225595
lint: Check for missing space after comments.
2016-05-02 22:10:47 -07:00
Tim Abbott
762a3188ee
Fix missing whitespace after # in comments.
2016-05-02 22:10:47 -07:00