Commit Graph

4979 Commits

Author SHA1 Message Date
Lalit c0c4c2e1e7 ts: Migrate `message_overlay_ui` to TypeScript. 2023-07-17 16:24:16 -07:00
Lalit b51bdd33bb ts: Migrate `list_widget` to TypeScript. 2023-07-17 11:31:51 -07:00
Zixuan James Li 604ffebf5f tools: Make screenshot tool work with the modern web client.
This fixes some deprecation use of the APIs, including using "new"
instead of "true" for the "headless" flag when launching puppeteer and
using $$ instead of $x when using XPath selectors.

We also use {waitUntil: "networkidle2"} to fix the issue of webhook bot
avatar not being loaded consistently when generating the screenshots
(this happened to webhooks like Slack and Harbor).

Positioning of the clip area is adjusted to take the new grid layout
into account.
2023-07-17 09:23:01 -07:00
Zixuan James Li d1455d81f2 integrations: Extend screenshot tool for more flexibility.
This allows the user to skip generating screenshots up to certain
integration when working through generating screenshots for all
integrations.

This also allow the user to select a number of integrations to
selectively generate screenshots for.
2023-07-17 09:23:01 -07:00
xoldyckk a062a82f06 ts: Migrate setup.js to typescript.
Also added global type definition for `get_offset_to_window`
helper function.
2023-07-10 13:49:26 -07:00
Lalit ae6063807b ts: Convert `poll_data` to typescript.
Used zod schemas to validate inbound data types and removed some over
defensive code.
2023-07-06 16:21:52 -07:00
Alex Vandiver 23fd05494d release: Release 8.0-prereleases from `main`. 2023-07-06 16:16:11 -07:00
Alex Vandiver c1008b5b12 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.
2023-07-06 16:16:11 -07:00
Alex Vandiver 9bd340957f changelog: Retitle sections, to allow section anchors. 2023-07-06 16:16:11 -07:00
Zixuan James Li eebe46ad1c test_classes: Do not necessary wrap test cases in a transaction.
By relocating helper methods into a mixin class, we can be more flexible
with managing transactions in test cases, without always forcing the
django.test.TestCase behavior of always putting the test case into an
atomic transaction.

We include a check for side effects in ZulipTransactionTestCase. It only
checks for the set of row ids in all tables before and after each test.
It is not a comprehensive check for side effects, but should be
sufficient for the basics without much performance overhead.
2023-07-06 11:44:50 -07:00
Satyam Bansal 605e9065a2 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.
2023-07-05 14:59:06 -07:00
Akshat e7f4700d76 test-backend: Enable single-threaded profiling when thread count is unspecified.
If the number of threads is not specified
while profiling then use a single thread. This is
because profiling across multiple threads (earlier
default behaviour) may obscure the accurate
measurement of which functions are the most costly
due to thread blocking.

Signed-off-by: Akshat <akshat25iiit@gmail.com>
2023-07-02 16:18:59 -07:00
Anders Kaseorg 407c16fc77 eslint: Expand no-unused-vars check to all function parameters.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-07-02 16:16:38 -07:00
Alex Vandiver dc2726c814 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.
2023-06-23 14:40:27 -07:00
Lalit 13187ff8f6 ts: Convert `web/src/billing` module to TypeScript.
Converted all files inside `web/src/billing` to TypeScript.
2023-06-23 11:42:29 -07:00
Anders Kaseorg 639efc5ce1 docs: Update Transifex URLs.
https://help.transifex.com/en/articles/7171815-web-application-s-domain-change

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-06-12 17:38:41 -07:00
Zixuan James Li 4a18552ff8 docs: Document and advocate systemd for WSL 2.
systemd makes it a lot convenient to run services required for Zulip's
development environment on WSL 2. Once enabled, `tools/start_service`
becomes unnecessary.

More info:
https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-06-12 10:58:11 -07:00
Anders Kaseorg 7e811ea1bd custom_check: Remove checks for deleted ui_report aliases.
They were deleted in commit 2d52463b61.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-06-09 16:46:57 -07:00
Lalit 5744ed32e2 tippyjs: Extract compose_tooltips.js module. 2023-06-08 16:20:59 -07:00
Tim Abbott e7c012c850 tippyjs: Extract message_list_tooltips module. 2023-06-08 16:20:59 -07:00
Zixuan James Li 119cf9100c semgrep: Check if a batched migration is made atomic.
This raises an error when we forget to make migration non-atomic when
doing it in batches. BATCH_SIZE seems to be a good indicator for when
we do batching with few early exceptions.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2023-06-07 16:49:11 -07:00
evykassirer aa270bcef0 search: Remove support for experimental search pills.
This in-progress feature was started in 2018 and hasn't
been worked on much since. It's already in a broken state,
which makes it hard to iterate on the existing search bar
since it's hard to know how those changes will affect search
pills.

We do still want to add search pills eventually, and when
we work on that, we can refer to this diff to readd the
changes back.
2023-06-06 18:36:02 -07:00
Tim Abbott 713a64d415 message_scroll: Extract module message_feed_top_notices. 2023-06-05 21:57:35 -07:00
Anders Kaseorg b5e5728112 coverage: Clean up coverage configuration.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-31 13:53:04 -07: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