Commit Graph

33994 Commits

Author SHA1 Message Date
Tim Abbott
31f02cd926 test_fixtures: Fix buggy reuse of status_dir between databases.
Apparently, the arguments passed to template_database_status were
incorrect for the manual testing development database, in that we
didn't pass a status_dir when calling into that code from provision.

The result was that provisioning before running `test-backend` would
ignore changes to the list of check_files (etc.) made after rebasing,
and vice versa.

The cleanest fix is to compute status_dir from other values passed in;
I'm also going to open a follow-up issue for creating a better overall
interface here.
2020-02-19 12:28:26 -08:00
Tim Abbott
266c7c83e0 test_fixtures: Note populate_db depends on server_initialization.py.
This should ensure that folks rebasing past this commit from an older
database model get their database rebuilt in the way that will
match the test_subs.py query count of 40.
2020-02-19 12:08:55 -08:00
Hemanth V. Alluri
dd198fd06e webhooks/ansibletower: Update for AWX 9.1.1.
Add a simple compatibility function for AWX 9.x.x. Before AWX 9.x.x
a "friendly_name" key was sent by default. Afterwards it was removed
from being a default key but we can still more or less determine if
the triggering event was a job from the REST-style URL.

Note: It is also technically possible to add the key back by defining
a custom notification template in AWX/Tower.

Resolves #13295.
2020-02-19 12:08:55 -08:00
xpac1985
10e8928b0f docs: Add info about zulip-announce RSS feed to install docs.
The mailing list can also be subscribed to via RSS/Atom feeds, I just wanted to make that information easier accessible.
2020-02-19 12:08:55 -08:00
Ray Kraesig
bc81275d3c register: Ensure future client_capabilities fields are optional.
The `notification_settings_null` field of the `client_capabilities`
parameter is, apparently unintentionally, required.

This is mostly harmless. However, if any _future_ fields are made
required, all existing clients using this parameter will break, and it
will be needlessly difficult for new clients to specify new
capabilities in a backwards-compatible way.

Attempt to stave that possibility off with warnings.

(No functional changes.)
2020-02-19 12:08:55 -08:00
Tim Abbott
6c8c3cd3dc settings: Fix copy-from-clipboard behavior for bot tokens.
We do this by cleaning up the API for generate_zuliprc_content,
allowing us to deduplicate the previously incorrect code.
2020-02-19 12:08:55 -08:00
Vishnu KS
1783515794 emails: Use the word email instead of message in do not reply sentence.
Fixes #13693
2020-02-19 12:08:55 -08:00
Vishnu KS
21026d984b emails: Remove unecessary call to message_content_allowed_in_missedmessage_emails. 2020-02-19 12:08:55 -08:00
Vishnu KS
66fe724c8a emails: Show proper message when email content is not shown. 2020-02-19 12:08:55 -08:00
Vishnu KS
282d6edf2e tests: Check whether body include multiple strings in _test_cases. 2020-02-19 12:08:55 -08:00
Mateusz Mandera
785a7ec9e7 email_mirror: Handle encoded attachment filenames. 2020-02-19 12:08:55 -08:00
Mateusz Mandera
c44d9f9b1b email_mirror: Extract handle_header_content function. 2020-02-19 12:08:55 -08:00
Tim Abbott
0d5d3c4912 email_mirror: Rewrite docstrings to focus on current reality.
These docstrings hadn't been properly updated in years, and bad an
awkward mix of a bad version of the user-facing documentation and
details that are no longer true (e.g. references to "Voyager").

(One important detail is that we have real documentation for this
system now).
2020-02-19 12:08:55 -08:00
Mateusz Mandera
ef793590c1 email_mirror: Parse encoded From headers with show_sender=True. 2020-02-19 12:08:55 -08:00
Tim Abbott
3032ba15cf soft_deactivation: Fix incorrect logging function.
Using logging.info() rather than logger.info() meant that our
zulip.soft_deactivation logger configuration (which, in particular,
included not logging to the console) was not active on this log line,
resulting in the `manage.py soft_deactivate_users` cron job sending
emails every time it ran.

Fixes #13750.
2020-02-19 12:08:55 -08:00
Tim Abbott
96a2ddffe7 docs: Add link from LDAP docs to invitation docs.
This addresses confusion we had with some organizations where they
were surprised that with only LDAP enabled, the "invite more users"
feature was available.

Fixes #11685.
2020-02-19 12:08:55 -08:00
Tim Abbott
2794362214 slack import: Fix handling of messages sent by user U00. 2020-02-19 12:08:55 -08:00
Vishnu KS
9b3e1e2c97 emails: Set alt attribute to empty for leading images.
The alt text of the leading images were displayed as preview
content in inbox by email clients like gmail. Since the leading
images were used mostly for decoration this made the preview
content gibberish. It's fine to set the alt attributes to empty
from accessibility point of view since the old alt attributes
did't added any meaningful information.
2020-02-19 12:08:55 -08:00
orientor
ae44fdd7cc settings: Fix buggy emoji format loading spinner.
When a user clicked the current emoji format in "display settings",
we'd show an infinite loading spinner (basically as a side effect of
trying to tell the server to change the emoji format to what it
already was).

Fix this by aborting early if the emoji format is already the option
that the user clicked.

Fixes #13684.
2020-02-19 12:08:55 -08:00
Tim Abbott
b45cce61e7 message_list_view: Fix handling of links to deleted streams.
Previously, links to deleted streams would be incorrectly rendered as
stream's name).

Fixes an issue that was reported where after deleting the "general"
stream, the welcome turtle messages might appear as links to
2020-02-19 12:08:55 -08:00
Tim Abbott
2e923a0eb5 slack import: Improve error messages around invalid tokens.
This updates our error handling of invalid Slack API tokens (and other
networking error handling) to mostly make sense:
* A token that doesn't start with `xoxp-` gives an extended error early.
* An AssertionError for the codebase is correctly declared as such.
* We check for token shape errors before querying the Slack API.

We could still do useful work to raise custom exception classes here.

Thanks to @stavrospat for raising this issue.
2020-02-19 12:08:55 -08:00
Mateusz Mandera
f538f34d95 email_mirror: Use .walk() to search all MIME parts for attachments.
Fixes #13416

We used to search only one level in depth through the MIME structure,
and thus would miss attachments that were nested deeper (which can
happen with some email clients). We can take advantage of message.walk()
to iterate through each MIME part.
2020-02-19 12:08:55 -08:00
Mateusz Mandera
5d2befdc54 send_to_email_mirror: Fix loop setting recipient-like headers.
return in that loop was a bug, which would lead to the To: header not
being set even though data['recipient'] = str(message['To']) is being
run next, thus requiring the header. We can remove the return
statement and now the loop will overwrite all the potentially
troublesome headers.
2020-02-19 12:08:55 -08:00
Mateusz Mandera
cc8b83b261 email_mirror: Insert a new line before attachment links. 2020-02-19 12:08:55 -08:00
Mateusz Mandera
ac8f4aaa93 email_mirror: Check address usability in get_missed_message_address. 2020-02-19 12:08:55 -08:00
Mateusz Mandera
843c148c59 email_mirror: Give extract_and_validate a more descriptive name. 2020-02-19 12:08:55 -08:00
Mateusz Mandera
d39bcf2264 email_mirror: Reuse exception messages in mirror_email_message. 2020-02-19 12:08:55 -08:00
Tim Abbott
ce64a6b163 default stream groups: Fix broken registration UI.
The default stream groups feature (#6693) was never fully implemented;
this fixes a key detail (the registration UI being broken).
2020-02-19 12:08:55 -08:00
Tim Abbott
7875196783 default stream groups: Fix buggy LDAP behavior.
With LDAP authentication, we don't currently have a good way to
support the default stream groups feature.

The old behavior was just to assume a user select every default stream
group, which seems wrong; since we didn't prompt the user about these,
we should just ignore the feature.
2020-02-19 12:08:55 -08:00
Mateusz Mandera
56c1ad1a3d install: Don't create internal realm in the installation process. 2020-02-19 17:05:28 +01:00
Tim Abbott
d9aa4161f8 install: Remove references to "Zulip Voyager".
"Zulip Voyager" was a name invented during the Hack Week to open
source Zulip for what a single-system Zulip server might be called, as
a Star Trek pun on the code it was based on, "Zulip Enterprise".

At the time, we just needed a name quickly, but it was never a good
name, just a placeholder.  This removes that placeholder name from
much of the codebase.  A bit more work will be required to transition
the `zulip::voyager` Puppet class, as that has some migration work
involved.
2020-02-19 17:00:17 +01:00
Mateusz Mandera
728155afee server_initialization: Add server_initialized function. 2020-02-19 16:59:56 +01:00
Mateusz Mandera
660501c782 test_classes: Fix bug where UserProfile could be passed to client_post.
It would cause JSON overflow error while producing URL coverage report.
2020-02-19 16:59:14 +01:00
Mateusz Mandera
ad974c3ae3 initialize_voyager_db: Deduplicate create_internal_realm logic.
zerver.lib.server_initialization.create_internal has precisely the same
code (you can copy-and-paste swap them, with one level of indentation
adjustment, without generating any diff) so they can be trivially
deduplicated.
2020-02-19 16:57:44 +01:00
Mateusz Mandera
bc4029deae initialize_voyager_db: Deduplicate create_users.
zerver.lib.server_initialization.create_users has precisely the same
code (you can copy-and-paste swap them without generating any diff) so
they can be trivially deduplicated.
2020-02-19 16:54:39 +01:00
Mateusz Mandera
218ca61dd0 server_initialization: Rename some variables.
This makes the code of create_internal_realm identical to the
corresponding block in initialize_voyager_db.py.
2020-02-19 16:43:18 +01:00
Mateusz Mandera
3419908f39 initialize_voyager_db: Add comment above default client creation block. 2020-02-19 16:42:57 +01:00
Mateusz Mandera
af67990f14 server_initialization: Set internal bots owners to themselves. 2020-02-19 16:42:39 +01:00
Mateusz Mandera
e6cf30fc22 server_initialization: Remove unnecessary type annotation. 2020-02-19 16:42:15 +01:00
Mateusz Mandera
e2ccbe7c80 initialize_voyager_db: Add bot_owner argument to create_users.
This doesn't change any behavior, the purpose of this is to make the
function identical to what we have in server_initialization.py so that
it can be deduplicated in follow-up commits.
2020-02-19 16:41:56 +01:00
Mateusz Mandera
8b31387670 server_initialization: Use tos_version argument in create_users. 2020-02-19 16:41:31 +01:00
Mateusz Mandera
501eb09716 populate_db: Extract default client creation to server_initialization. 2020-02-19 16:25:30 +01:00
Mateusz Mandera
280d9db26d populate_db: Extract some functions to server_initialization.py. 2020-02-19 16:23:51 +01:00
Vishnu KS
cee6227f53 bots: Remove feedback cross realm bot.
This completes the remaining pieces of removing this missed in
d70e799466 (mostly in tests).
Backported to 2.1.x branch.
2020-02-19 16:21:02 +01:00
Mateusz Mandera
cae803e8a9 bots: Remove FEEDBACK_BOT implementation.
This legacy cross-realm bot hasn't been used in several years, as far
as I know.  If we wanted to re-introduce it, I'd want to implement it
as an embedded bot using those common APIs, rather than the totally
custom hacky code used for it that involves unnecessary queue workers
and similar details.
Backported to the 2.1.x branch.
2020-02-19 15:26:08 +01:00
Tim Abbott
ba598366e9 Release Zulip Server 2.1.2. 2.1.2 2020-01-16 12:26:14 -08:00
Steve Howell
d452ad31e0 server: Sort user_ids in recent PM conversations.
This change should prevent test flakes, plus
it's more deterministic behavior for clients,
who will generally comma-join the ids into
a key for their internal data structures.

I was able to verify test coverage on this
by making the sort reversed, which would
cause test_huddle_send_message_events to
fail.
2020-01-16 12:25:11 -08:00
Steve Howell
aed813f44c bug fix: Fix huddles in "Private Messages".
If two user_ids in a recent huddle have ids
that sort lexically differently than numerically,
such as 7 and 66, then we were creating two
different buckets in pm_conversations.

This regression was introduced in
263ac0eb45 on
November 21, 2019.
2020-01-16 12:25:11 -08:00
Steve Howell
71dae1b92a refactor: Have pm_conversations take user_ids.
Instead of having our callers pass in a possibly
non-canonical version of a user_ids_string, just
have them pass in a list.

The next commit will canonicalize the sort.
2020-01-16 12:25:11 -08:00
Steve Howell
629ec1aa8b tests: Use tricky server data in unit tests.
The server may send us ids in the order
[11, 2], instead of [2, 11].  We don't want
to rely on server behavior, regardless, for
the sort.

Our tests now show we process that data.

The current code is is still buggy and causes
us to show the same huddle two different times
for situations where the lexical sort doesn't
match the numerical sort.

This happens on czo often, where Tim is user
7, and his id sorts lexically after ids like
58, 622, 4444, etc.
2020-01-16 12:25:11 -08:00