Commit Graph

57355 Commits

Author SHA1 Message Date
Mateusz Mandera 89a22fb076 register_server: Check write access to secrets file when rotate_key.
Using --rotate-key without write access to the secrets file is currently
quite painful, since you end up rotating your registration's secret with
no local record of it; so effectively you lose your registration and
need help from support. We should just prevent this failure mode.
2024-03-22 09:33:00 -07:00
Alex Vandiver 7d0c12aa3a semgrep: Enforce no bare select_related() calls.
Previously, #26419 addressed the majority of these calls, but did not
prevent more from creeping in.  Remove the one remaining
callsite (after the cleanup from the previous commits), and ban any
future use of the pattern.
2024-03-22 09:30:17 -07:00
Alex Vandiver fd5a091b30 messages: Only check the UserMessage row if necessary.
For the common case of not needing to reference the UserMessage row
later, and for being a stream without private history, the UserMessage
row is irrelevant.  Convert `has_user_message` to a thunk, and defer
loading it unless necessary.
2024-03-22 09:30:17 -07:00
Alex Vandiver f92d43c690 messages: Use overloads to only return a user_message if needed. 2024-03-22 09:30:17 -07:00
Alex Vandiver 6ace34c374 messages: Stop joining through every table.
Calling `.select_related()` with no arguments joins through every
possible table, recursively.  In this case, this currently produces a
query which joins through forty-three tables.

This is rather inefficient, particularly for what is a very common
call which should be very fast.

No callsite depends on having prefetched any joined table on the
object; drop all of the joins.
2024-03-22 09:30:17 -07:00
John Lu a5cf0ec526
refactor: Replace HUDDLE with DIRECT_MESSAGE_GROUP.
Replaced HUDDLE attribute with DIRECT_MESSAGE_GROUP using VS Code search,
part of a general renaming of the object class.

Fixes part of #28640.

Co-authored-by: JohnLu2004 <JohnLu10212004@gmail.com>
2024-03-21 16:39:33 -07:00
Anders Kaseorg 224b484195 test_classes: Skip OpenAPI validation on exceptions.
This gives more helpful error tracebacks from failing tests.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-21 16:36:48 -07:00
Varun Singh 1aaedf89ee poll_modal: Convert module to TypeScript. 2024-03-21 16:33:24 -07:00
Alex Vandiver e06b1794a8 kandra: Template and insert email credentials. 2024-03-21 16:14:44 -07:00
Alex Vandiver 75411b264e kandra: Remove unnecessary libapache2-mod-wsgi.
It does not exist in 22.04, and its last use was removed in
61666a9262.
2024-03-21 14:23:30 -07:00
Alex Vandiver 9d8d2d138b missedmessage_emails: Add Sentry spans to worker thread. 2024-03-21 12:46:13 -07:00
Alex Vandiver 9451d08bb9 worker: Split out worker sampling rate, and add Sentry transactions. 2024-03-21 12:46:13 -07:00
Alex Vandiver f64b9475c1 sentry: Optionally enable tracing, with transactions and spans. 2024-03-21 12:46:13 -07:00
Alex Vandiver 3cbce0c5c7 missedmessage_emails: Clear caches and db query tracking per-loop.
Otherwise, these accumulate and leak memory.
2024-03-21 12:46:13 -07:00
Alex Vandiver 23504308fb puppet: Install the same version of postgres-client as the server.
We require a `pg_dump` whose version matches the version of the server
we are configured against (see 3a8b4b0205).  Installing the latest
`postgresql-client` does not guarantee that we have such a binary
present.
2024-03-21 12:34:34 -07:00
Alex Vandiver 6ad777c86f dev_urls: Make requests to /docs redirect to the index.
This makes it easier to browse to the docs in development mode, and
more closely matches ReadTheDocs production.
2024-03-21 11:27:14 -07:00
Vector73 f758ca596b custom_profile_fields: Add "required" parameter to the profile fields.
Fixes #28512.
2024-03-21 10:48:54 -07:00
Tim Abbott ac0673e0b5 settings: Rename overly generic field and field_hint classes. 2024-03-21 10:48:54 -07:00
Tim Abbott 9786a16680 bot_avatar_row: Rename extremely generic CSS classes.
I fixed one apparent typo, `$row.find("api_key_error").hide();`, while
doing this.
2024-03-21 10:48:54 -07:00
Tim Abbott e436aea917 change_password: Avoid super generic CSS classes. 2024-03-21 10:48:54 -07:00
afeefuddin 6f81fe1b5b info_overlay: Convert module to TypeScript. 2024-03-21 09:00:33 -07:00
Anders Kaseorg e3340774ce requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-21 08:59:17 -07:00
Anders Kaseorg 71e1b3c91b sentry: Fix type error in add_context.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-21 08:59:17 -07:00
Anders Kaseorg eb622bae0a ruff: Fix S605 Starting a process with a shell.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-21 08:59:17 -07:00
Anders Kaseorg a1a341f0ae ruff: Fix UP032 Use f-string instead of `format` call.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-21 08:59:17 -07:00
evykassirer f1b8e11e8b narrow: Remove stale comment about deactivate(). 2024-03-20 19:11:25 -07:00
evykassirer ba215e3e80 buddy_list: Ensure users are visible when hide_headers is true. 2024-03-20 18:47:24 -07:00
evykassirer 1defce3172 composebox_typeahead: Don't use typeahead to store `completions`.
It wasn't being used in the typeahead, just hackily being
referenced within composebox_typahead.
2024-03-20 13:08:26 -07:00
evykassirer d5d505a561 typeahead: Remove unneeded eventSupported.
It will always be true.
2024-03-20 13:08:26 -07:00
evykassirer 596233e14d typeahead: Default options to undefined instead of null. 2024-03-20 13:08:26 -07:00
Lauryn Menard 373671080d remote-support: Include billing entity name in internal billing notice.
Adds a line to the top of the internal_billing_notice email with
the billing entity's display name.

Makes sure all internal_billng_notice email subjects also include
the billing entity's display name.

Makes small updates to the notice text for some cases.
2024-03-20 11:58:15 -07:00
Prakhar Pratyush 118a7e8d9d zulip_updates: Send zulip updates based on zulip_update_*_level.
This commit adds a management command that will run regularly
as a cron job to send zulip updates to realms based on their
current and latest zulip_update_announcements_level.

For realms with:
* level = None: Send a group DM to admins notifying them about
this new feature & suggestion to set the stream accordingly.

* level = 0:
  * If stream is still not configured, wait for a week
    before setting their level to latest level. They will
    miss updates until their configure the stream.
  * If stream is configured, send updates.

* level > 0: Send one message/update per level & increase
  the level by 1 till the latest level.

Fixes #28604.
2024-03-20 11:48:06 -07:00
Prakhar Pratyush 336d46001c message_send: Add 'internal_prep_huddle_message' function.
This is a prep commit to extract out the logic to
create message from 'internal_send_huddle_message'
into a separate function 'internal_prep_huddle_message'.

We will use this new function to get the huddle message
without sending it immediately.
2024-03-20 11:48:06 -07:00
Prakhar Pratyush 23fc04577b message_send: Don't create savepoint in do_send_messages.
In general, we never want to use savepoints.

This prep commit adds savepoint=False in do_send_messages
as we don't want to just rollback to this savepoint and
proceed if we encounter any error while sending zulip updates
via cron.
2024-03-20 11:48:06 -07:00
Prakhar Pratyush 6484532830 help: Migrate configure-notification-bot help page to a new URL.
This commit migrates the 'help/configure-notification-bot' help
page to a new URL i.e. 'help/configure-automated-notices'.
2024-03-20 11:48:06 -07:00
roanster007 3d152296f6 message_view: Fix error thrown on deleting stream and searching for it.
Previously, when a stream is deleted and the deleted stream is looked
up in the search bar, then an error is thrown.

This is because, when the StreamSubscription object of the deleted
stream is fetched we try to access its properties - invite_only and
is_web_public, despite it being undefined.

This is fixed by accessing the properties only when the object is not
undefined.
2024-03-20 09:59:10 -07:00
Aman Agrawal 446de85e76 upgrade: Minor text edits. 2024-03-20 09:38:19 -07:00
tnmkr e1b101ceec docs: Fix incorrect function typo in events system. 2024-03-20 09:32:44 -07:00
Eklavya Sharma fb0697f266 docs: Fix typos in the Hindi translation guide. 2024-03-20 09:15:21 -07:00
Aditya Bajaj 8c5d333cde docs: Update broken edX reference links
Change edX's GitHub links to point to their new
organisation 'openedx' and change 'readthedocs.io'
links to 'docs.openedx.org'

Fixes #29332
2024-03-20 09:14:19 -07:00
Bedo Khaled 55dcdf8f01 docs: Change "restart" to "flush" command. 2024-03-20 09:13:38 -07:00
Alya Abbott c744154591 help: Improve documentation for Shift+M keyboard shortcut. 2024-03-19 16:30:49 -07:00
Alex Vandiver db4e093ad7 release: Fix changelog output.
9bd340957f changed the headers; while we no longer store the
changelog text in the Github release object, we should still output
the changelog to STDOUT correctly.
2024-03-19 16:05:53 -07:00
afeefuddin 69fbd81a73 integration_url_modal: Fix input selector for runtime safety. 2024-03-19 16:05:34 -07:00
Alex Vandiver 6bf9b7a7f7 migrations: Merge duplicated migration heads. 2024-03-19 19:04:32 -04:00
Alex Vandiver 1e5421276f version: Update version and changelog following 8.3 release. 2024-03-19 22:31:25 +00:00
Alex Vandiver 0f0631813f message_edit: Do set differences in QuerySets. 2024-03-19 18:22:24 -04:00
Alex Vandiver c71b7afe9f message_edit: Handle user, not subscription, collections.
Nothing about the subscription is relevant -- we instead use
collections of User objects for readability.
2024-03-19 18:22:24 -04:00
Alex Vandiver f15e006873 message_edit: Perform cross join in SQL, not Python.
The database can do this faster than we can, and it reduces the amount
of information transmitted over the wire.
2024-03-19 18:22:24 -04:00
Alex Vandiver a8795c5d0b message_edit: Pull user_ids_gaining_usermessages higher, rename. 2024-03-19 18:22:24 -04:00