Commit Graph

517 Commits

Author SHA1 Message Date
Stanko K.R. a9e052d8cb Explicitly use a shard for caching
See: https://github.com/rails/solid_cache/pull/219
2025-11-17 09:12:41 -05:00
Mike Dalessio e3d86bb21e Clean up some spots where "current account" is ambiguous
Primarily this is in tests (which were caught by temporarily
introducing acts_as_tenant and enabling safety checks), but notably
action cable connections were not working properly, and that's now
fixed.
2025-11-17 09:12:41 -05:00
Stanko K.R. 488c74d99e Always use the cache db for caching 2025-11-17 09:12:41 -05:00
Kevin McConnell fd3ad90f47 Remove outdated job reference 2025-11-17 09:12:41 -05:00
Kevin McConnell 11a38a4526 Initial (wip) staging deployment
This adds an initial configuration for staging. Note that we are doing
this ahead of having the full infrastructure in all 3 DCs. So this
this will result in some cross-DC writes for now (e.g. we have a single cache in
IAD). We'll correct this as the infrastructure becomes available.

We'll also run jobs on every app server, until we split them out to
separate instances.
2025-11-17 09:12:41 -05:00
Mike Dalessio aca00d6218 Configure a reading: connection for solid gems
because I'm getting exceptions from Mission Control
2025-11-17 09:12:41 -05:00
Stanko K.R. e0693de7c3 Scope jobs and controllers by account 2025-11-17 09:12:41 -05:00
Mike Dalessio fe6df7085f Finish the rollout of account_id to all core data models
Schema:
- add account_id to tables it was missing from
- make account_id a required column everywhere
- add [account_id] indexes, or add `account_id` to existing indices

Models:
- add `belongs_to :account` to all models (default to using a domain
  model's account whenever possible)
- add account_id in all the necessary fixtures
- add account_id to insert_all hashes
- pass account_id to a few initialize calls

Miscellaneous:
- update the import script to set account_id

Note that I'm not adding account_id to the join tables primarily
because I couldn't think of an easy way to populate it without making
it a full Join model, and that was more work than I have time to take
on right now.
2025-11-17 09:12:40 -05:00
Mike Dalessio 5a7f08067a Move setting Current.account into the middleware
so that code called from the Rails controllers can use Current.account
2025-11-17 09:12:40 -05:00
Stanko K.R. 34d83aaa7c Fix tests after the removal of memberships 2025-11-17 09:12:40 -05:00
Mike Dalessio adaf6966c6 brakeman: drop two obsolete warnings, ignore new searchable sql 2025-11-17 09:12:36 -05:00
Donal McBreen 6323e0abee Use uuid as the id type in schema.rb
This matches the format in the migration files and makes the type_to_sql
override redundant.

The only wart we are left with is that since there are no true UUID
types in MySQL we'll have to assume that binary(16) columns are UUIDs.

In practice this is probably fine as the MySQL adapter doesn't map any
other types to binary.
2025-11-17 09:12:36 -05:00
Donal McBreen ac82f20051 Memoize native_database_types and consolidate modules 2025-11-17 09:12:36 -05:00
Donal McBreen d81b7af7bb Switch to binary and add uuid as a native type for MySQL 2025-11-17 09:12:36 -05:00
Donal McBreen 8ec5c1af5c Use Binary::Data for serialization
This handles quoting for us automatically
2025-11-17 09:12:36 -05:00
Donal McBreen f6ec9bbeea Use a custom class for Uuid values 2025-11-17 09:12:35 -05:00
Donal McBreen f4729577b6 Use uuids in the search_index tables too 2025-11-17 09:12:35 -05:00
Donal McBreen fc56ad9d7c Combine uuid-old and uuid branch changes
- Switch to binary 16 for UUID keys
- Remove AccountScopedRecord base class, all model use binary uuids now
- Fix the search sql to serialize uuids properly
- Patch the MySQL schema dumper to output binary lengths
2025-11-17 09:12:34 -05:00
Mike Dalessio e4011ef211 Update primary keys on customer data to UUIDs
- schema changes to primary and foreign keys
- fixture changes
- customer data models subclass AccountScopedRecord
- import script updated
2025-11-17 09:12:30 -05:00
Stanko K.R. 71a332bb08 Remove dead code 2025-11-17 09:12:17 -05:00
Donal McBreen 3aa4a1a562 Shard the search index into 16 tables
Create search_index_0 to search_index_15 tables and shard each index by
account id. MySQL has no ability to pre-filter fulltext indexes by
another field so this is the best bet for improving performance.

Each fulltest index internally creates 11 sub tables (see
https://dev.mysql.com/doc/refman/8.4/en/innodb-fulltext-index.html) so
actually we have 192 tables in total here.

The search_index table name is generated dynamically based on the
account_id.
2025-11-17 09:12:17 -05:00
Kevin McConnell 915c1202f8 Initial minimal primary/replica switching 2025-11-17 09:11:57 -05:00
Mike Dalessio 29cf6485e4 Drop the migrations audit from CI 2025-11-17 09:11:57 -05:00
Mike Dalessio 006aa4d6b3 Tests need to set up the script_name properly
which requires tweaking fixtures for the memberships and the account
2025-11-17 09:11:42 -05:00
Mike Dalessio 030433b99d Remove debugging statements 2025-11-17 09:11:42 -05:00
Mike Dalessio ec54014832 Add account slug middleware
and set Current.account
2025-11-17 09:11:42 -05:00
Mike Dalessio d6c7fc9e0a Database config for mysql 2025-11-17 09:11:42 -05:00
Stanko K.R. 6705b5225f Remove the untenanted database 2025-11-17 09:11:36 -05:00
Mike Dalessio 4d3c265042 Rip out activerecord-tenanting
Co-authored-by: Stanko K.R. <stanko@stanko.io>
2025-11-17 09:11:35 -05:00
Kevin McConnell e5bbe6cf64 Remove Beamer 2025-11-17 09:11:28 -05:00
Mike Dalessio 19df86aef9 Re-enable SQL query logging 2025-11-14 13:19:35 -05:00
Jorge Manrubia eea9afb639 Fix: dismiss grouped notifications by card from the notifications tray
This also splits the templates into two: index and tray, since the URL now changes.
2025-11-14 12:58:24 +01:00
David Heinemeier Hansson 63291ca0a2 Alpha sort lists when they're three or longer and there isn't another reason for existing sort 2025-11-08 20:09:12 +01:00
David Heinemeier Hansson 5231f13ced Show up top 2025-11-08 20:06:56 +01:00
David Heinemeier Hansson 75b8adeb9a No longer used 2025-11-08 20:06:50 +01:00
David Heinemeier Hansson 5d4f4f8a74 No longer used 2025-11-08 20:04:38 +01:00
David Heinemeier Hansson e28e02f273 Move down to related routes for logging in and joining 2025-11-08 20:03:48 +01:00
Jorge Manrubia 8a07782e0f Enable public file server for assets
Attempt to deal with https://app.fizzy.do/5986089/cards/2790
2025-11-07 13:13:24 +01:00
Kevin McConnell 7a23e0bdd5 Serve default error pages 2025-11-06 09:56:28 +00:00
Mike Dalessio 72a1cfc088 dep: update Rails and AR::Tenanted
Note that the query logs in this version of AR::Tenanted have changed,
to use standard Rails query log tags, which I have enabled.

Note that enabling Rails query log tags disables prepared
statements. I don't think turning off prepared statements will impact
our performance, but I'll verify that post-deploy (we have dashboards
for a reason).
2025-11-05 13:12:42 -05:00
Jorge Manrubia 2af7a9f402 Merge pull request #1498 from basecamp/rename-boards
Rename collections => boards
2025-11-05 18:50:49 +01:00
Jorge Manrubia a717ae838b Support old public collection urls 2025-11-05 14:02:40 +01:00
Jorge Manrubia 41c8c7ee53 Support old collection urls 2025-11-05 13:58:40 +01:00
Jorge Manrubia 03a345609e Baseline replacing collection with board across code 2025-11-05 13:31:54 +01:00
Stanko Krtalić 1c54efbd75 Merge pull request #1497 from basecamp/fix-double-memberships
Prohibit duplicate memberships
2025-11-05 12:22:32 +01:00
Stanko K.R. cfdd7ab1cb Prohibit duplicate memberships 2025-11-05 11:57:40 +01:00
Kevin McConnell b66bad082a Specify asset path in deployment
We need this so that app containers can serve old asset versions, to
cover the cases where a request for an old asset is a MISS on the CDN.
2025-11-05 08:32:10 +00:00
Jorge Manrubia 2bb90eab13 Use the sole collection as the root for a better onboarding experience for new accounts 2025-11-04 17:09:35 +01:00
Fernando Álvarez 514c0f45a2 Migrate to fizzy.do 2025-11-04 13:17:10 +01:00
Kevin McConnell 417acab12a Upgrade Beamer to zone-aware version 2025-11-04 09:58:53 +00:00