Commit Graph

158 Commits

Author SHA1 Message Date
Shubham Padia
a766c092fc help: Restore broken link checks for help center documentation.
We add a step to build help center and then test the broken links as we
used to before removing the test temporarily.

This commit focuses on just adding back the broken link checks for the
help center. We skip the fragment check since that is in-built in
starlight and starlight tests account for that already. For the image
check we can add it back in a followup issue.
2025-09-03 09:28:15 -07:00
Vector73
4f65c99a6b github_actions: Add a GitHub action for notifying if API docs changed. 2025-08-28 09:57:24 -07:00
Alex Vandiver
fd4104f365 ci: Test upgrades from 11.0. 2025-08-19 23:35:09 -07:00
Tim Abbott
66114d404a version: Updates version after 11.0 release. 2025-08-13 16:41:15 -07:00
Anders Kaseorg
ff15d746c3 install: Support Debian 13.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2025-08-13 14:11:05 -07:00
Vector73
f9d52189fc github_actions: Check if feature levels are updated in API docs.
In the past, some API documentation changes were merged with
unresolved placeholders like "ZF-..." instead of actual feature level numbers.
This commit introduces a GitHub Action that scans the API docs for
any occurrence of "ZF-". If found, it will fail the CI check and block the
commit from being merged into main.

This ensures that all feature level references are properly updated before merging.
2025-07-09 09:33:55 -07:00
Alex Vandiver
bd8764f0f6 actions: Add test upgrade from 10.0. 2025-04-03 11:37:42 -07:00
Tim Abbott
095149387a github: Update issue template after 10.0 release. 2025-03-21 09:55:21 -07:00
Anders Kaseorg
d7556b4060 requirements: Migrate to uv.
https://docs.astral.sh/uv/

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-24 22:29:24 -08:00
Tim Abbott
36e44c57a1 github: Use British spelling for organization.
This is required by https://dir.floss.fund/validate.
2024-12-16 15:55:23 -08:00
Alya Abbott
a04759f7f9 funding: Add a funding.json file.
See https://floss.fund/funding-manifest/ for details.
2024-12-13 13:36:51 -08:00
Tim Abbott
d8cf3ff2e9 ci: Run production suite when changing storage.py. 2024-10-25 10:59:57 -07:00
Anders Kaseorg
6a4c4195f5 ci: Enable Python warnings.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-23 10:55:55 -07:00
Alex Vandiver
b87b26d0f2 ci: Test upgrades from Noble and 9.0. 2024-07-26 14:25:49 -07:00
Tim Abbott
c95f048aaa version: Update version after 9.0 release. 2024-07-25 14:35:16 -07:00
Anders Kaseorg
bfd68d5e69 ci: Upgrade github/codeql-action.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-17 19:37:28 -07:00
Alex Vandiver
b3115fd7c3 Revert "ci: Temporarily upgrade postgresql-client-common before upgrading."
This reverts commit 2ec288a983.
Debian fixed this in
7df2322ef5,
and it was released as version 257:
https://metadata.ftp-master.debian.org/changelogs//main/p/postgresql-common/postgresql-common_257_changelog
2024-05-15 15:25:51 -07:00
Anders Kaseorg
70914b0475 Remove support for Ubuntu 20.04 and Debian 11.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2024-04-01 13:27:39 -07:00
Anders Kaseorg
ce075fec6c ci: Move specialized tests away from Ubuntu 20.04 and Debian 11.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2024-04-01 13:27:39 -07:00
Tim Abbott
d6c91cb7f9 Revert "ci: Disable 8.0 upgrade suite to unbreak CI."
This reverts commit 51773d55ed.

Supposedly https://github.com/apache/arrow/issues/40744 is fixed.
2024-03-25 10:47:41 -07:00
Tim Abbott
51773d55ed ci: Disable 8.0 upgrade suite to unbreak CI.
As noted in the comment, hopefully we get to revert this tomorrow, but
it still seems worth doing so that PRs can pass CI again.
2024-03-24 21:19:16 -07:00
Anders Kaseorg
066ea3ebf9 install: Support Ubuntu 24.04.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-03-01 17:38:08 -08:00
Anders Kaseorg
0347e07a96 ci: Upgrade external GitHub actions.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-21 17:17:36 -08:00
Anders Kaseorg
4f27381ebc ci: Disable coverage on Debian 12.
This is probably a more effective workaround for
https://github.com/python/cpython/issues/106092.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-02-05 19:57:21 -05:00
Tim Abbott
35f14e3a89 github: Add Zulip Server 8.0+ to bug report checklist.
And the release checklist so we don't forget next time.
2024-01-24 09:53:45 -08:00
Alex Vandiver
f9834d4e6d ci: Switch 6.0 production to be on Ubuntu 22.04.
This causes us to cover all of our supported operating systems, and
Ubuntu 22.04 support was originally added in Zulip Server 6.0.
2024-01-05 13:19:07 -08:00
Alex Vandiver
9f12e1437a ci: Test upgrades from Zulip Server 8.0. 2024-01-05 13:19:07 -08:00
Alex Vandiver
3cba6c4303 ci: Add a test for upgrading from 7.0.
We build this image on bookworm, for diversity.
2023-11-29 13:57:33 -08:00
Alex Vandiver
2ec288a983 ci: Temporarily upgrade postgresql-client-common before upgrading.
This works around a failure in the current postgresql-client-common
and postgresql-client-15 packages; it exists primarily to improve
the signal on our CI builds, as the failure is a real failure caused
by the package upgrade process.
2023-09-15 07:50:17 -07:00
Zixuan James Li
a081428ad2 user_groups: Make locks required for updating user group memberships.
**Background**

User groups are expected to comply with the DAG constraint for the
many-to-many inter-group membership. The check for this constraint has
to be performed recursively so that we can find all direct and indirect
subgroups of the user group to be added.

This kind of check is vulnerable to phantom reads which is possible at
the default read committed isolation level because we cannot guarantee
that the check is still valid when we are adding the subgroups to the
user group.

**Solution**

To avoid having another transaction concurrently update one of the
to-be-subgroup after the recursive check is done, and before the subgroup
is added, we use SELECT FOR UPDATE to lock the user group rows.

The lock needs to be acquired before a group membership change is about
to occur before any check has been conducted.

Suppose that we are adding subgroup B to supergroup A, the locking protocol
is specified as follows:

1. Acquire a lock for B and all its direct and indirect subgroups.
2. Acquire a lock for A.

For the removal of user groups, we acquire a lock for the user group to
be removed with all its direct and indirect subgroups. This is the special
case A=B, which is still complaint with the protocol.

**Error handling**

We currently rely on Postgres' deadlock detection to abort transactions
and show an error for the users. In the future, we might need some
recovery mechanism or at least better error handling.

**Notes**

An important note is that we need to reuse the recursive CTE query that
finds the direct and indirect subgroups when applying the lock on the
rows. And the lock needs to be acquired the same way for the addition and
removal of direct subgroups.

User membership change (as opposed to user group membership) is not
affected. Read-only queries aren't either. The locks only protect
critical regions where the user group dependency graph might violate
the DAG constraint, where users are not participating.

**Testing**

We implement a transaction test case targeting some typical scenarios
when an internal server error is expected to happen (this means that the
user group view makes the correct decision to abort the transaction when
something goes wrong with locks).

To achieve this, we add a development view intended only for unit tests.
It has a global BARRIER that can be shared across threads, so that we
can synchronize them to consistently reproduce certain potential race
conditions prevented by the database locks.

The transaction test case lanuches pairs of threads initiating possibly
conflicting requests at the same time. The tests are set up such that exactly N
of them are expected to succeed with a certain error message (while we don't
know each one).

**Security notes**

get_recursive_subgroups_for_groups will no longer fetch user groups from
other realms. As a result, trying to add/remove a subgroup from another
realm results in a UserGroup not found error response.

We also implement subgroup-specific checks in has_user_group_access to
keep permission managing in a single place. Do note that the API
currently don't have a way to violate that check because we are only
checking the realm ID now.
2023-08-24 17:21:08 -07:00
Anders Kaseorg
124c5d02e5 ci: Restore commented clean_unused_caches.py invocation.
The comment logic doesn’t make sense.  Every build gets to write to
the caches; some builds do in fact add new items, and without
clean_unused_caches.py there’s no way for them to remove items.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-08-23 16:20:01 -07:00
Tim Abbott
396cedd0e8 ci: Reorder tests to run unique tests first.
As discussed in the comment, it doesn't really make sense for our 4
jobs that we run in parallel for different platforms to all start with
running the backend tests. While it's true that puppeteer will likely
fail if the backend doesn't run, and thus there's a mild prerequisite
relationship there, what is far more common is the node tests fail and
the user doesn't get that input for 10 minutes unnecessarily while all
the backend jobs run, and this change lets us avoid that.
2023-08-09 17:15:51 -07:00
Alya Abbott
0adcc2a1df github: Configure templates for filing issues.
This PR creates templates for filing issues. The templates are
intentionally quite light-weight. Note that I'm specifically not using
forms for creating issues, as the UI for filling out such a form does
not include GitHub's helpful formatting buttons and preview mode.

Follow-up to #25998, pushed as a separate PR so that the original one can pass CI.

This PR creates templates for filing issues. The templates are
intentionally quite light-weight. Note that I'm specifically not using
forms for creating issues, as the UI for filling out such a form does
not include GitHub's helpful formatting buttons and preview mode.

A major goal is to guide users towards starting a CZO conversation
when that's more appropriate than filing a GitHub issue.

Note that the config makes it possible to create a blank issue, which
should be handy for:

* Issues filed by maintainers
* Issues for tracking follow-ups from merged PRs
* Probably some other situations

Because the blank issue option is easy to miss, it should probably be
documented somewhere, but I'm not sure where. We can perhaps start
with a note on CZO.

Relevant CZO threads:

https://chat.zulip.org/#narrow/stream/137-feedback/topic/issues.20link.20in.20description/near/1561110)
https://chat.zulip.org/#narrow/stream/2-general/topic/bug.20report.20management/near/1589141

Also provide external documentation links for situations where
filing an issue is not the best approach.
2023-06-12 17:05:42 -07:00
Anders Kaseorg
d926144e13 ci: Fix pnpm store path for GitHub Actions.
This would ordinarily be determined by running ‘pnpm store path’, but
pnpm is not installed yet at that point.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-31 13:23:06 -07:00
Anders Kaseorg
a4d897c42b ci: Remove unused pnpm cache from production install test.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-31 13:23:06 -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
16dedb08fd ci: Fix matrix definition for tests job.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-05-18 11:52:22 -07:00
Alex Vandiver
65c552e55a ci: Rename focal job to describe all it does. 2023-05-05 13:35:32 -07:00
Alex Vandiver
4a9424b207 ci: Stop trying to pull out the default extra-args.
This was preventing the 20.04 install from actually happening, as
GitHub was folding the two into one configuration.
2023-05-05 13:35:32 -07:00
Anders Kaseorg
033f561d94 ci: Run pnpm dedupe --check.
New in pnpm 8.3.0, this replaces the yarn-deduplicate check that was
removed in commit 3a27b12a7d (#24731).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-04-25 22:26:04 -07:00
Anders Kaseorg
341f6173aa ci: Enable XML coverage report to fix Codecov uploads.
This was broken by commit 534754442a
(#22039).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-31 15:51:43 -07:00
Anders Kaseorg
3a27b12a7d dependencies: Switch to pnpm.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-20 15:48:29 -07:00
Anders Kaseorg
8102556578 ci: Run generate-failure-message from the right path.
This was broken by commit 3a0620a40c
(#23719).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-09 13:20:24 -08:00
Anders Kaseorg
5a79ca251b check-database-compatibility: Drop .py from script name.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-03-03 18:02:37 -08:00
Anders Kaseorg
0ef8e88b17 webpack: Move webpack configuration to web.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-24 06:35:58 -08:00
Anders Kaseorg
c1675913a2 web: Move web app to ‘web’ directory.
Ever since we started bundling the app with webpack, there’s been less
and less overlap between our ‘static’ directory (files belonging to
the frontend app) and Django’s interpretation of the ‘static’
directory (files served directly to the web).

Split the app out to its own ‘web’ directory outside of ‘static’, and
remove all the custom collectstatic --ignore rules.  This makes it
much clearer what’s actually being served to the web, and what’s being
bundled by webpack.  It also shrinks the release tarball by 3%.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-23 16:04:17 -08:00
Anders Kaseorg
7cafbefdef ci: Reduce production suite tarball retention from 14 days to 1.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-02-16 10:15:11 -05:00
Mateusz Mandera
9aacf76f0d do: Install pynacl in the oneclick job.
This is now a required dependency.
2023-01-24 10:33:41 -08:00
David Rosa
e31070c480 contributing docs: Update "Version Control" > "Commit discipline" links.
Updates `.html` links as a follow-up to #23750.
2022-12-09 13:28:49 -08:00
Anders Kaseorg
872f4b41c1 ci: Check that non-scripts aren’t marked executable.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-12-07 09:54:01 -08:00