Skip to content
69 linesCodeBlameRaw
1{
2 "$schema": "../../node_modules/wrangler/config-schema.json",
3 "name": "g1t-events",
4 "account_id": "1e6f2cffa3f445920836e8ebe446bb58",
5 "compatibility_date": "2026-09-26",
6 // Runs next to its database: a request makes several queries in turn,
7 // and each would otherwise cross the distance to it.
8 "placement": { "mode": "off" },
9 "main": "build/index.js",
10 "build": { "command": "node ../../scripts/build-rust-worker.mjs" },
11 "workers_dev": false,
12 "d1_databases": [
13 {
14 "binding": "DB",
15 "database_name": "g1t-events",
16 "database_id": "dd889749-0d01-4c94-8b9b-d789dec1c0e4",
17 "migrations_dir": "migrations"
18 }
19 ],
20 "queues": {
21 "producers": [
22 { "binding": "BUS", "queue": "g1t-events" },
23 // One queue per subscribing service, so each consumes, retries
24 // and scales on its own. Bindings named SUBSCRIBER_* receive
25 // the event types g1t_contracts::subscribers routes to them.
26 { "binding": "SUBSCRIBER_WORK", "queue": "g1t-events-work" },
27 { "binding": "SUBSCRIBER_RUNNER", "queue": "g1t-events-runner" },
28 { "binding": "SUBSCRIBER_INTEGRATIONS", "queue": "g1t-events-integrations" },
29 { "binding": "SUBSCRIBER_WEBHOOKS", "queue": "g1t-events-webhooks" },
30 { "binding": "SUBSCRIBER_ACTIONS", "queue": "g1t-events-actions" },
31 { "binding": "SUBSCRIBER_DEPLOYMENTS", "queue": "g1t-events-deployments" },
32 { "binding": "SUBSCRIBER_PROJECTS", "queue": "g1t-events-projects" },
33 { "binding": "SUBSCRIBER_REPOS", "queue": "g1t-events-repos" },
34 { "binding": "SUBSCRIBER_BILLING", "queue": "g1t-events-billing" },
35 { "binding": "SUBSCRIBER_SECURITY", "queue": "g1t-events-security" },
36 { "binding": "SUBSCRIBER_CONTEXT", "queue": "g1t-events-context" },
37 { "binding": "SUBSCRIBER_SEARCH", "queue": "g1t-events-search" },
38 { "binding": "SUBSCRIBER_PACKAGES", "queue": "g1t-events-packages" },
39 // Pages that cite code a merge changed, and projects' docs folders
40 // (services/docs/src/staleness.ts). Create it once:
41 // npx wrangler queues create g1t-events-docs
42 { "binding": "SUBSCRIBER_DOCS", "queue": "g1t-events-docs" },
43 // Agents' routines that run on events (services/agents/src/triggers.ts).
44 { "binding": "SUBSCRIBER_AGENTS", "queue": "g1t-events-agents" }
45 ],
46 "consumers": [{ "queue": "g1t-events", "max_batch_size": 100, "max_batch_timeout": 1, "max_retries": 3, "dead_letter_queue": "g1t-events-dlq" }]
47 },
48 // Each workspace's audit log keeps as many days as billing says (7 free,
49 // 90 on the plan, or what staff set), asked for over this binding.
50 // The inbox (src/inbox.rs) reads what each event names from work, where
51 // its repository is from repos, and who acted from identity; listing
52 // asks repos which repositories the person can still read.
53 "services": [
54 { "binding": "BILLING", "service": "g1t-billing" },
55 { "binding": "WORK", "service": "g1t-work" },
56 { "binding": "REPOS", "service": "g1t-repos" },
57 { "binding": "IDENTITY", "service": "g1t-identity" },
58 // Each new inbox item, told live in the person's tabs and pushed (services/notify).
59 { "binding": "NOTIFY", "service": "g1t-notify" }
60 ],
61 // Once a day, audit entries older than AUDIT_MAX_DAYS are removed for
62 // everyone (keep it at least billing's AUDIT_MAX_DAYS), then each
63 // workspace's older than its own days. Only workspaces with entries
64 // older than AUDIT_MIN_DAYS, the shortest any plan keeps, are asked about.
65 "triggers": { "crons": ["41 3 * * *"] },
66 "vars": { "AUDIT_MAX_DAYS": "400", "AUDIT_MIN_DAYS": "7" },
67 // Logs of a tenth of requests: every change in g1t is an event.
68 "observability": { "enabled": true, "head_sampling_rate": 0.1 }
69}