Skip to content

Commit 16e0d4d

Browse files
AdamDonnacodex
andcommitted
Merge main and preserve scheduling across Solo follow-ups
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Adam Donaghy <adonaghy@squareup.com>
2 parents 895e30e + 86511a9 commit 16e0d4d

549 files changed

Lines changed: 32236 additions & 6001 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.env.example‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ REDIS_URL=redis://localhost:6379
3434
# Max connections in each of the relay's Postgres pools — writer and, when
3535
# READ_DATABASE_URL is set, reader (default 50).
3636
# BUZZ_DB_POOL_SIZE=50
37+
# Max connections in the reader pool (default BUZZ_DB_POOL_SIZE).
38+
# BUZZ_DB_READ_POOL_SIZE=50
39+
# Connections the reader pool keeps open even when idle, capped at its size
40+
# (default: a fifth of BUZZ_DB_READ_POOL_SIZE).
41+
# BUZZ_DB_READ_POOL_MIN=10
42+
# Writer and reader connections close once they are this old (default 300).
43+
# BUZZ_DB_MAX_LIFETIME_SECS=300
44+
# Each connection closes at its own point in this many seconds before the
45+
# lifetime, so connections opened in one burst do not all close together.
46+
# Jitter does not schedule replacements: a closed connection above the floor
47+
# is dialed again only when a request needs it. 0 closes every connection at
48+
# exactly the lifetime (default 60).
49+
# The point is checked when a connection is returned to the pool, so the
50+
# spread depends on traffic: a quiet pool can still close its idle
51+
# connections together at the lifetime. BUZZ_DB_READ_POOL_MIN keeps a warm
52+
# reader floor through quiet periods.
53+
# BUZZ_DB_MAX_LIFETIME_JITTER_SECS=60
3754
# Read-only partition catalog audit interval, clamped to 60s..24h (default 900s).
3855
# BUZZ_PARTITION_AUDIT_INTERVAL_SECS=900
3956
# Emergency kill switch for all automatic partition DDL, including catch-all
@@ -265,6 +282,14 @@ BUZZ_S3_ADDRESSING_STYLE=path
265282
# How often the reaper checks for expired ephemeral channels (default: 60s).
266283
# BUZZ_REAPER_INTERVAL_SECS=5
267284

285+
# -----------------------------------------------------------------------------
286+
# Channel discovery repair
287+
# -----------------------------------------------------------------------------
288+
# On startup, republish relay-signed discovery events (kinds 39000-39002) for
289+
# channels created in this many past hours that are missing any of them, as a
290+
# failed post-commit emission leaves them (default: 72; 0 turns it off).
291+
# BUZZ_DISCOVERY_REPAIR_LOOKBACK_HOURS=72
292+
268293
# -----------------------------------------------------------------------------
269294
# Logging / Tracing
270295
# -----------------------------------------------------------------------------

‎.github/workflows/_ci-relay.yml‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ jobs:
121121
cargo nextest archive \
122122
--cargo-profile ci \
123123
-p buzz-db \
124+
-p buzz-deletion \
124125
-p buzz-pubsub \
125126
-p buzz-relay \
126127
-p buzz-relay-mesh \
@@ -582,6 +583,22 @@ jobs:
582583
--archive-file target/ci/backend-integration-tests.tar.zst \
583584
-E 'package(buzz-relay) and test(/api::admin::postgres_tests::external_infra_minio_tests::/)' \
584585
--run-ignored ignored-only
586+
- name: Community deletion executor regressions
587+
# The executor tests need Redis and MinIO. Each test that changes the
588+
# catalog builds its own scratch database.
589+
env:
590+
BUZZ_TEST_SCHEMA_MODE: desired
591+
BUZZ_TEST_DATABASE_URL: postgres://buzz:${{ env.BUZZ_TEST_POSTGRES_PASSWORD }}@localhost:5432/buzz
592+
BUZZ_TEST_REDIS_URL: redis://localhost:6379
593+
BUZZ_TEST_S3_ENDPOINT: http://localhost:9000
594+
BUZZ_TEST_S3_ACCESS_KEY: buzz_dev
595+
BUZZ_TEST_S3_SECRET_KEY: buzz_dev_secret
596+
BUZZ_TEST_S3_BUCKET: buzz-media
597+
run: |
598+
cargo nextest run \
599+
--archive-file target/ci/backend-integration-tests.tar.zst \
600+
-E 'package(buzz-deletion) and test(/^postgres_tests::external_infra_s3_tests::/)' \
601+
--run-ignored ignored-only
585602
- name: Media thumbnail regeneration regressions
586603
# The tests share one fixture image's storage keys, and nextest gives
587604
# each its own process, so their in-process lock can't order them.

‎AGENTS.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ crates/
112112
buzz-db # Postgres event store and data access layer
113113
buzz-auth # Authentication and authorization
114114
buzz-pubsub # Redis pub/sub fan-out, presence, typing indicators
115-
buzz-search # Postgres FTS full-text search
115+
buzz-search # Postgres FTS and OpenSearch message search + indexer
116116
buzz-audit # Hash-chain audit log
117117
buzz-media # Blossom/S3 media storage
118118
# Agent surface
@@ -169,6 +169,14 @@ For changes limited to Flutter/Dart code in the mobile app, run
169169
Native code and build-configuration changes also require the corresponding
170170
platform checks.
171171

172+
`clippy.toml` bans raw calls that review has caught before, and each error
173+
names the replacement. When you fix a class of bug, or a reviewer asks how to
174+
keep it from happening again, add a ban there or a check in the same PR, plus a
175+
line in `crates/buzz-relay/src/clippy_ban_witness.rs`. To keep a banned call in
176+
production code, use `#[expect(clippy::disallowed_methods, reason = "...")]`,
177+
not `#[allow]`. Test code may use banned calls, but a new file under `tests/`
178+
needs the `#![allow(...)]` line the other test files start with.
179+
172180
Run `just test` for integration tests if you touched `buzz-relay`,
173181
`buzz-db`, or `buzz-auth` — these require a running Postgres and Redis.
174182

‎CONTRIBUTING.md‎

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@ We review as capacity allows — focused PRs that follow this guide move fastest
8585
| pnpm | 10+ | Required for desktop app commands and `just ci` |
8686
| Flutter | 3.47.9+ | Required for mobile app — install via [flutter.dev](https://docs.flutter.dev/get-started/install) |
8787
| Xcode | 27.1 recommended; 26 supported | Required for iOS builds; see [iOS toolchain setup](mobile/README.md#ios-toolchain) |
88-
| Docker | 24+ | For Postgres, Redis, MinIO |
88+
| Docker | 24+ | For Postgres, Redis, MinIO (and opt-in OpenSearch) |
8989
| `just` | latest | Task runner — `cargo install just` |
90+
| `cargo-nextest` | 0.9.136+ | Faster unit tests; required for `just test-postgres` and `just test-search` |
9091
| `lefthook` | 2.1.3 (Hermit-pinned) | Auto-installed by `just hooks` — no manual install needed |
9192
| `sqlx` migrations | workspace crate | `just migrate` applies embedded migrations from `migrations/` |
9293

@@ -179,6 +180,13 @@ just relay # terminal 1 — relay on ws://localhost:3000
179180
just desktop-dev # terminal 2 — Vite dev server only (no Tauri shell)
180181
```
181182

183+
To also run the opt-in local OpenSearch message index (auto-starts the
184+
`buzz-opensearch` container on `:9200`):
185+
186+
```bash
187+
just search=1 relay # or `just search=1 dev`
188+
```
189+
182190
### Stopping / Resetting
183191

184192
```bash
@@ -264,11 +272,20 @@ Set `BUZZ_POSTGRES_ADMIN_URL` to that role's maintenance database, and set
264272
schema bootstrap. PostgreSQL client tools are resolved from `PATH` unless
265273
`PG_BIN_DIR` is set. Tests that use Redis read `REDIS_URL`.
266274

267-
With native PostgreSQL and Redis running, the complete lane is below. The
268-
runner bounds compilation to the packages discovered from the current source
269-
tree and removes the run-scoped desired-state source database on exit.
270-
Per-test and source-database cleanup retries transient PostgreSQL disconnect
271-
races and emits a warning if all five attempts fail.
275+
Against the local Docker Compose stack, the `just` recipes auto-start the
276+
needed containers and set the local Postgres/OpenSearch environment variables
277+
for you (requires `cargo-nextest` and PostgreSQL client tools such as `psql` /
278+
`createdb` / `dropdb`):
279+
280+
```bash
281+
just test-search # Postgres FTS + OpenSearch tests
282+
just test-postgres # full PostgreSQL-backed lane
283+
just test-postgres -p buzz-db --lib # a single package or filter
284+
```
285+
286+
Against native PostgreSQL and Redis (or CI), run the script directly after
287+
setting `BUZZ_POSTGRES_ADMIN_URL`, `PGHOST`, `PGPORT`, `PGUSER`, `PGPASSWORD`,
288+
and `REDIS_URL`:
272289

273290
```bash
274291
./scripts/postgres-test-run.sh

‎Cargo.lock‎

Lines changed: 16 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)