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.
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.
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.
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.
- 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
* Bind sessions to identities
* Remove references to the identity token
* Move email changes to identity
* Move account menu into a turbo-frame
* Create tenants from a tenanted route
This is the first step of a multi-step SaaS engine extraction.
Looking ahead to an open source release, we need to make sure that
local authentication is treated as an "official" option, and not just
a hack I added for Kevin to do load testing outside our DC. So this PR
gets to green, and adds a CI step in "local authentication" mode.
This all probably feels a little hacky to you, Reader, but the goal of
this change is to ease the next step, which will be extracting the
37id and Queenbee integrations into a proprietary "SaaS mode" engine.
In service of that goal, this commit simply wraps all of the dependent
code and tests with a conditional check on
`config.x.local_authentication`.
Also, downgrade LLM for commands to mini. It's much cheaper and I only upgraded because of the
interpretation complexities that the insight command introduced.
We are implementing a much better approach with Ask.
* main: (28 commits)
Clean up the /scripts directory
Prevent recursion when invoking AI
Bump sqlite3 from 2.7.2 to 2.7.3
Port over Jeremy's fix for slow uploads
.gitignore log files and portfolio's local storage
Drop Current.account and just use Account.sole
Use the utf8-patched mysql driver
Call blob.preview for previewable attachments
Make sure the image variants we use are preprocessed
Add /user command
Make sure it doesn't infer custom abbreviations when matching user names
Script to load prod db in development
Update Signup to use the queenbee_id for the tenant name
Bump cache version
Make sure it uses latest bundler to prevent error due to mismatch
Invalidate cache
Update ruby
Update bundler to prevent error on lower version
Update bundler to prevent error on lower version
Resolve stages
...
to avoid implicitly creating a variant during a GET to a read replica,
which will raise an exception and cause the image to fail to load.
This feels pretty brittle, to be honest, and we'll need to be careful
in the future about creating and using new variants; we will probably
need to backfill the new variant for existing images because we can't
guarantee that they will be created implicitly/lazily if the GET lands
on the replica.
ref: https://fizzy.37signals.com/5986089/collections/7/cards/942