Go to file
Zixuan Li e39e04c3ce
migration: Add `extra_data_json` for audit log models.
Note that we use the DjangoJSONEncoder so that we have builtin support
for parsing Decimal and datetime.

During this intermediate state, the migration that creates
extra_data_json field has been run. We prepare for running the backfilling
migration that populates extra_data_json from extra_data.

This change implements double-write, which is important to keep the
state of extra data consistent. For most extra_data usage, this is
handled by the overriden `save` method on `AbstractRealmAuditLog`, where
we either generates extra_data_json using orjson.loads or
ast.literal_eval.

While backfilling ensures that old realm audit log entries have
extra_data_json populated, double-write ensures that any new entries
generated will also have extra_data_json set. So that we can then safely
rename extra_data_json to extra_data while ensuring the non-nullable
invariant.

For completeness, we additionally set RealmAuditLog.NEW_VALUE for
the USER_FULL_NAME_CHANGED event. This cannot be handled with the
overridden `save`.

This addresses: https://github.com/zulip/zulip/pull/23116#discussion_r1040277795

Note that extra_data_json at this point is not used yet. So the test
cases do not need to switch to testing extra_data_json. This is later
done after we rename extra_data_json to extra_data.

Double-write for the remote server audit logs is special, because we only
get the dumped bytes from an external source. Luckily, none of the
payload carries extra_data that is not generated using orjson.dumps for
audit logs of event types in SYNC_BILLING_EVENTS. This can be verified
by looking at:

`git grep -A 6 -E "event_type=.*(USER_CREATED|USER_ACTIVATED|USER_DEACTIVATED|USER_REACTIVATED|USER_ROLE_CHANGED|REALM_DEACTIVATED|REALM_REACTIVATED)"`

Therefore, we just need to populate extra_data_json doing an
orjson.loads call after a None-check.

Co-authored-by: Zixuan James Li <p359101898@gmail.com>
2023-06-07 12:14:43 -07:00
.github ci: Fix pnpm store path for GitHub Actions. 2023-05-31 13:23:06 -07:00
.tx provision: Replace transifex-client with new transifex-cli. 2022-12-13 12:34:08 -08:00
.vscode vscode: Recommend remote development extension. 2021-11-03 16:03:46 -07:00
analytics support: Make user search by email case-insensitive. 2023-05-16 12:38:12 -07:00
api_docs Update version following 7.0 release. 2023-05-31 13:04:44 -07:00
confirmation ruff: Fix DJ012 Order of model's inner classes, methods, and fields. 2023-04-12 17:32:38 -07:00
corporate migration: Add `extra_data_json` for audit log models. 2023-06-07 12:14:43 -07:00
docs docs: Clarify access to port 25 is needed for local email delivery. 2023-06-07 08:56:01 -07:00
help invite: Restructure "Invite user" modal for improved user experience. 2023-06-06 17:48:29 -07:00
locale i18n: Update translation data from Transifex. 2023-05-31 08:36:53 -07:00
pgroonga migrations: Import BaseDatabaseSchemaEditor from its canonical module. 2023-03-05 14:46:28 -08:00
puppet puppet: Include trusted-proto definition in zulip_ops configurations. 2023-05-29 15:13:45 -07:00
requirements requirements: Switch to released coverage fix. 2023-05-29 14:41:20 -07:00
scripts install: Check CPU and OS architecture. 2023-06-01 17:09:48 -07:00
static integrations: Add Linear webhook integration. 2023-05-30 10:48:19 -07:00
stubs/taint actions: Split out zerver.actions.message_send. 2022-04-14 17:14:34 -07:00
templates emails: Apply different styles to custom email headings. 2023-05-31 13:42:12 -07:00
tools search: Remove support for experimental search pills. 2023-06-06 18:36:02 -07:00
var/puppeteer puppeteer_tests: Port to TypeScript. 2021-02-22 16:03:10 -08:00
web settings: Remove id column from tables in stream and group settings. 2023-06-07 12:01:26 -07:00
zerver migration: Add `extra_data_json` for audit log models. 2023-06-07 12:14:43 -07:00
zilencer migration: Add `extra_data_json` for audit log models. 2023-06-07 12:14:43 -07:00
zproject search: Remove support for experimental search pills. 2023-06-06 18:36:02 -07:00
.codecov.yml
.codespellignore codespell: Fix newly found typos. 2023-04-03 22:39:21 -07:00
.editorconfig editorconfig: Restore indent_size = 2 for Markdown. 2021-08-20 23:14:37 -07:00
.eslintignore web: Move web app to ‘web’ directory. 2023-02-23 16:04:17 -08:00
.eslintrc.json shared: Avoid replaceAll again. 2023-05-25 22:39:12 -07:00
.gitattributes .gitattributes: Mark *.bmp, *.bson, *.mp3, *.pdf as binary. 2022-02-07 18:51:06 -08:00
.gitignore dependencies: Switch to pnpm. 2023-03-20 15:48:29 -07:00
.gitlint lint: Update line-length for commit message to 72 in gitlint. 2023-05-01 10:35:52 -07:00
.mailmap mailmap: Add entry for Brijmohan Siyag. 2023-05-31 08:48:02 -07:00
.npmignore
.npmrc dependencies: Switch to pnpm. 2023-03-20 15:48:29 -07:00
.prettierignore dependencies: Switch to pnpm. 2023-03-20 15:48:29 -07:00
.pyre_configuration
.readthedocs.yaml readthedocs: Add a configuration file. 2023-02-03 16:36:54 -08:00
.sonarcloud.properties
CODE_OF_CONDUCT.md contributor docs: Add guidelines on moderating the Zulip community. 2022-12-02 16:57:41 -08:00
CONTRIBUTING.md CONTRIBUTING: Add links to new review process guide. 2023-05-25 18:10:22 -07:00
Dockerfile-postgresql docker: Document the PostgreSQL Dockerfile build steps. 2022-04-26 18:00:00 -07:00
LICENSE license: Move copyright notice from LICENSE to NOTICE. 2021-02-05 09:28:12 -08:00
NOTICE docs: Bump copyright year. 2021-02-05 09:28:15 -08:00
README.md README: Update Ruff badge. 2023-03-21 11:46:20 -07:00
SECURITY.md SECURITY.md: Reorder and make clearer how to subscribe to announcements. 2022-01-07 15:56:26 -08:00
Vagrantfile vagrant: Add Fedora 36 support. 2022-09-08 16:12:59 -07:00
manage.py ruff: Fix SIM102 nested `if` statements. 2023-01-23 11:18:36 -08:00
package.json dependencies: Upgrade JavaScript dependencies. 2023-06-05 21:51:26 -07:00
pnpm-lock.yaml dependencies: Upgrade JavaScript dependencies. 2023-06-05 21:51:26 -07:00
prettier.config.js prettier: Disable embedded language formatting for Markdown. 2021-08-20 23:14:37 -07:00
pyproject.toml requirements: Upgrade Python requirements. 2023-04-25 21:20:33 -07:00
stylelint.config.js linter: Lint grid-area names for quotation marks. 2023-05-19 13:08:15 -07:00
tsconfig.json ts: Convert `emoji.js` to TypeScript. 2023-04-05 10:29:01 -07:00
version.py migration: Add `extra_data_json` for audit log models. 2023-06-07 12:14:43 -07:00

README.md

Zulip overview

Zulip is an open-source team collaboration tool with unique topic-based threading that combines the best of email and chat to make remote work productive and delightful. Fortune 500 companies, leading open source projects, and thousands of other organizations use Zulip every day. Zulip is the only modern team chat app that is designed for both live and asynchronous conversations.

Zulip is built by a distributed community of developers from all around the world, with 74+ people who have each contributed 100+ commits. With over 1000 contributors merging over 500 commits a month, Zulip is the largest and fastest growing open source team chat project.

Come find us on the development community chat!

GitHub Actions build status coverage status Mypy coverage Ruff code style: black code style: prettier GitHub release docs Zulip chat Twitter GitHub Sponsors

Getting started

You may also be interested in reading our blog, and following us on Twitter and LinkedIn.

Zulip is distributed under the Apache 2.0 license.