774 Commits

Author SHA1 Message Date
Donal McBreen b839340cf2 Tidy up modules and on_load points 2025-11-26 10:02:32 +00:00
Donal McBreen 9c86205510 Enforce SQLite column limits via CHECK constraints
Patch the sqlite adapter to add CHECK constraints for string and text
column limits. We'll do them inline, so that any column changes
automatically update the constraints.
2025-11-26 09:50:29 +00:00
Donal McBreen 97bcdf1853 Enforce column limits via concern
SQLite columns lengths are purely informational, so we'll enforce the
limits via a concern that checks the lengths from the schema.
2025-11-25 15:32:34 +00:00
Donal McBreen 67f648f356 Enforce MySQL string/text limits in SQLite
To ensure consistent column lengths, we'll add limits to string and text
columns which match MySQL defaults.
2025-11-25 14:50:40 +00:00
Kevin McConnell b238a5b45b Don't report ConcurrentMigrationError to Sentry 2025-11-25 13:24:07 +00:00
Kevin McConnell b6e31a234a Set MySQL max statement timeout to 5s 2025-11-25 12:58:17 +00:00
Donal McBreen e07419e953 Update config/database.yml
Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2025-11-25 11:38:21 +00:00
Donal McBreen b96ea6e9d0 Update config/database.yml
Co-authored-by: Mike Dalessio <mike.dalessio@gmail.com>
2025-11-25 11:38:13 +00:00
Mike Dalessio 9f117159a6 Restore structured logging of queenbee_id
and clean up some other small remaining "plan b" to-dos.
2025-11-24 15:50:45 -05:00
Mike Dalessio 44f1d19f9a Configure beta to use production blob store 2025-11-24 14:25:14 -05:00
Mike Dalessio 2a88e8aacc Configure beta load balancer
including otel config
2025-11-24 14:21:42 -05:00
Mike Dalessio a600faa0fc Update beta deployment and secrets config
to use the production database. Note:

- no jobs containers are running
- we use a single cache db (not a DC-local one)
2025-11-24 14:21:40 -05:00
Mike Dalessio 6ebb572964 Remove tenant format specifier from Disk storage config 2025-11-24 13:45:23 -05:00
Kevin McConnell bd259f7795 Add optimistic pausing to avoid stale reads
Instead of writer pinning, we'll track the last transaction ID of each
write in the session. Then on each read we'll wait for the replica to
report that this transaction is available.

If it doesn't become available within a reasonable timeout, we'll
proceed anyway, and accept the possibility of a stale read.

The hope here is that most of the time, the replica is caught up in the
time between a write request and the following read request. If it's
not, we now have a little tolerance to wait for it, which hopefully
proves enough to stale reads are not encountered in normal use.

We also disable the writer affinity opt-out mechanism that we had
before, since we will no longer be using writer affinity at the load
balancer.
2025-11-24 13:29:52 +00:00
David Heinemeier Hansson 03e24b0ffa Not needed 2025-11-22 12:13:22 +01:00
Donal McBreen 4c4f6957ec Drop sqlite compability, using a separate schema.rb 2025-11-21 17:25:40 +00:00
Donal McBreen b1862733dd Merge branch 'main' into sqlite 2025-11-21 15:23:34 +00:00
Jason Zimdars 2382326a13 Merge pull request #1638 from basecamp/expand-activity-columns
Expand activity columns
2025-11-21 09:11:22 -06:00
Donal McBreen f384a0d9b8 Fix database.yml merge error 2025-11-21 14:30:17 +00:00
Donal McBreen 32c3bcec9f Merge branch 'main' into sqlite 2025-11-21 14:26:21 +00:00
Jorge Manrubia c1f5699443 Switch READ-COMMITED so that queries see the last committed data
This should help solving the problem with overlapping bundles

It is what we use in HEY and Basecamp
2025-11-21 14:35:29 +01:00
Jorge Manrubia 6e20c8c68f Add brakeman rule 2025-11-21 10:42:08 +01:00
Jorge Manrubia e4558f00ab Merge branch 'main' into expand-activity-columns 2025-11-21 10:25:39 +01:00
Donal McBreen f24f959d19 Add brakeman ignores 2025-11-21 09:15:19 +00:00
Donal McBreen dd18b6641d Simplify patching 2025-11-21 09:15:19 +00:00
Donal McBreen 33ef482189 Patch dumper on load 2025-11-21 09:15:19 +00:00
Donal McBreen 9c8d5e40ad Always apply patches on load 2025-11-21 09:15:19 +00:00
Donal McBreen f665b5a1fa No need for default schema 2025-11-21 09:15:19 +00:00
Donal McBreen cc7e091508 Disable multi-db for SQLite 2025-11-21 09:15:19 +00:00
Donal McBreen bb36b4846f Support SQLite searching 2025-11-21 09:15:19 +00:00
Donal McBreen a2333d9a37 Add SQLite support
- UUID support
- Schema compatibility layer, ignore MySQL specific options
- Search not working yet
2025-11-21 09:15:19 +00:00
David Heinemeier Hansson ae640198ae Stick with the same general retention policy we use for everything 2025-11-21 09:40:50 +01:00
David Heinemeier Hansson 0a88565bd7 Slim down 2025-11-21 09:39:59 +01:00
David Heinemeier Hansson f66da318aa No longer needed now that we are back to a single DB 2025-11-21 09:39:33 +01:00
David Heinemeier Hansson 62d4998f27 We stopped using load_async in the code base 2025-11-21 09:35:25 +01:00
Mike Dalessio 2c2a1c4b4a Make sure jobs are enqueued only after all transactions are committed
This should fix the recurring ActiveStorage::FileNotFoundError errors
from ActiveStorage::AnalyzeJob.

The issue is that, when images are not direct uploaded (e.g. a card
background image or avatar image), the AnalyzeJob has been getting
enqueued before the file itself was uploaded to blob storage.

Setting ActiveJob::Base.enqueue_after_transaction_commit = true makes
sure that jobs are always enqueued only once *all* transactions have
been committed.

This will be the Rails default at some point, but for now we still
need to explicitly set it.

Big thanks to @jeremy for the assist. 👏
2025-11-20 18:47:42 -05:00
Mike Dalessio 362be963c0 Add a very rudimentary admin dashboard. 2025-11-19 14:23:47 -05:00
Jason Zimdars eba749a193 Expand activity columns 2025-11-19 12:48:36 -06:00
Fernando Álvarez 672816dec5 Move production jobs to specific hosts 2025-11-19 19:12:02 +01:00
Fernando Álvarez a6a4bb236b Split jobs hosts for Staging
Related to https://3.basecamp.com/2914079/buckets/37331921/todos/9266308208
2025-11-19 18:31:29 +01:00
Mike Dalessio 711cc8568e Fix account slugs in Active Storage URLs 2025-11-19 08:51:12 -05:00
Mike Dalessio 3b717bbe0d Move AccountSlug::Extractor later in the stack
so that in development, it runs after reloading; but still before the
database selector middleware in case we ever want to do something
account-specific.
2025-11-18 09:20:47 -05:00
Kevin McConnell 9b3b2f5d29 Prevent pinning writes in non-primary DCs 2025-11-18 11:03:58 +00:00
Kevin McConnell d584950457 Consolidate staging MySQL replica hostname 2025-11-18 08:29:42 +00:00
Mike Dalessio 695037c7ee Make sure rack-mini-profiler doesn't load in test 2025-11-17 15:03:26 -05:00
Mike Dalessio e3ce26c53d rubocop: more style fixes 2025-11-17 14:54:42 -05:00
Kevin McConnell a7ff18c437 Add regional cache DBs for production 2025-11-17 17:49:26 +00:00
Stanko K.R. 0b8c51c2e9 Preload cards for columns 2025-11-17 16:16:19 +01:00
Mike Dalessio 2a1817d902 Bringing back the TurboStreamsExtension
so that, for example, notification content contains the URLs properly
scoped to the account.
2025-11-17 09:12:41 -05:00
Mike Dalessio 142a342e53 Make sure ActiveJob preserves the current account context
This is a pretty common pattern, something like this is in both
ActiveRecord::Tenanted and ActsAsTenanted.
2025-11-17 09:12:41 -05:00