4969 Commits

Author SHA1 Message Date
Anders Kaseorg
7c50e1a40e ruff: Fix PIE808 Unnecessary start argument in range.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 81bd63cb46)
2023-09-15 12:21:28 -07:00
Anders Kaseorg
e953ff71e4 tools: Use subprocess.check_call where appropriate.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 041dcdfbad)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
47e2b07316 ruff: Fix PLW1510 subprocess.run without explicit check argument.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit c43629a222)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
99b37de89f ruff: Fix UP032 Use f-string instead of format call.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit e932e2ce52)
2023-08-23 02:29:07 +00:00
Anders Kaseorg
91e5ef39eb ruff: Fix PLR1714 Consider merging multiple comparisons.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 2ae285af7c)
2023-08-23 02:29:05 +00:00
Anders Kaseorg
b9aa772885 ruff: Fix RUF015 Prefer next(...) over single element slice.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 3b09197fdf)
2023-08-23 02:28:06 +00:00
Anders Kaseorg
a0ce536fa4 tests: Remove compatibility code for Python < 3.5.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 4e645c8ff9)
2023-08-23 02:28:06 +00:00
Anders Kaseorg
3325f2ef06 ruff: Fix UP032 Use f-string instead of format call.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit bca5564c1e)
2023-08-23 02:28:06 +00:00
Anders Kaseorg
a8675741a0 error_notify: Remove custom email error reporting handler.
Restore the default django.utils.log.AdminEmailHandler when
ERROR_REPORTING is enabled.  Those with more sophisticated needs can
turn it off and use Sentry or a Sentry-compatible system.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit b285813beb)
2023-07-21 06:55:56 -07:00
Alex Vandiver
3349c596d5 release: Release 8.0-prereleases from main.
(cherry picked from commit 23fd05494d)
2023-07-19 17:32:06 -04:00
Alex Vandiver
5a58adf62a release: Link to the changelog in the Github Release.
Release notes in GitHub have significant-newlines, which makes our
canonical `changelog.md` content look not-great -- and the relative
links are also broken, as they have the wrong relative path.

Switch to linking to the canonical release notes on ReadTheDocs, now
that those have proper anchors.

(cherry picked from commit c1008b5b12)
2023-07-19 17:32:06 -04:00
Alex Vandiver
bf68d676c0 changelog: Retitle sections, to allow section anchors.
(cherry picked from commit 9bd340957f)
2023-07-19 17:32:03 -04:00
Satyam Bansal
ec46497507 tools: Copy "assets" subdirectory of bots to "static/generated/bots/".
Previously, the "assets" subdirectory of various bots was not
being copied to the "static/generated/bots/" folder, which
resulted in the documentation on some pages not loading at all.

(cherry picked from commit 605e9065a2)
2023-07-19 17:29:14 -04:00
Alex Vandiver
92c538c862 pgroonga: Remove now-unnecessary 'GRANT USAGE' statement.
This was only necessary for PGroonga 1.x, and the `pgroonga` schema
will most likely be removed at some point inthe future, which will
make this statement error out.

Drop the unnecessary statement.

(cherry picked from commit dc2726c814)
2023-07-03 18:50:14 +00:00
Lalit
38dd1de5b2 ts: Convert compose_textarea.js to TypeScript.
Added type definitions for `jquery-caret-plugin` third party package and
converted `compose_textarea.js` to TypeScript.
2023-05-25 17:33:18 -07:00
Anders Kaseorg
13d92acdb3 run-dev: Clarify magic number for errno.EADDRINUSE.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-25 15:49:06 -07:00
Anders Kaseorg
8a128ba81e commit-msg: Don’t change the current directory for non-Vagrant.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-23 12:24:44 -07:00
Greg Price
2baa4fc0ca total-contributions: Add zulip-flutter to the list of repos. 2023-05-22 16:04:26 -07:00
Greg Price
c4cc27cd20 total-contributions: Fix bug that replaced a repo's whole history with nothing.
When using a start date before the first commit to a repo, we should
include the repo's entire history (up to the end date) in our totals.

Instead, we were using a range like "..{upper_version}", which in Git
revision-range syntax means the start of the range is HEAD -- so the
range was empty.

Fix that by leaving out the ".." when we want no left endpoint.
2023-05-22 16:04:26 -07:00
Greg Price
0c8fef2fc8 total-contributions: Factor out logic common to all repos. 2023-05-22 16:04:26 -07:00
Lalit
7346ce98f3 ts: Convert emojisets to TypeScript.
Declared types for '*.png' modules and '!style-loader?*' modules in
`assets.d.ts` and used them in `emojisets.ts`.
2023-05-22 09:02:42 -07:00
Alex Vandiver
c978bfaa32 models: Add a unique index on UserProfile.api_key.
This prevents `get_user_profile_by_api_key` from doing a sequential
scan.

Doing this requires moving the generation of initial api_key values
into the column definition, so that even bare calls to
`UserProfile.objects.create` (e.g. from tests) call appropriately
generate a random initial value.
2023-05-19 11:11:04 -07:00
Anders Kaseorg
12310189ed install: Support Debian 12.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-18 11:52:22 -07:00
Anders Kaseorg
480a2e2d64 postgresql-init-dev-db: Work around PGroonga WAL issue.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-18 11:52:22 -07:00
Lalit
a2db6df826 ts: Convert deprecated_feature_notice module to TypeScript. 2023-05-18 08:52:26 -07:00
Lalit
a3f46957bc ts: Convert confirm_dialog module to TypeScript. 2023-05-18 08:44:30 -07:00
Lauryn Menard
4fcb243769 api-docs: Standardize on lowercase true, false and null.
Creates a custom linter rule for `zerver/openapi/zulip.yaml` to
only allow lowercase versions of "true", "false" and "null".

Updates existing documentation for new rules.
2023-05-16 12:31:03 -07:00
Daniil Fadeev
f2e627ba51 drafts: Move code handling keyboard navigation to a separate module.
The keyboard navigation that used to only work in drafts can now be
reused. This commit has moved the related functions to a separate
module.
2023-05-15 14:46:21 -07:00
Lalit
cab3a992c0 refactor: Extract message_feed_loading module from message_scroll.
This new module allows us to remove dependency on `message_scroll` in `fetch_status`
and hence allowing us to migrate it to TypeScript.
2023-05-14 11:24:31 -07:00
Anders Kaseorg
54f90e41c0 eslint: Fix unicorn/prefer-string-replace-all.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-12 11:12:20 -07:00
Anders Kaseorg
5f1a07aaad dev-vagrant-docker: Upgrade docker-systemctl-replacement.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-11 14:50:53 -07:00
Sahil Batra
ddb0bb58ed tests: Add tests to update visibility policy when target topic is empty.
This commit adds a new test to check how the visibility policy updates
when moving messages to a topic that didn't exist previously.

This test also helps us adding coverage for the code which just
skips setting visibility_policy if there is no need to update the
value because both previous and new value of visibility policy
is INHERIT. The "actions/message_edit.py" file has 100% coverage
now and thus is removed from "not_yet_fully_covered" list.
2023-05-11 12:13:50 -07:00
Sahil Batra
9fa67f0fa9 tests: Add coverage to actions/create_realm.py.
This commit adds test coverage to actions/create_realm.py.
The file is also removed from not_yet_fully_covered list
since it has 100% coverage now.
2023-05-11 12:13:50 -07:00
Lauryn Menard
1d209220dd tests: Add coverage for error when editing a sent scheduled message.
Adds test coverage for the error sent for editing a scheduled
message that was successfully sent.

`zerver/actions/scheduled_messages.py` now has 100% test coverage
again.
2023-05-11 10:52:01 -07:00
Lalit
ebaabc6b68 ts: Migrate feedback_widget to TypeScript.
This commit migrates `feedback_widget` module to TypeScript.
2023-05-10 14:31:42 -07:00
Anders Kaseorg
3bc1acba4a install: Use set -x when installing node, shellcheck, shfmt, tx.
This makes it clearer which step failed if there’s an error.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-10 12:15:34 -07:00
Aman Agrawal
a196b949f7 dropdown_widget: Implement dropdown widget using tippy.
This will soon replace DropdownListWidget.
2023-05-09 14:11:26 -07:00
Lauryn Menard
df17a1bf28 test-events: Test do_delete_message with no messages specified.
Test coverage for `zerver/actions/message_delete.py`.

Both callers of this function would already return if there were
no Messages specified to delete, which is why existing tests did
not cover this.
2023-05-09 09:58:33 -07:00
Tim Abbott
cce0c57a04 test-backend: Actions files should target full coverage.
We neglected to add this pattern when we split actions.py into a
directory.
2023-05-09 08:09:17 -07:00
Alex Vandiver
dffbd91452 ci: Test that the installed PostgreSQL was what was asked for. 2023-05-05 13:35:32 -07:00
Alex Vandiver
787c74d0b8 ci: Reduce number of places that hardcode Ubuntu and PostgreSQL versions. 2023-05-05 13:35:32 -07:00
Alex Vandiver
f32e6543be ci: Install PostgreSQL 12 on focal.
The previous commit removed support for PostgreSQL 11, and PostgreSQL
10 support was removed in 11a86ec328.
2023-05-05 13:35:32 -07:00
Anders Kaseorg
8f27a6fb73 provision: Disable compilemessages searching for locale directories.
We explicitly configure LOCALE_PATHS, so we can safely disable this
search of the entire tree for other locale directories.

https://github.com/django/django/blob/4.1/django/core/management/commands/compilemessages.py#L92-L100

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-03 17:20:16 -07:00
evykassirer
9ea6eca253 compose: Move cursor to end of topic input after stream selection.
Fixes #25321.
2023-05-02 12:49:31 -07:00
Alex Vandiver
47e0a89739 webpack: Silence out-of-date warnings from caniuse browserslist. 2023-05-02 09:12:22 -07:00
Aman Agrawal
f40855bad2 reminder: Remove feature from zulip.
This is being removed to make the code simpler. We have plans
to add it as a feature in the future , but it will most likely
not use the same code.
2023-04-28 17:25:00 -07:00
Lalit
c7b8f0658b ts: Migrate scroll_util.js to TypeScript.
This commit migrates `scroll_util.js` to typescript. I made a helper
type `JQueryOrZJQuery` for the argument of `get_scroll_element` instead
of adding a `__zjquery` property to the global JQuery object because it
isn't being used anywhere outside of this function and hence it makes
sense to have a little helper type than to add the property to the global
object.
2023-04-27 09:00:13 -07:00
AcKindle3
de420f68a4 ts migration: Convert dark_theme.js to dark_theme.ts.
Add `void` type annotation to the return type of functions. The
rest of the file is not modified.
2023-04-26 15:40:23 -07:00
Lalit
b9223088f3 refactor: Move simplebar helper functions from ui to scroll_util.
This commit eliminates the `ui.js` module from the codebase by moving
all simplebar helper functions to the `scroll_util` module.
2023-04-26 12:59:08 -07:00
Lalit
e132a68193 refactor: Create compose_textarea and extracted related handlers from ui.js.
Created the new `compose_textarea` and moved event handlers for `#compose_textarea`
from `ui` to this new module so that it is now responsible for initializing event handlers
for compose_textarea instead of `ui` module.
2023-04-26 12:59:08 -07:00