Commit Graph

35014 Commits

Author SHA1 Message Date
Steve Howell eb9a252ec9 populate_db, tests: Restrict emails in zulip realm.
We now restrict emails on the zulip realm, and now
`email` and `delivery_email` will be different for
users.

This change should make it more likely to catch
errors where we leak delivery emails or use the
wrong field for lookups.
2020-03-19 16:21:31 -07:00
Steve Howell f647587675 bulk_create: Handle realms that hide delivery emails. 2020-03-19 16:04:05 -07:00
Steve Howell ecbbc3e365 performance: Simplify bulk_create_users().
We were going back to the database to get all
the users in the realm, when we had them right
there already.  I believe this is a legacy
of us running on a very old version of Django
(back in early days), where `bulk_create`
didn't give you back ids in a nice way.

In the interim we added the `RealmAuditLog`
code, which does take advantage of the
existing profiles (and proves we can rely
on them).

But meanwhile we were still
doing a query to get all N users in the
realm.  With `selected_related`!

To be fair, bulk_create_users() is by
its very nature a pretty infrequent
operation.  This change is more motivated
by code cleanup.

Now we just loop through user_ids for
the Recipient/Subscriber foreign key rows.

I also removed some fairly convoluted code mapping
emails to user_ids and just work in user_id
space.
2020-03-19 16:04:05 -07:00
Steve Howell 1306239c16 tests: Use email/delivery_email more explicitly.
We try to use the correct variation of `email`
or `delivery_email`, even though in some
databases they are the same.

(To find the differences, I temporarily hacked
populate_db to use different values for email
and delivery_email, and reduced email visibility
in the zulip realm to admins only.)

In places where we want the "normal" realm
behavior of showing emails (and having `email`
be the same as `delivery_email`), we use
the new `reset_emails_in_zulip_realm` helper.

A couple random things:

    - I fixed any error messages that were leaking
      the wrong email

    - a test that claimed to rely on the order
      of emails no longer does (we sort user_ids
      instead)

    - we now use user_ids in some place where we used
      to use emails

    - for IRC mirrors I just punted and used
      `reset_emails_in_zulip_realm` in most places

    - for MIT-related tests, I didn't fix email
      vs. delivery_email unless it was obvious

I also explicitly reset the realm to a "normal"
realm for a couple tests that I frankly just didn't
have the energy to debug.  (Also, we do want some
coverage on the normal case, even though it is
"easier" for tests to pass if you mix up `email`
and `delivery_email`.)

In particular, I just reset data for the analytics
and corporate tests.
2020-03-19 16:04:03 -07:00
Steve Howell b1f8141200 tests: Prevent false positives for duplicate signups.
We specifically give the existing user different
delivery_email and email addresses, to prevent false
positives during the test that checks that users
signing up with an already-existing email get
an error message.

(We also rename the test.)
2020-03-19 14:32:18 -07:00
Steve Howell d71111f3dc presence api: Use email to look up presence.
We don't want to use delivery_email to look up
presence on email-restricted realms.
2020-03-19 14:32:18 -07:00
orientor 5cfdfbe6b1 docs: Fix wrong file address the Matrix Integration docs.
The matrix integration folder in python-zulip-api changed its name
from matrix to bridge_with_matrix but this was not reflected in
the docs. Change the docs accordingly.

Solves issue #545 in the python-zulip-api directory.
2020-03-19 11:35:37 -07:00
vaibhavrajsingh2001 03393631bd design: Simplebar usage in some modals.
The simplebar is the default scrollbar throughout majority of Zulip but
it was missing in "Keyboard shortcuts", "Message formatting" and "Search
operators" modals. Added simplebar in the 3 modals.
2020-03-19 11:34:17 -07:00
Anders Kaseorg 07bca27fbc styles: Exempt visibility from overlay show transition.
This fixes a failure to give focus to a newly shown overlay.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-03-19 11:23:40 -07:00
Divyanshu Agrawal cd9a9908ca
docs: Fix some small errors in CONTRIBUTING.md.
Some of these errors were identified using Grammarly, and others
while reading.
2020-03-19 11:15:23 -07:00
Steve Howell 42ee2f5e86 tests: Fix test coverage on recent commit.
I guess `test_classes` has 100% line coverage
enforcement, which is a bit tricky for error
handling.

This fixes that, as well as making the name
snake_case and improving the format of the
errors.
2020-03-19 11:37:31 -04:00
Steve Howell 80acbb9fdf Clean up `test_get_all_profiles_avatar_urls`.
This test was using the anti-pattern of doing an
assertion inside a conditional.

I added the `findOne` helper to make it easier
to write robust tests for scenarios like this.
2020-03-19 10:34:35 -04:00
Rohitt Vashishtha b25e02aa14 tests: Treat github.com/zulip links as external.
Tests for these links often result in rate-limiting from GitHub,
leading to the builds failing in Circle CI. We temporarily mark
github.com/zulip links as external to keep the builds passing.
2020-03-19 09:27:40 -04:00
Mateusz Mandera 65f7231dd3 docs: Refresh docs on updating python requirements.
Those docs were outdated and no longer represantative of how things
work. upgrade-python-dependencies and unupgradable.json are no longer a
thing, so the entire paragraph about them should be removed.
Then the requirements/README.md file is refreshed a bit to be more
accurate.
2020-03-18 12:14:31 -07:00
Mateusz Mandera f5e95c4fc1 requirements: Bump python-social-auth version.
We had a bunch of ugly hacks to monkey patch things due to upstream
being temporarily unmaintained and not merging PRs. Now the project is
active again and the fixes have been merged and included in the latest
version - so we clean up all that code.
2020-03-18 12:14:31 -07:00
Puneeth Chaganti 1a994821fc
docs: Create bin directory before fetching rmate file to it.
Running the curl command when the directory is not present causes it to fail.
2020-03-17 17:14:04 -07:00
Anders Kaseorg 815418d0d7 portico: Typographical nitpicking.
Punctuate marketing headings with a period.  Fix a couple of
title-cased headings to sentense case.  Consistently use curly
apostrophes, curly quotation marks, and Unicode ellipses.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-03-17 16:53:46 -07:00
dependabot[bot] a23c067d2c build(deps): bump acorn from 5.7.3 to 5.7.4
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-17 16:47:19 -07:00
Vishnu KS a48845c8fb tests: Create new test mode for generating stripe fixtures. 2020-03-17 16:46:56 -07:00
Steve Howell ca74cd6e37 bug fix: Fix unread counts for certain API messages.
If I send a message from a normal Zulip client, it is
considered to be "read" by me.  But if I send it via
an API program (using my human account), the message
is not immediately "read" by me.

Now we handle this correctly in `get_raw_unread_data`.

The symptom of this was that these messages would get
"stuck" in "Private Messages" narrows until the next
time you reloaded your app.
2020-03-17 16:26:42 -07:00
arpit551 e916d0b733 provision: Added provision support for Ubuntu 20.04(Focal).
Groonga does not have a ppa package for Focal yet so pgroonga is
built from the source.
Postgres 12 is used when os_version is 20.04.
2020-03-17 14:57:14 -07:00
arpit551 b0cb493850 setup_venv: Added get_venv_dependencies function.
Added a get_venv_dependencies() function in setup_venv.py which
returns VENV_DEPENDENCIES according to the vendor and os_version.
The reason for adding this function was because python-dev will be
depreciated in Focal but can be used as python2-dev so when adding
support for Focal VENV_DEPENDENCIES should to be os_version dependent.
2020-03-17 14:57:14 -07:00
arpit551 3963b6740a provision: Corrected how scripts/lib/build-* is included for sha1 sum check.
There were two problems with the previous code-
1) The code glob.glob("scripts/lib/build-") should be
   glob.glob("scripts/lib/build-*) otherwise it would always return [].
2) The part of the code where we included scripts/lib/build-* for sha1 sum
   check would only run when debian is not in os_families(). This wasn't
   correct as we could have a situation where we have to build pgroonga
   from source even in case of debian and so we need to improve the
   condition on it.
Now since we only have build-pgroonga there its better to just directly hash
its content with the condition of BUILD_PGROONGA_FROM_SOURCE.
2020-03-17 14:57:14 -07:00
Tim Abbott 1b95a1dea7 hello: Focus on distributed teams as use case.
I've always thought of distributed teams as the place where Zulip
really shines over other tools, because chat is much more important in
that context.

And I've always been kinda unhappy with "most productive team chat" as
a line.

There's a lot more we should do here, but this is a start.
2020-03-17 14:49:17 -07:00
Mateusz Mandera d00a579318 Revert "test-run-dev: Use a pipe rather than polling a log file."
This should fix spurious failures, where test-run-dev would occasionally
freeze. What exactly about these changes was causing that is still to
be potentially investigated. This is merely meant as a fix to the
failures.
This reverts commit 19429c3ad7.
2020-03-17 14:16:18 -07:00
majordwarf 6da7b390e4 css: Reorder CSS rulesets above media queries. 2020-03-17 12:40:08 -07:00
majordwarf 69422dca9e css: Use SCSS nesting for `.forgot-password-container`. 2020-03-17 12:40:08 -07:00
majordwarf c034287da6 css: Use SCSS nesting in portico-signin.scss for `.split-view`. 2020-03-17 12:40:08 -07:00
majordwarf 87f8061a12 css: Use SCSS nesting for `.static.org-url`. 2020-03-17 12:40:08 -07:00
majordwarf 76999ccaa8 css: Use SCSS nesting for `#registration`. 2020-03-17 12:40:08 -07:00
majordwarf 17f29b3d25 css: Merge `.subdomain` in `portico-signin.scss`. 2020-03-17 12:40:08 -07:00
majordwarf bc1f075d25 css: Reorder `#registration`to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf eb3b5a626a css: Use SCSS nesting for `.split-view` and `.back-to-login`. 2020-03-17 12:40:08 -07:00
majordwarf 18c6cc9929 css: Use SCSS nesting for `.back-to-login-wrapper`. 2020-03-17 12:40:08 -07:00
majordwarf f881ceba3f css: Use SCSS nesting for `.login-social-button`. 2020-03-17 12:40:08 -07:00
majordwarf 62f367f2ff css: Merge `button` style for `.login-social-button`. 2020-03-17 12:40:08 -07:00
majordwarf 4956020f0b css: Use SCSS nesting for `.info-box`. 2020-03-17 12:40:08 -07:00
majordwarf 08edbcad86 css: Use SCSS nesting for `.split-view`. 2020-03-17 12:40:08 -07:00
majordwarf 2b6a618be5 css: Reorder `.split-view` to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf 7067646764 css: Use SCSS nesting for `.portico-page`. 2020-03-17 12:40:08 -07:00
majordwarf 7f05f19c03 css: Reorder `.portico-page` to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf 649399dba8 css: Use SCSS nesting for `#login_form`. 2020-03-17 12:40:08 -07:00
majordwarf a3b395ce94 css: Reorder `#login_form` to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf 5eeef33117 css: Use SCSS nesting for `.register-account`. 2020-03-17 12:40:08 -07:00
majordwarf aeaaf601ea css: Use SCSS nesting for `.register-page-container`. 2020-03-17 12:40:08 -07:00
majordwarf 5dbd3499a9 css: Reorder `.register-page-container` to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf e24fe3b5a6 css: Use SCSS nesting for `.login-page-container`. 2020-03-17 12:40:08 -07:00
majordwarf 37983b0e41 css: Reorder `.login-page-container` to put next to each other. 2020-03-17 12:40:08 -07:00
majordwarf 889aeffc83 css: Use SCSS nesting in portico-signin.scss for `.app-main`. 2020-03-17 12:40:08 -07:00
majordwarf 8a556fd2a7 css: Merge `.login-page-header` in portico-signin.scss. 2020-03-17 12:40:08 -07:00