Commit Graph

39 Commits

Author SHA1 Message Date
Jorge Manrubia 3ef5e4eeef Add record to track overridden limits
Before, we were relying on just changing the cards_count in account, but this
could create problems where the system to calculate the next card number fails due
to the unique constraint.
2025-12-16 12:00:23 +01:00
Jorge Manrubia c8330a7be8 Don't prevent creating drafts, or you won't get to see the upgrade banner
Instead:

- Always let you create drafts when pressing "Add card"
- Prevent creations of published cards via API
- Prevent publication of cards in all cases when the limit is exceeded
2025-12-16 12:00:23 +01:00
Jorge Manrubia 984a5dd4ce Add Stripe-based billing system
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Jason Zimdars <jz@37signals.com>
2025-12-16 12:00:23 +01:00
Jorge Manrubia 2616045476 Add rubocop linting 2025-12-16 11:54:31 +01:00
Mike Dalessio acc90ec8eb Fix inclusion of Fizzy::Saas::Authorization::Controller 2025-12-12 15:28:27 -05:00
Mike Dalessio d82d68fcd0 Restrict logins to employees in staging
as inferred from the email domain, which must be "@37signals.com" or
"@basecamp.com".
2025-12-12 15:07:16 -05:00
Jeremy Daer e35c1223f4 Sentry: error context and release tracking (#22)
* Sentry: use KAMAL_VERSION for release tracking

Kamal injects KAMAL_VERSION at container runtime with the git SHA,
so no need to bake it into the Docker image via build args.

* Sentry: serve as Rails error reporter

Sentry receives errors from Rails.error.report and Active Job
`retry_on/discard_on report: true`.

Error context is provided by Rails.error.set_context in Fizzy's
Authentication concern and ApplicationJob.
2025-12-08 09:39:35 -08:00
Mike Dalessio 8f73e1e1be Add console1984 and audits1984
To keep as much of this as we can in the `fizzy-saas` gem, this PR
opts to store console/audits models in a separate database, and so:

- the gem contains the migrations and the database config
- the app contains a separate schema file distinctly for SaaS concerns
  - Rails' current behavior prevents us from easily keeping this file in the gem

Also note that the stock `audits1984` schema is updated to reference
the auditor via a UUID foreign key.

Finally, in order for the database schema file to be located in the
gem directory (and not the application directory), it's necessary to
monkeypatch `AR::DatabaseTasks.schema_dump_path` to support absolute
paths. This functionality has been proposed upstream in
https://github.com/rails/rails/pull/56290 but is awaiting a decision
from the core team.

ref: https://app.fizzy.do/5986089/cards/2469
ref: #17
2025-12-04 11:43:48 -05:00
Mike Dalessio 3ab3bcc580 Mark a development token as gitleaks:allow 2025-12-03 17:03:16 -05:00
Jorge Manrubia a204b188b0 Fix: log identity ids 2025-12-02 15:27:22 +01:00
Jorge Manrubia b3611363a9 Merge pull request #8 from basecamp/drop-healthcheck-metrics
Drop healthcheck metrics
2025-11-30 11:14:41 +01:00
Jorge Manrubia 1a74735218 We need to require this *after* or the mocks won't work 2025-11-29 11:53:47 +01:00
Jorge Manrubia 299212aae1 Move env-specific bits to env files
TIL Rails engines load these by default before loading the host app's
2025-11-29 11:46:23 +01:00
Lewis Buckley 92b00b744f Drop healthcheck metrics 2025-11-28 13:49:19 +00:00
Jorge Manrubia 82c4e87bf0 Require metrics once Yabeda has been loaded 2025-11-28 11:59:20 +01:00
Jorge Manrubia 61c53054da Restructure a bit 2025-11-28 11:54:33 +01:00
Jorge Manrubia d30e327f1e Move yabeda/prometheus configuration to gem 2025-11-28 11:51:24 +01:00
Jorge Manrubia 8bb27c3e31 Should not be needed 2025-11-27 16:10:17 +01:00
Jorge Manrubia 1af178b152 Only if replica configured 2025-11-27 16:09:29 +01:00
Jorge Manrubia b5ca92b999 Superfluous 2025-11-27 13:21:05 +01:00
Jorge Manrubia 3d849a202a Move signup code back to the app, leave only queenbee hooks 2025-11-27 12:52:12 +01:00
Jorge Manrubia 120ae3b9b6 Move structured logging to the engine 2025-11-27 07:24:41 +01:00
Jorge Manrubia 1cc3693635 Move more settings to the gem 2025-11-26 17:31:39 +01:00
Jorge Manrubia fa340579b9 Remove from credentials 2025-11-26 14:01:11 +01:00
Jorge Manrubia cb76bf10e2 No need to use try here 2025-11-26 13:00:09 +01:00
Jorge Manrubia f806d31fdd Merge pull request #3 from basecamp/flavorjones/log-account-id
Restore structured logging of `queenbee_id`
2025-11-26 12:59:38 +01:00
Jorge Manrubia e6a015b931 Prefer path via the engine 2025-11-25 13:09:49 +01:00
Jorge Manrubia 5e3c9c1d92 Add method to invoke from the rails runner 2025-11-25 13:05:06 +01:00
Mike Dalessio 034b162991 Restore structured logging of queenbee_id 2025-11-24 15:57:16 -05:00
Jorge Manrubia ebc212c1d7 Fix: the queenbe mocks were not really being applied 2025-11-24 16:26:41 +01:00
Kevin McConnell 73be889a18 Include transaction pinning support
See https://github.com/basecamp/fizzy/pull/1656
2025-11-24 14:49:27 +00:00
Jorge Manrubia 79e1861dbb This should be added to the root fizzy project so that you dont have to set the instance var! 2025-11-23 20:24:32 +01:00
Jorge Manrubia 63c9bd8256 Add tasks for enable/disabling sass mode via rake task 2025-11-23 20:22:42 +01:00
Jorge Manrubia 7d47ec7534 Make engine automount for now so that we can remove that bit from the main app 2025-11-23 09:32:12 +01:00
Jorge Manrubia d3f382c023 Simplify (still 2 failures) 2025-11-23 07:37:19 +01:00
Jorge Manrubia 406658967f The task extension was not working 2025-11-23 06:58:17 +01:00
Jorge Manrubia 3eaa2ed774 Suppress warnings 2025-11-23 06:51:51 +01:00
Jorge Manrubia ff6b3d4428 Add rake task to run tests from host app 2025-11-23 06:48:12 +01:00
Jorge Manrubia db57a7ba0f Initial commit: Move fizzy-saas to separate repository 2025-11-23 06:04:20 +01:00