Commit Graph

61552 Commits

Author SHA1 Message Date
Mateusz Mandera 70fb590466 change_realm_subdomain: Revoke user sessions.
If we don't revoke sessions, this can lead to issues when we import a
realm (e.g. from Slack) into the original subdomain for the same
organization. Because then, users who already had sessions before the
move end up stuck:
- when they try to open Zulip on the original subdomain, which now has
the imported instance, they get redirected to the moved subdomain due to
their pre-existing session cookie.
- they can't even log out to get rid of the bugged cookie, because the
account they're logged into in that session is now on the moved
subdomain.
2024-11-10 19:13:14 -08:00
Mateusz Mandera 1f21b7437c test_import_export: Don't hard-code ZULIP_VERSION in fixtures.
Otherwise, these tests fail if ZULIP_VERSION is different locally from
what's hard-coded. Use a placeholder instead and replace dynamically in
a helper function.
2024-11-10 19:12:39 -08:00
Anders Kaseorg 9506950f09 lint: Further recognize more JavaScript file extensions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-10 17:52:49 -08:00
Anders Kaseorg ff70ab441d dependencies: Remove three JS argument parsing libraries.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-10 16:00:29 -08:00
Anders Kaseorg da749d1c94 mdiff: Add missing exit for --help.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-10 16:00:29 -08:00
Anders Kaseorg 9c6e261861 dependencies: Remove mkdirp.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-10 15:02:52 -08:00
Anders Kaseorg efd7c06e30 lint: Recognize more JavaScript file extensions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-09 23:09:46 -08:00
Anders Kaseorg b020d5e2e8 tests: Remove deprecated Sentry.addTracingExtensions() call.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-09 22:18:10 -08:00
Anders Kaseorg 9b7a4c89ec svgicons2svgfont: Patch to fix Node 22 punycode DeprecationWarning.
(node:13734) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    (Use `node --trace-deprecation ...` to show where the warning was created)

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 18:19:30 -08:00
PieterCK 0d7199b22e data_import: Add migration status file to converted exports.
This commit updates all third-party importer tools (Slack, Mattermost,
and Rocket Chat) in the `zerver/data_import` directory to also output a
migration_status.json file in their output tarball.

This is required because all importable tarball will be checked for
migration compatibility during import.

Fixes #28443.
2024-11-08 15:52:45 -08:00
PieterCK a9838d8089 import: Verify exported realm's migration compatibility.
When transferring a realm to a server that has a different set of
applied migrations (different Zulip versions), there is a chance that
the imported data formats appear to be compatible but data invariants
could still be violated.

This commit adds an assertion during the import process to verify
that both the exported realm and the importing server have matching
Zulip versions and have a compatible set of migrations.
2024-11-08 15:52:45 -08:00
PieterCK 40bcb4b42b export: Add migration status file to export tarball.
This commit updates the export process to write the migration status of
the realm as a JSON file to be included in the export tarball.

This is a preparatory step for adding an assertion to ensure that the
importing and exporting realms have a compatible set of applied
migrations.
2024-11-08 15:52:45 -08:00
Giovanni Silva 70d559cafa integrations: Update New Relic integration.
Newrelic has introduced a new update. This commit
updates the exisiting integration by adding support
for new types of payloads and cleaning up legacy
codes and fixtures.

Fixes #29729.

Co-authored-by: Pieter CK <pieterceka123@gmail.com>
Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2024-11-08 15:49:56 -08:00
evykassirer 424e5d6ad0 buddy_list: Add background color placeholder to loading avatar. 2024-11-08 15:44:14 -08:00
Mateusz Mandera 420849ff6a slack: Call the correct resize_* function when importing realm icon.
For resizing the icon.png files, we use resize_avatar, not resize_logo.
This is pretty confusing - sure, for icons we use the same function as
for avatars, but we should have a proper name for the function called in
the icon context. So this commit also adds resize_realm_icon, and
changes the calls to resize_avatar in icon contexts to
resize_realm_icon.
2024-11-08 15:43:18 -08:00
evykassirer cb6c60ef7a stream_create: Fix puppeteer test flake from modal reopening.
In 245357c868 we added a redirect
after stream creation, to go to the stream feed. This means
the stream settings modal was closed partway through the tests.
This caused a flake where when the modal was reopened it was
not always open by the time we fetched the stream name.

The main fix in this commit is changing the classname for
the stream in the modal to be more specific (`stream-name`
can also be found in the left sidebar in many places) and
waiting for it to be visible again before getting text from
it.

More discussion here:
https://chat.zulip.org/#narrow/channel/43-automated-testing/topic/stream.20create.20puppeteer.20failure/near/1976724

Co-authored-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 14:12:24 -08:00
Mateusz Mandera a669fece3a email_mirror: Check that email gateway bot can send to the channel.
Otherwise this leads to an uncaught exception when the check happens
later in `check_message`.
2024-11-08 13:13:15 -08:00
Anders Kaseorg 2f2a207ae0 tests: Remove babel-plugin-rewire-ts.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg aab541bd4e namespace: Recognize immutable ES modules without checking __Rewire__.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg 8c60b66a95 tests: Use setters instead of __Rewire__.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg 52e59a9605 web: Add setters for rewired variables.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg e2cc125583 eslint: Exempt function variables from no-use-before-define.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg a208870b59 tests: Fix override of immutable ES module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg df6bcf6d3d tests: Avoid override_rewire of overloaded function.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg ee52618e1b namespace: Require rewired variables to be exported.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg db2723036f tests: Export rewired variables.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg a37aab19ed tests: Avoid override_rewire of imports.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg c57f12a792 tests: Remove override_rewire of nonexistent variables.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Harsh e468818d2b import: Remove skipping of too-long messages during import.
This commit eliminates the skipping of messages longer than 10K characters during the import process.
2024-11-07 16:04:14 -08:00
Karl Stolley 4038832889 unread_count: Set class for legacy quiet counters. 2024-11-07 14:56:38 -08:00
Karl Stolley 0e3be942b9 unread_count: Introduce classes for different counts.
This includes more prominent quiet counts, with increased
font-weight and, in dark mode, a brighter text color.
2024-11-07 14:56:38 -08:00
bedo a632948482 left_sidebar: Fix keyboard accessibility.
Fixes #31823

When home view changes, CSS just puts the selected home view
at the top of the left_sidebar navigation list (expanded)
or to the left (collapsed), but the rendered <li> elements
stay in the same order in DOM, so regarldess of current home view,
keyboard navigation always follows the order in which the <li>
elements appear in DOM.

Changes:
- Reorder <li> navigation elements in DOM based on current home view.

- Remove tabindex=0 from <a> elements, because they are now ordered
correctly in DOM.

- Add (tabindex="0" role="button") to the <i> collapsable VIEWS, to be
keyboard accessibile.
2024-11-07 11:55:48 -08:00
Mateusz Mandera e37f3cca07 docs: Fix upgrade instructions for Ubuntu 22.04->24.04.
Due to Ubuntu 22.04->24.04 doing an incompatible minor version
jump in rabbitmq-server, we need to work around the issue by removing
the rabbitmq-server package before upgrading to 24.04.

https://bugs.launchpad.net/ubuntu/+source/rabbitmq-server/+bug/2074309
2024-11-07 11:20:08 -08:00
PieterCK 92437b4ab5 integrations: Refactor slack_incoming webhook.
This commit refactors `render_attachment` and `render_block`
out of slack_incoming.py to promote reusability.

The primary motivation for this refactor is to add support for
converting integration bots messages in Slack exports, which could use
the same functions.

Part of #31311.
2024-11-07 10:47:08 -08:00
Tim Abbott fce6f4ef66 topic_list: Harden topic clicks against propagation.
I saw some profiling traces where it appears multiple copies of this
click handler got processed when clicking on a topic in the left
sidebar.

I suspect that was a profiling artifact, but the intent is for
on_topic_click to fully process clicks on topics in the sidebar, and
we should write the code to say that.
2024-11-07 10:46:30 -08:00
evykassirer a1e31a44bd buddy_list: Tweak spacing of rows, line-height, and circle placement.
This commit adds more space between rows, increases the line height
so that the status message doesn't touch the status emoji, and makes
the status circle a little bigger.
2024-11-07 10:33:04 -08:00
swayam0322 6c583c9bfe integrations: Update GoCD integration.
Previously, the GoCD integration relied on GoCD's integration with bug
tracking and monitoring tools through the users' Config XML file [1].
However, this feature no longer works as expected, as it cannot send
HTTPS payloads to an external endpoint.

This commit updates our GoCD integration to use Sentry's WebHook
notifier GoCD plugin [2] to send webhook payloads from users GoCD server
to Zulip. We are using an older version of the plugin—v0.0.6—because the
newer version—v0.0.9—doesn't work at this time.

Additionally, this change reformats the notifications to include more
details on the GoCD event, such as lists of passed and failed jobs.

Fixes #21224.

Co-authored-by: Pieter CK <pieterceka123@gmail.com>

[1]:
https://docs.gocd.org/current/integration/#integration-with-bug-tracking-and-story-management-tools
[2]:
https://github.com/getsentry/gocd-webhook-notification-plugin/releases/tag/v0.0.6
2024-11-07 10:25:29 -08:00
evykassirer bd10923f13 settings_realm_user_settings_default: Convert module to typescript. 2024-11-06 17:55:55 -08:00
Anders Kaseorg cd701c8468 webpack: Disable CompressionPlugin for Puppeteer tests.
Zopfli is very slow and the development server does not use its output
anyway.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-06 16:47:30 -08:00
Tim Abbott 30c54d023b settings: Write fewer values into template settings files.
This makes it easier for us to change the default values for these
settings, and also just helps keep settings files clear of values that
the relevant organization didn't choose themselves.

There's about a dozen more settings that could receive similar
treatment; I just went with the easiest ones.
2024-11-06 16:43:44 -08:00
evykassirer 898af8a9af user_circles: Fix bug causing incorrect colors in typeahead.
c39ae45d95 was incorrect, and should
only have been applied to the circles in the buddy list avatars.
In other places in the app, the transparency was over other colors
of background.
2024-11-06 16:36:40 -08:00
evykassirer 45d9c04e8e buddy_list: Fix vertical spacing issue. 2024-11-06 16:36:40 -08:00
Tim Abbott 81476308f5 docs: Stop describing Docker as experimental.
It's not an accurate descripton for an image that's been used in
production for many years, and we fully support.
2024-11-06 11:38:28 -08:00
Lauryn Menard 2c0a2b9998 help: Update example screenshot for markdown link formatting. 2024-11-06 09:52:53 -08:00
Prakhar Pratyush 75edce59c1 process_downgrade: Add savepoint=False to avoid creating savepoint.
'process_downgrade' is used inside an outer db transaction
created in 'remote_server_post_analytics'.

`transaction.atomic()` block in 'process_downgrade' resulted in
savepoint creation.

This commit adds `savepoint=False` to avoid that.
2024-11-05 17:58:47 -08:00
Prakhar Pratyush 86a909e703 users: Add `savepoint=False` to avoid creating savepoints.
'do_deactivate_user' is used inside an outer db transaction
created in 'sync_user_from_ldap'.

`transaction.atomic()` block in 'do_deactivate_user' resulted
in savepoint creation.

This commit adds `savepoint=False` to avoid that.
2024-11-05 17:58:47 -08:00
Prakhar Pratyush 27eeb08459 streams: Add `savepoint=False` to avoid creating savepoints.
'bulk_remove_subscriptions' is used inside an outer db transaction
created in 'do_change_bot_owner'.

`transaction.atomic()` block in 'bulk_remove_subscriptions'
resulted in savepoint creation.

This commit adds `savepoint=False` to avoid that.
2024-11-05 17:58:47 -08:00
Prakhar Pratyush 8c8cc80183 create_user: Add `savepoint=False` to avoid creating savepoints.
'do_activate_mirror_dummy_user' is used inside an outer db
transaction created in 'registration_helper'.

`transaction.atomic()` block in 'do_activate_mirror_dummy_user'
resulted in savepoint creation.

This commit adds `savepoint=False` to avoid that.
2024-11-05 17:58:47 -08:00
Prakhar Pratyush ca4760a04c recipients: Add `savepoint=False` to avoid creating savepoints.
'get_or_create_direct_message_group' is used inside an outer
db transaction created in 'edit_scheduled_message'.

`transaction.atomic()` block in 'get_or_create_direct_message_group'
resulted in savepoint creation.

This commit adds `savepoint=False` to avoid that.
2024-11-05 17:58:47 -08:00
Prakhar Pratyush 0e67e4f1a1 compose_views: Add `savepoint=False` to avoid creating savepoints.
'compose_views' is used inside an outer db transaction created in
'update_user_group_backend'.

`transaction.atomic()` block in 'compose_views' resulted in
savepoint creation.

This commit adds `savepoint=False` to avoid that.
2024-11-05 17:58:47 -08:00