From c2d693fc9afa6ac712011f472b99b01582d95f66 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Fri, 3 Apr 2026 08:21:29 +0100 Subject: [PATCH 001/129] Fix off-by-one date display for UTC-negative timezone users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit beginningOfDay() used local timezone methods (getFullYear, getMonth, getDate) to snap timestamps to midnight. Since the server sends UTC timestamps, this caused day boundary calculations to be off by one for users in UTC-negative timezones — cards created after UTC midnight but before local midnight showed as "yesterday" instead of "today". Switch to UTC methods (getUTCFullYear, getUTCMonth, getUTCDate) so day boundaries are calculated consistently with the server's UTC timestamps. Affects DaysAgoFormatter, DaysAgoOrWeekdayFormatter, TimeOrDateFormatter, InDaysFormatter, and bubble controller stalled/entropy calculations. --- app/javascript/helpers/date_helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/helpers/date_helpers.js b/app/javascript/helpers/date_helpers.js index b8d9855f47..1fc21b995a 100644 --- a/app/javascript/helpers/date_helpers.js +++ b/app/javascript/helpers/date_helpers.js @@ -7,7 +7,7 @@ export function signedDifferenceInDays(fromDate, toDate) { } export function beginningOfDay(date) { - return new Date(date.getFullYear(), date.getMonth(), date.getDate()) + return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())) } export function secondsToDate(seconds) { From b79c7897e6810b9dd25df32d2b0d7027776a0e53 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Fri, 3 Apr 2026 10:05:11 +0100 Subject: [PATCH 002/129] Fix export/import losing custom column colors record.to_json serializes through model accessors. Column::Colored overrides the color accessor to return a Color struct, which serializes as {"name":"Blue","value":"var(--color-card-default)"} instead of the raw CSS string. Two fixes: - Export raw DB values via record.attributes.slice(*attributes).to_json - Color.for_value parses legacy JSON format so columns imported from old exports self-heal when read --- app/models/account/data_transfer/record_set.rb | 2 +- app/models/color.rb | 16 +++++++++++++++- test/models/account/import_test.rb | 1 + test/models/column/colored_test.rb | 8 ++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/app/models/account/data_transfer/record_set.rb b/app/models/account/data_transfer/record_set.rb index ff7b79b5c5..c46c348961 100644 --- a/app/models/account/data_transfer/record_set.rb +++ b/app/models/account/data_transfer/record_set.rb @@ -65,7 +65,7 @@ def records end def export_record(record) - zip.add_file "data/#{model_dir}/#{record.id}.json", record.to_json + zip.add_file "data/#{model_dir}/#{record.id}.json", record.attributes.slice(*attributes).to_json end def files diff --git a/app/models/color.rb b/app/models/color.rb index 1817d4f709..b6cc1110cc 100644 --- a/app/models/color.rb +++ b/app/models/color.rb @@ -2,9 +2,23 @@ class Color class << self + # Finds a Color by its CSS value (e.g. "var(--color-card-4)"). + # Falls back to extracting the value from legacy export formats where + # the Color struct was serialized instead of the raw CSS string. def for_value(value) - COLORS.find { |it| it.value == value } + COLORS.find { |it| it.value == value } || + extract_from_legacy_export(value) end + + private + # Broken exports serialized Color structs instead of raw CSS values, + # producing JSON like {"name":"Lime","value":"var(--color-card-4)"}. + # Parse it and extract the value. + def extract_from_legacy_export(value) + parsed = value.is_a?(String) && JSON.parse(value) + COLORS.find { |it| it.value == parsed["value"] } if parsed.is_a?(Hash) + rescue JSON::ParserError + end end def to_s diff --git a/test/models/account/import_test.rb b/test/models/account/import_test.rb index de384b385f..c1e9c2f7cb 100644 --- a/test/models/account/import_test.rb +++ b/test/models/account/import_test.rb @@ -226,6 +226,7 @@ def account_digest(account) name: account.name, board_count: Board.where(account: account).count, column_count: Column.where(account: account).count, + column_colors: Column.where(account: account).order(:id).pluck(:color), card_count: Card.where(account: account).count, comment_count: Comment.where(account: account).count, tag_count: Tag.where(account: account).count diff --git a/test/models/column/colored_test.rb b/test/models/column/colored_test.rb index 9d2d469e4d..241ddb6607 100644 --- a/test/models/column/colored_test.rb +++ b/test/models/column/colored_test.rb @@ -7,6 +7,14 @@ class Column::ColoredTest < ActiveSupport::TestCase assert_equal Column::Colored::DEFAULT_COLOR, column.color end + test "reads color from legacy export format" do + column = columns(:writebook_triage) + # Broken exports serialized Color structs as JSON + column.update_column(:color, { "name" => "Lime", "value" => "var(--color-card-4)" }.to_json) + + assert_equal Color.for_value("var(--color-card-4)"), column.reload.color + end + test "update the column color" do columns(:writebook_triage).update!(color: "var(--color-card-3)") From 6d71385846ab7f76fc99eceb2bf678eb1eb4cf27 Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Mon, 6 Apr 2026 09:21:03 +0100 Subject: [PATCH 003/129] Fix timezone handling for day timeline and card dates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert beginningOfDay() to use local timezone methods — the UTC change from #2790 caused cards created earlier the same day to show "yesterday" for users in UTC-negative timezones after their local 7 PM. Add Time.zone.name to day timeline fragment cache keys so timezone-different renders don't collide. --- app/javascript/helpers/date_helpers.js | 2 +- app/models/user/day_timeline.rb | 2 +- app/views/events/day_timeline/_columns.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/javascript/helpers/date_helpers.js b/app/javascript/helpers/date_helpers.js index 1fc21b995a..b8d9855f47 100644 --- a/app/javascript/helpers/date_helpers.js +++ b/app/javascript/helpers/date_helpers.js @@ -7,7 +7,7 @@ export function signedDifferenceInDays(fromDate, toDate) { } export function beginningOfDay(date) { - return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())) + return new Date(date.getFullYear(), date.getMonth(), date.getDate()) } export function secondsToDate(seconds) { diff --git a/app/models/user/day_timeline.rb b/app/models/user/day_timeline.rb index 4b30d24ca6..137122f5a7 100644 --- a/app/models/user/day_timeline.rb +++ b/app/models/user/day_timeline.rb @@ -42,7 +42,7 @@ def closed_column end def cache_key - ActiveSupport::Cache.expand_cache_key [ user, filter, day.to_date, events ], "day-timeline" + ActiveSupport::Cache.expand_cache_key [ user, filter, day.to_date, Time.zone.name, events ], "day-timeline" end private diff --git a/app/views/events/day_timeline/_columns.html.erb b/app/views/events/day_timeline/_columns.html.erb index 80752d9add..16d09ed07d 100644 --- a/app/views/events/day_timeline/_columns.html.erb +++ b/app/views/events/day_timeline/_columns.html.erb @@ -1,4 +1,4 @@ -<% cache [ day_timeline.events ] do %> +<% cache [ day_timeline.events, Time.zone.name ] do %> <%# Template Dependency Updated: _layout.html.erb 2026-01-26 %> <% if day_timeline.has_activity? %>
From e51f0bfee74bdc6abf2d934f1e4ab07daec5702d Mon Sep 17 00:00:00 2001 From: Donal McBreen Date: Wed, 1 Apr 2026 12:24:21 +0100 Subject: [PATCH 004/129] Fix account destroy cascade gaps Account incineration could leave orphaned records due to missing cascade declarations and async jobs failing when the account was already gone. Cascade fixes: - Add Account::Searchable concern to clean up Search::Query (delete_all) and Search::Record (destroy_all, respects SQLite FTS dependent: :destroy) - Add before_destroy in Account::Storage to delete storage entries - Suppress storage entry recording during incineration so attachment purge callbacks don't create entries or enqueue materialize jobs - Guard Access#clean_inaccessible_data_later with unless user.destroyed? to avoid enqueuing pointless jobs during user cascade Job tenancy: - Extract AccountTenanted concern from the global ActiveJob initializer into ApplicationJob (include) with targeted prepends for ActionMailer::MailDeliveryJob and Turbo broadcast jobs - Defer account resolution from deserialize to perform so that missing accounts raise DeserializationError inside the execution path where discard_on can handle it Tests: - Comprehensive incineration test covering 35 model types with before/after assertions and full enqueued job processing - Mailer deliver_later test verifying account context survives job serialization for multi-account users - Turbo broadcast test verifying account-scoped URLs in rendered partials --- app/jobs/application_job.rb | 2 + app/jobs/concerns/account_tenanted.rb | 47 ++++++ app/models/access.rb | 2 +- app/models/account.rb | 2 +- app/models/account/import.rb | 2 +- app/models/account/incineratable.rb | 2 +- app/models/account/searchable.rb | 14 ++ app/models/account/storage.rb | 8 + app/models/export.rb | 2 +- app/models/identity.rb | 2 +- app/models/storage/entry.rb | 10 ++ app/models/user/avatar.rb | 2 +- config/initializers/active_job.rb | 42 ++--- .../notification/bundle_mailer_test.rb | 13 ++ test/models/account/incineratable_test.rb | 153 ++++++++++++++++++ test/models/notification_test.rb | 17 ++ test/test_helper.rb | 10 ++ 17 files changed, 290 insertions(+), 40 deletions(-) create mode 100644 app/jobs/concerns/account_tenanted.rb create mode 100644 app/models/account/searchable.rb diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index d394c3d106..7cbf01d557 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -1,4 +1,6 @@ class ApplicationJob < ActiveJob::Base + prepend AccountTenanted + # Automatically retry jobs that encountered a deadlock # retry_on ActiveRecord::Deadlocked diff --git a/app/jobs/concerns/account_tenanted.rb b/app/jobs/concerns/account_tenanted.rb new file mode 100644 index 0000000000..d8df4331c2 --- /dev/null +++ b/app/jobs/concerns/account_tenanted.rb @@ -0,0 +1,47 @@ +# Serializes the current account into job data so that jobs run +# within the correct account context via Current.with_account. +# +# Account resolution is deferred to an around_perform callback so +# that missing accounts raise DeserializationError inside the +# execution path where discard_on can handle it. +module AccountTenanted + extend ActiveSupport::Concern + + prepended do + attr_reader :account + around_perform :with_account_context + end + + def initialize(...) + super + @account = Current.account + end + + def serialize + super.merge({ "account" => @account&.to_gid }) + end + + def deserialize(job_data) + super + @account_gid = job_data["account"] + end + + private + def with_account_context(&block) + resolve_account! + + if account.present? + Current.with_account(account, &block) + else + yield + end + end + + def resolve_account! + if @account_gid + @account = GlobalID::Locator.locate(@account_gid) + end + rescue ActiveRecord::RecordNotFound + raise ActiveJob::DeserializationError + end +end diff --git a/app/models/access.rb b/app/models/access.rb index afdd6312fa..3492317e71 100644 --- a/app/models/access.rb +++ b/app/models/access.rb @@ -19,6 +19,6 @@ def recently_accessed? end def clean_inaccessible_data_later - Board::CleanInaccessibleDataJob.perform_later(user, board) + Board::CleanInaccessibleDataJob.perform_later(user, board) unless user.destroyed? end end diff --git a/app/models/account.rb b/app/models/account.rb index 92590d9f90..687a46a39f 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -1,5 +1,5 @@ class Account < ApplicationRecord - include Account::Storage, Cancellable, Entropic, Incineratable, MultiTenantable, Seedeable + include Account::Storage, Cancellable, Entropic, Incineratable, MultiTenantable, Searchable, Seedeable has_one :join_code, dependent: :destroy has_many :users, dependent: :destroy diff --git a/app/models/account/import.rb b/app/models/account/import.rb index 50ec3769d4..2bf1b88e7b 100644 --- a/app/models/account/import.rb +++ b/app/models/account/import.rb @@ -4,7 +4,7 @@ class Account::Import < ApplicationRecord belongs_to :account belongs_to :identity - has_one_attached :file + has_one_attached :file, dependent: :purge_later enum :status, %w[ pending processing completed failed ].index_by(&:itself), default: :pending enum :failure_reason, %w[ conflict invalid_export ].index_by(&:itself), prefix: :failed_due_to, scopes: false diff --git a/app/models/account/incineratable.rb b/app/models/account/incineratable.rb index c734c0768a..25b26a9f92 100644 --- a/app/models/account/incineratable.rb +++ b/app/models/account/incineratable.rb @@ -11,7 +11,7 @@ module Account::Incineratable def incinerate run_callbacks :incinerate do - account.destroy + Storage::Entry.suppressing_recording { account.destroy } end end end diff --git a/app/models/account/searchable.rb b/app/models/account/searchable.rb new file mode 100644 index 0000000000..b06a44ed32 --- /dev/null +++ b/app/models/account/searchable.rb @@ -0,0 +1,14 @@ +module Account::Searchable + extend ActiveSupport::Concern + + included do + has_many :search_queries, class_name: "Search::Query", dependent: :delete_all + + before_destroy :clear_search_records + end + + private + def clear_search_records + Search::Record.for(id).destroy_all + end +end diff --git a/app/models/account/storage.rb b/app/models/account/storage.rb index 8b432e8ce6..f59ff88bba 100644 --- a/app/models/account/storage.rb +++ b/app/models/account/storage.rb @@ -2,7 +2,15 @@ module Account::Storage extend ActiveSupport::Concern include Storage::Totaled + included do + before_destroy :clear_storage_entries + end + private + def clear_storage_entries + Storage::Entry.where(account_id: id).delete_all + end + def calculate_real_storage_bytes boards.sum { |board| board.send(:calculate_real_storage_bytes) } end diff --git a/app/models/export.rb b/app/models/export.rb index 101c9a3790..1ebdebda96 100644 --- a/app/models/export.rb +++ b/app/models/export.rb @@ -2,7 +2,7 @@ class Export < ApplicationRecord belongs_to :account belongs_to :user - has_one_attached :file + has_one_attached :file, dependent: :purge_later enum :status, %w[ pending processing completed failed ].index_by(&:itself), default: :pending diff --git a/app/models/identity.rb b/app/models/identity.rb index ae4f7a8cb9..059e8ac9c0 100644 --- a/app/models/identity.rb +++ b/app/models/identity.rb @@ -9,7 +9,7 @@ class Identity < ApplicationRecord has_many :users, dependent: :nullify has_many :accounts, through: :users - has_one_attached :avatar + has_one_attached :avatar, dependent: :purge_later before_destroy :deactivate_users, prepend: true diff --git a/app/models/storage/entry.rb b/app/models/storage/entry.rb index 768a4c6f81..cb1e25c6ec 100644 --- a/app/models/storage/entry.rb +++ b/app/models/storage/entry.rb @@ -5,12 +5,22 @@ class Storage::Entry < ApplicationRecord scope :pending, ->(last_entry_id) { where.not(id: ..last_entry_id) if last_entry_id } + thread_mattr_accessor :recording, default: true + + def self.suppressing_recording(&block) + original, self.recording = self.recording, false + yield + ensure + self.recording = original + end + # Records may be destroyed (during cascading deletes) but .id still works. # Skip entirely if account is destroyed - no need to track storage for deleted accounts. # Skip materialize jobs for destroyed boards since there's nothing to update. def self.record(delta:, operation:, account:, board: nil, recordable: nil, blob: nil) return if delta.zero? return if account.destroyed? + return unless recording entry = create! \ account_id: account.id, diff --git a/app/models/user/avatar.rb b/app/models/user/avatar.rb index 970104d6f4..02e4376302 100644 --- a/app/models/user/avatar.rb +++ b/app/models/user/avatar.rb @@ -11,7 +11,7 @@ module User::Avatar ].freeze included do - has_one_attached :avatar do |attachable| + has_one_attached :avatar, dependent: :purge_later do |attachable| attachable.variant :thumb, resize_to_fill: [ 256, 256 ], process: :immediately end diff --git a/config/initializers/active_job.rb b/config/initializers/active_job.rb index d8eed109d9..415fcc9092 100644 --- a/config/initializers/active_job.rb +++ b/config/initializers/active_job.rb @@ -1,39 +1,15 @@ # frozen_string_literal: true -# inspired from code in ActiveRecord::Tenanted -module FizzyActiveJobExtensions - extend ActiveSupport::Concern - - prepended do - attr_reader :account - self.enqueue_after_transaction_commit = true - end - - def initialize(...) - super - @account = Current.account - end - - def serialize - super.merge({ "account" => @account&.to_gid }) - end - - def deserialize(job_data) - super - if _account = job_data.fetch("account", nil) - @account = GlobalID::Locator.locate(_account) - end - end +ActiveSupport.on_load(:active_job) do + self.enqueue_after_transaction_commit = true +end - def perform_now - if account.present? - Current.with_account(account) { super } - else - super - end - end +ActiveSupport.on_load(:action_mailer) do + ActionMailer::MailDeliveryJob.prepend AccountTenanted end -ActiveSupport.on_load(:active_job) do - prepend FizzyActiveJobExtensions +Rails.application.config.after_initialize do + Turbo::Streams::ActionBroadcastJob.prepend AccountTenanted + Turbo::Streams::BroadcastJob.prepend AccountTenanted + Turbo::Streams::BroadcastStreamJob.prepend AccountTenanted end diff --git a/test/mailers/notification/bundle_mailer_test.rb b/test/mailers/notification/bundle_mailer_test.rb index 8aca366c9a..d37ecaeb78 100644 --- a/test/mailers/notification/bundle_mailer_test.rb +++ b/test/mailers/notification/bundle_mailer_test.rb @@ -106,6 +106,19 @@ class Notification::BundleMailerTest < ActionMailer::TestCase "Should not generate a real email when all notifications are stale" end + test "deliver_later works with account context" do + # Give user a second account so the mailer includes the account name in the subject + second_account = Account.create!(name: "Second account") + second_account.users.create!(identity: @user.identity, role: :member, name: @user.name) + + create_notification(@user) + + Notification::BundleMailer.notification(@bundle).deliver_later + perform_enqueued_jobs + + assert_emails 1 + end + private def create_notification(user, source: events(:logo_published)) Notification.create!(user: user, creator: user, source: source, created_at: 30.minutes.ago) diff --git a/test/models/account/incineratable_test.rb b/test/models/account/incineratable_test.rb index 021f751ba6..7f69bed0ba 100644 --- a/test/models/account/incineratable_test.rb +++ b/test/models/account/incineratable_test.rb @@ -23,4 +23,157 @@ class Account::IncineratableTest < ActiveSupport::TestCase @account.cancellation.update!(created_at: 29.days.ago) assert Account.due_for_incineration.empty? end + + test "incinerate destroys all associated records" do + account = accounts(:initech) + board = boards(:miltons_wish_list) + card = cards(:radio) + + Current.account = account + Current.session = Session.new(identity: identities(:mike)) + + user = users(:mike) + user.create_settings!(bundle_email_frequency: :never) + + # Direct on Account + tag = Tag.create!(title: "urgent") + column = Column.create!(board: board, name: "Test", position: 0) + export = Account::Export.create!(account: account, user: user) + search_query = Search::Query.create!(user: user, terms: "test search") + storage_entry = Storage::Entry.create!(account: account, delta: 100, operation: "attach") + + # Via Board + publication = Board::Publication.create!(board: board) + webhook = Webhook.create!(board: board, name: "Test", url: "https://example.com/webhook") + event = Event.create!(board: board, creator: user, eventable: card, action: "card_published") + + # Via Webhook + delivery = Webhook::Delivery.create!(webhook: webhook, event: event) + # DelinquencyTracker is auto-created with Webhook + + # Via Card + comment = card.comments.create!(body: "Test comment") + step = Step.create!(card: card, content: "Test step") + assignment = Assignment.create!(card: card, assignee: user, assigner: user) + tagging = Tagging.create!(card: card, tag: tag) + watch = Watch.create!(card: card, user: user) + pin = Pin.create!(card: card, user: user) + reaction = Reaction.create!(reactable: card, content: "thumbs_up") + mention = Mention.create!(source: card, mentioner: user, mentionee: user) + closure = Closure.create!(card: cards(:paycheck), user: user) + goldness = Card::Goldness.create!(card: card) + not_now = Card::NotNow.create!(card: cards(:unfinished_thoughts), user: user) + activity_spike = Card::ActivitySpike.create!(card: card) + + # Via User + notification = Notification.create!(user: user, source: event, creator: user) + notification_bundle = Notification::Bundle.create!(user: user, starts_at: 1.hour.ago, ends_at: 1.hour.from_now) + filter = Filter.create!(creator: user, fields: { indexed_by: :all, sorted_by: :newest }.to_json, params_digest: SecureRandom.hex) + + # ActiveStorage (attach image to card) + card.image.attach(io: StringIO.new("fake image"), filename: "test.png", content_type: "image/png") + + account_id = account.id + user_ids = User.where(account_id: account_id).pluck(:id) + + # Confirm records exist before destroy + assert User.where(account_id: account_id).exists? + assert Board.where(account_id: account_id).exists? + assert Card.where(account_id: account_id).exists? + assert Tag.where(account_id: account_id).exists? + assert Column.where(account_id: account_id).exists? + assert Webhook.where(account_id: account_id).exists? + assert Access.where(account_id: account_id).exists? + assert Entropy.where(account_id: account_id).exists? + assert Account::JoinCode.where(account_id: account_id).exists? + assert Account::Export.where(account_id: account_id).exists? + assert Search::Query.where(account_id: account_id).exists? + assert Storage::Entry.where(account_id: account_id).exists? + assert Board::Publication.where(account_id: account_id).exists? + assert Event.where(account_id: account_id).exists? + assert Webhook::Delivery.where(account_id: account_id).exists? + assert Webhook::DelinquencyTracker.where(account_id: account_id).exists? + assert Comment.where(account_id: account_id).exists? + assert Step.where(account_id: account_id).exists? + assert Assignment.where(account_id: account_id).exists? + assert Tagging.where(account_id: account_id).exists? + assert Watch.where(account_id: account_id).exists? + assert Pin.where(account_id: account_id).exists? + assert Reaction.where(account_id: account_id).exists? + assert Mention.where(account_id: account_id).exists? + assert Closure.where(account_id: account_id).exists? + assert Card::Goldness.where(account_id: account_id).exists? + assert Card::NotNow.where(account_id: account_id).exists? + assert Card::ActivitySpike.where(account_id: account_id).exists? + assert Notification.where(account_id: account_id).exists? + assert Notification::Bundle.where(account_id: account_id).exists? + assert Filter.where(account_id: account_id).exists? + assert User::Settings.where(user_id: user.id).exists? + assert ActiveStorage::Attachment.where(account_id: account_id).exists? + assert ActiveStorage::Blob.where(account_id: account_id).exists? + assert ActionText::RichText.where(account_id: account_id).exists? + + # Flush jobs enqueued during setup (Turbo broadcasts, etc.) while records still exist + perform_enqueued_jobs + + account.incinerate + perform_enqueued_jobs + + # Confirm account is gone + assert_not Account.exists?(account_id) + + # Direct associations + assert_empty User.where(account_id: account_id) + assert_empty Board.where(account_id: account_id) + assert_empty Card.where(account_id: account_id) + assert_empty Webhook.where(account_id: account_id) + assert_empty Tag.where(account_id: account_id) + assert_empty Column.where(account_id: account_id) + assert_empty Entropy.where(account_id: account_id) + assert_empty Account::JoinCode.where(account_id: account_id) + assert_empty Account::Export.where(account_id: account_id) + assert_empty Account::Import.where(account_id: account_id) + assert_empty Search::Query.where(account_id: account_id) + + # Via Board + assert_empty Board::Publication.where(account_id: account_id) + assert_empty Access.where(account_id: account_id) + assert_empty Event.where(account_id: account_id) + + # Via Webhook + assert_empty Webhook::Delivery.where(account_id: account_id) + assert_empty Webhook::DelinquencyTracker.where(account_id: account_id) + + # Via Card + assert_empty Comment.where(account_id: account_id) + assert_empty Step.where(account_id: account_id) + assert_empty Assignment.where(account_id: account_id) + assert_empty Tagging.where(account_id: account_id) + assert_empty Watch.where(account_id: account_id) + assert_empty Pin.where(account_id: account_id) + assert_empty Reaction.where(account_id: account_id) + assert_empty Mention.where(account_id: account_id) + assert_empty Closure.where(account_id: account_id) + assert_empty Card::Goldness.where(account_id: account_id) + assert_empty Card::NotNow.where(account_id: account_id) + assert_empty Card::ActivitySpike.where(account_id: account_id) + + # Via User + assert_empty Notification.where(account_id: account_id) + assert_empty Notification::Bundle.where(account_id: account_id) + assert_empty Filter.where(account_id: account_id) + assert_empty User::Settings.where(user_id: user_ids) + + # Storage + assert_empty Storage::Entry.where(account_id: account_id) + assert_empty Storage::Total.where(owner_type: "Account", owner_id: account_id) + + # ActiveStorage / ActionText + assert_empty ActiveStorage::Attachment.where(account_id: account_id) + assert_empty ActiveStorage::Blob.where(account_id: account_id) + assert_empty ActionText::RichText.where(account_id: account_id) + + # Search records (sharded) + assert_empty Search::Record.for(account_id).where(account_id: account_id) + end end diff --git a/test/models/notification_test.rb b/test/models/notification_test.rb index 8d9809ba1a..02dcbc7dbb 100644 --- a/test/models/notification_test.rb +++ b/test/models/notification_test.rb @@ -50,6 +50,23 @@ class NotificationTest < ActiveSupport::TestCase assert_turbo_stream_broadcasts [ kevin, :notifications ] end + test "broadcast job renders account-scoped URLs" do + kevin = users(:kevin) + account = kevin.account + notifications(:layout_commented_kevin).destroy + + # Enqueue the broadcast job but don't run it yet + notification = Notification.create!(user: kevin, source: events(:layout_commented), creator: users(:david)) + + broadcasts = capture_turbo_stream_broadcasts([ kevin, :notifications ]) do + perform_enqueued_jobs + end + + assert broadcasts.any?, "Expected at least one broadcast" + html = broadcasts.last.to_s + assert_includes html, "href=\"#{account.slug}/", "Broadcast should include account slug in URLs" + end + test "broadcasting on update when read removes" do notification = notifications(:layout_commented_kevin) diff --git a/test/test_helper.rb b/test/test_helper.rb index b1f8137610..4d85c51f9c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -48,6 +48,16 @@ class TestCase include ActionTextTestHelper, CachingTestHelper, CardTestHelper, ChangeTestHelper, SessionTestHelper include Turbo::Broadcastable::TestHelper + # Jobs must carry their own account context via AccountTenanted, + # not rely on Current.account leaking from the test setup. + def perform_enqueued_jobs(...) + saved_account = Current.account + Current.account = nil + super + ensure + Current.account = saved_account + end + setup do Current.account = accounts("37s") end From cdd13c1a612d0b86d25068df19d09101940e399e Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Mon, 6 Apr 2026 14:00:17 -0400 Subject: [PATCH 005/129] Split API docs into per-resource sections under docs/api/ (#2793) * Split docs/API.md into per-resource sections under docs/api/ * Move API endpoints index above authentication in docs/api/README.md * Fix trailing comma in boards.md JSON example * Fix trailing comma in cards.md, add Response label to identity.md, add Rich Text to endpoint index --- docs/API.md | 1779 --------------------------- docs/api/README.md | 148 +++ docs/api/sections/account.md | 65 + docs/api/sections/authentication.md | 172 +++ docs/api/sections/boards.md | 176 +++ docs/api/sections/cards.md | 322 +++++ docs/api/sections/columns.md | 96 ++ docs/api/sections/comments.md | 124 ++ docs/api/sections/identity.md | 46 + docs/api/sections/notifications.md | 62 + docs/api/sections/pins.md | 74 ++ docs/api/sections/reactions.md | 119 ++ docs/api/sections/rich_text.md | 86 ++ docs/api/sections/steps.md | 71 ++ docs/api/sections/tags.md | 26 + docs/api/sections/users.md | 99 ++ docs/api/sections/webhooks.md | 117 ++ 17 files changed, 1803 insertions(+), 1779 deletions(-) delete mode 100644 docs/API.md create mode 100644 docs/api/README.md create mode 100644 docs/api/sections/account.md create mode 100644 docs/api/sections/authentication.md create mode 100644 docs/api/sections/boards.md create mode 100644 docs/api/sections/cards.md create mode 100644 docs/api/sections/columns.md create mode 100644 docs/api/sections/comments.md create mode 100644 docs/api/sections/identity.md create mode 100644 docs/api/sections/notifications.md create mode 100644 docs/api/sections/pins.md create mode 100644 docs/api/sections/reactions.md create mode 100644 docs/api/sections/rich_text.md create mode 100644 docs/api/sections/steps.md create mode 100644 docs/api/sections/tags.md create mode 100644 docs/api/sections/users.md create mode 100644 docs/api/sections/webhooks.md diff --git a/docs/API.md b/docs/API.md deleted file mode 100644 index e8b60697c2..0000000000 --- a/docs/API.md +++ /dev/null @@ -1,1779 +0,0 @@ -# Fizzy API - -Fizzy has an API that allows you to integrate your application with it or to create -a bot to perform various actions for you. - -## Authentication - -There are two ways to authenticate with the Fizzy API: - -1. **Personal access tokens** - Long-lived tokens for scripts and integrations -2. **Magic link authentication** - Session-based authentication for native apps - -### Personal Access Tokens - -To use the API you'll need an access token. To get one, go to your profile, then, -in the API section, click on "Personal access tokens" and then click on -"Generate new access token". - -Give it a description and pick what kind of permission you want the access token to have: -- `Read`: allows reading data from your account -- `Read + Write`: allows reading and writing data to your account on your behalf - -Then click on "Generate access token". - -
- Access token generation guide with screenshots - - | Step | Description | Screenshot | - |:----:|-------------|:----------:| - | 1 | Go to your profile | Profile page with API section | - | 2 | In the API section click on "Personal access token" | Personal access tokens page | - | 3 | Click on "Generate a new access token" | Generate new access token dialog | - | 4 | Give it a description and assign it a permission | Access token created | -
- -> [!IMPORTANT] -> __An access token is like a password, keep it secret and do not share it with anyone.__ -> Any person or application that has your access token can perform actions on your behalf. - -To authenticate a request using your access token, include it in the `Authorization` header: - -```bash -curl -H "Authorization: Bearer put-your-access-token-here" -H "Accept: application/json" https://app.fizzy.do/my/identity -``` - -### Magic Link Authentication - -For native apps, you can authenticate users via magic links. This is a two-step process: - -#### 1. Request a magic link - -Send the user's email address to request a magic link be sent to them: - -```bash -curl -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -d '{"email_address": "user@example.com"}' \ - https://app.fizzy.do/session -``` - -__Response:__ - -``` -HTTP/1.1 201 Created -Set-Cookie: pending_authentication_token=...; HttpOnly; SameSite=Lax -``` - -```json -{ - "pending_authentication_token": "eyJfcmFpbHMi..." -} -``` - -The response includes a `pending_authentication_token` both in the JSON body and as a cookie. -Native apps should store this token and include it as a cookie when submitting the magic link code. - -__Error responses:__ - -| Status Code | Description | -|--------|-------------| -| `422 Unprocessable entity` | Invalid email address, if sign ups are enabled and the value isn't a valid email address | -| `429 Too Many Requests` | Rate limit exceeded | - -#### 2. Submit the magic link code - -Once the user receives the magic link email, they'll have a 6-character code. Submit it to complete authentication: - -```bash -curl -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Cookie: pending_authentication_token=eyJfcmFpbHMi..." \ - -d '{"code": "ABC123"}' \ - https://app.fizzy.do/session/magic_link -``` - -__Response:__ - -```json -{ - "session_token": "eyJfcmFpbHMi..." -} -``` - -The `session_token` can be used to authenticate subsequent requests by including it as a cookie: - -```bash -curl -H "Cookie: session_token=eyJfcmFpbHMi..." \ - -H "Accept: application/json" \ - https://app.fizzy.do/my/identity -``` - -__Error responses:__ - -| Status Code | Description | -|--------|-------------| -| `401 Unauthorized` | Invalid `pending_authentication_token` or `code` | -| `429 Too Many Requests` | Rate limit exceeded | - - -#### Delete server-side session (_log out_) - -To log out and destroy the server-side session: - -```bash -curl -X DELETE \ - -H "Accept: application/json" \ - -H "Cookie: session_token=eyJfcmFpbHMi..." \ - https://app.fizzy.do/session -``` - -__Response:__ - -Returns `204 No Content` on success. - -#### Create an access token via the API - -You can programmatically create a personal access token using either a session cookie or an existing Bearer token: - -```bash -curl -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Cookie: session_token=eyJfcmFpbHMi..." \ - -d '{"access_token": {"description": "Fizzy CLI", "permission": "write"}}' \ - https://app.fizzy.do/1234567/my/access_tokens -``` - -Or with a Bearer token (must have `write` permission): - -```bash -curl -X POST \ - -H "Content-Type: application/json" \ - -H "Accept: application/json" \ - -H "Authorization: Bearer put-your-access-token-here" \ - -d '{"access_token": {"description": "Fizzy CLI", "permission": "write"}}' \ - https://app.fizzy.do/1234567/my/access_tokens -``` - -The `permission` field accepts `read` or `write`. - -__Response:__ - -``` -HTTP/1.1 201 Created -``` - -```json -{ - "token": "4f9Q6d2wXr8Kp1Ls0Vz3BnTa", - "description": "Fizzy CLI", - "permission": "write" -} -``` - -Store the `token` value securely — it won't be retrievable again. Use it as a Bearer token for subsequent API requests. - -## Caching - -Most endpoints return [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag) and [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control) headers. You can use these to avoid re-downloading unchanged data. - -### Using ETags - -When you make a request, the response includes an `ETag` header: - -``` -HTTP/1.1 200 OK -ETag: "abc123" -Cache-Control: max-age=0, private, must-revalidate -``` - -On subsequent requests, include the ETag value in the `If-None-Match` header: - -``` -GET /1234567/cards/42.json -If-None-Match: "abc123" -``` - -If the resource hasn't changed, you'll receive a `304 Not Modified` response with no body, saving bandwidth and processing time: - -``` -HTTP/1.1 304 Not Modified -ETag: "abc123" -``` - -If the resource has changed, you'll receive the full response with a new ETag. - -__Example in Ruby:__ - -```ruby -# Store the ETag from the response -etag = response.headers["ETag"] - -# On next request, send it back -headers = { "If-None-Match" => etag } -response = client.get("/1234567/cards/42.json", headers: headers) - -if response.status == 304 - # Nothing to do, the card hasn't changed -else - # The card has changed, process the new data -end -``` - -## Error Responses - -When a request fails, the API response will communicate the source of the problem through the HTTP status code. - -| Status Code | Description | -|-------------|-------------| -| `400 Bad Request` | The request was malformed or missing required parameters | -| `401 Unauthorized` | Authentication failed or access token is invalid | -| `403 Forbidden` | You don't have permission to perform this action | -| `404 Not Found` | The requested resource doesn't exist or you don't have access to it | -| `422 Unprocessable Entity` | Validation failed (see error response format above) | -| `500 Internal Server Error` | An unexpected error occurred on the server | - -If a request contains invalid data for fields, such as entering a string into a number field, in most cases the API will respond with a `500 Internal Server Error`. Clients are expected to perform some validation on their end before making a request. - -A validation error will produce a `422 Unprocessable Entity` response, which will sometimes be accompanied by details about the error: - -```json -{ - "avatar": ["must be a JPEG, PNG, GIF, or WebP image"] -} -``` - -## Pagination - -All endpoints that return a list of items are paginated. The page size can vary from endpoint to endpoint, -and we use a dynamic page size where initial pages return fewer results than later pages. - -If there are more results to fetch, the response will include a `Link` header with a `rel="next"` link to the next page of results: - -```bash -curl -H "Authorization: Bearer put-your-access-token-here" -H "Accept: application/json" -v http://fizzy.localhost:3006/686465299/cards -# ... -< link: ; rel="next" -# ... -``` - -## List parameters - -When an endpoint accepts a list of values as a parameter, you can provide multiple values by repeating the parameter name: - -``` -?tag_ids[]=tag1&tag_ids[]=tag2&tag_ids[]=tag3 -``` - -List parameters always end with `[]`. - -## File Uploads - -Some endpoints accept file uploads. To upload a file, send a `multipart/form-data` request instead of JSON. -You can combine file uploads with other parameters in the same request. - -__Example using curl:__ - -```bash -curl -X PUT \ - -H "Authorization: Bearer put-your-access-token-here" \ - -F "user[name]=David H. Hansson" \ - -F "user[avatar]=@/path/to/avatar.jpg" \ - http://fizzy.localhost:3006/686465299/users/03f5v9zjw7pz8717a4no1h8a7 -``` - -## Rich Text Fields - -Some fields accept rich text content. These fields accept HTML input, which will be sanitized to remove unsafe tags and attributes. - -```json -{ - "card": { - "title": "My card", - "description": "

This is bold and this is italic.

  • Item 1
  • Item 2
" - } -} -``` - -### Attaching files to rich text - -To attach files (images, documents) to rich text fields, use ActionText's direct upload flow: - -#### 1. Create a direct upload - -First, request a direct upload URL by sending file metadata: - -```bash -curl -X POST \ - -H "Authorization: Bearer put-your-access-token-here" \ - -H "Content-Type: application/json" \ - -d '{ - "blob": { - "filename": "screenshot.png", - "byte_size": 12345, - "checksum": "GQ5SqLsM7ylnji0Wgd9wNA==", - "content_type": "image/png" - } - }' \ - https://app.fizzy.do/123456/rails/active_storage/direct_uploads -``` - -The `checksum` is a Base64-encoded MD5 hash of the file content. -The direct upload endpoint is scoped to your account (replace `/123456` with your account slug). - -__Response:__ - -```json -{ - "id": "abc123", - "key": "abc123def456", - "filename": "screenshot.png", - "content_type": "image/png", - "byte_size": 12345, - "checksum": "GQ5SqLsM7ylnji0Wgd9wNA==", - "direct_upload": { - "url": "https://storage.example.com/...", - "headers": { - "Content-Type": "image/png", - "Content-MD5": "GQ5SqLsM7ylnji0Wgd9wNA==" - } - }, - "signed_id": "eyJfcmFpbHMi..." -} -``` - -#### 2. Upload the file - -Upload the file directly to the provided URL with the specified headers: - -```bash -curl -X PUT \ - -H "Content-Type: image/png" \ - -H "Content-MD5: GQ5SqLsM7ylnji0Wgd9wNA==" \ - --data-binary @screenshot.png \ - "https://storage.example.com/..." -``` - -#### 3. Reference the file in rich text - -Use the `signed_id` from step 1 to embed the file in your rich text using an `` tag: - -```json -{ - "card": { - "title": "Card with image", - "description": "

Here's a screenshot:

" - } -} -``` - -The `sgid` attribute should contain the `signed_id` returned from the direct upload response. - -## Identity - -An Identity represents a person using Fizzy. - -### `GET /my/identity` - -Returns a list of accounts the identity has access to, including the user for each account. - -```json -{ - "accounts": [ - { - "id": "03f5v9zjskhcii2r45ih3u1rq", - "name": "37signals", - "slug": "/897362094", - "created_at": "2025-12-05T19:36:35.377Z", - "user": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/users/03f5v9zjw7pz8717a4no1h8a7" - } - }, - { - "id": "03f5v9zpko7mmhjzwum3youpp", - "name": "Honcho", - "slug": "/686465299", - "created_at": "2025-12-05T19:36:36.746Z", - "user": { - "id": "03f5v9zppzlksuj4mxba2nbzn", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:36.783Z", - "url": "http://fizzy.localhost:3006/users/03f5v9zppzlksuj4mxba2nbzn" - } - } - ] -} -``` - -## Boards - -Boards are where you organize your work - they contain your cards. - -### `GET /:account_slug/boards` - -Returns a list of boards that you can access in the specified account. - -__Response:__ - -```json -[ - { - "id": "03f5v9zkft4hj9qq0lsn9ohcm", - "name": "Fizzy", - "all_access": true, - "created_at": "2025-12-05T19:36:35.534Z", - "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - } - } -] -``` - -### `GET /:account_slug/boards/:board_id` - -Returns the specified board. - -__Response:__ - -```json -{ - "id": "03f5v9zkft4hj9qq0lsn9ohcm", - "name": "Fizzy", - "all_access": true, - "created_at": "2025-12-05T19:36:35.534Z", - "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - }, - "public_url": "http://fizzy.localhost:3006/897362094/public/boards/aB3dEfGhIjKlMnOp" -} -``` - -The `public_url` field is only present when the board is published. - -### `POST /:account_slug/boards` - -Creates a new Board in the account. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `name` | string | Yes | The name of the board | -| `all_access` | boolean | No | Whether any user in the account can access this board. Defaults to `true` | -| `auto_postpone_period_in_days` | integer | No | Number of days of inactivity before cards are automatically postponed (e.g. `30`) | -| `public_description` | string | No | Rich text description shown on the public board page | - -__Request:__ - -```json -{ - "board": { - "name": "My new board", - } -} -``` - -__Response:__ - -Returns `201 Created` with a `Location` header pointing to the new board: - -``` -HTTP/1.1 201 Created -Location: /897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm.json -``` - -### `PUT /:account_slug/boards/:board_id` - -Updates a Board. Only board administrators can update a board. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `name` | string | No | The name of the board | -| `all_access` | boolean | No | Whether any user in the account can access this board | -| `auto_postpone_period_in_days` | integer | No | Number of days of inactivity before cards are automatically postponed (e.g. `30`) | -| `public_description` | string | No | Rich text description shown on the public board page | -| `user_ids` | array | No | Array of *all* user IDs who should have access to this board (only applicable when `all_access` is `false`) | - -__Request:__ - -```json -{ - "board": { - "name": "Updated board name", - "auto_postpone_period_in_days": 30, - "public_description": "This is a **public** description of the board.", - "all_access": false, - "user_ids": [ - "03f5v9zppzlksuj4mxba2nbzn", - "03f5v9zjw7pz8717a4no1h8a7" - ] - } -} -``` - -__Response:__ - -Returns `204 No Content` on success. - -### `DELETE /:account_slug/boards/:board_id` - -Deletes a Board. Only board administrators can delete a board. - -__Response:__ - -Returns `204 No Content` on success. - -## Board Publications - -Publishing a board makes it publicly accessible via a shareable link, without requiring authentication. Only board administrators can publish or unpublish a board. - -### `POST /:account_slug/boards/:board_id/publication` - -Publishes a board, generating a shareable public link. - -__Response:__ - -``` -HTTP/1.1 201 Created -``` - -```json -{ - "id": "03f5v9zkft4hj9qq0lsn9ohcm", - "name": "Fizzy", - "all_access": true, - "created_at": "2025-12-05T19:36:35.534Z", - "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - }, - "public_url": "http://fizzy.localhost:3006/897362094/public/boards/aB3dEfGhIjKlMnOp" -} -``` - -If the board is already published, the existing publication is returned. - -### `DELETE /:account_slug/boards/:board_id/publication` - -Unpublishes a board, removing public access. - -__Response:__ - -Returns `204 No Content` on success. - -## Account - -### `GET /account/settings` - -Returns the current account. - -__Response:__ - -```json -{ - "id": "03f5v9zjvypwh0t0e2rfh0h7k", - "name": "37signals", - "cards_count": 5, - "created_at": "2025-12-05T19:36:35.401Z", - "auto_postpone_period_in_days": 30 -} -``` - -The `auto_postpone_period_in_days` is the account-level default in days (e.g. `30`). Cards are automatically moved to "Not Now" after this period of inactivity. Each board can override this with its own value. - -### `PUT /account/entropy` - -Updates the account-level default auto close period. Requires admin role. - -__Request:__ - -```json -{ - "entropy": { - "auto_postpone_period_in_days": 30 - } -} -``` - -__Response:__ - -Returns the account object: - -```json -{ - "id": "03f5v9zjvypwh0t0e2rfh0h7k", - "name": "37signals", - "cards_count": 5, - "created_at": "2025-12-05T19:36:35.401Z", - "auto_postpone_period_in_days": 30 -} -``` - -### `PUT /:account_slug/boards/:board_id/entropy` - -Updates the auto close period for a specific board. Requires board admin permission. - -__Request:__ - -```json -{ - "board": { - "auto_postpone_period_in_days": 90 - } -} -``` - -__Response:__ - -Returns the board object. - -## Webhooks - -Webhooks notify another application when something happens on a board. Only account admins can list, view, create, update, delete, or reactivate webhooks. - -### `GET /:account_slug/boards/:board_id/webhooks` - -Returns a paginated list of webhooks for a board. - -__Response:__ - -```json -[ - { - "id": "03f5v9zkft4hj9qq0lsn9ohcm", - "name": "Production API", - "payload_url": "https://api.example.com/webhooks", - "active": true, - "signing_secret": "p94Bx2HjempCdYB4DTyZkY1b", - "subscribed_actions": ["card_published", "card_assigned", "card_closed"], - "created_at": "2025-12-05T19:36:35.534Z", - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy/webhooks/03f5v9zkft4hj9qq0lsn9ohcm", - "board": { - "id": "03f5v9zkft4hj9qq0lsn9ohcy", - "name": "Fizzy", - "all_access": true, - "created_at": "2025-12-05T19:36:35.534Z", - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy", - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - } - } - } -] -``` - -### `GET /:account_slug/boards/:board_id/webhooks/:id` - -Returns a single webhook. - -__Response:__ - -Returns the same webhook shape shown above. - -### `POST /:account_slug/boards/:board_id/webhooks` - -Creates a webhook. - -__Request:__ - -```json -{ - "webhook": { - "name": "Production API", - "url": "https://api.example.com/webhooks", - "subscribed_actions": ["card_published", "card_assigned", "card_closed"] - } -} -``` - -`subscribed_actions` accepts any of: -`card_assigned`, `card_closed`, `card_postponed`, `card_auto_postponed`, `card_board_changed`, `card_published`, `card_reopened`, `card_sent_back_to_triage`, `card_triaged`, `card_unassigned`, `comment_created` - -__Response:__ - -``` -HTTP/1.1 201 Created -Location: http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy/webhooks/03f5v9zkft4hj9qq0lsn9ohcm.json -``` - -Returns the created webhook in the response body. - -### `PATCH /:account_slug/boards/:board_id/webhooks/:id` - -Updates a webhook. - -__Request:__ - -```json -{ - "webhook": { - "name": "Production API", - "subscribed_actions": ["card_closed"] - } -} -``` - -The `url` is immutable after creation and is ignored on update. - -__Response:__ - -Returns the updated webhook. - -### `DELETE /:account_slug/boards/:board_id/webhooks/:id` - -Deletes a webhook. - -__Response:__ - -Returns `204 No Content` on success. - -### `POST /:account_slug/boards/:board_id/webhooks/:id/activation` - -Reactivates a deactivated webhook. - -__Response:__ - -``` -HTTP/1.1 201 Created -``` - -Returns the reactivated webhook in the response body. - -## Cards - -Cards are tasks or items of work on a board. They can be organized into columns, tagged, assigned to users, and have comments. - -### `GET /:account_slug/cards` - -Returns a paginated list of cards you have access to. Results can be filtered using query parameters. - -__Query Parameters:__ - -| Parameter | Description | -|-----------|-------------| -| `board_ids[]` | Filter by board ID(s) | -| `tag_ids[]` | Filter by tag ID(s) | -| `assignee_ids[]` | Filter by assignee user ID(s) | -| `creator_ids[]` | Filter by card creator ID(s) | -| `closer_ids[]` | Filter by user ID(s) who closed the cards | -| `card_ids[]` | Filter to specific card ID(s) | -| `indexed_by` | Filter by: `all` (default), `closed`, `not_now`, `stalled`, `postponing_soon`, `golden` | -| `sorted_by` | Sort order: `latest` (default), `newest`, `oldest` | -| `assignment_status` | Filter by assignment status: `unassigned` | -| `creation` | Filter by creation date: `today`, `yesterday`, `thisweek`, `lastweek`, `thismonth`, `lastmonth`, `thisyear`, `lastyear` | -| `closure` | Filter by closure date: `today`, `yesterday`, `thisweek`, `lastweek`, `thismonth`, `lastmonth`, `thisyear`, `lastyear` | -| `terms[]` | Search terms to filter cards | - -__Response:__ - -```json -[ - { - "id": "03f5vaeq985jlvwv3arl4srq2", - "number": 1, - "title": "First!", - "status": "published", - "description": "Hello, World!", - "description_html": "

Hello, World!

", - "image_url": null, - "has_attachments": false, - "tags": ["programming"], - "golden": false, - "last_active_at": "2025-12-05T19:38:48.553Z", - "created_at": "2025-12-05T19:38:48.540Z", - "url": "http://fizzy.localhost:3006/897362094/cards/4", - "board": { - "id": "03f5v9zkft4hj9qq0lsn9ohcm", - "name": "Fizzy", - "all_access": true, - "created_at": "2025-12-05T19:36:35.534Z", - "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - } - }, - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - }, - "comments_url": "http://fizzy.localhost:3006/897362094/cards/4/comments", - "reactions_url": "http://fizzy.localhost:3006/897362094/cards/4/reactions" - }, -] -``` - -### `GET /:account_slug/cards/:card_number` - -Returns a specific card by its number. - -__Response:__ - -```json -{ - "id": "03f5vaeq985jlvwv3arl4srq2", - "number": 1, - "title": "First!", - "status": "published", - "description": "Hello, World!", - "description_html": "

Hello, World!

", - "image_url": null, - "has_attachments": false, - "tags": ["programming"], - "closed": false, - "golden": false, - "last_active_at": "2025-12-05T19:38:48.553Z", - "created_at": "2025-12-05T19:38:48.540Z", - "url": "http://fizzy.localhost:3006/897362094/cards/4", - "board": { - "id": "03f5v9zkft4hj9qq0lsn9ohcm", - "name": "Fizzy", - "all_access": true, - "created_at": "2025-12-05T19:36:35.534Z", - "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - } - }, - "column": { - "id": "03f5v9zkft4hj9qq0lsn9ohcn", - "name": "In Progress", - "color": { - "name": "Lime", - "value": "var(--color-card-4)" - }, - "created_at": "2025-12-05T19:36:35.534Z" - }, - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - }, - "comments_url": "http://fizzy.localhost:3006/897362094/cards/4/comments", - "reactions_url": "http://fizzy.localhost:3006/897362094/cards/4/reactions", - "steps": [ - { - "id": "03f8huu0sog76g3s975963b5e", - "content": "This is the first step", - "completed": false - }, - { - "id": "03f8huu0sog76g3s975969734", - "content": "This is the second step", - "completed": false - } - ] -} -``` - -> **Note:** The `closed` field indicates whether the card is in the "Done" state. The `column` field is only present when the card has been triaged into a column; cards in "Maybe?", "Not Now" or "Done" will not have this field. - -### `POST /:account_slug/boards/:board_id/cards` - -Creates a new card in a board. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `title` | string | Yes | The title of the card | -| `description` | string | No | Rich text description of the card | -| `status` | string | No | Initial status: `published` (default), `drafted` | -| `image` | file | No | Header image for the card | -| `tag_ids` | array | No | Array of tag IDs to apply to the card | -| `created_at` | datetime | No | Override creation timestamp (ISO 8601 format) | -| `last_active_at` | datetime | No | Override last activity timestamp (ISO 8601 format) | - -__Request:__ - -```json -{ - "card": { - "title": "Add dark mode support", - "description": "We need to add dark mode to the app" - } -} -``` - -__Response:__ - -Returns `201 Created` with a `Location` header pointing to the new card. - -### `PUT /:account_slug/cards/:card_number` - -Updates a card. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `title` | string | No | The title of the card | -| `description` | string | No | Rich text description of the card | -| `status` | string | No | Card status: `drafted`, `published` | -| `image` | file | No | Header image for the card | -| `tag_ids` | array | No | Array of tag IDs to apply to the card | -| `last_active_at` | datetime | No | Override last activity timestamp (ISO 8601 format) | - -__Request:__ - -```json -{ - "card": { - "title": "Add dark mode support (Updated)" - } -} -``` - -__Response:__ - -Returns the updated card. - -### `DELETE /:account_slug/cards/:card_number` - -Deletes a card. Only the card creator or board administrators can delete cards. - -__Response:__ - -Returns `204 No Content` on success. - -### `DELETE /:account_slug/cards/:card_number/image` - -Removes the header image from a card. - -__Response:__ - -Returns `204 No Content` on success. - -### `POST /:account_slug/cards/:card_number/closure` - -Closes a card. - -__Response:__ - -Returns `204 No Content` on success. - -### `DELETE /:account_slug/cards/:card_number/closure` - -Reopens a closed card. - -__Response:__ - -Returns `204 No Content` on success. - -### `POST /:account_slug/cards/:card_number/not_now` - -Moves a card to "Not Now" status. - -__Response:__ - -Returns `204 No Content` on success. - -### `POST /:account_slug/cards/:card_number/triage` - -Moves a card into a column. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `column_id` | string | Yes | The ID of the column to move the card into | - -__Response:__ - -Returns `204 No Content` on success. - -### `DELETE /:account_slug/cards/:card_number/triage` - -Sends a card back to triage. - -__Response:__ - -Returns `204 No Content` on success. - -### `POST /:account_slug/cards/:card_number/taggings` - -Toggles a tag on or off for a card. If the tag doesn't exist, it will be created. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `tag_title` | string | Yes | The title of the tag (leading `#` is stripped) | - -__Response:__ - -Returns `204 No Content` on success. - -### `POST /:account_slug/cards/:card_number/assignments` - -Toggles assignment of a user to/from a card. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `assignee_id` | string | Yes | The ID of the user to assign/unassign | - -__Response:__ - -Returns `204 No Content` on success. - -### `POST /:account_slug/cards/:card_number/watch` - -Subscribes the current user to notifications for this card. - -__Response:__ - -Returns `204 No Content` on success. - -### `DELETE /:account_slug/cards/:card_number/watch` - -Unsubscribes the current user from notifications for this card. - -__Response:__ - -Returns `204 No Content` on success. - -### `POST /:account_slug/cards/:card_number/goldness` - -Marks a card as golden. - -__Response:__ - -Returns `204 No Content` on success. - -### `DELETE /:account_slug/cards/:card_number/goldness` - -Removes golden status from a card. - -__Response:__ - -Returns `204 No Content` on success. - -## Pins - -Pins let users keep quick access to important cards. - -### `POST /:account_slug/cards/:card_number/pin` - -Pins a card for the current user. - -__Response:__ - -Returns `204 No Content` on success. - -### `DELETE /:account_slug/cards/:card_number/pin` - -Unpins a card for the current user. - -__Response:__ - -Returns `204 No Content` on success. - -### `GET /my/pins` - -Returns the current user's pinned cards. This endpoint is not paginated and returns up to 100 cards. - -__Response:__ - -```json -[ - { - "id": "03f5vaeq985jlvwv3arl4srq2", - "number": 1, - "title": "First!", - "status": "published", - "description": "Hello, World!", - "description_html": "

Hello, World!

", - "image_url": null, - "has_attachments": false, - "tags": ["programming"], - "golden": false, - "last_active_at": "2025-12-05T19:38:48.553Z", - "created_at": "2025-12-05T19:38:48.540Z", - "url": "http://fizzy.localhost:3006/897362094/cards/4", - "board": { - "id": "03f5v9zkft4hj9qq0lsn9ohcm", - "name": "Fizzy", - "all_access": true, - "created_at": "2025-12-05T19:36:35.534Z", - "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", - "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar" - } - }, - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", - "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar" - }, - "comments_url": "http://fizzy.localhost:3006/897362094/cards/4/comments" - } -] -``` - -## Comments - -Comments are attached to cards and support rich text. - -### `GET /:account_slug/cards/:card_number/comments` - -Returns a paginated list of comments on a card, sorted chronologically (oldest first). - -__Response:__ - -```json -[ - { - "id": "03f5v9zo9qlcwwpyc0ascnikz", - "created_at": "2025-12-05T19:36:35.534Z", - "updated_at": "2025-12-05T19:36:35.534Z", - "body": { - "plain_text": "This looks great!", - "html": "
This looks great!
" - }, - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - }, - "card": { - "id": "03f5v9zo9qlcwwpyc0ascnikz", - "url": "http://fizzy.localhost:3006/897362094/cards/03f5v9zo9qlcwwpyc0ascnikz" - }, - "reactions_url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions", - "url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz" - } -] -``` - -### `GET /:account_slug/cards/:card_number/comments/:comment_id` - -Returns a specific comment. - -__Response:__ - -```json -{ - "id": "03f5v9zo9qlcwwpyc0ascnikz", - "created_at": "2025-12-05T19:36:35.534Z", - "updated_at": "2025-12-05T19:36:35.534Z", - "body": { - "plain_text": "This looks great!", - "html": "
This looks great!
" - }, - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - }, - "card": { - "id": "03f5v9zo9qlcwwpyc0ascnikz", - "url": "http://fizzy.localhost:3006/897362094/cards/03f5v9zo9qlcwwpyc0ascnikz" - }, - "reactions_url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions", - "url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz" -} -``` - -### `POST /:account_slug/cards/:card_number/comments` - -Creates a new comment on a card. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `body` | string | Yes | The comment body (supports rich text) | -| `created_at` | datetime | No | Override creation timestamp (ISO 8601 format) | - -__Request:__ - -```json -{ - "comment": { - "body": "This looks great!" - } -} -``` - -__Response:__ - -Returns `201 Created` with a `Location` header pointing to the new comment. - -### `PUT /:account_slug/cards/:card_number/comments/:comment_id` - -Updates a comment. Only the comment creator can update their comments. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `body` | string | Yes | The updated comment body | - -__Request:__ - -```json -{ - "comment": { - "body": "This looks even better now!" - } -} -``` - -__Response:__ - -Returns the updated comment. - -### `DELETE /:account_slug/cards/:card_number/comments/:comment_id` - -Deletes a comment. Only the comment creator can delete their comments. - -__Response:__ - -Returns `204 No Content` on success. - -## Card Reactions (Boosts) - -Card reactions (also called "boosts") let users add short responses directly to cards. These are limited to 16 characters. - -### `GET /:account_slug/cards/:card_number/reactions` - -Returns a list of reactions on a card. - -__Response:__ - -```json -[ - { - "id": "03f5v9zo9qlcwwpyc0ascnikz", - "content": "👍", - "reacter": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - }, - "url": "http://fizzy.localhost:3006/897362094/cards/3/reactions/03f5v9zo9qlcwwpyc0ascnikz" - } -] -``` - -### `POST /:account_slug/cards/:card_number/reactions` - -Adds a reaction (boost) to a card. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `content` | string | Yes | The reaction text (max 16 characters) | - -__Request:__ - -```json -{ - "reaction": { - "content": "Great 👍" - } -} -``` - -__Response:__ - -Returns `201 Created` on success. - -### `DELETE /:account_slug/cards/:card_number/reactions/:reaction_id` - -Removes your reaction from a card. Only the reaction creator can remove their own reactions. - -__Response:__ - -Returns `204 No Content` on success. - -## Comment Reactions - -Reactions are short (16-character max) responses to comments. - -### `GET /:account_slug/cards/:card_number/comments/:comment_id/reactions` - -Returns a list of reactions on a comment. - -__Response:__ - -```json -[ - { - "id": "03f5v9zo9qlcwwpyc0ascnikz", - "content": "👍", - "reacter": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - }, - "url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions/03f5v9zo9qlcwwpyc0ascnikz" - } -] -``` - -### `POST /:account_slug/cards/:card_number/comments/:comment_id/reactions` - -Adds a reaction to a comment. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `content` | string | Yes | The reaction text | - -__Request:__ - -```json -{ - "reaction": { - "content": "Great 👍" - } -} -``` - -__Response:__ - -Returns `201 Created` on success. - -### `DELETE /:account_slug/cards/:card_number/comments/:comment_id/reactions/:reaction_id` - -Removes your reaction from a comment. - -__Response:__ - -Returns `204 No Content` on success. - -## Steps - -Steps are to-do items on a card. - -### `GET /:account_slug/cards/:card_number/steps/:step_id` - -Returns a specific step. - -__Response:__ - -```json -{ - "id": "03f5v9zo9qlcwwpyc0ascnikz", - "content": "Write tests", - "completed": false -} -``` - -### `POST /:account_slug/cards/:card_number/steps` - -Creates a new step on a card. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `content` | string | Yes | The step text | -| `completed` | boolean | No | Whether the step is completed (default: `false`) | - -__Request:__ - -```json -{ - "step": { - "content": "Write tests" - } -} -``` - -__Response:__ - -Returns `201 Created` with a `Location` header pointing to the new step. - -### `PUT /:account_slug/cards/:card_number/steps/:step_id` - -Updates a step. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `content` | string | No | The step text | -| `completed` | boolean | No | Whether the step is completed | - -__Request:__ - -```json -{ - "step": { - "completed": true - } -} -``` - -__Response:__ - -Returns the updated step. - -### `DELETE /:account_slug/cards/:card_number/steps/:step_id` - -Deletes a step. - -__Response:__ - -Returns `204 No Content` on success. - -## Tags - -Tags are labels that can be applied to cards for organization and filtering. - -### `GET /:account_slug/tags` - -Returns a list of all tags in the account, sorted alphabetically. - -__Response:__ - -```json -[ - { - "id": "03f5v9zo9qlcwwpyc0ascnikz", - "title": "bug", - "created_at": "2025-12-05T19:36:35.534Z", - "url": "http://fizzy.localhost:3006/897362094/cards?tag_ids[]=03f5v9zo9qlcwwpyc0ascnikz" - }, - { - "id": "03f5v9zo9qlcwwpyc0ascnilz", - "title": "feature", - "created_at": "2025-12-05T19:36:35.534Z", - "url": "http://fizzy.localhost:3006/897362094/cards?tag_ids[]=03f5v9zo9qlcwwpyc0ascnilz" - } -] -``` - -## Columns - -Columns represent stages in a workflow on a board. Cards move through columns as they progress. - -### `GET /:account_slug/boards/:board_id/columns` - -Returns a list of columns on a board, sorted by position. - -__Response:__ - -```json -[ - { - "id": "03f5v9zkft4hj9qq0lsn9ohcm", - "name": "Recording", - "color": "var(--color-card-default)", - "created_at": "2025-12-05T19:36:35.534Z" - }, - { - "id": "03f5v9zkft4hj9qq0lsn9ohcn", - "name": "Published", - "color": "var(--color-card-4)", - "created_at": "2025-12-05T19:36:35.534Z" - } -] -``` - -### `GET /:account_slug/boards/:board_id/columns/:column_id` - -Returns the specified column. - -__Response:__ - -```json -{ - "id": "03f5v9zkft4hj9qq0lsn9ohcm", - "name": "In Progress", - "color": "var(--color-card-default)", - "created_at": "2025-12-05T19:36:35.534Z" -} -``` - -### `POST /:account_slug/boards/:board_id/columns` - -Creates a new column on the board. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `name` | string | Yes | The name of the column | -| `color` | string | No | The column color. One of: `var(--color-card-default)` (Blue), `var(--color-card-1)` (Gray), `var(--color-card-2)` (Tan), `var(--color-card-3)` (Yellow), `var(--color-card-4)` (Lime), `var(--color-card-5)` (Aqua), `var(--color-card-6)` (Violet), `var(--color-card-7)` (Purple), `var(--color-card-8)` (Pink) | - -__Request:__ - -```json -{ - "column": { - "name": "In Progress", - "color": "var(--color-card-4)" - } -} -``` - -__Response:__ - -Returns `201 Created` with a `Location` header pointing to the new column. - -### `PUT /:account_slug/boards/:board_id/columns/:column_id` - -Updates a column. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `name` | string | No | The name of the column | -| `color` | string | No | The column color | - -__Request:__ - -```json -{ - "column": { - "name": "Done" - } -} -``` - -__Response:__ - -Returns `204 No Content` on success. - -### `DELETE /:account_slug/boards/:board_id/columns/:column_id` - -Deletes a column. - -__Response:__ - -Returns `204 No Content` on success. - -## Users - -Users represent people who have access to an account. - -### `GET /:account_slug/users` - -Returns a list of active users in the account. - -__Response:__ - -```json -[ - { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - }, - { - "id": "03f5v9zjysoy0fqs9yg0ei3hq", - "name": "Jason Fried", - "role": "member", - "active": true, - "email_address": "jason@example.com", - "created_at": "2025-12-05T19:36:35.419Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjysoy0fqs9yg0ei3hq" - }, - { - "id": "03f5v9zk1dtqduod5bkhv3k8m", - "name": "Jason Zimdars", - "role": "member", - "active": true, - "email_address": "jz@example.com", - "created_at": "2025-12-05T19:36:35.435Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zk1dtqduod5bkhv3k8m" - }, - { - "id": "03f5v9zk3nw9ja92e7s4h2wbe", - "name": "Kevin Mcconnell", - "role": "member", - "active": true, - "email_address": "kevin@example.com", - "created_at": "2025-12-05T19:36:35.451Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zk3nw9ja92e7s4h2wbe" - } -] -``` - -### `GET /:account_slug/users/:user_id` - -Returns the specified user. - -__Response:__ - -```json -{ - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" -} -``` - -### `PUT /:account_slug/users/:user_id` - -Updates a user. You can only update users you have permission to change. - -| Parameter | Type | Required | Description | -|-----------|------|----------|-------------| -| `name` | string | No | The user's display name | -| `avatar` | file | No | The user's avatar image | - -__Request:__ - -```json -{ - "user": { - "name": "David H. Hansson" - } -} -``` - -__Response:__ - -Returns `204 No Content` on success. - -### `DELETE /:account_slug/users/:user_id` - -Deactivates a user. You can only deactivate users you have permission to change. - -__Response:__ - -Returns `204 No Content` on success. - -## Notifications - -Notifications inform users about events that happened in the account, such as comments, assignments, and card updates. - -### `GET /:account_slug/notifications` - -Returns a list of notifications for the current user. Unread notifications are returned first, followed by read notifications. - -__Response:__ - -```json -[ - { - "id": "03f5va03bpuvkcjemcxl73ho2", - "read": false, - "read_at": null, - "created_at": "2025-11-19T04:03:58.000Z", - "title": "Plain text mentions", - "body": "Assigned to self", - "creator": { - "id": "03f5v9zjw7pz8717a4no1h8a7", - "name": "David Heinemeier Hansson", - "role": "owner", - "active": true, - "email_address": "david@example.com", - "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" - }, - "card": { - "id": "03f5v9zo9qlcwwpyc0ascnikz", - "title": "Plain text mentions", - "status": "published", - "url": "http://fizzy.localhost:3006/897362094/cards/3" - }, - "url": "http://fizzy.localhost:3006/897362094/notifications/03f5va03bpuvkcjemcxl73ho2" - } -] -``` - -### `POST /:account_slug/notifications/:notification_id/reading` - -Marks a notification as read. - -__Response:__ - -Returns `204 No Content` on success. - -### `DELETE /:account_slug/notifications/:notification_id/reading` - -Marks a notification as unread. - -__Response:__ - -Returns `204 No Content` on success. - -### `POST /:account_slug/notifications/bulk_reading` - -Marks all unread notifications as read. - -__Response:__ - -Returns `204 No Content` on success. diff --git a/docs/api/README.md b/docs/api/README.md new file mode 100644 index 0000000000..92d5fe2c2a --- /dev/null +++ b/docs/api/README.md @@ -0,0 +1,148 @@ +# Fizzy API + +Fizzy has an API that allows you to integrate your application with it or to create +a bot to perform various actions for you. + +## API Endpoints + +- [Authentication](sections/authentication.md) +- [Identity](sections/identity.md) +- [Account](sections/account.md) +- [Boards](sections/boards.md) +- [Columns](sections/columns.md) +- [Cards](sections/cards.md) +- [Pins](sections/pins.md) +- [Steps](sections/steps.md) +- [Comments](sections/comments.md) +- [Reactions](sections/reactions.md) +- [Tags](sections/tags.md) +- [Users](sections/users.md) +- [Notifications](sections/notifications.md) +- [Rich Text](sections/rich_text.md) +- [Webhooks](sections/webhooks.md) + +## Authentication + +There are two ways to authenticate with the Fizzy API: + +1. **Personal access tokens** - Long-lived tokens for scripts and integrations +2. **Magic link authentication** - Session-based authentication for native apps + +Read the [authentication guide](sections/authentication.md) to get started. + +## Caching + +Most endpoints return [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag) and [Cache-Control](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cache-Control) headers. You can use these to avoid re-downloading unchanged data. + +### Using ETags + +When you make a request, the response includes an `ETag` header: + +``` +HTTP/1.1 200 OK +ETag: "abc123" +Cache-Control: max-age=0, private, must-revalidate +``` + +On subsequent requests, include the ETag value in the `If-None-Match` header: + +``` +GET /1234567/cards/42.json +If-None-Match: "abc123" +``` + +If the resource hasn't changed, you'll receive a `304 Not Modified` response with no body, saving bandwidth and processing time: + +``` +HTTP/1.1 304 Not Modified +ETag: "abc123" +``` + +If the resource has changed, you'll receive the full response with a new ETag. + +__Example in Ruby:__ + +```ruby +# Store the ETag from the response +etag = response.headers["ETag"] + +# On next request, send it back +headers = { "If-None-Match" => etag } +response = client.get("/1234567/cards/42.json", headers: headers) + +if response.status == 304 + # Nothing to do, the card hasn't changed +else + # The card has changed, process the new data +end +``` + +## Error Responses + +When a request fails, the API response will communicate the source of the problem through the HTTP status code. + +| Status Code | Description | +|-------------|-------------| +| `400 Bad Request` | The request was malformed or missing required parameters | +| `401 Unauthorized` | Authentication failed or access token is invalid | +| `403 Forbidden` | You don't have permission to perform this action | +| `404 Not Found` | The requested resource doesn't exist or you don't have access to it | +| `422 Unprocessable Entity` | Validation failed (see error response format above) | +| `500 Internal Server Error` | An unexpected error occurred on the server | + +If a request contains invalid data for fields, such as entering a string into a number field, in most cases the API will respond with a `500 Internal Server Error`. Clients are expected to perform some validation on their end before making a request. + +A validation error will produce a `422 Unprocessable Entity` response, which will sometimes be accompanied by details about the error: + +```json +{ + "avatar": ["must be a JPEG, PNG, GIF, or WebP image"] +} +``` + +## Pagination + +All endpoints that return a list of items are paginated. The page size can vary from endpoint to endpoint, +and we use a dynamic page size where initial pages return fewer results than later pages. + +If there are more results to fetch, the response will include a `Link` header with a `rel="next"` link to the next page of results: + +```bash +curl -H "Authorization: Bearer put-your-access-token-here" -H "Accept: application/json" -v http://fizzy.localhost:3006/686465299/cards +# ... +< link: ; rel="next" +# ... +``` + +## List parameters + +When an endpoint accepts a list of values as a parameter, you can provide multiple values by repeating the parameter name: + +``` +?tag_ids[]=tag1&tag_ids[]=tag2&tag_ids[]=tag3 +``` + +List parameters always end with `[]`. + +## File Uploads + +Some endpoints accept file uploads. To upload a file, send a `multipart/form-data` request instead of JSON. +You can combine file uploads with other parameters in the same request. + +__Example using curl:__ + +```bash +curl -X PUT \ + -H "Authorization: Bearer put-your-access-token-here" \ + -F "user[name]=David H. Hansson" \ + -F "user[avatar]=@/path/to/avatar.jpg" \ + http://fizzy.localhost:3006/686465299/users/03f5v9zjw7pz8717a4no1h8a7 +``` + +## Rich Text Fields + +Some fields accept rich text content. These fields accept HTML input, which will be sanitized to remove unsafe tags and attributes. + +See the [rich text guide](sections/rich_text.md) for more information, including how to attach files to rich text fields using the direct upload flow. + + diff --git a/docs/api/sections/account.md b/docs/api/sections/account.md new file mode 100644 index 0000000000..2b1a9a4f55 --- /dev/null +++ b/docs/api/sections/account.md @@ -0,0 +1,65 @@ +# Account + +## `GET /account/settings` + +Returns the current account. + +__Response:__ + +```json +{ + "id": "03f5v9zjvypwh0t0e2rfh0h7k", + "name": "37signals", + "cards_count": 5, + "created_at": "2025-12-05T19:36:35.401Z", + "auto_postpone_period_in_days": 30 +} +``` + +The `auto_postpone_period_in_days` is the account-level default in days (e.g. `30`). Cards are automatically moved to "Not Now" after this period of inactivity. Each board can override this with its own value. + +## `PUT /account/entropy` + +Updates the account-level default auto close period. Requires admin role. + +__Request:__ + +```json +{ + "entropy": { + "auto_postpone_period_in_days": 30 + } +} +``` + +__Response:__ + +Returns the account object: + +```json +{ + "id": "03f5v9zjvypwh0t0e2rfh0h7k", + "name": "37signals", + "cards_count": 5, + "created_at": "2025-12-05T19:36:35.401Z", + "auto_postpone_period_in_days": 30 +} +``` + +## `PUT /:account_slug/boards/:board_id/entropy` + +Updates the auto close period for a specific board. Requires board admin permission. + +__Request:__ + +```json +{ + "board": { + "auto_postpone_period_in_days": 90 + } +} +``` + +__Response:__ + +Returns the board object. diff --git a/docs/api/sections/authentication.md b/docs/api/sections/authentication.md new file mode 100644 index 0000000000..1030597b35 --- /dev/null +++ b/docs/api/sections/authentication.md @@ -0,0 +1,172 @@ +# Authentication + +There are two ways to authenticate with the Fizzy API: + +1. **Personal access tokens** - Long-lived tokens for scripts and integrations +2. **Magic link authentication** - Session-based authentication for native apps + +## Personal Access Tokens + +To use the API you'll need an access token. To get one, go to your profile, then, +in the API section, click on "Personal access tokens" and then click on +"Generate new access token". + +Give it a description and pick what kind of permission you want the access token to have: +- `Read`: allows reading data from your account +- `Read + Write`: allows reading and writing data to your account on your behalf + +Then click on "Generate access token". + +
+ Access token generation guide with screenshots + + | Step | Description | Screenshot | + |:----:|-------------|:----------:| + | 1 | Go to your profile | Profile page with API section | + | 2 | In the API section click on "Personal access token" | Personal access tokens page | + | 3 | Click on "Generate a new access token" | Generate new access token dialog | + | 4 | Give it a description and assign it a permission | Access token created | +
+ +> [!IMPORTANT] +> __An access token is like a password, keep it secret and do not share it with anyone.__ +> Any person or application that has your access token can perform actions on your behalf. + +To authenticate a request using your access token, include it in the `Authorization` header: + +```bash +curl -H "Authorization: Bearer put-your-access-token-here" -H "Accept: application/json" https://app.fizzy.do/my/identity +``` + +## Magic Link Authentication + +For native apps, you can authenticate users via magic links. This is a two-step process: + +### 1. Request a magic link + +Send the user's email address to request a magic link be sent to them: + +```bash +curl -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -d '{"email_address": "user@example.com"}' \ + https://app.fizzy.do/session +``` + +__Response:__ + +``` +HTTP/1.1 201 Created +Set-Cookie: pending_authentication_token=...; HttpOnly; SameSite=Lax +``` + +```json +{ + "pending_authentication_token": "eyJfcmFpbHMi..." +} +``` + +The response includes a `pending_authentication_token` both in the JSON body and as a cookie. +Native apps should store this token and include it as a cookie when submitting the magic link code. + +__Error responses:__ + +| Status Code | Description | +|--------|-------------| +| `422 Unprocessable entity` | Invalid email address, if sign ups are enabled and the value isn't a valid email address | +| `429 Too Many Requests` | Rate limit exceeded | + +### 2. Submit the magic link code + +Once the user receives the magic link email, they'll have a 6-character code. Submit it to complete authentication: + +```bash +curl -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Cookie: pending_authentication_token=eyJfcmFpbHMi..." \ + -d '{"code": "ABC123"}' \ + https://app.fizzy.do/session/magic_link +``` + +__Response:__ + +```json +{ + "session_token": "eyJfcmFpbHMi..." +} +``` + +The `session_token` can be used to authenticate subsequent requests by including it as a cookie: + +```bash +curl -H "Cookie: session_token=eyJfcmFpbHMi..." \ + -H "Accept: application/json" \ + https://app.fizzy.do/my/identity +``` + +__Error responses:__ + +| Status Code | Description | +|--------|-------------| +| `401 Unauthorized` | Invalid `pending_authentication_token` or `code` | +| `429 Too Many Requests` | Rate limit exceeded | + + +### Delete server-side session (_log out_) + +To log out and destroy the server-side session: + +```bash +curl -X DELETE \ + -H "Accept: application/json" \ + -H "Cookie: session_token=eyJfcmFpbHMi..." \ + https://app.fizzy.do/session +``` + +__Response:__ + +Returns `204 No Content` on success. + +### Create an access token via the API + +You can programmatically create a personal access token using either a session cookie or an existing Bearer token: + +```bash +curl -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Cookie: session_token=eyJfcmFpbHMi..." \ + -d '{"access_token": {"description": "Fizzy CLI", "permission": "write"}}' \ + https://app.fizzy.do/1234567/my/access_tokens +``` + +Or with a Bearer token (must have `write` permission): + +```bash +curl -X POST \ + -H "Content-Type: application/json" \ + -H "Accept: application/json" \ + -H "Authorization: Bearer put-your-access-token-here" \ + -d '{"access_token": {"description": "Fizzy CLI", "permission": "write"}}' \ + https://app.fizzy.do/1234567/my/access_tokens +``` + +The `permission` field accepts `read` or `write`. + +__Response:__ + +``` +HTTP/1.1 201 Created +``` + +```json +{ + "token": "4f9Q6d2wXr8Kp1Ls0Vz3BnTa", + "description": "Fizzy CLI", + "permission": "write" +} +``` + +Store the `token` value securely — it won't be retrievable again. Use it as a Bearer token for subsequent API requests. diff --git a/docs/api/sections/boards.md b/docs/api/sections/boards.md new file mode 100644 index 0000000000..bf77245ab9 --- /dev/null +++ b/docs/api/sections/boards.md @@ -0,0 +1,176 @@ +# Boards + +Boards are where you organize your work - they contain your cards. + +## `GET /:account_slug/boards` + +Returns a list of boards that you can access in the specified account. + +__Response:__ + +```json +[ + { + "id": "03f5v9zkft4hj9qq0lsn9ohcm", + "name": "Fizzy", + "all_access": true, + "created_at": "2025-12-05T19:36:35.534Z", + "auto_postpone_period_in_days": 30, + "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + } + } +] +``` + +## `GET /:account_slug/boards/:board_id` + +Returns the specified board. + +__Response:__ + +```json +{ + "id": "03f5v9zkft4hj9qq0lsn9ohcm", + "name": "Fizzy", + "all_access": true, + "created_at": "2025-12-05T19:36:35.534Z", + "auto_postpone_period_in_days": 30, + "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + }, + "public_url": "http://fizzy.localhost:3006/897362094/public/boards/aB3dEfGhIjKlMnOp" +} +``` + +The `public_url` field is only present when the board is published. + +## `POST /:account_slug/boards` + +Creates a new Board in the account. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `name` | string | Yes | The name of the board | +| `all_access` | boolean | No | Whether any user in the account can access this board. Defaults to `true` | +| `auto_postpone_period_in_days` | integer | No | Number of days of inactivity before cards are automatically postponed (e.g. `30`) | +| `public_description` | string | No | Rich text description shown on the public board page | + +__Request:__ + +```json +{ + "board": { + "name": "My new board" + } +} +``` + +__Response:__ + +Returns `201 Created` with a `Location` header pointing to the new board: + +``` +HTTP/1.1 201 Created +Location: /897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm.json +``` + +## `PUT /:account_slug/boards/:board_id` + +Updates a Board. Only board administrators can update a board. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `name` | string | No | The name of the board | +| `all_access` | boolean | No | Whether any user in the account can access this board | +| `auto_postpone_period_in_days` | integer | No | Number of days of inactivity before cards are automatically postponed (e.g. `30`) | +| `public_description` | string | No | Rich text description shown on the public board page | +| `user_ids` | array | No | Array of *all* user IDs who should have access to this board (only applicable when `all_access` is `false`) | + +__Request:__ + +```json +{ + "board": { + "name": "Updated board name", + "auto_postpone_period_in_days": 30, + "public_description": "This is a **public** description of the board.", + "all_access": false, + "user_ids": [ + "03f5v9zppzlksuj4mxba2nbzn", + "03f5v9zjw7pz8717a4no1h8a7" + ] + } +} +``` + +__Response:__ + +Returns `204 No Content` on success. + +## `DELETE /:account_slug/boards/:board_id` + +Deletes a Board. Only board administrators can delete a board. + +__Response:__ + +Returns `204 No Content` on success. + +## Board Publications + +Publishing a board makes it publicly accessible via a shareable link, without requiring authentication. Only board administrators can publish or unpublish a board. + +## `POST /:account_slug/boards/:board_id/publication` + +Publishes a board, generating a shareable public link. + +__Response:__ + +``` +HTTP/1.1 201 Created +``` + +```json +{ + "id": "03f5v9zkft4hj9qq0lsn9ohcm", + "name": "Fizzy", + "all_access": true, + "created_at": "2025-12-05T19:36:35.534Z", + "auto_postpone_period_in_days": 30, + "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + }, + "public_url": "http://fizzy.localhost:3006/897362094/public/boards/aB3dEfGhIjKlMnOp" +} +``` + +If the board is already published, the existing publication is returned. + +## `DELETE /:account_slug/boards/:board_id/publication` + +Unpublishes a board, removing public access. + +__Response:__ + +Returns `204 No Content` on success. diff --git a/docs/api/sections/cards.md b/docs/api/sections/cards.md new file mode 100644 index 0000000000..83ca512534 --- /dev/null +++ b/docs/api/sections/cards.md @@ -0,0 +1,322 @@ +# Cards + +Cards are tasks or items of work on a board. They can be organized into columns, tagged, assigned to users, and have comments. + +## `GET /:account_slug/cards` + +Returns a paginated list of cards you have access to. Results can be filtered using query parameters. + +__Query Parameters:__ + +| Parameter | Description | +|-----------|-------------| +| `board_ids[]` | Filter by board ID(s) | +| `tag_ids[]` | Filter by tag ID(s) | +| `assignee_ids[]` | Filter by assignee user ID(s) | +| `creator_ids[]` | Filter by card creator ID(s) | +| `closer_ids[]` | Filter by user ID(s) who closed the cards | +| `card_ids[]` | Filter to specific card ID(s) | +| `indexed_by` | Filter by: `all` (default), `closed`, `not_now`, `stalled`, `postponing_soon`, `golden` | +| `sorted_by` | Sort order: `latest` (default), `newest`, `oldest` | +| `assignment_status` | Filter by assignment status: `unassigned` | +| `creation` | Filter by creation date: `today`, `yesterday`, `thisweek`, `lastweek`, `thismonth`, `lastmonth`, `thisyear`, `lastyear` | +| `closure` | Filter by closure date: `today`, `yesterday`, `thisweek`, `lastweek`, `thismonth`, `lastmonth`, `thisyear`, `lastyear` | +| `terms[]` | Search terms to filter cards | + +__Response:__ + +```json +[ + { + "id": "03f5vaeq985jlvwv3arl4srq2", + "number": 1, + "title": "First!", + "status": "published", + "description": "Hello, World!", + "description_html": "

Hello, World!

", + "image_url": null, + "has_attachments": false, + "tags": ["programming"], + "golden": false, + "last_active_at": "2025-12-05T19:38:48.553Z", + "created_at": "2025-12-05T19:38:48.540Z", + "url": "http://fizzy.localhost:3006/897362094/cards/4", + "board": { + "id": "03f5v9zkft4hj9qq0lsn9ohcm", + "name": "Fizzy", + "all_access": true, + "created_at": "2025-12-05T19:36:35.534Z", + "auto_postpone_period_in_days": 30, + "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + } + }, + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + }, + "comments_url": "http://fizzy.localhost:3006/897362094/cards/4/comments", + "reactions_url": "http://fizzy.localhost:3006/897362094/cards/4/reactions" + } +] +``` + +## `GET /:account_slug/cards/:card_number` + +Returns a specific card by its number. + +__Response:__ + +```json +{ + "id": "03f5vaeq985jlvwv3arl4srq2", + "number": 1, + "title": "First!", + "status": "published", + "description": "Hello, World!", + "description_html": "

Hello, World!

", + "image_url": null, + "has_attachments": false, + "tags": ["programming"], + "closed": false, + "golden": false, + "last_active_at": "2025-12-05T19:38:48.553Z", + "created_at": "2025-12-05T19:38:48.540Z", + "url": "http://fizzy.localhost:3006/897362094/cards/4", + "board": { + "id": "03f5v9zkft4hj9qq0lsn9ohcm", + "name": "Fizzy", + "all_access": true, + "created_at": "2025-12-05T19:36:35.534Z", + "auto_postpone_period_in_days": 30, + "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + } + }, + "column": { + "id": "03f5v9zkft4hj9qq0lsn9ohcn", + "name": "In Progress", + "color": { + "name": "Lime", + "value": "var(--color-card-4)" + }, + "created_at": "2025-12-05T19:36:35.534Z" + }, + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + }, + "comments_url": "http://fizzy.localhost:3006/897362094/cards/4/comments", + "reactions_url": "http://fizzy.localhost:3006/897362094/cards/4/reactions", + "steps": [ + { + "id": "03f8huu0sog76g3s975963b5e", + "content": "This is the first step", + "completed": false + }, + { + "id": "03f8huu0sog76g3s975969734", + "content": "This is the second step", + "completed": false + } + ] +} +``` + +> **Note:** The `closed` field indicates whether the card is in the "Done" state. The `column` field is only present when the card has been triaged into a column; cards in "Maybe?", "Not Now" or "Done" will not have this field. + +## `POST /:account_slug/boards/:board_id/cards` + +Creates a new card in a board. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `title` | string | Yes | The title of the card | +| `description` | string | No | Rich text description of the card | +| `status` | string | No | Initial status: `published` (default), `drafted` | +| `image` | file | No | Header image for the card | +| `tag_ids` | array | No | Array of tag IDs to apply to the card | +| `created_at` | datetime | No | Override creation timestamp (ISO 8601 format) | +| `last_active_at` | datetime | No | Override last activity timestamp (ISO 8601 format) | + +__Request:__ + +```json +{ + "card": { + "title": "Add dark mode support", + "description": "We need to add dark mode to the app" + } +} +``` + +__Response:__ + +Returns `201 Created` with a `Location` header pointing to the new card. + +## `PUT /:account_slug/cards/:card_number` + +Updates a card. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `title` | string | No | The title of the card | +| `description` | string | No | Rich text description of the card | +| `status` | string | No | Card status: `drafted`, `published` | +| `image` | file | No | Header image for the card | +| `tag_ids` | array | No | Array of tag IDs to apply to the card | +| `last_active_at` | datetime | No | Override last activity timestamp (ISO 8601 format) | + +__Request:__ + +```json +{ + "card": { + "title": "Add dark mode support (Updated)" + } +} +``` + +__Response:__ + +Returns the updated card. + +## `DELETE /:account_slug/cards/:card_number` + +Deletes a card. Only the card creator or board administrators can delete cards. + +__Response:__ + +Returns `204 No Content` on success. + +## `DELETE /:account_slug/cards/:card_number/image` + +Removes the header image from a card. + +__Response:__ + +Returns `204 No Content` on success. + +## `POST /:account_slug/cards/:card_number/closure` + +Closes a card. + +__Response:__ + +Returns `204 No Content` on success. + +## `DELETE /:account_slug/cards/:card_number/closure` + +Reopens a closed card. + +__Response:__ + +Returns `204 No Content` on success. + +## `POST /:account_slug/cards/:card_number/not_now` + +Moves a card to "Not Now" status. + +__Response:__ + +Returns `204 No Content` on success. + +## `POST /:account_slug/cards/:card_number/triage` + +Moves a card into a column. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `column_id` | string | Yes | The ID of the column to move the card into | + +__Response:__ + +Returns `204 No Content` on success. + +## `DELETE /:account_slug/cards/:card_number/triage` + +Sends a card back to triage. + +__Response:__ + +Returns `204 No Content` on success. + +## `POST /:account_slug/cards/:card_number/taggings` + +Toggles a tag on or off for a card. If the tag doesn't exist, it will be created. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `tag_title` | string | Yes | The title of the tag (leading `#` is stripped) | + +__Response:__ + +Returns `204 No Content` on success. + +## `POST /:account_slug/cards/:card_number/assignments` + +Toggles assignment of a user to/from a card. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `assignee_id` | string | Yes | The ID of the user to assign/unassign | + +__Response:__ + +Returns `204 No Content` on success. + +## `POST /:account_slug/cards/:card_number/watch` + +Subscribes the current user to notifications for this card. + +__Response:__ + +Returns `204 No Content` on success. + +## `DELETE /:account_slug/cards/:card_number/watch` + +Unsubscribes the current user from notifications for this card. + +__Response:__ + +Returns `204 No Content` on success. + +## `POST /:account_slug/cards/:card_number/goldness` + +Marks a card as golden. + +__Response:__ + +Returns `204 No Content` on success. + +## `DELETE /:account_slug/cards/:card_number/goldness` + +Removes golden status from a card. + +__Response:__ + +Returns `204 No Content` on success. diff --git a/docs/api/sections/columns.md b/docs/api/sections/columns.md new file mode 100644 index 0000000000..73bd1c728d --- /dev/null +++ b/docs/api/sections/columns.md @@ -0,0 +1,96 @@ +# Columns + +Columns represent stages in a workflow on a board. Cards move through columns as they progress. + +## `GET /:account_slug/boards/:board_id/columns` + +Returns a list of columns on a board, sorted by position. + +__Response:__ + +```json +[ + { + "id": "03f5v9zkft4hj9qq0lsn9ohcm", + "name": "Recording", + "color": "var(--color-card-default)", + "created_at": "2025-12-05T19:36:35.534Z" + }, + { + "id": "03f5v9zkft4hj9qq0lsn9ohcn", + "name": "Published", + "color": "var(--color-card-4)", + "created_at": "2025-12-05T19:36:35.534Z" + } +] +``` + +## `GET /:account_slug/boards/:board_id/columns/:column_id` + +Returns the specified column. + +__Response:__ + +```json +{ + "id": "03f5v9zkft4hj9qq0lsn9ohcm", + "name": "In Progress", + "color": "var(--color-card-default)", + "created_at": "2025-12-05T19:36:35.534Z" +} +``` + +## `POST /:account_slug/boards/:board_id/columns` + +Creates a new column on the board. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `name` | string | Yes | The name of the column | +| `color` | string | No | The column color. One of: `var(--color-card-default)` (Blue), `var(--color-card-1)` (Gray), `var(--color-card-2)` (Tan), `var(--color-card-3)` (Yellow), `var(--color-card-4)` (Lime), `var(--color-card-5)` (Aqua), `var(--color-card-6)` (Violet), `var(--color-card-7)` (Purple), `var(--color-card-8)` (Pink) | + +__Request:__ + +```json +{ + "column": { + "name": "In Progress", + "color": "var(--color-card-4)" + } +} +``` + +__Response:__ + +Returns `201 Created` with a `Location` header pointing to the new column. + +## `PUT /:account_slug/boards/:board_id/columns/:column_id` + +Updates a column. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `name` | string | No | The name of the column | +| `color` | string | No | The column color | + +__Request:__ + +```json +{ + "column": { + "name": "Done" + } +} +``` + +__Response:__ + +Returns `204 No Content` on success. + +## `DELETE /:account_slug/boards/:board_id/columns/:column_id` + +Deletes a column. + +__Response:__ + +Returns `204 No Content` on success. diff --git a/docs/api/sections/comments.md b/docs/api/sections/comments.md new file mode 100644 index 0000000000..a0854acc22 --- /dev/null +++ b/docs/api/sections/comments.md @@ -0,0 +1,124 @@ +# Comments + +Comments are attached to cards and support rich text. + +## `GET /:account_slug/cards/:card_number/comments` + +Returns a paginated list of comments on a card, sorted chronologically (oldest first). + +__Response:__ + +```json +[ + { + "id": "03f5v9zo9qlcwwpyc0ascnikz", + "created_at": "2025-12-05T19:36:35.534Z", + "updated_at": "2025-12-05T19:36:35.534Z", + "body": { + "plain_text": "This looks great!", + "html": "
This looks great!
" + }, + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + }, + "card": { + "id": "03f5v9zo9qlcwwpyc0ascnikz", + "url": "http://fizzy.localhost:3006/897362094/cards/03f5v9zo9qlcwwpyc0ascnikz" + }, + "reactions_url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions", + "url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz" + } +] +``` + +## `GET /:account_slug/cards/:card_number/comments/:comment_id` + +Returns a specific comment. + +__Response:__ + +```json +{ + "id": "03f5v9zo9qlcwwpyc0ascnikz", + "created_at": "2025-12-05T19:36:35.534Z", + "updated_at": "2025-12-05T19:36:35.534Z", + "body": { + "plain_text": "This looks great!", + "html": "
This looks great!
" + }, + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + }, + "card": { + "id": "03f5v9zo9qlcwwpyc0ascnikz", + "url": "http://fizzy.localhost:3006/897362094/cards/03f5v9zo9qlcwwpyc0ascnikz" + }, + "reactions_url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions", + "url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz" +} +``` + +## `POST /:account_slug/cards/:card_number/comments` + +Creates a new comment on a card. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `body` | string | Yes | The comment body (supports rich text) | +| `created_at` | datetime | No | Override creation timestamp (ISO 8601 format) | + +__Request:__ + +```json +{ + "comment": { + "body": "This looks great!" + } +} +``` + +__Response:__ + +Returns `201 Created` with a `Location` header pointing to the new comment. + +## `PUT /:account_slug/cards/:card_number/comments/:comment_id` + +Updates a comment. Only the comment creator can update their comments. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `body` | string | Yes | The updated comment body | + +__Request:__ + +```json +{ + "comment": { + "body": "This looks even better now!" + } +} +``` + +__Response:__ + +Returns the updated comment. + +## `DELETE /:account_slug/cards/:card_number/comments/:comment_id` + +Deletes a comment. Only the comment creator can delete their comments. + +__Response:__ + +Returns `204 No Content` on success. diff --git a/docs/api/sections/identity.md b/docs/api/sections/identity.md new file mode 100644 index 0000000000..5167aaf95f --- /dev/null +++ b/docs/api/sections/identity.md @@ -0,0 +1,46 @@ +# Identity + +An Identity represents a person using Fizzy. + +## `GET /my/identity` + +Returns a list of accounts the identity has access to, including the user for each account. + +__Response:__ + +```json +{ + "accounts": [ + { + "id": "03f5v9zjskhcii2r45ih3u1rq", + "name": "37signals", + "slug": "/897362094", + "created_at": "2025-12-05T19:36:35.377Z", + "user": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/users/03f5v9zjw7pz8717a4no1h8a7" + } + }, + { + "id": "03f5v9zpko7mmhjzwum3youpp", + "name": "Honcho", + "slug": "/686465299", + "created_at": "2025-12-05T19:36:36.746Z", + "user": { + "id": "03f5v9zppzlksuj4mxba2nbzn", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:36.783Z", + "url": "http://fizzy.localhost:3006/users/03f5v9zppzlksuj4mxba2nbzn" + } + } + ] +} +``` diff --git a/docs/api/sections/notifications.md b/docs/api/sections/notifications.md new file mode 100644 index 0000000000..891d3a86af --- /dev/null +++ b/docs/api/sections/notifications.md @@ -0,0 +1,62 @@ +# Notifications + +Notifications inform users about events that happened in the account, such as comments, assignments, and card updates. + +## `GET /:account_slug/notifications` + +Returns a list of notifications for the current user. Unread notifications are returned first, followed by read notifications. + +__Response:__ + +```json +[ + { + "id": "03f5va03bpuvkcjemcxl73ho2", + "read": false, + "read_at": null, + "created_at": "2025-11-19T04:03:58.000Z", + "title": "Plain text mentions", + "body": "Assigned to self", + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + }, + "card": { + "id": "03f5v9zo9qlcwwpyc0ascnikz", + "title": "Plain text mentions", + "status": "published", + "url": "http://fizzy.localhost:3006/897362094/cards/3" + }, + "url": "http://fizzy.localhost:3006/897362094/notifications/03f5va03bpuvkcjemcxl73ho2" + } +] +``` + +## `POST /:account_slug/notifications/:notification_id/reading` + +Marks a notification as read. + +__Response:__ + +Returns `204 No Content` on success. + +## `DELETE /:account_slug/notifications/:notification_id/reading` + +Marks a notification as unread. + +__Response:__ + +Returns `204 No Content` on success. + +## `POST /:account_slug/notifications/bulk_reading` + +Marks all unread notifications as read. + +__Response:__ + +Returns `204 No Content` on success. diff --git a/docs/api/sections/pins.md b/docs/api/sections/pins.md new file mode 100644 index 0000000000..0df248698c --- /dev/null +++ b/docs/api/sections/pins.md @@ -0,0 +1,74 @@ +# Pins + +Pins let users keep quick access to important cards. + +## `POST /:account_slug/cards/:card_number/pin` + +Pins a card for the current user. + +__Response:__ + +Returns `204 No Content` on success. + +## `DELETE /:account_slug/cards/:card_number/pin` + +Unpins a card for the current user. + +__Response:__ + +Returns `204 No Content` on success. + +## `GET /my/pins` + +Returns the current user's pinned cards. This endpoint is not paginated and returns up to 100 cards. + +__Response:__ + +```json +[ + { + "id": "03f5vaeq985jlvwv3arl4srq2", + "number": 1, + "title": "First!", + "status": "published", + "description": "Hello, World!", + "description_html": "

Hello, World!

", + "image_url": null, + "has_attachments": false, + "tags": ["programming"], + "golden": false, + "last_active_at": "2025-12-05T19:38:48.553Z", + "created_at": "2025-12-05T19:38:48.540Z", + "url": "http://fizzy.localhost:3006/897362094/cards/4", + "board": { + "id": "03f5v9zkft4hj9qq0lsn9ohcm", + "name": "Fizzy", + "all_access": true, + "created_at": "2025-12-05T19:36:35.534Z", + "auto_postpone_period_in_days": 30, + "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", + "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar" + } + }, + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", + "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar" + }, + "comments_url": "http://fizzy.localhost:3006/897362094/cards/4/comments" + } +] +``` diff --git a/docs/api/sections/reactions.md b/docs/api/sections/reactions.md new file mode 100644 index 0000000000..7ad7b57299 --- /dev/null +++ b/docs/api/sections/reactions.md @@ -0,0 +1,119 @@ +# Reactions + +## Card Reactions (Boosts) + +Card reactions (also called "boosts") let users add short responses directly to cards. These are limited to 16 characters. + +## `GET /:account_slug/cards/:card_number/reactions` + +Returns a list of reactions on a card. + +__Response:__ + +```json +[ + { + "id": "03f5v9zo9qlcwwpyc0ascnikz", + "content": "👍", + "reacter": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + }, + "url": "http://fizzy.localhost:3006/897362094/cards/3/reactions/03f5v9zo9qlcwwpyc0ascnikz" + } +] +``` + +## `POST /:account_slug/cards/:card_number/reactions` + +Adds a reaction (boost) to a card. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `content` | string | Yes | The reaction text (max 16 characters) | + +__Request:__ + +```json +{ + "reaction": { + "content": "Great 👍" + } +} +``` + +__Response:__ + +Returns `201 Created` on success. + +## `DELETE /:account_slug/cards/:card_number/reactions/:reaction_id` + +Removes your reaction from a card. Only the reaction creator can remove their own reactions. + +__Response:__ + +Returns `204 No Content` on success. + +## Comment Reactions + +Reactions are short (16-character max) responses to comments. + +## `GET /:account_slug/cards/:card_number/comments/:comment_id/reactions` + +Returns a list of reactions on a comment. + +__Response:__ + +```json +[ + { + "id": "03f5v9zo9qlcwwpyc0ascnikz", + "content": "👍", + "reacter": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + }, + "url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions/03f5v9zo9qlcwwpyc0ascnikz" + } +] +``` + +## `POST /:account_slug/cards/:card_number/comments/:comment_id/reactions` + +Adds a reaction to a comment. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `content` | string | Yes | The reaction text | + +__Request:__ + +```json +{ + "reaction": { + "content": "Great 👍" + } +} +``` + +__Response:__ + +Returns `201 Created` on success. + +## `DELETE /:account_slug/cards/:card_number/comments/:comment_id/reactions/:reaction_id` + +Removes your reaction from a comment. + +__Response:__ + +Returns `204 No Content` on success. diff --git a/docs/api/sections/rich_text.md b/docs/api/sections/rich_text.md new file mode 100644 index 0000000000..18cbb28f72 --- /dev/null +++ b/docs/api/sections/rich_text.md @@ -0,0 +1,86 @@ +# Rich Text Fields + +Some fields accept rich text content. These fields accept HTML input, which will be sanitized to remove unsafe tags and attributes. + +```json +{ + "card": { + "title": "My card", + "description": "

This is bold and this is italic.

  • Item 1
  • Item 2
" + } +} +``` + +## Attaching files to rich text + +To attach files (images, documents) to rich text fields, use ActionText's direct upload flow: + +### 1. Create a direct upload + +First, request a direct upload URL by sending file metadata: + +```bash +curl -X POST \ + -H "Authorization: Bearer put-your-access-token-here" \ + -H "Content-Type: application/json" \ + -d '{ + "blob": { + "filename": "screenshot.png", + "byte_size": 12345, + "checksum": "GQ5SqLsM7ylnji0Wgd9wNA==", + "content_type": "image/png" + } + }' \ + https://app.fizzy.do/123456/rails/active_storage/direct_uploads +``` + +The `checksum` is a Base64-encoded MD5 hash of the file content. +The direct upload endpoint is scoped to your account (replace `/123456` with your account slug). + +__Response:__ + +```json +{ + "id": "abc123", + "key": "abc123def456", + "filename": "screenshot.png", + "content_type": "image/png", + "byte_size": 12345, + "checksum": "GQ5SqLsM7ylnji0Wgd9wNA==", + "direct_upload": { + "url": "https://storage.example.com/...", + "headers": { + "Content-Type": "image/png", + "Content-MD5": "GQ5SqLsM7ylnji0Wgd9wNA==" + } + }, + "signed_id": "eyJfcmFpbHMi..." +} +``` + +### 2. Upload the file + +Upload the file directly to the provided URL with the specified headers: + +```bash +curl -X PUT \ + -H "Content-Type: image/png" \ + -H "Content-MD5: GQ5SqLsM7ylnji0Wgd9wNA==" \ + --data-binary @screenshot.png \ + "https://storage.example.com/..." +``` + +### 3. Reference the file in rich text + +Use the `signed_id` from step 1 to embed the file in your rich text using an `` tag: + +```json +{ + "card": { + "title": "Card with image", + "description": "

Here's a screenshot:

" + } +} +``` + +The `sgid` attribute should contain the `signed_id` returned from the direct upload response. diff --git a/docs/api/sections/steps.md b/docs/api/sections/steps.md new file mode 100644 index 0000000000..668957d37c --- /dev/null +++ b/docs/api/sections/steps.md @@ -0,0 +1,71 @@ +# Steps + +Steps are to-do items on a card. + +## `GET /:account_slug/cards/:card_number/steps/:step_id` + +Returns a specific step. + +__Response:__ + +```json +{ + "id": "03f5v9zo9qlcwwpyc0ascnikz", + "content": "Write tests", + "completed": false +} +``` + +## `POST /:account_slug/cards/:card_number/steps` + +Creates a new step on a card. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `content` | string | Yes | The step text | +| `completed` | boolean | No | Whether the step is completed (default: `false`) | + +__Request:__ + +```json +{ + "step": { + "content": "Write tests" + } +} +``` + +__Response:__ + +Returns `201 Created` with a `Location` header pointing to the new step. + +## `PUT /:account_slug/cards/:card_number/steps/:step_id` + +Updates a step. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `content` | string | No | The step text | +| `completed` | boolean | No | Whether the step is completed | + +__Request:__ + +```json +{ + "step": { + "completed": true + } +} +``` + +__Response:__ + +Returns the updated step. + +## `DELETE /:account_slug/cards/:card_number/steps/:step_id` + +Deletes a step. + +__Response:__ + +Returns `204 No Content` on success. diff --git a/docs/api/sections/tags.md b/docs/api/sections/tags.md new file mode 100644 index 0000000000..4e18163418 --- /dev/null +++ b/docs/api/sections/tags.md @@ -0,0 +1,26 @@ +# Tags + +Tags are labels that can be applied to cards for organization and filtering. + +## `GET /:account_slug/tags` + +Returns a list of all tags in the account, sorted alphabetically. + +__Response:__ + +```json +[ + { + "id": "03f5v9zo9qlcwwpyc0ascnikz", + "title": "bug", + "created_at": "2025-12-05T19:36:35.534Z", + "url": "http://fizzy.localhost:3006/897362094/cards?tag_ids[]=03f5v9zo9qlcwwpyc0ascnikz" + }, + { + "id": "03f5v9zo9qlcwwpyc0ascnilz", + "title": "feature", + "created_at": "2025-12-05T19:36:35.534Z", + "url": "http://fizzy.localhost:3006/897362094/cards?tag_ids[]=03f5v9zo9qlcwwpyc0ascnilz" + } +] +``` diff --git a/docs/api/sections/users.md b/docs/api/sections/users.md new file mode 100644 index 0000000000..1bd939fc01 --- /dev/null +++ b/docs/api/sections/users.md @@ -0,0 +1,99 @@ +# Users + +Users represent people who have access to an account. + +## `GET /:account_slug/users` + +Returns a list of active users in the account. + +__Response:__ + +```json +[ + { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + }, + { + "id": "03f5v9zjysoy0fqs9yg0ei3hq", + "name": "Jason Fried", + "role": "member", + "active": true, + "email_address": "jason@example.com", + "created_at": "2025-12-05T19:36:35.419Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjysoy0fqs9yg0ei3hq" + }, + { + "id": "03f5v9zk1dtqduod5bkhv3k8m", + "name": "Jason Zimdars", + "role": "member", + "active": true, + "email_address": "jz@example.com", + "created_at": "2025-12-05T19:36:35.435Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zk1dtqduod5bkhv3k8m" + }, + { + "id": "03f5v9zk3nw9ja92e7s4h2wbe", + "name": "Kevin Mcconnell", + "role": "member", + "active": true, + "email_address": "kevin@example.com", + "created_at": "2025-12-05T19:36:35.451Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zk3nw9ja92e7s4h2wbe" + } +] +``` + +## `GET /:account_slug/users/:user_id` + +Returns the specified user. + +__Response:__ + +```json +{ + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" +} +``` + +## `PUT /:account_slug/users/:user_id` + +Updates a user. You can only update users you have permission to change. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `name` | string | No | The user's display name | +| `avatar` | file | No | The user's avatar image | + +__Request:__ + +```json +{ + "user": { + "name": "David H. Hansson" + } +} +``` + +__Response:__ + +Returns `204 No Content` on success. + +## `DELETE /:account_slug/users/:user_id` + +Deactivates a user. You can only deactivate users you have permission to change. + +__Response:__ + +Returns `204 No Content` on success. diff --git a/docs/api/sections/webhooks.md b/docs/api/sections/webhooks.md new file mode 100644 index 0000000000..e06a027080 --- /dev/null +++ b/docs/api/sections/webhooks.md @@ -0,0 +1,117 @@ +# Webhooks + +Webhooks notify another application when something happens on a board. Only account admins can list, view, create, update, delete, or reactivate webhooks. + +## `GET /:account_slug/boards/:board_id/webhooks` + +Returns a paginated list of webhooks for a board. + +__Response:__ + +```json +[ + { + "id": "03f5v9zkft4hj9qq0lsn9ohcm", + "name": "Production API", + "payload_url": "https://api.example.com/webhooks", + "active": true, + "signing_secret": "p94Bx2HjempCdYB4DTyZkY1b", + "subscribed_actions": ["card_published", "card_assigned", "card_closed"], + "created_at": "2025-12-05T19:36:35.534Z", + "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy/webhooks/03f5v9zkft4hj9qq0lsn9ohcm", + "board": { + "id": "03f5v9zkft4hj9qq0lsn9ohcy", + "name": "Fizzy", + "all_access": true, + "created_at": "2025-12-05T19:36:35.534Z", + "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy", + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + } + } + } +] +``` + +## `GET /:account_slug/boards/:board_id/webhooks/:id` + +Returns a single webhook. + +__Response:__ + +Returns the same webhook shape shown above. + +## `POST /:account_slug/boards/:board_id/webhooks` + +Creates a webhook. + +__Request:__ + +```json +{ + "webhook": { + "name": "Production API", + "url": "https://api.example.com/webhooks", + "subscribed_actions": ["card_published", "card_assigned", "card_closed"] + } +} +``` + +`subscribed_actions` accepts any of: +`card_assigned`, `card_closed`, `card_postponed`, `card_auto_postponed`, `card_board_changed`, `card_published`, `card_reopened`, `card_sent_back_to_triage`, `card_triaged`, `card_unassigned`, `comment_created` + +__Response:__ + +``` +HTTP/1.1 201 Created +Location: http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy/webhooks/03f5v9zkft4hj9qq0lsn9ohcm.json +``` + +Returns the created webhook in the response body. + +## `PATCH /:account_slug/boards/:board_id/webhooks/:id` + +Updates a webhook. + +__Request:__ + +```json +{ + "webhook": { + "name": "Production API", + "subscribed_actions": ["card_closed"] + } +} +``` + +The `url` is immutable after creation and is ignored on update. + +__Response:__ + +Returns the updated webhook. + +## `DELETE /:account_slug/boards/:board_id/webhooks/:id` + +Deletes a webhook. + +__Response:__ + +Returns `204 No Content` on success. + +## `POST /:account_slug/boards/:board_id/webhooks/:id/activation` + +Reactivates a deactivated webhook. + +__Response:__ + +``` +HTTP/1.1 201 Created +``` + +Returns the reactivated webhook in the response body. From adc1b02d7a48a3d2881777a8235e0f8eebfcd4d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 10:08:59 -0700 Subject: [PATCH 006/129] Bump thruster from 0.1.19 to 0.1.20 (#2797) * Bump thruster from 0.1.19 to 0.1.20 Bumps [thruster](https://github.com/basecamp/thruster) from 0.1.19 to 0.1.20. - [Changelog](https://github.com/basecamp/thruster/blob/v0.1.20/CHANGELOG.md) - [Commits](https://github.com/basecamp/thruster/compare/v0.1.19...v0.1.20) --- updated-dependencies: - dependency-name: thruster dependency-version: 0.1.20 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Sync Gemfile.saas.lock --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] --- Gemfile.lock | 10 +++++----- Gemfile.saas.lock | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 354984d3cd..0ef621a691 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -456,11 +456,11 @@ GEM railties (>= 6.0.0) stringio (3.2.0) thor (1.5.0) - thruster (0.1.19) - thruster (0.1.19-aarch64-linux) - thruster (0.1.19-arm64-darwin) - thruster (0.1.19-x86_64-darwin) - thruster (0.1.19-x86_64-linux) + thruster (0.1.20) + thruster (0.1.20-aarch64-linux) + thruster (0.1.20-arm64-darwin) + thruster (0.1.20-x86_64-darwin) + thruster (0.1.20-x86_64-linux) timeout (0.6.0) trilogy (2.10.0) bigdecimal diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index f5bc0bb20b..64f81b34f5 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -627,11 +627,11 @@ GEM railties (>= 6.0.0) stringio (3.2.0) thor (1.5.0) - thruster (0.1.19) - thruster (0.1.19-aarch64-linux) - thruster (0.1.19-arm64-darwin) - thruster (0.1.19-x86_64-darwin) - thruster (0.1.19-x86_64-linux) + thruster (0.1.20) + thruster (0.1.20-aarch64-linux) + thruster (0.1.20-arm64-darwin) + thruster (0.1.20-x86_64-darwin) + thruster (0.1.20-x86_64-linux) timeout (0.6.0) trilogy (2.10.0) bigdecimal From dc6139a75ec8298d6e00bc8a423fd38216d5e9ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 10:09:30 -0700 Subject: [PATCH 007/129] Bump sigstore/cosign-installer in the github-actions group (#2795) Bumps the github-actions group with 1 update: [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer). Updates `sigstore/cosign-installer` from 4.1.0 to 4.1.1 - [Release notes](https://github.com/sigstore/cosign-installer/releases) - [Commits](https://github.com/sigstore/cosign-installer/compare/ba7bc0a3fef59531c69a25acd34668d6d3fe6f22...cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003) --- updated-dependencies: - dependency-name: sigstore/cosign-installer dependency-version: 4.1.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/publish-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index dfbb70246d..41d4a9a385 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -190,7 +190,7 @@ jobs: done <<< "$tags" - name: Install Cosign - uses: sigstore/cosign-installer@ba7bc0a3fef59531c69a25acd34668d6d3fe6f22 # v4.1.0 + uses: sigstore/cosign-installer@cad07c2e89fa2edd6e2d7bab4c1aa38e53f76003 # v4.1.1 - name: Cosign sign all tags (keyless OIDC) shell: bash From b2021e1e744e0070d9fc8f18bb709feef8399ae1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 10:09:41 -0700 Subject: [PATCH 008/129] Bump trilogy from 2.10.0 to 2.11.1 (#2794) * Bump trilogy from 2.10.0 to 2.11.1 Bumps [trilogy](https://github.com/trilogy-libraries/trilogy) from 2.10.0 to 2.11.1. - [Release notes](https://github.com/trilogy-libraries/trilogy/releases) - [Changelog](https://github.com/trilogy-libraries/trilogy/blob/main/CHANGELOG.md) - [Commits](https://github.com/trilogy-libraries/trilogy/compare/v2.10.0...v2.11.1) --- updated-dependencies: - dependency-name: trilogy dependency-version: 2.11.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Sync Gemfile.saas.lock --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- Gemfile.saas.lock | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 6b012e96d5..2ef5295a6f 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,7 @@ gem "solid_cache", "~> 1.0" gem "solid_queue", "~> 1.3" gem "sqlite3", ">= 2.0" gem "thruster", require: false -gem "trilogy", "~> 2.10" +gem "trilogy", "~> 2.11" # Features gem "bcrypt", "~> 3.1.22" diff --git a/Gemfile.lock b/Gemfile.lock index 0ef621a691..e5ce67808d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -462,7 +462,7 @@ GEM thruster (0.1.20-x86_64-darwin) thruster (0.1.20-x86_64-linux) timeout (0.6.0) - trilogy (2.10.0) + trilogy (2.11.1) bigdecimal tsort (0.2.0) tzinfo (2.0.6) @@ -539,7 +539,7 @@ DEPENDENCIES stackprof stimulus-rails thruster - trilogy (~> 2.10) + trilogy (~> 2.11) turbo-rails! useragent! vcr diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index 64f81b34f5..9e43090e12 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -633,7 +633,7 @@ GEM thruster (0.1.20-x86_64-darwin) thruster (0.1.20-x86_64-linux) timeout (0.6.0) - trilogy (2.10.0) + trilogy (2.11.1) bigdecimal tsort (0.2.0) tzinfo (2.0.6) From f3bacffe2bd3eba4a6295dc7f10822670545d18c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Apr 2026 11:36:12 -0700 Subject: [PATCH 009/129] Bump lexxy from 0.9.0.beta to 0.9.1.beta (#2796) * Bump lexxy from 0.9.0.beta to 0.9.1.beta Bumps [lexxy](https://github.com/basecamp/lexxy) from 0.9.0.beta to 0.9.1.beta. - [Release notes](https://github.com/basecamp/lexxy/releases) - [Commits](https://github.com/basecamp/lexxy/compare/v0.9.0.beta...v0.9.1.beta) --- updated-dependencies: - dependency-name: lexxy dependency-version: 0.9.1.beta dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Sync Gemfile.saas.lock --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] --- Gemfile | 2 +- Gemfile.lock | 14 +++++++------- Gemfile.saas.lock | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Gemfile b/Gemfile index 2ef5295a6f..4200deb313 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,7 @@ gem "geared_pagination", "~> 1.2" gem "rqrcode" gem "rouge" gem "jbuilder" -gem "lexxy", "0.9.0.beta" +gem "lexxy", "0.9.2.beta" gem "image_processing", "~> 1.14" gem "platform_agent" gem "aws-sdk-s3", require: false diff --git a/Gemfile.lock b/Gemfile.lock index e5ce67808d..686d8f2455 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -156,7 +156,7 @@ GEM bcrypt (3.1.22) bcrypt_pbkdf (1.1.2) benchmark (0.5.0) - bigdecimal (4.1.0) + bigdecimal (4.1.1) bindex (0.8.1) bootsnap (1.23.0) msgpack (~> 1.2) @@ -254,7 +254,7 @@ GEM logger (~> 1.6) letter_opener (1.10.0) launchy (>= 2.2, < 4) - lexxy (0.9.0.beta) + lexxy (0.9.2.beta) rails (>= 8.0.2) lint_roller (1.1.0) logger (1.7.0) @@ -272,7 +272,7 @@ GEM mini_magick (5.3.1) logger mini_mime (1.1.5) - minitest (6.0.2) + minitest (6.0.3) drb (~> 2.0) prism (~> 1.5) mission_control-jobs (1.1.0) @@ -347,10 +347,10 @@ GEM nio4r (~> 2.0) raabro (1.4.0) racc (1.8.1) - rack (3.2.5) + rack (3.2.6) rack-mini-profiler (4.0.1) rack (>= 1.2.0) - rack-session (2.1.1) + rack-session (2.1.2) base64 (>= 0.1.0) rack (>= 3.0.0) rack-test (2.2.0) @@ -461,7 +461,7 @@ GEM thruster (0.1.20-arm64-darwin) thruster (0.1.20-x86_64-darwin) thruster (0.1.20-x86_64-linux) - timeout (0.6.0) + timeout (0.6.1) trilogy (2.11.1) bigdecimal tsort (0.2.0) @@ -518,7 +518,7 @@ DEPENDENCIES jbuilder kamal letter_opener - lexxy (= 0.9.0.beta) + lexxy (= 0.9.2.beta) mission_control-jobs mittens mocha diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index 9e43090e12..ea51835f65 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -246,7 +246,7 @@ GEM bcrypt (3.1.22) bcrypt_pbkdf (1.1.2) benchmark (0.5.0) - bigdecimal (4.1.0) + bigdecimal (4.1.1) bindex (0.8.1) bootsnap (1.23.0) msgpack (~> 1.2) @@ -367,7 +367,7 @@ GEM logger (~> 1.6) letter_opener (1.10.0) launchy (>= 2.2, < 4) - lexxy (0.9.0.beta) + lexxy (0.9.2.beta) rails (>= 8.0.2) lint_roller (1.1.0) logger (1.7.0) @@ -385,7 +385,7 @@ GEM mini_magick (5.3.1) logger mini_mime (1.1.5) - minitest (6.0.2) + minitest (6.0.3) drb (~> 2.0) prism (~> 1.5) mission_control-jobs (1.1.0) @@ -499,10 +499,10 @@ GEM nio4r (~> 2.0) raabro (1.4.0) racc (1.8.1) - rack (3.2.5) + rack (3.2.6) rack-mini-profiler (4.0.1) rack (>= 1.2.0) - rack-session (2.1.1) + rack-session (2.1.2) base64 (>= 0.1.0) rack (>= 3.0.0) rack-test (2.2.0) @@ -632,7 +632,7 @@ GEM thruster (0.1.20-arm64-darwin) thruster (0.1.20-x86_64-darwin) thruster (0.1.20-x86_64-linux) - timeout (0.6.0) + timeout (0.6.1) trilogy (2.11.1) bigdecimal tsort (0.2.0) From 21981898d28b48be36a01585f8dd757a886c7d4d Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Tue, 7 Apr 2026 15:08:27 -0400 Subject: [PATCH 010/129] Add JSON API for webhook deliveries (#2785) * Add JSON API for webhook deliveries * Extract sanitized_request method on Webhook::Delivery * Extract response_summary method on Webhook::Delivery --- .../webhooks/deliveries_controller.rb | 19 ++++ app/models/webhook/delivery.rb | 12 +++ .../deliveries/_delivery.json.jbuilder | 10 +++ .../webhooks/deliveries/_event.json.jbuilder | 15 ++++ .../webhooks/deliveries/index.json.jbuilder | 1 + config/routes.rb | 1 + docs/api/sections/webhooks.md | 44 +++++++++ .../webhooks/deliveries_controller_test.rb | 90 +++++++++++++++++++ test/models/webhook/delivery_test.rb | 39 ++++++++ 9 files changed, 231 insertions(+) create mode 100644 app/controllers/webhooks/deliveries_controller.rb create mode 100644 app/views/webhooks/deliveries/_delivery.json.jbuilder create mode 100644 app/views/webhooks/deliveries/_event.json.jbuilder create mode 100644 app/views/webhooks/deliveries/index.json.jbuilder create mode 100644 test/controllers/webhooks/deliveries_controller_test.rb diff --git a/app/controllers/webhooks/deliveries_controller.rb b/app/controllers/webhooks/deliveries_controller.rb new file mode 100644 index 0000000000..551e5ae76a --- /dev/null +++ b/app/controllers/webhooks/deliveries_controller.rb @@ -0,0 +1,19 @@ +class Webhooks::DeliveriesController < ApplicationController + include BoardScoped + + before_action :ensure_admin + before_action :set_webhook + + def index + respond_to do |format| + format.json do + set_page_and_extract_portion_from @webhook.deliveries.ordered.includes(event: [ :creator, { eventable: :card } ]) + end + end + end + + private + def set_webhook + @webhook = @board.webhooks.find(params[:webhook_id]) + end +end diff --git a/app/models/webhook/delivery.rb b/app/models/webhook/delivery.rb index 40dab42f00..952aab1288 100644 --- a/app/models/webhook/delivery.rb +++ b/app/models/webhook/delivery.rb @@ -44,6 +44,18 @@ def deliver raise end + def sanitized_request + if headers = request&.dig("headers")&.except("X-Webhook-Signature") + { headers: headers } + end + end + + def response_summary + if response.present? + { code: response[:code], error: response[:error] } + end + end + def failed? (errored? || completed?) && !succeeded? end diff --git a/app/views/webhooks/deliveries/_delivery.json.jbuilder b/app/views/webhooks/deliveries/_delivery.json.jbuilder new file mode 100644 index 0000000000..0fa8d92b3a --- /dev/null +++ b/app/views/webhooks/deliveries/_delivery.json.jbuilder @@ -0,0 +1,10 @@ +json.cache! delivery do + json.(delivery, :id, :state) + json.created_at delivery.created_at.utc + json.updated_at delivery.updated_at.utc + + json.request delivery.sanitized_request + json.response delivery.response_summary + + json.event delivery.event, partial: "webhooks/deliveries/event", as: :event +end diff --git a/app/views/webhooks/deliveries/_event.json.jbuilder b/app/views/webhooks/deliveries/_event.json.jbuilder new file mode 100644 index 0000000000..311a736910 --- /dev/null +++ b/app/views/webhooks/deliveries/_event.json.jbuilder @@ -0,0 +1,15 @@ +json.cache! [ event, event.creator, event.eventable ] do + json.(event, :id, :action) + json.created_at event.created_at.utc + + json.creator do + json.id event.creator_id + json.name event.creator.name + end + + json.eventable do + json.type event.eventable_type + json.id event.eventable_id + json.url polymorphic_url(event.eventable) + end +end diff --git a/app/views/webhooks/deliveries/index.json.jbuilder b/app/views/webhooks/deliveries/index.json.jbuilder new file mode 100644 index 0000000000..8df50813b4 --- /dev/null +++ b/app/views/webhooks/deliveries/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @page.records, partial: "webhooks/deliveries/delivery", as: :delivery diff --git a/config/routes.rb b/config/routes.rb index a21a0c4575..d3eb300d07 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -46,6 +46,7 @@ resources :webhooks do scope module: :webhooks do resource :activation, only: :create + resources :deliveries, only: :index, defaults: { format: :json } end end end diff --git a/docs/api/sections/webhooks.md b/docs/api/sections/webhooks.md index e06a027080..28eedfea7a 100644 --- a/docs/api/sections/webhooks.md +++ b/docs/api/sections/webhooks.md @@ -115,3 +115,47 @@ HTTP/1.1 201 Created ``` Returns the reactivated webhook in the response body. + +## `GET /:account_slug/boards/:board_id/webhooks/:webhook_id/deliveries` + +Returns a paginated list of deliveries for a webhook. Only account admins can access delivery history. + +__Response:__ + +```json +[ + { + "id": "03f5v9zkft4hj9qq0lsn9ohdn", + "state": "completed", + "created_at": "2025-12-05T19:36:35.534Z", + "updated_at": "2025-12-05T19:36:36.102Z", + "request": { + "headers": { + "User-Agent": "fizzy/1.0.0 Webhook", + "Content-Type": "application/json", + "X-Webhook-Timestamp": "2025-12-05T19:36:35.401Z" + } + }, + "response": { + "code": 200, + "error": null + }, + "event": { + "id": "03f5v9zkft4hj9qq0lsn9ohde", + "action": "card_closed", + "created_at": "2025-12-05T19:36:35.401Z", + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson" + }, + "eventable": { + "type": "Card", + "id": "03f5v9zkft4hj9qq0lsn9ohdb", + "url": "http://fizzy.localhost:3006/897362094/cards/1" + } + } + } +] +``` + +`request` and `response` can be `null` for deliveries that have not started yet or are still in progress. The delivery request headers omit the `X-Webhook-Signature` header. diff --git a/test/controllers/webhooks/deliveries_controller_test.rb b/test/controllers/webhooks/deliveries_controller_test.rb new file mode 100644 index 0000000000..49b167e6d7 --- /dev/null +++ b/test/controllers/webhooks/deliveries_controller_test.rb @@ -0,0 +1,90 @@ +require "test_helper" + +class Webhooks::DeliveriesControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in_as :kevin + end + + test "index as JSON" do + webhook = webhooks(:active) + delivery = webhook_deliveries(:successfully_completed) + webhook_timestamp = delivery.event.created_at.utc.iso8601 + delivery.update!( + request: { + headers: { + "User-Agent" => "fizzy/1.0.0 Webhook", + "Content-Type" => "application/json", + "X-Webhook-Signature" => "super-secret-signature", + "X-Webhook-Timestamp" => webhook_timestamp + } + }, + response: { code: 200 } + ) + + get board_webhook_deliveries_path(webhook.board, webhook), as: :json + + assert_response :success + assert_kind_of Array, @response.parsed_body + assert_equal webhook.deliveries.count, @response.parsed_body.count + assert_equal webhook.deliveries.ordered.pluck(:id), @response.parsed_body.pluck("id") + + completed_delivery = @response.parsed_body.find { |record| record["id"] == delivery.id } + + assert_equal "completed", completed_delivery["state"] + assert_equal delivery.created_at.utc.iso8601(3), completed_delivery["created_at"] + assert_equal delivery.updated_at.utc.iso8601(3), completed_delivery["updated_at"] + assert_equal "fizzy/1.0.0 Webhook", completed_delivery.dig("request", "headers", "User-Agent") + assert_equal "application/json", completed_delivery.dig("request", "headers", "Content-Type") + assert_equal webhook_timestamp, completed_delivery.dig("request", "headers", "X-Webhook-Timestamp") + assert_not completed_delivery.dig("request", "headers").key?("X-Webhook-Signature") + assert_equal 200, completed_delivery.dig("response", "code") + assert_nil completed_delivery.dig("response", "error") + assert_equal delivery.event.id, completed_delivery.dig("event", "id") + assert_equal delivery.event.action, completed_delivery.dig("event", "action") + assert_equal delivery.event.created_at.utc.iso8601(3), completed_delivery.dig("event", "created_at") + assert_equal delivery.event.creator_id, completed_delivery.dig("event", "creator", "id") + assert_equal delivery.event.creator.name, completed_delivery.dig("event", "creator", "name") + assert_equal delivery.event.eventable_type, completed_delivery.dig("event", "eventable", "type") + assert_equal delivery.event.eventable_id, completed_delivery.dig("event", "eventable", "id") + assert_equal polymorphic_url(delivery.event.eventable), completed_delivery.dig("event", "eventable", "url") + + pending_delivery = @response.parsed_body.find { |record| record["id"] == webhook_deliveries(:pending).id } + assert_nil pending_delivery["request"] + assert_nil pending_delivery["response"] + end + + test "index defaults to JSON" do + webhook = webhooks(:active) + + get board_webhook_deliveries_path(webhook.board, webhook) + + assert_response :success + assert_equal "application/json; charset=utf-8", @response.headers["Content-Type"] + end + + test "index rejects HTML" do + webhook = webhooks(:active) + + get board_webhook_deliveries_path(webhook.board, webhook, format: :html) + + assert_response :not_acceptable + end + + test "non-admin cannot access deliveries as JSON" do + logout_and_sign_in_as :jz + webhook = webhooks(:active) + + get board_webhook_deliveries_path(webhook.board, webhook), as: :json + + assert_response :forbidden + end + + test "cannot access deliveries on board without access as JSON" do + logout_and_sign_in_as :jason + webhook = webhooks(:inactive) + + get board_webhook_deliveries_path(webhook.board, webhook), as: :json + + assert_response :not_found + end +end diff --git a/test/models/webhook/delivery_test.rb b/test/models/webhook/delivery_test.rb index 8d40c44178..5c63bc5959 100644 --- a/test/models/webhook/delivery_test.rb +++ b/test/models/webhook/delivery_test.rb @@ -45,6 +45,45 @@ class Webhook::DeliveryTest < ActiveSupport::TestCase assert_not delivery.succeeded?, "the response can't have an error" end + test "sanitized_request strips signature header" do + delivery = webhook_deliveries(:successfully_completed) + delivery.update!(request: { + headers: { + "User-Agent" => "fizzy/1.0.0 Webhook", + "Content-Type" => "application/json", + "X-Webhook-Signature" => "super-secret-signature", + "X-Webhook-Timestamp" => "2025-12-05T19:36:35.401Z" + } + }) + + result = delivery.sanitized_request + assert_equal %w[ User-Agent Content-Type X-Webhook-Timestamp ], result[:headers].keys + assert_not result[:headers].key?("X-Webhook-Signature") + end + + test "sanitized_request returns nil when request is blank" do + delivery = webhook_deliveries(:pending) + delivery.update_columns(request: nil) + + assert_nil delivery.sanitized_request + end + + test "response_summary returns code and error" do + delivery = webhook_deliveries(:successfully_completed) + delivery.update!(response: { code: 200, error: nil }) + + result = delivery.response_summary + assert_equal 200, result[:code] + assert_nil result[:error] + end + + test "response_summary returns nil when response is blank" do + delivery = webhook_deliveries(:pending) + delivery.update_columns(response: nil) + + assert_nil delivery.response_summary + end + test "deliver_later" do delivery = webhook_deliveries(:pending) From 98b6bdcfb715a16c3d7538fe18b3c79cb67f5166 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Tue, 7 Apr 2026 15:56:43 -0400 Subject: [PATCH 011/129] Document undocumented API endpoints (#2805) * Document avatar removal API endpoint * Document notification settings API endpoints * Document access token list and delete API endpoints * Document join code API endpoints * Fix access token delete URL parameter name in docs --- docs/api/sections/account.md | 48 +++++++++++++++++++++++++++++ docs/api/sections/authentication.md | 38 +++++++++++++++++++++++ docs/api/sections/notifications.md | 36 ++++++++++++++++++++++ docs/api/sections/users.md | 8 +++++ 4 files changed, 130 insertions(+) diff --git a/docs/api/sections/account.md b/docs/api/sections/account.md index 2b1a9a4f55..5db4e776ea 100644 --- a/docs/api/sections/account.md +++ b/docs/api/sections/account.md @@ -18,6 +18,54 @@ __Response:__ The `auto_postpone_period_in_days` is the account-level default in days (e.g. `30`). Cards are automatically moved to "Not Now" after this period of inactivity. Each board can override this with its own value. +## `GET /account/join_code` + +Returns the account's join code for inviting new users. The join code URL can be shared with people to let them join the account. + +__Response:__ + +```json +{ + "code": "abc123", + "usage_count": 3, + "usage_limit": 10, + "url": "http://fizzy.localhost:3006/897362094/join/abc123", + "active": true +} +``` + +A join code is `active` when `usage_count` is less than `usage_limit`. + +## `PUT /account/join_code` + +Updates the join code's usage limit. Requires admin role. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `usage_limit` | integer | Yes | Maximum number of times the join code can be used | + +__Request:__ + +```json +{ + "account_join_code": { + "usage_limit": 10 + } +} +``` + +__Response:__ + +Returns `204 No Content` on success. + +## `DELETE /account/join_code` + +Resets the join code, generating a new one and invalidating the old code. Requires admin role. + +__Response:__ + +Returns `204 No Content` on success. + ## `PUT /account/entropy` Updates the account-level default auto close period. Requires admin role. diff --git a/docs/api/sections/authentication.md b/docs/api/sections/authentication.md index 1030597b35..f06ea6e882 100644 --- a/docs/api/sections/authentication.md +++ b/docs/api/sections/authentication.md @@ -170,3 +170,41 @@ HTTP/1.1 201 Created ``` Store the `token` value securely — it won't be retrievable again. Use it as a Bearer token for subsequent API requests. + +### List access tokens + +Returns all access tokens for the authenticated identity. + +```bash +curl -H "Authorization: Bearer put-your-access-token-here" \ + -H "Accept: application/json" \ + https://app.fizzy.do/my/access_tokens +``` + +__Response:__ + +```json +[ + { + "id": "03f5v9zo9qlcwwpyc0ascnikz", + "description": "Fizzy CLI", + "permission": "write", + "created_at": "2025-12-05T19:36:35.534Z" + } +] +``` + +Note: The raw token value is only returned once at creation time and cannot be retrieved again. + +### Delete an access token + +```bash +curl -X DELETE \ + -H "Authorization: Bearer put-your-access-token-here" \ + -H "Accept: application/json" \ + https://app.fizzy.do/my/access_tokens/:id +``` + +__Response:__ + +Returns `204 No Content` on success. diff --git a/docs/api/sections/notifications.md b/docs/api/sections/notifications.md index 891d3a86af..9a4bdd562d 100644 --- a/docs/api/sections/notifications.md +++ b/docs/api/sections/notifications.md @@ -60,3 +60,39 @@ Marks all unread notifications as read. __Response:__ Returns `204 No Content` on success. + +## `GET /:account_slug/notifications/settings` + +Returns the current user's notification settings. + +__Response:__ + +```json +{ + "bundle_email_frequency": "every_few_hours" +} +``` + +Possible values for `bundle_email_frequency`: `never`, `every_few_hours`, `daily`, `weekly`. + +## `PUT /:account_slug/notifications/settings` + +Updates the current user's notification settings. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `bundle_email_frequency` | string | Yes | How often to bundle notification emails. One of: `never`, `every_few_hours`, `daily`, `weekly` | + +__Request:__ + +```json +{ + "user_settings": { + "bundle_email_frequency": "daily" + } +} +``` + +__Response:__ + +Returns `204 No Content` on success. diff --git a/docs/api/sections/users.md b/docs/api/sections/users.md index 1bd939fc01..cbbed314cb 100644 --- a/docs/api/sections/users.md +++ b/docs/api/sections/users.md @@ -90,6 +90,14 @@ __Response:__ Returns `204 No Content` on success. +## `DELETE /:account_slug/users/:user_id/avatar` + +Removes the user's avatar image. You can only remove avatars for users you have permission to change. + +__Response:__ + +Returns `204 No Content` on success. + ## `DELETE /:account_slug/users/:user_id` Deactivates a user. You can only deactivate users you have permission to change. From 8201c2a4bdd36e5b0fde642aaadbc213013b6fca Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Wed, 8 Apr 2026 08:17:24 -0400 Subject: [PATCH 012/129] Add JSON API support for user data exports (#2786) --- .../users/data_exports_controller.rb | 16 +++- .../users/data_exports/show.json.jbuilder | 6 ++ docs/api/README.md | 1 + docs/api/sections/exports.md | 77 +++++++++++++++++ .../users/data_exports_controller_test.rb | 86 +++++++++++++++++++ 5 files changed, 183 insertions(+), 3 deletions(-) create mode 100644 app/views/users/data_exports/show.json.jbuilder create mode 100644 docs/api/sections/exports.md diff --git a/app/controllers/users/data_exports_controller.rb b/app/controllers/users/data_exports_controller.rb index 60df1e3265..8a3239b8f9 100644 --- a/app/controllers/users/data_exports_controller.rb +++ b/app/controllers/users/data_exports_controller.rb @@ -7,11 +7,20 @@ class Users::DataExportsController < ApplicationController CURRENT_EXPORT_LIMIT = 10 def show + respond_to do |format| + format.html + format.json { @export ? render(:show) : head(:not_found) } + end end def create - @user.data_exports.create!(account: Current.account).build_later - redirect_to @user, notice: "Export started. You'll receive an email when it's ready." + @export = @user.data_exports.create!(account: Current.account) + @export.build_later + + respond_to do |format| + format.html { redirect_to @user, notice: "Export started. You'll receive an email when it's ready." } + format.json { render :show, status: :created } + end end private @@ -28,6 +37,7 @@ def ensure_export_limit_not_exceeded end def set_export - @export = @user.data_exports.completed.find_by(id: params[:id]) + scope = request.format.json? ? @user.data_exports : @user.data_exports.completed + @export = scope.find_by(id: params[:id]) end end diff --git a/app/views/users/data_exports/show.json.jbuilder b/app/views/users/data_exports/show.json.jbuilder new file mode 100644 index 0000000000..2bd9e3d60a --- /dev/null +++ b/app/views/users/data_exports/show.json.jbuilder @@ -0,0 +1,6 @@ +json.(@export, :id, :status) +json.created_at @export.created_at.utc + +if @export.completed? && @export.file.attached? + json.download_url rails_blob_url(@export.file, disposition: "attachment") +end diff --git a/docs/api/README.md b/docs/api/README.md index 92d5fe2c2a..6c9e8b8d52 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -19,6 +19,7 @@ a bot to perform various actions for you. - [Users](sections/users.md) - [Notifications](sections/notifications.md) - [Rich Text](sections/rich_text.md) +- [Exports](sections/exports.md) - [Webhooks](sections/webhooks.md) ## Authentication diff --git a/docs/api/sections/exports.md b/docs/api/sections/exports.md new file mode 100644 index 0000000000..e6d2146760 --- /dev/null +++ b/docs/api/sections/exports.md @@ -0,0 +1,77 @@ +# Exports + +Exports are asynchronous jobs. Start an export with `POST`, then poll the export resource with `GET` until it reaches `completed`. When the export file is ready, the response includes a temporary `download_url`. + +Possible export statuses are: +- `pending` +- `processing` +- `completed` +- `failed` + +Completed export files expire after 24 hours. When that happens, request a new export. + +## `POST /account/exports` + +Starts an account export for the current account. Only account admins and owners can create account exports. + +__Response:__ + +Returns `201 Created` with the export object: + +```json +{ + "id": "03f8huu0sog76g3s97596abcd", + "status": "pending", + "created_at": "2026-04-02T12:34:56Z" +} +``` + +## `GET /account/exports/:id` + +Returns the status of an account export created by the current user. + +__Response:__ + +```json +{ + "id": "03f8huu0sog76g3s97596abcd", + "status": "completed", + "created_at": "2026-04-02T12:34:56Z", + "download_url": "https://app.fizzy.do/rails/active_storage/blobs/redirect/.../fizzy-account-export.zip" +} +``` + +The `download_url` field is only present when the export is completed and the export file is still available. Download requests still require normal authenticated access as the export owner. + +## `POST /:account_slug/users/:user_id/data_exports` + +Starts a personal data export for the current user. You can only create exports for your own user record. + +__Response:__ + +Returns `201 Created` with the export object: + +```json +{ + "id": "03f8huu0sog76g3s97596wxyz", + "status": "pending", + "created_at": "2026-04-02T12:34:56Z" +} +``` + +## `GET /:account_slug/users/:user_id/data_exports/:id` + +Returns the status of one of your personal data exports. + +__Response:__ + +```json +{ + "id": "03f8huu0sog76g3s97596wxyz", + "status": "completed", + "created_at": "2026-04-02T12:34:56Z", + "download_url": "https://app.fizzy.do/rails/active_storage/blobs/redirect/.../fizzy-user-data-export.zip" +} +``` + +The `download_url` field is only present when the export is completed and the export file is still available. Download requests still require normal authenticated access as the export owner. diff --git a/test/controllers/users/data_exports_controller_test.rb b/test/controllers/users/data_exports_controller_test.rb index c482547053..4007c6eef8 100644 --- a/test/controllers/users/data_exports_controller_test.rb +++ b/test/controllers/users/data_exports_controller_test.rb @@ -67,6 +67,62 @@ class Users::DataExportsControllerTest < ActionDispatch::IntegrationTest assert_select "h2", "Download Expired" end + test "create as JSON" do + assert_difference -> { User::DataExport.count }, 1 do + assert_enqueued_with(job: DataExportJob) do + post user_data_exports_path(@user), as: :json + end + end + + assert_response :created + body = @response.parsed_body + assert body["id"].present? + assert_equal "pending", body["status"] + assert_nil body["download_url"] + end + + test "show as JSON with completed export" do + export = @user.data_exports.create!(account: Current.account) + export.build + + get user_data_export_path(@user, export), as: :json + assert_response :success + + body = @response.parsed_body + assert_equal export.id, body["id"] + assert_equal "completed", body["status"] + assert body["download_url"].present? + end + + test "show as JSON with pending export" do + export = @user.data_exports.create!(account: Current.account) + + get user_data_export_path(@user, export), as: :json + assert_response :success + + body = @response.parsed_body + assert_equal export.id, body["id"] + assert_equal "pending", body["status"] + assert_nil body["download_url"] + end + + test "show as JSON with failed export" do + export = @user.data_exports.create!(account: Current.account, status: :failed) + + get user_data_export_path(@user, export), as: :json + assert_response :success + + body = @response.parsed_body + assert_equal export.id, body["id"] + assert_equal "failed", body["status"] + assert_nil body["download_url"] + end + + test "show as JSON with missing export" do + get user_data_export_path(@user, "nonexistent"), as: :json + assert_response :not_found + end + test "create is forbidden for other users" do other_user = users(:kevin) @@ -75,6 +131,14 @@ class Users::DataExportsControllerTest < ActionDispatch::IntegrationTest assert_response :forbidden end + test "create as JSON is forbidden for other users" do + other_user = users(:kevin) + + post user_data_exports_path(other_user), as: :json + + assert_response :forbidden + end + test "show is forbidden for other users" do other_user = users(:kevin) export = other_user.data_exports.create!(account: Current.account) @@ -84,4 +148,26 @@ class Users::DataExportsControllerTest < ActionDispatch::IntegrationTest assert_response :forbidden end + + test "show as JSON is forbidden for other users" do + other_user = users(:kevin) + export = other_user.data_exports.create!(account: Current.account) + export.build + + get user_data_export_path(other_user, export), as: :json + + assert_response :forbidden + end + + test "create as JSON rejects request when current export limit is reached" do + Users::DataExportsController::CURRENT_EXPORT_LIMIT.times do + @user.data_exports.create!(account: Current.account) + end + + assert_no_difference -> { User::DataExport.count } do + post user_data_exports_path(@user), as: :json + end + + assert_response :too_many_requests + end end From 2a4adf3a2bf744bea650c06416a186d56b1a235d Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Wed, 8 Apr 2026 08:31:52 -0400 Subject: [PATCH 013/129] Add board settings fields to board JSON responses (#2788) * Add board settings fields to board JSON responses * Move public_description fields to board partial, gate on published * Add index test for public_description fields on published boards * Update app/views/boards/show.json.jbuilder Prefer `unless` to `if !` --------- Co-authored-by: Mike Dalessio --- app/views/boards/_board.json.jbuilder | 6 ++- app/views/boards/show.json.jbuilder | 1 + docs/api/sections/boards.md | 10 ++++- test/controllers/boards_controller_test.rb | 50 ++++++++++++++++++++++ 4 files changed, 64 insertions(+), 3 deletions(-) diff --git a/app/views/boards/_board.json.jbuilder b/app/views/boards/_board.json.jbuilder index 0eeff18968..586835c38b 100644 --- a/app/views/boards/_board.json.jbuilder +++ b/app/views/boards/_board.json.jbuilder @@ -6,5 +6,9 @@ json.cache! board do json.creator board.creator, partial: "users/user", as: :user - json.public_url published_board_url(board) if board.published? + if board.published? + json.public_description board.public_description.to_plain_text + json.public_description_html board.public_description.to_s + json.public_url published_board_url(board) + end end diff --git a/app/views/boards/show.json.jbuilder b/app/views/boards/show.json.jbuilder index a6916c4673..08c3456605 100644 --- a/app/views/boards/show.json.jbuilder +++ b/app/views/boards/show.json.jbuilder @@ -1 +1,2 @@ json.partial! "boards/board", board: @board +json.user_ids @board.users.ids unless @board.all_access? diff --git a/docs/api/sections/boards.md b/docs/api/sections/boards.md index bf77245ab9..b3157cdcd3 100644 --- a/docs/api/sections/boards.md +++ b/docs/api/sections/boards.md @@ -40,7 +40,7 @@ __Response:__ { "id": "03f5v9zkft4hj9qq0lsn9ohcm", "name": "Fizzy", - "all_access": true, + "all_access": false, "created_at": "2025-12-05T19:36:35.534Z", "auto_postpone_period_in_days": 30, "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", @@ -53,11 +53,17 @@ __Response:__ "created_at": "2025-12-05T19:36:35.401Z", "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" }, + "public_description": "Follow along with public product updates.", + "public_description_html": "

Follow along with public product updates.

", + "user_ids": [ + "03f5v9zjw7pz8717a4no1h8a7", + "03f5v9zppzlksuj4mxba2nbzn" + ], "public_url": "http://fizzy.localhost:3006/897362094/public/boards/aB3dEfGhIjKlMnOp" } ``` -The `public_url` field is only present when the board is published. +The `public_description`, `public_description_html`, and `public_url` fields are only present when the board is published. The `user_ids` field is only present when `all_access` is `false`; use `GET /:account_slug/users` to resolve those IDs to user records if needed. ## `POST /:account_slug/boards` diff --git a/test/controllers/boards_controller_test.rb b/test/controllers/boards_controller_test.rb index 059c380266..e4d4d3103b 100644 --- a/test/controllers/boards_controller_test.rb +++ b/test/controllers/boards_controller_test.rb @@ -217,6 +217,19 @@ class BoardsControllerTest < ActionDispatch::IntegrationTest assert_equal users(:kevin).boards.count, @response.parsed_body.count end + test "index as JSON includes public_description fields for published boards" do + board = boards(:writebook) + board.publish + board.update!(public_description: "

Public board description.

") + + get boards_path, as: :json + assert_response :success + + published_board = @response.parsed_body.find { |b| b["id"] == board.id } + assert_equal board.public_description.to_plain_text, published_board["public_description"] + assert_equal board.public_description.to_s, published_board["public_description_html"] + end + test "index as JSON paginates and preserves recently-accessed order" do account = accounts("37s") kevin = users(:kevin) @@ -261,6 +274,43 @@ class BoardsControllerTest < ActionDispatch::IntegrationTest assert_equal boards(:writebook).auto_postpone_period_in_days, @response.parsed_body["auto_postpone_period_in_days"] end + test "show as JSON includes public_description fields when published" do + board = boards(:writebook) + board.publish + board.update!(public_description: "

This is a public note.

") + + get board_path(board), as: :json + assert_response :success + assert_equal board.public_description.to_plain_text, @response.parsed_body["public_description"] + assert_equal board.public_description.to_s, @response.parsed_body["public_description_html"] + end + + test "show as JSON excludes public_description fields when not published" do + board = boards(:writebook) + board.update!(public_description: "

This is a public note.

") + assert_not board.published? + + get board_path(board), as: :json + assert_response :success + assert_nil @response.parsed_body["public_description"] + assert_nil @response.parsed_body["public_description_html"] + end + + test "show as JSON includes granted user_ids when board is not all access" do + board = boards(:private) + board.accesses.revise granted: users(:david, :jz), revoked: [] + + get board_path(board), as: :json + assert_response :success + assert_equal board.users.ids.sort, @response.parsed_body["user_ids"].sort + end + + test "show as JSON excludes user_ids when board is all access" do + get board_path(boards(:writebook)), as: :json + assert_response :success + assert_nil @response.parsed_body["user_ids"] + end + test "show as JSON includes public_url when published" do board = boards(:writebook) board.publish From 6a71856b3de415027b48e9fcfda786ffa3cf7e95 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Wed, 8 Apr 2026 08:39:36 -0400 Subject: [PATCH 014/129] Add JSON activities API endpoint (#2783) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add JSON events API endpoint * Add regression test for event particulars defaults * Move JSON events API to a dedicated ActivitiesController The events endpoint served both the HTML day timeline and the JSON API feed, but the two paths shared no data or behavior — the HTML side uses DayTimelinesScoped while the JSON side built its own query. Splitting into ActivitiesController gives the API its own home at GET /:account/activities.json without dragging in the timeline before_actions. Also preloads comment creator in Event.preloaded to avoid an N+1 when rendering comment eventables in the JSON feed. --- app/controllers/activities_controller.rb | 30 ++ app/models/event.rb | 5 +- app/models/event/particulars.rb | 17 ++ app/views/activities/_activity.json.jbuilder | 21 ++ app/views/activities/index.json.jbuilder | 1 + config/routes.rb | 1 + docs/api/README.md | 1 + docs/api/sections/activities.md | 161 +++++++++++ .../controllers/activities_controller_test.rb | 272 ++++++++++++++++++ test/models/event_test.rb | 53 ++++ 10 files changed, 561 insertions(+), 1 deletion(-) create mode 100644 app/controllers/activities_controller.rb create mode 100644 app/views/activities/_activity.json.jbuilder create mode 100644 app/views/activities/index.json.jbuilder create mode 100644 docs/api/sections/activities.md create mode 100644 test/controllers/activities_controller_test.rb create mode 100644 test/models/event_test.rb diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rb new file mode 100644 index 0000000000..51ae3de8f0 --- /dev/null +++ b/app/controllers/activities_controller.rb @@ -0,0 +1,30 @@ +class ActivitiesController < ApplicationController + ACTIONS = %w[ + card_assigned + card_auto_postponed + card_board_changed + card_closed + card_postponed + card_published + card_reopened + card_sent_back_to_triage + card_title_changed + card_triaged + card_unassigned + comment_created + ].freeze + + def index + set_page_and_extract_portion_from(activities) + end + + private + def activities + Current.user.accessible_events + .preloaded + .where(action: ACTIONS) + .for_creators(params[:creator_ids]) + .for_boards(params[:board_ids]) + .reverse_chronologically + end +end diff --git a/app/models/event.rb b/app/models/event.rb index bbbf2a60c6..23495326d2 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -9,10 +9,13 @@ class Event < ApplicationRecord has_many :webhook_deliveries, class_name: "Webhook::Delivery", dependent: :delete_all scope :chronologically, -> { order created_at: :asc, id: :desc } + scope :reverse_chronologically, -> { order created_at: :desc, id: :desc } + scope :for_creators, ->(ids) { where(creator_id: ids) if ids.present? } + scope :for_boards, ->(ids) { where(board_id: ids) if ids.present? } scope :preloaded, -> { includes(:creator, :board, { eventable: [ - :goldness, :closure, :image_attachment, + :creator, :goldness, :closure, :image_attachment, { rich_text_body: :embeds_attachments }, { rich_text_description: :embeds_attachments }, { card: [ :goldness, :closure, :image_attachment ] } diff --git a/app/models/event/particulars.rb b/app/models/event/particulars.rb index 31ecd66bfa..d7a133ae2c 100644 --- a/app/models/event/particulars.rb +++ b/app/models/event/particulars.rb @@ -8,4 +8,21 @@ module Event::Particulars def assignees @assignees ||= User.where id: assignee_ids end + + def api_particulars + nested = particulars.dig("particulars") || {} + + case action.to_s + when "card_assigned", "card_unassigned" + { "assignee_ids" => Array(assignee_ids) } + when "card_board_changed" + { "old_board" => nested["old_board"].to_s, "new_board" => nested["new_board"].to_s } + when "card_title_changed" + { "old_title" => nested["old_title"].to_s, "new_title" => nested["new_title"].to_s } + when "card_triaged" + { "column" => nested["column"].to_s } + else + {} + end + end end diff --git a/app/views/activities/_activity.json.jbuilder b/app/views/activities/_activity.json.jbuilder new file mode 100644 index 0000000000..5585ac1fe3 --- /dev/null +++ b/app/views/activities/_activity.json.jbuilder @@ -0,0 +1,21 @@ +json.(event, :id, :action) +json.created_at event.created_at.utc +json.description event.description_for(Current.user).to_plain_text +json.particulars event.api_particulars +json.url( + case event.eventable + when Comment then card_url(event.eventable.card, anchor: dom_id(event.eventable)) + else polymorphic_url(event.eventable) + end +) +json.eventable_type event.eventable_type + +json.eventable do + case event.eventable + when Card then json.partial! "cards/card", card: event.eventable + when Comment then json.partial! "cards/comments/comment", comment: event.eventable + end +end + +json.board event.board, partial: "boards/board", as: :board +json.creator event.creator, partial: "users/user", as: :user diff --git a/app/views/activities/index.json.jbuilder b/app/views/activities/index.json.jbuilder new file mode 100644 index 0000000000..1e40481842 --- /dev/null +++ b/app/views/activities/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @page.records, partial: "activities/activity", as: :event diff --git a/config/routes.rb b/config/routes.rb index d3eb300d07..6c01c8d02c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -133,6 +133,7 @@ end end + resources :activities, only: :index resources :events, only: :index namespace :events do resources :days diff --git a/docs/api/README.md b/docs/api/README.md index 6c9e8b8d52..065d09e632 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -17,6 +17,7 @@ a bot to perform various actions for you. - [Reactions](sections/reactions.md) - [Tags](sections/tags.md) - [Users](sections/users.md) +- [Activities](sections/activities.md) - [Notifications](sections/notifications.md) - [Rich Text](sections/rich_text.md) - [Exports](sections/exports.md) diff --git a/docs/api/sections/activities.md b/docs/api/sections/activities.md new file mode 100644 index 0000000000..3820bdd289 --- /dev/null +++ b/docs/api/sections/activities.md @@ -0,0 +1,161 @@ +# Activities + +Activities are the activity stream for an account — a record of significant actions like cards being published, assigned, closed, and commented on. + +## `GET /:account_slug/activities` + +Returns a paginated flat list of activities the current user can access, sorted newest first. + +__Query Parameters:__ + +| Parameter | Description | +|-----------|-------------| +| `creator_ids[]` | Filter to activities created by specific user ID(s). Multiple values are ORed. | +| `board_ids[]` | Filter to activities on specific board ID(s). Multiple values are ORed. | + +Different filter params are ANDed together: `creator_ids[]=A&board_ids[]=X` means activities created by A on board X. + +To fetch activity for a specific user, use `creator_ids[]=USER_ID`. + +__Supported actions:__ + +| `action` | `eventable_type` | `particulars` shape | +|----------|-----------------|---------------------| +| `card_assigned` | `Card` | `{ "assignee_ids": [USER_ID, ...] }` | +| `card_auto_postponed` | `Card` | `{}` | +| `card_board_changed` | `Card` | `{ "old_board": STRING, "new_board": STRING }` | +| `card_closed` | `Card` | `{}` | +| `card_postponed` | `Card` | `{}` | +| `card_published` | `Card` | `{}` | +| `card_reopened` | `Card` | `{}` | +| `card_sent_back_to_triage` | `Card` | `{}` | +| `card_title_changed` | `Card` | `{ "old_title": STRING, "new_title": STRING }` | +| `card_triaged` | `Card` | `{ "column": STRING }` | +| `card_unassigned` | `Card` | `{ "assignee_ids": [USER_ID, ...] }` | +| `comment_created` | `Comment` | `{}` | + +`particulars` is always an object. It contains action-specific metadata in a normalized format intended for API clients. It does not necessarily mirror the internal event JSON stored by Fizzy. Unknown keys may appear in the future and should be ignored. For `card_assigned` and `card_unassigned`, `assignee_ids` is currently a single-element array in practice. + +__`particulars` examples:__ + +```json +{ "action": "card_assigned", "particulars": { "assignee_ids": ["03f5user123"] } } +{ "action": "card_unassigned", "particulars": { "assignee_ids": ["03f5user123"] } } +{ "action": "card_board_changed", "particulars": { "old_board": "Backlog", "new_board": "Mobile" } } +{ "action": "card_title_changed", "particulars": { "old_title": "Fix login", "new_title": "Fix mobile login" } } +{ "action": "card_triaged", "particulars": { "column": "In Progress" } } +{ "action": "card_closed", "particulars": {} } +``` + +The practical `eventable_type` values are `Card` and `Comment`. Clients should handle unknown future values conservatively. + +Activities whose underlying `Card` or `Comment` has been deleted or is inaccessible to the current user are omitted from the feed. The endpoint never returns `eventable: null`. + +The top-level `board` field reflects the activity's current board association. If a card moves boards, all its activities move with it for the purposes of this feed and `board_ids[]` filtering. + +This endpoint is a paginated activity feed, not an immutable audit-log. `description`, `eventable`, `board`, and `creator` may reflect current resource state. Re-fetch recent pages to get fresh activity data. + +__Response:__ + +```json +[ + { + "id": "03faevt004", + "action": "card_closed", + "created_at": "2026-03-25T15:11:04.000Z", + "description": "David Heinemeier Hansson moved \"Fix mobile login\" to \"Done\"", + "particulars": {}, + "url": "http://fizzy.localhost:3006/897362094/cards/42", + "eventable_type": "Card", + "eventable": { + "id": "03f6card042", + "number": 42, + "title": "Fix mobile login", + "status": "closed", + "description": "Users cannot complete login on iOS.", + "description_html": "
Users cannot complete login on iOS.
", + "image_url": null, + "has_attachments": false, + "tags": ["ios", "auth"], + "closed": true, + "postponed": false, + "golden": false, + "last_active_at": "2026-03-25T15:11:04.000Z", + "created_at": "2026-03-25T09:00:00.000Z", + "url": "http://fizzy.localhost:3006/897362094/cards/42" + }, + "board": { + "id": "03f6abc123", + "name": "Mobile", + "all_access": true, + "created_at": "2026-03-01T10:00:00.000Z", + "auto_postpone_period_in_days": 14, + "url": "http://fizzy.localhost:3006/897362094/boards/03f6abc123" + }, + "creator": { + "id": "03f5user123", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2026-03-01T09:00:00.000Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5user123", + "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5user123/avatar" + } + }, + { + "id": "03faevt003", + "action": "comment_created", + "created_at": "2026-03-25T14:17:22.000Z", + "description": "David Heinemeier Hansson commented on \"Fix mobile login\"", + "particulars": {}, + "url": "http://fizzy.localhost:3006/897362094/cards/42#comment_03facomment9", + "eventable_type": "Comment", + "eventable": { + "id": "03facomment9", + "created_at": "2026-03-25T14:17:22.000Z", + "updated_at": "2026-03-25T14:17:22.000Z", + "body": { + "plain_text": "I found the regression in the callback flow.", + "html": "
I found the regression in the callback flow.
" + }, + "creator": { + "id": "03f5user123", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2026-03-01T09:00:00.000Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5user123", + "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5user123/avatar" + }, + "card": { + "id": "03f6card042", + "url": "http://fizzy.localhost:3006/897362094/cards/42" + }, + "reactions_url": "http://fizzy.localhost:3006/897362094/cards/42/comments/03facomment9/reactions", + "url": "http://fizzy.localhost:3006/897362094/cards/42/comments/03facomment9" + }, + "board": { + "id": "03f6abc123", + "name": "Mobile", + "all_access": true, + "created_at": "2026-03-01T10:00:00.000Z", + "auto_postpone_period_in_days": 14, + "url": "http://fizzy.localhost:3006/897362094/boards/03f6abc123" + }, + "creator": { + "id": "03f5user123", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2026-03-01T09:00:00.000Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5user123", + "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5user123/avatar" + } + } +] +``` + +All `url` fields are opaque absolute URLs for the current Fizzy instance. Clients should not construct them. diff --git a/test/controllers/activities_controller_test.rb b/test/controllers/activities_controller_test.rb new file mode 100644 index 0000000000..82357e3d9f --- /dev/null +++ b/test/controllers/activities_controller_test.rb @@ -0,0 +1,272 @@ +require "test_helper" + +class ActivitiesControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in_as :kevin + end + + test "index returns flat array of events with required envelope fields" do + get activities_path, as: :json + assert_response :success + + body = @response.parsed_body + assert_kind_of Array, body + assert body.any? + + event = body.first + assert_includes event.keys, "id" + assert_includes event.keys, "action" + assert_includes event.keys, "created_at" + assert_includes event.keys, "description" + assert_includes event.keys, "particulars" + assert_includes event.keys, "url" + assert_includes event.keys, "eventable_type" + assert_includes event.keys, "eventable" + assert_includes event.keys, "board" + assert_includes event.keys, "creator" + end + + test "index returns events in reverse-chronological order" do + get activities_path, as: :json + assert_response :success + + times = @response.parsed_body.map { |e| Time.parse(e["created_at"]) } + assert_equal times, times.sort.reverse + end + + test "index includes card eventable" do + event = events(:logo_published) + get activities_path, as: :json + assert_response :success + + item = @response.parsed_body.find { |e| e["id"] == event.id } + assert_not_nil item + assert_equal "Card", item["eventable_type"] + assert_equal cards(:logo).title, item["eventable"]["title"] + assert_equal "card_published", item["action"] + assert item["url"].end_with?("/cards/#{cards(:logo).number}") + end + + test "index includes comment eventable" do + event = events(:layout_commented) + get activities_path, as: :json + assert_response :success + + item = @response.parsed_body.find { |e| e["id"] == event.id } + assert_not_nil item + assert_equal "Comment", item["eventable_type"] + assert_equal card_url(event.eventable.card, anchor: ActionView::RecordIdentifier.dom_id(event.eventable)), item["url"] + assert item["eventable"]["body"].present? + end + + test "index includes board and creator at top level" do + get activities_path, as: :json + assert_response :success + + item = @response.parsed_body.first + assert item["board"]["id"].present? + assert item["board"]["name"].present? + assert item["creator"]["id"].present? + assert item["creator"]["name"].present? + end + + test "index normalizes particulars for card_assigned" do + event = events(:logo_assignment_jz) + get activities_path, as: :json + assert_response :success + + item = @response.parsed_body.find { |e| e["id"] == event.id } + assert_not_nil item + assert_equal "card_assigned", item["action"] + assert_equal [ users(:jz).id ], item["particulars"]["assignee_ids"] + end + + test "index normalizes particulars for card_unassigned" do + card = cards(:logo) + event = card.board.events.create!( + action: "card_unassigned", + creator: users(:david), + eventable: card, + account: accounts("37s"), + particulars: { assignee_ids: [ users(:jz).id ] } + ) + + get activities_path, as: :json + assert_response :success + + item = @response.parsed_body.find { |e| e["id"] == event.id } + assert_not_nil item + assert_equal [ users(:jz).id ], item["particulars"]["assignee_ids"] + end + + test "index returns empty particulars for actions with no payload" do + event = events(:logo_published) + get activities_path, as: :json + assert_response :success + + item = @response.parsed_body.find { |e| e["id"] == event.id } + assert_not_nil item + assert_equal({}, item["particulars"]) + end + + test "index normalizes particulars for card_board_changed" do + card = cards(:logo) + event = card.board.events.create!( + action: "card_board_changed", + creator: users(:david), + eventable: card, + account: accounts("37s"), + particulars: { particulars: { old_board: "Backlog", new_board: "Mobile" } } + ) + + get activities_path, as: :json + assert_response :success + + item = @response.parsed_body.find { |e| e["id"] == event.id } + assert_not_nil item + assert_equal "Backlog", item["particulars"]["old_board"] + assert_equal "Mobile", item["particulars"]["new_board"] + end + + test "index normalizes particulars for card_title_changed" do + card = cards(:logo) + event = card.board.events.create!( + action: "card_title_changed", + creator: users(:david), + eventable: card, + account: accounts("37s"), + particulars: { particulars: { old_title: "Old title", new_title: "New title" } } + ) + + get activities_path, as: :json + assert_response :success + + item = @response.parsed_body.find { |e| e["id"] == event.id } + assert_not_nil item + assert_equal "Old title", item["particulars"]["old_title"] + assert_equal "New title", item["particulars"]["new_title"] + end + + test "index normalizes particulars for card_triaged" do + card = cards(:logo) + event = card.board.events.create!( + action: "card_triaged", + creator: users(:david), + eventable: card, + account: accounts("37s"), + particulars: { particulars: { column: "In Progress" } } + ) + + get activities_path, as: :json + assert_response :success + + item = @response.parsed_body.find { |e| e["id"] == event.id } + assert_not_nil item + assert_equal "In Progress", item["particulars"]["column"] + end + + test "index filters by creator_ids" do + get activities_path(creator_ids: [ users(:kevin).id ]), as: :json + assert_response :success + + body = @response.parsed_body + assert body.any? + assert body.all? { |e| e["creator"]["id"] == users(:kevin).id } + end + + test "index filters by multiple creator_ids with OR semantics" do + get activities_path(creator_ids: [ users(:david).id, users(:kevin).id ]), as: :json + assert_response :success + + body = @response.parsed_body + creator_ids = body.map { |e| e["creator"]["id"] }.uniq.sort + assert_includes creator_ids, users(:david).id + assert_includes creator_ids, users(:kevin).id + end + + test "index filters by board_ids" do + get activities_path(board_ids: [ boards(:writebook).id ]), as: :json + assert_response :success + + body = @response.parsed_body + assert body.any? + assert body.all? { |e| e["board"]["id"] == boards(:writebook).id } + end + + test "index ANDs creator_ids and board_ids filters" do + get activities_path(creator_ids: [ users(:david).id ], board_ids: [ boards(:writebook).id ]), as: :json + assert_response :success + + body = @response.parsed_body + assert body.any? + assert body.all? { |e| e["creator"]["id"] == users(:david).id } + assert body.all? { |e| e["board"]["id"] == boards(:writebook).id } + end + + test "index ignores empty creator_ids and board_ids filters" do + get activities_path(creator_ids: [], board_ids: []), as: :json + assert_response :success + + assert_predicate @response.parsed_body, :any? + end + + test "index only returns events from accessible boards" do + get activities_path, as: :json + assert_response :success + + accessible_board_ids = users(:kevin).boards.pluck(:id) + @response.parsed_body.each do |item| + assert_includes accessible_board_ids, item["board"]["id"] + end + end + + test "index paginates and returns Link header when more results exist" do + board = boards(:writebook) + 30.times do |i| + board.events.create!( + action: "card_published", + creator: users(:kevin), + eventable: cards(:logo), + account: accounts("37s") + ) + end + + get activities_path, as: :json + assert_response :success + + link_header = @response.headers["Link"] + assert link_header.present?, "Expected a Link header for paginated results" + assert_match(/rel="next"/, link_header) + end + + test "index follows pagination to retrieve all events" do + board = boards(:writebook) + 30.times do + board.events.create!( + action: "card_published", + creator: users(:kevin), + eventable: cards(:logo), + account: accounts("37s") + ) + end + + all_ids = [] + next_path = activities_path(format: :json) + + while next_path + get next_path + assert_response :success + all_ids.concat(@response.parsed_body.map { |e| e["id"] }) + next_path = next_page_from_link_header(@response.headers["Link"]) + end + + total = Event.where(board: users(:kevin).boards).where(action: ActivitiesController::ACTIONS).count + assert_equal total, all_ids.uniq.count + end + + private + def next_page_from_link_header(link_header) + url = link_header&.match(/<([^>]+)>;\s*rel="next"/)&.captures&.first + URI.parse(url).request_uri if url + end +end diff --git a/test/models/event_test.rb b/test/models/event_test.rb new file mode 100644 index 0000000000..3c50bd2a12 --- /dev/null +++ b/test/models/event_test.rb @@ -0,0 +1,53 @@ +require "test_helper" + +class EventTest < ActiveSupport::TestCase + test "blank creator and board filters return the current relation unchanged" do + relation = Event.where(action: "card_published") + + assert_equal relation.to_sql, relation.for_creators(nil).to_sql + assert_equal relation.to_sql, relation.for_creators([]).to_sql + assert_equal relation.to_sql, relation.for_boards(nil).to_sql + assert_equal relation.to_sql, relation.for_boards([]).to_sql + end + + test "blank creator and board filters remain chainable" do + relation = Event.where(action: "card_published") + + assert_nothing_raised do + relation.for_creators([]).for_boards([]).load + end + end + + test "api_particulars returns empty strings for missing nested board change values" do + event = boards(:writebook).events.create!( + action: "card_board_changed", + creator: users(:david), + eventable: cards(:logo), + account: accounts("37s"), + particulars: {} + ) + + assert_equal({ "old_board" => "", "new_board" => "" }, event.api_particulars) + end + + test "api_particulars returns empty strings for missing nested title and column values" do + title_event = boards(:writebook).events.create!( + action: "card_title_changed", + creator: users(:david), + eventable: cards(:logo), + account: accounts("37s"), + particulars: {} + ) + + triage_event = boards(:writebook).events.create!( + action: "card_triaged", + creator: users(:david), + eventable: cards(:logo), + account: accounts("37s"), + particulars: {} + ) + + assert_equal({ "old_title" => "", "new_title" => "" }, title_event.api_particulars) + assert_equal({ "column" => "" }, triage_event.api_particulars) + end +end From d08aa11bfb55636e9f85a785fb463d55fed1dae1 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Wed, 8 Apr 2026 08:41:34 -0400 Subject: [PATCH 015/129] Add JSON API support for timezone update (#2806) * Add JSON API support for timezone update * Simplify timezone controller to just head :no_content * Use PUT instead of PATCH in timezone tests to match docs * Use PATCH instead of PUT for timezone endpoint Reverts tests to use patch and updates docs heading to PATCH for consistency. --- app/controllers/my/timezones_controller.rb | 1 + docs/api/sections/identity.md | 20 +++++++++++++++++++ .../my/timezones_controller_test.rb | 7 +++++++ 3 files changed, 28 insertions(+) diff --git a/app/controllers/my/timezones_controller.rb b/app/controllers/my/timezones_controller.rb index c70d7e80a4..8ad770db3c 100644 --- a/app/controllers/my/timezones_controller.rb +++ b/app/controllers/my/timezones_controller.rb @@ -1,6 +1,7 @@ class My::TimezonesController < ApplicationController def update Current.user.settings.update!(timezone_name: timezone_param) + head :no_content end private diff --git a/docs/api/sections/identity.md b/docs/api/sections/identity.md index 5167aaf95f..9c3352095d 100644 --- a/docs/api/sections/identity.md +++ b/docs/api/sections/identity.md @@ -44,3 +44,23 @@ __Response:__ ] } ``` + +## `PATCH /my/timezone` + +Updates the current user's timezone. This affects how times are displayed in notification emails. + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `timezone_name` | string | Yes | IANA timezone identifier (e.g. `America/New_York`, `Europe/London`, `Asia/Tokyo`) | + +__Request:__ + +```json +{ + "timezone_name": "America/New_York" +} +``` + +__Response:__ + +Returns `204 No Content` on success. diff --git a/test/controllers/my/timezones_controller_test.rb b/test/controllers/my/timezones_controller_test.rb index 98d45e3041..d39d7cbd46 100644 --- a/test/controllers/my/timezones_controller_test.rb +++ b/test/controllers/my/timezones_controller_test.rb @@ -12,4 +12,11 @@ class My::TimezonesControllerTest < ActionDispatch::IntegrationTest patch my_timezone_path, params: { timezone_name: "America/New_York" } assert_equal time_zone, users(:kevin).reload.timezone end + + test "update as JSON" do + assert_not_equal ActiveSupport::TimeZone["America/Chicago"], users(:kevin).timezone + patch my_timezone_path, params: { timezone_name: "America/Chicago" }, as: :json + assert_response :no_content + assert_equal ActiveSupport::TimeZone["America/Chicago"], users(:kevin).reload.timezone + end end From d7040388fa015bf4040705a5259bb19caf85684f Mon Sep 17 00:00:00 2001 From: Zoltan Hosszu Date: Wed, 8 Apr 2026 15:09:29 +0200 Subject: [PATCH 016/129] Fix icon color and chevron size --- app/assets/stylesheets/lexxy.css | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/assets/stylesheets/lexxy.css b/app/assets/stylesheets/lexxy.css index 053f626a9f..db67b39aa7 100644 --- a/app/assets/stylesheets/lexxy.css +++ b/app/assets/stylesheets/lexxy.css @@ -59,6 +59,10 @@ lexxy-toolbar { border-color: var(--lexxy-border-color); gap: 0; + + svg { + fill: currentColor; + } } .lexxy-editor__toolbar-button { @@ -76,6 +80,13 @@ } } + .lexxy-editor__toolbar-dropdown--chevron { + summary:after { + block-size: 0.3rem; + inline-size: 0.3rem; + } + } + lexxy-link-dropdown { --lexxy-toolbar-spacing: 1.5ch; From 1975a04f14b4660b11c206d80211905d59d8d54d Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Wed, 8 Apr 2026 09:09:36 -0400 Subject: [PATCH 017/129] Add JSON API support for email address changes (#2807) --- .../confirmations_controller.rb | 10 ++- .../users/email_addresses_controller.rb | 30 ++++++-- docs/api/sections/users.md | 43 +++++++++++ .../confirmations_controller_test.rb | 38 ++++++++++ .../users/email_addresses_controller_test.rb | 73 +++++++++++++++++++ 5 files changed, 186 insertions(+), 8 deletions(-) diff --git a/app/controllers/users/email_addresses/confirmations_controller.rb b/app/controllers/users/email_addresses/confirmations_controller.rb index b5fd334ea4..f844285daa 100644 --- a/app/controllers/users/email_addresses/confirmations_controller.rb +++ b/app/controllers/users/email_addresses/confirmations_controller.rb @@ -12,9 +12,15 @@ def create terminate_session if Current.session start_new_session_for @user.identity - redirect_to edit_user_url(script_name: @user.account.slug, id: @user) + respond_to do |format| + format.html { redirect_to edit_user_url(script_name: @user.account.slug, id: @user) } + format.json { head :no_content } + end else - render :invalid_token, status: :unprocessable_entity + respond_to do |format| + format.html { render :invalid_token, status: :unprocessable_entity } + format.json { render json: { error: "Token is invalid or has expired" }, status: :unprocessable_entity } + end end end diff --git a/app/controllers/users/email_addresses_controller.rb b/app/controllers/users/email_addresses_controller.rb index 69957b1f61..58d8a2723e 100644 --- a/app/controllers/users/email_addresses_controller.rb +++ b/app/controllers/users/email_addresses_controller.rb @@ -1,18 +1,17 @@ class Users::EmailAddressesController < ApplicationController before_action :set_user + before_action :ensure_valid_email_address, only: :create rate_limit to: 5, within: 1.hour, only: :create def new end def create - identity = Identity.find_by_email_address(new_email_address) + @user.send_email_address_change_confirmation(new_email_address) - if identity&.users&.exists?(account: @user.account) - flash[:alert] = "You already have a user in this account with that email address" - redirect_to new_user_email_address_path(@user) - else - @user.send_email_address_change_confirmation(new_email_address) + respond_to do |format| + format.html + format.json { head :created } end end @@ -21,6 +20,25 @@ def set_user @user = Current.identity.users.find(params[:user_id]) end + def ensure_valid_email_address + if !new_email_address.match?(URI::MailTo::EMAIL_REGEXP) + error = "Please enter a valid email address" + elsif (identity = Identity.find_by_email_address(new_email_address)) + if identity == @user.identity + error = "That is already your email address" + elsif identity.users.exists?(account: @user.account) + error = "You already have a user in this account with that email address" + end + end + + if error + respond_to do |format| + format.html { redirect_to new_user_email_address_path(@user), alert: error } + format.json { render json: { error: error }, status: :unprocessable_entity } + end + end + end + def new_email_address params.expect :email_address end diff --git a/docs/api/sections/users.md b/docs/api/sections/users.md index cbbed314cb..b30986c10e 100644 --- a/docs/api/sections/users.md +++ b/docs/api/sections/users.md @@ -98,6 +98,49 @@ __Response:__ Returns `204 No Content` on success. +## `POST /:account_slug/users/:user_id/email_addresses` + +Initiates an email address change for the user. A confirmation email is sent to the new address with a token link. You can only change your own email address. + +This is a two-step process, similar to magic link authentication: + +1. Request the change (this endpoint) — a confirmation email is sent to the new address +2. Confirm the change (`POST .../confirmation`) — the token from the email is submitted to complete the change + +| Parameter | Type | Required | Description | +|-----------|------|----------|-------------| +| `email_address` | string | Yes | The new email address | + +__Response:__ + +Returns `201 Created` on success. The user must check the new email address for a confirmation link. + +__Error responses:__ + +| Status Code | Description | +|--------|-------------| +| `400 Bad Request` | Missing `email_address` parameter | +| `404 Not Found` | User is not your own | +| `422 Unprocessable Entity` | Invalid email format, same as current email, or already belongs to a user in the same account | +| `429 Too Many Requests` | Rate limit exceeded (5 per hour) | + +## `POST /:account_slug/users/:user_id/email_addresses/:token/confirmation` + +Confirms an email address change using the token from the confirmation email. This endpoint does not require authentication — the token itself serves as proof of access to the new email. + +The token is the full value from the confirmation URL sent in the email. It expires after 30 minutes. + +__Response:__ + +Returns `204 No Content` on success. The user's email address has been changed. + +__Error responses:__ + +| Status Code | Description | +|--------|-------------| +| `422 Unprocessable Entity` | Token is invalid or has expired | +| `429 Too Many Requests` | Rate limit exceeded (5 per hour) | + ## `DELETE /:account_slug/users/:user_id` Deactivates a user. You can only deactivate users you have permission to change. diff --git a/test/controllers/users/email_addresses/confirmations_controller_test.rb b/test/controllers/users/email_addresses/confirmations_controller_test.rb index 5cd2b4a7e7..9d1764a37f 100644 --- a/test/controllers/users/email_addresses/confirmations_controller_test.rb +++ b/test/controllers/users/email_addresses/confirmations_controller_test.rb @@ -27,4 +27,42 @@ class Users::EmailAddresses::ConfirmationsControllerTest < ActionDispatch::Integ assert_response :unprocessable_entity assert_match /Link expired/, response.body end + + test "create as JSON" do + post user_email_address_confirmation_path(user_id: @user.id, email_address_token: @token, script_name: @user.account.slug), as: :json + + assert_response :no_content + assert_equal @new_email, @user.reload.identity.email_address + end + + test "create as JSON with invalid token" do + post user_email_address_confirmation_path(user_id: @user.id, email_address_token: "invalid", script_name: @user.account.slug), as: :json + + assert_response :unprocessable_entity + assert_equal "Token is invalid or has expired", @response.parsed_body["error"] + assert_equal @old_email, @user.reload.identity.email_address + end + + test "create as JSON with expired token" do + expired_token = @user.send(:generate_email_address_change_token, to: @new_email, expires_in: 0.seconds) + + travel_to 1.minute.from_now do + post user_email_address_confirmation_path(user_id: @user.id, email_address_token: expired_token, script_name: @user.account.slug), as: :json + + assert_response :unprocessable_entity + assert_equal "Token is invalid or has expired", @response.parsed_body["error"] + assert_equal @old_email, @user.reload.identity.email_address + end + end + + test "create as JSON changes identity" do + assert_equal @old_email, @user.identity.email_address + + post user_email_address_confirmation_path(user_id: @user.id, email_address_token: @token, script_name: @user.account.slug), as: :json + + assert_response :no_content + @user.reload + assert_equal @new_email, @user.identity.email_address + assert_not_equal @old_email, @user.identity.email_address + end end diff --git a/test/controllers/users/email_addresses_controller_test.rb b/test/controllers/users/email_addresses_controller_test.rb index d9b973d882..064345c201 100644 --- a/test/controllers/users/email_addresses_controller_test.rb +++ b/test/controllers/users/email_addresses_controller_test.rb @@ -20,6 +20,22 @@ class Users::EmailAddressesControllerTest < ActionDispatch::IntegrationTest assert_response :success end + test "create with invalid email format" do + assert_no_emails do + post user_email_addresses_path(@user, script_name: @user.account.slug), params: { email_address: "notanemail" } + end + assert_redirected_to new_user_email_address_path(@user) + assert_equal "Please enter a valid email address", flash[:alert] + end + + test "create with same email as current" do + assert_no_emails do + post user_email_addresses_path(@user, script_name: @user.account.slug), params: { email_address: @user.identity.email_address } + end + assert_redirected_to new_user_email_address_path(@user) + assert_equal "That is already your email address", flash[:alert] + end + test "create with existing email in same account" do existing_user = users(:kevin) existing_email = existing_user.identity.email_address @@ -37,4 +53,61 @@ class Users::EmailAddressesControllerTest < ActionDispatch::IntegrationTest end assert_response :not_found end + + test "create as JSON" do + assert_emails 1 do + post user_email_addresses_path(@user, script_name: @user.account.slug), params: { email_address: "newemail@example.com" }, as: :json + end + assert_response :created + end + + test "create as JSON with existing email in same account" do + existing_email = users(:kevin).identity.email_address + + assert_no_emails do + post user_email_addresses_path(@user, script_name: @user.account.slug), params: { email_address: existing_email }, as: :json + end + assert_response :unprocessable_entity + assert_equal "You already have a user in this account with that email address", @response.parsed_body["error"] + end + + test "create as JSON with blank email" do + assert_no_emails do + post user_email_addresses_path(@user, script_name: @user.account.slug), params: { email_address: "" }, as: :json + end + assert_response :bad_request + end + + test "create as JSON with same email as current" do + assert_no_emails do + post user_email_addresses_path(@user, script_name: @user.account.slug), params: { email_address: @user.identity.email_address }, as: :json + end + assert_response :unprocessable_entity + assert_equal "That is already your email address", @response.parsed_body["error"] + end + + test "create as JSON with same email different case" do + assert_no_emails do + post user_email_addresses_path(@user, script_name: @user.account.slug), params: { email_address: @user.identity.email_address.upcase }, as: :json + end + assert_response :unprocessable_entity + assert_equal "That is already your email address", @response.parsed_body["error"] + end + + test "create as JSON with invalid email format" do + assert_no_emails do + post user_email_addresses_path(@user, script_name: @user.account.slug), params: { email_address: "notanemail" }, as: :json + end + assert_response :unprocessable_entity + assert_equal "Please enter a valid email address", @response.parsed_body["error"] + end + + test "create as JSON for other user" do + other_user = users(:kevin) + + assert_no_emails do + post user_email_addresses_path(other_user, script_name: @user.account.slug), params: { email_address: "newemail@example.com" }, as: :json + end + assert_response :not_found + end end From dd67f4171d74975e69be6e960492077ca1f3ba2f Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Wed, 8 Apr 2026 14:36:34 -0400 Subject: [PATCH 018/129] Add regression tests for bearer-authenticated blob downloads --- .../active_storage_authorization_test.rb | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/integration/active_storage_authorization_test.rb b/test/integration/active_storage_authorization_test.rb index 605bc109db..045d08e4bd 100644 --- a/test/integration/active_storage_authorization_test.rb +++ b/test/integration/active_storage_authorization_test.rb @@ -17,6 +17,13 @@ class ActiveStorageAuthorizationTest < ActionDispatch::IntegrationTest assert_match %r{rails/active_storage}, response.location end + test "bearer token with board access can view blob" do + get rails_blob_path(@blob, disposition: :inline), env: bearer_token_env(identity_access_tokens(:davids_api_token).token) + + assert_response :redirect + assert_match %r{rails/active_storage}, response.location + end + test "authenticated user without board access cannot view blob" do sign_in_as :mike @@ -38,6 +45,13 @@ class ActiveStorageAuthorizationTest < ActionDispatch::IntegrationTest assert_match %r{rails/active_storage/}, response.location end + test "bearer token with board access can view representation" do + get rails_representation_path(@blob.representation(resize_to_limit: [ 100, 100 ])), env: bearer_token_env(identity_access_tokens(:davids_api_token).token) + + assert_response :redirect + assert_match %r{rails/active_storage/}, response.location + end + test "authenticated user without board access cannot view representation" do sign_in_as :mike @@ -194,6 +208,15 @@ class ActiveStorageAuthorizationTest < ActionDispatch::IntegrationTest assert_match %r{rails/active_storage}, response.location end + test "export owner can download their export with bearer token" do + blob = create_export_blob_for(users(:david)) + + get rails_blob_path(blob, disposition: :attachment), env: bearer_token_env(identity_access_tokens(:davids_api_token).token) + + assert_response :redirect + assert_match %r{rails/active_storage}, response.location + end + test "non-owner cannot download another user's export" do sign_in_as :jz @@ -249,4 +272,8 @@ def attach_avatar_to(user) user.avatar.blob end end + + def bearer_token_env(token) + { "HTTP_AUTHORIZATION" => "Bearer #{token}" } + end end From 5e154a767f087eeac6afb14b25b3b3038a15d912 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Wed, 8 Apr 2026 14:37:24 -0400 Subject: [PATCH 019/129] Allow bearer auth on Active Storage downloads --- app/controllers/concerns/authentication.rb | 6 +++++- lib/rails_ext/active_storage_authorization.rb | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/authentication.rb b/app/controllers/concerns/authentication.rb index a269fc2d66..95240f11e7 100644 --- a/app/controllers/concerns/authentication.rb +++ b/app/controllers/concerns/authentication.rb @@ -57,7 +57,7 @@ def find_session_by_cookie def authenticate_by_bearer_token if request.authorization.to_s.include?("Bearer") - if request.format.json? + if bearer_token_authenticatable_request? authenticate_or_request_with_http_token do |token| if identity = Identity.find_by_permissable_access_token(token, method: request.method) Current.identity = identity @@ -69,6 +69,10 @@ def authenticate_by_bearer_token end end + def bearer_token_authenticatable_request? + request.format.json? + end + def request_authentication if Current.account.present? session[:return_to_after_authenticating] = request.url diff --git a/lib/rails_ext/active_storage_authorization.rb b/lib/rails_ext/active_storage_authorization.rb index 7d6fa8510b..33a2db43e6 100644 --- a/lib/rails_ext/active_storage_authorization.rb +++ b/lib/rails_ext/active_storage_authorization.rb @@ -31,6 +31,10 @@ module ActiveStorage::Authorize end private + def bearer_token_authenticatable_request? + true + end + def publicly_accessible_blob? @blob.publicly_accessible? end From 4a91e45aa510801c5b2f27217099021178d0f8f9 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Wed, 8 Apr 2026 14:41:32 -0400 Subject: [PATCH 020/129] Cover bearer-authenticated export download URLs --- .../accounts/exports_controller_test.rb | 19 +++++++++++++++++++ .../active_storage_authorization_test.rb | 15 ++++++++------- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/test/controllers/accounts/exports_controller_test.rb b/test/controllers/accounts/exports_controller_test.rb index fd950f989e..1888583559 100644 --- a/test/controllers/accounts/exports_controller_test.rb +++ b/test/controllers/accounts/exports_controller_test.rb @@ -103,6 +103,25 @@ class Account::ExportsControllerTest < ActionDispatch::IntegrationTest assert body["download_url"].present? end + test "show as JSON with bearer token returns a download URL that can be fetched" do + export = Account::Export.create!(account: Current.account, user: users(:jason)) + export.build + sign_out + bearer_token = { "HTTP_AUTHORIZATION" => "Bearer #{identity_access_tokens(:jasons_api_token).token}" } + + get account_export_path(export), as: :json, env: bearer_token + assert_response :success + + body = @response.parsed_body + assert_equal export.id, body["id"] + assert_equal "completed", body["status"] + assert body["download_url"].present? + + get URI(body["download_url"]).request_uri, env: bearer_token + assert_response :redirect + assert_match %r{rails/active_storage}, response.location + end + test "show as JSON with pending export" do export = Account::Export.create!(account: Current.account, user: users(:jason)) diff --git a/test/integration/active_storage_authorization_test.rb b/test/integration/active_storage_authorization_test.rb index 045d08e4bd..3fed18267e 100644 --- a/test/integration/active_storage_authorization_test.rb +++ b/test/integration/active_storage_authorization_test.rb @@ -18,7 +18,9 @@ class ActiveStorageAuthorizationTest < ActionDispatch::IntegrationTest end test "bearer token with board access can view blob" do - get rails_blob_path(@blob, disposition: :inline), env: bearer_token_env(identity_access_tokens(:davids_api_token).token) + bearer_token = { "HTTP_AUTHORIZATION" => "Bearer #{identity_access_tokens(:davids_api_token).token}" } + + get rails_blob_path(@blob, disposition: :inline), env: bearer_token assert_response :redirect assert_match %r{rails/active_storage}, response.location @@ -46,7 +48,9 @@ class ActiveStorageAuthorizationTest < ActionDispatch::IntegrationTest end test "bearer token with board access can view representation" do - get rails_representation_path(@blob.representation(resize_to_limit: [ 100, 100 ])), env: bearer_token_env(identity_access_tokens(:davids_api_token).token) + bearer_token = { "HTTP_AUTHORIZATION" => "Bearer #{identity_access_tokens(:davids_api_token).token}" } + + get rails_representation_path(@blob.representation(resize_to_limit: [ 100, 100 ])), env: bearer_token assert_response :redirect assert_match %r{rails/active_storage/}, response.location @@ -210,8 +214,9 @@ class ActiveStorageAuthorizationTest < ActionDispatch::IntegrationTest test "export owner can download their export with bearer token" do blob = create_export_blob_for(users(:david)) + bearer_token = { "HTTP_AUTHORIZATION" => "Bearer #{identity_access_tokens(:davids_api_token).token}" } - get rails_blob_path(blob, disposition: :attachment), env: bearer_token_env(identity_access_tokens(:davids_api_token).token) + get rails_blob_path(blob, disposition: :attachment), env: bearer_token assert_response :redirect assert_match %r{rails/active_storage}, response.location @@ -272,8 +277,4 @@ def attach_avatar_to(user) user.avatar.blob end end - - def bearer_token_env(token) - { "HTTP_AUTHORIZATION" => "Bearer #{token}" } - end end From 8908ee46f87347990daf6c17975aefe6033b6d38 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Wed, 8 Apr 2026 15:45:23 -0400 Subject: [PATCH 021/129] Upgrade addressable to 2.9.0 (#2815) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Upgrade addressable from 2.8.9 to 2.9.0 Security release fixing ReDoS vulnerabilities in Addressable::Template#match. No application impact — fizzy does not use Addressable::Template directly. * dep: fix saas drift --- Gemfile.lock | 2 +- Gemfile.saas.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 686d8f2455..36482e6e0d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -129,7 +129,7 @@ GEM specs: action_text-trix (2.1.18) railties - addressable (2.8.9) + addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) autotuner (1.1.0) diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index ea51835f65..96c36298ac 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -217,7 +217,7 @@ GEM activemodel (>= 7.0) activemodel-serializers-xml (~> 1.0) activesupport (>= 7.0) - addressable (2.8.9) + addressable (2.9.0) public_suffix (>= 2.0.2, < 8.0) anyway_config (2.7.2) ruby-next-core (~> 1.0) @@ -724,7 +724,7 @@ DEPENDENCIES jbuilder kamal letter_opener - lexxy (= 0.9.0.beta) + lexxy (= 0.9.2.beta) mission_control-jobs mittens mocha @@ -750,7 +750,7 @@ DEPENDENCIES stackprof stimulus-rails thruster - trilogy (~> 2.10) + trilogy (~> 2.11) turbo-rails! useragent! vcr From 6ddb04766a5cc27b73cf6357fa1e8deba862a7d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 15:47:08 -0400 Subject: [PATCH 022/129] Bump loofah from 2.25.0 to 2.25.1 (#2726) * Bump loofah from 2.25.0 to 2.25.1 Bumps [loofah](https://github.com/flavorjones/loofah) from 2.25.0 to 2.25.1. - [Release notes](https://github.com/flavorjones/loofah/releases) - [Changelog](https://github.com/flavorjones/loofah/blob/main/CHANGELOG.md) - [Commits](https://github.com/flavorjones/loofah/compare/v2.25.0...v2.25.1) --- updated-dependencies: - dependency-name: loofah dependency-version: 2.25.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] * Sync Gemfile.saas.lock --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] From 7bd3df33b8c3b315e9a646db2909a8498733f1c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 15:48:11 -0400 Subject: [PATCH 023/129] Bump rack from 3.2.5 to 3.2.6 (#2784) * Bump rack from 3.2.5 to 3.2.6 Bumps [rack](https://github.com/rack/rack) from 3.2.5 to 3.2.6. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/main/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/v3.2.5...v3.2.6) --- updated-dependencies: - dependency-name: rack dependency-version: 3.2.6 dependency-type: indirect ... Signed-off-by: dependabot[bot] * Sync Gemfile.saas.lock --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] From 45d165749fa0af43bee7420b730d8f0ecdc986e9 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Wed, 8 Apr 2026 16:06:38 -0400 Subject: [PATCH 024/129] Fix CORS issues when using minio in development (#2814) Move MinIO from minio.localhost to minio.fizzy.localhost, which makes it same-site with the app, so the CORS redirect succeeds. The service worker fetches Active Storage URLs with `mode: "cors"` so it can inspect response sizes for offline caching. Active Storage's redirect controller returns a 302 to the MinIO presigned URL. When that redirect crosses site boundaries (from fizzy.localhost to minio.localhost), the browser sets the Origin header to "null" on the redirected request per the Fetch spec, which fails the CORS check and produces net::ERR_FAILED. --- config/environments/development.rb | 4 ++-- config/storage.oss.yml | 2 +- saas/config/storage.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 05dc335c2d..afa223ced0 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -34,8 +34,8 @@ # Store uploaded files on the local file system (see config/storage.yml for options). if Rails.root.join("tmp/minio-dev.txt").exist? config.active_storage.service = :devminio - config.x.content_security_policy.connect_src = "http://minio.localhost:39000" - config.x.content_security_policy.img_src = "http://minio.localhost:39000" + config.x.content_security_policy.connect_src = "http://minio.fizzy.localhost:39000" + config.x.content_security_policy.img_src = "http://minio.fizzy.localhost:39000" else config.active_storage.service = :local end diff --git a/config/storage.oss.yml b/config/storage.oss.yml index 37052e6c5a..fb6f2841a4 100644 --- a/config/storage.oss.yml +++ b/config/storage.oss.yml @@ -9,7 +9,7 @@ local: devminio: service: S3 bucket: fizzy-dev-activestorage - endpoint: "http://minio.localhost:39000" + endpoint: "http://minio.fizzy.localhost:39000" force_path_style: true request_checksum_calculation: when_required # default is when_supported with CRC64NVME checksum which FlashBlade doesn't support response_checksum_validation: when_required # default is when_supported with CRC64NVME checksum which FlashBlade doesn't support diff --git a/saas/config/storage.yml b/saas/config/storage.yml index a149ccf7b3..3825e95bea 100644 --- a/saas/config/storage.yml +++ b/saas/config/storage.yml @@ -9,7 +9,7 @@ local: devminio: service: S3 bucket: fizzy-dev-activestorage - endpoint: "http://minio.localhost:39000" + endpoint: "http://minio.fizzy.localhost:39000" force_path_style: true request_checksum_calculation: when_required # default is when_supported with CRC64NVME checksum which FlashBlade doesn't support response_checksum_validation: when_required # default is when_supported with CRC64NVME checksum which FlashBlade doesn't support From 3a30d7796f542a8b09802960a539b890e14cad55 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 11:14:52 -0400 Subject: [PATCH 025/129] style: formalize preference for if/unless in rubocop (#2816) --- .rubocop.yml | 5 +++++ app/models/user/avatar.rb | 2 +- config/puma.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c0d945b705..f06669aabc 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -13,3 +13,8 @@ AllCops: - 'db/schema*.rb' - 'saas/db/migrate/**/*' - 'saas/db/saas_schema.rb' + +Style/NegatedIf: + Enabled: true +Style/NegatedUnless: + Enabled: true diff --git a/app/models/user/avatar.rb b/app/models/user/avatar.rb index 02e4376302..bdc14ba771 100644 --- a/app/models/user/avatar.rb +++ b/app/models/user/avatar.rb @@ -39,7 +39,7 @@ def publicly_accessible? private def avatar_content_type_allowed - if !ALLOWED_AVATAR_CONTENT_TYPES.include?(avatar.content_type) + unless ALLOWED_AVATAR_CONTENT_TYPES.include?(avatar.content_type) errors.add(:avatar, "must be a JPEG, PNG, GIF, or WebP image") end end diff --git a/config/puma.rb b/config/puma.rb index 70ca6ebb4e..d3e65c6710 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -22,7 +22,7 @@ plugin :yabeda_prometheus end -if !Rails.env.local? +unless Rails.env.local? # Because we expect fewer I/O waits than Rails apps that connect to the # database over the network, let's start with a baseline config of 1 # worker per CPU, 1 thread per worker and tune it from there. From 659ec1e6e6a6e85b0f551a1ba0ccabbc2704d888 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 11:16:29 -0400 Subject: [PATCH 026/129] Bump solid_queue from 1.3.2 to 1.4.0 (#2766) * Bump solid_queue from 1.3.2 to 1.4.0 Bumps [solid_queue](https://github.com/rails/solid_queue) from 1.3.2 to 1.4.0. - [Release notes](https://github.com/rails/solid_queue/releases) - [Commits](https://github.com/rails/solid_queue/compare/v1.3.2...v1.4.0) --- updated-dependencies: - dependency-name: solid_queue dependency-version: 1.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Sync Gemfile.saas.lock --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- Gemfile.saas.lock | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 4200deb313..1ae97bfa45 100644 --- a/Gemfile +++ b/Gemfile @@ -16,7 +16,7 @@ gem "kamal", require: false gem "puma", ">= 5.0" gem "solid_cable", ">= 3.0" gem "solid_cache", "~> 1.0" -gem "solid_queue", "~> 1.3" +gem "solid_queue", "~> 1.4" gem "sqlite3", ">= 2.0" gem "thruster", require: false gem "trilogy", "~> 2.11" diff --git a/Gemfile.lock b/Gemfile.lock index 36482e6e0d..1ca42bedd9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -429,7 +429,7 @@ GEM activejob (>= 7.2) activerecord (>= 7.2) railties (>= 7.2) - solid_queue (1.3.2) + solid_queue (1.4.0) activejob (>= 7.1) activerecord (>= 7.1) concurrent-ruby (>= 1.3.1) @@ -534,7 +534,7 @@ DEPENDENCIES selenium-webdriver solid_cable (>= 3.0) solid_cache (~> 1.0) - solid_queue (~> 1.3) + solid_queue (~> 1.4) sqlite3 (>= 2.0) stackprof stimulus-rails diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index 96c36298ac..ee5e74c87d 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -600,7 +600,7 @@ GEM activejob (>= 7.2) activerecord (>= 7.2) railties (>= 7.2) - solid_queue (1.3.2) + solid_queue (1.4.0) activejob (>= 7.1) activerecord (>= 7.1) concurrent-ruby (>= 1.3.1) From 759e6079e8aa6616bdd3f94afae368d33b9dd7c9 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 12:19:52 -0400 Subject: [PATCH 027/129] Update bin/bundle-drift to catch dependency requirement diffs (#2821) * Detect dependency requirement drift in bin/bundle-drift The checker only compared resolved spec versions between Gemfile.lock and Gemfile.saas.lock. When dependabot bumped solid_queue from ~> 1.3 to ~> 1.4, the forward command patched the resolved version but left the stale dependency requirement. The checker didn't catch it because both lockfiles resolved to the same version. Now find_drift also compares dependency requirements for shared direct dependencies, and forward patches the DEPENDENCIES section too. Includes built-in self-test (bin/bundle-drift self-test). * Sync solid_queue dependency requirement in Gemfile.saas.lock Updates ~> 1.3 to ~> 1.4 to match Gemfile.lock. --- Gemfile.saas.lock | 2 +- bin/bundle-drift | 168 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 149 insertions(+), 21 deletions(-) diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index ee5e74c87d..fc8ec79169 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -745,7 +745,7 @@ DEPENDENCIES sentry-ruby solid_cable (>= 3.0) solid_cache (~> 1.0) - solid_queue (~> 1.3) + solid_queue (~> 1.4) sqlite3 (>= 2.0) stackprof stimulus-rails diff --git a/bin/bundle-drift b/bin/bundle-drift index 08ea3713de..1a32962d62 100755 --- a/bin/bundle-drift +++ b/bin/bundle-drift @@ -3,9 +3,10 @@ # Since Gemfile.saas evals Gemfile, shared gems should have identical versions. # # Usage: -# bin/bundle-drift [check] # check for drift (default subcommand) -# bin/bundle-drift correct # restore alignment (Gemfile.saas.lock is authoritative) -# bin/bundle-drift forward # push Gemfile.lock changes into Gemfile.saas.lock +# bin/bundle-drift [check] # check for drift (default subcommand) +# bin/bundle-drift correct # restore alignment (Gemfile.saas.lock is authoritative) +# bin/bundle-drift forward # push Gemfile.lock changes into Gemfile.saas.lock +# bin/bundle-drift self-test # run built-in tests require "bundler" require "fileutils" @@ -31,12 +32,19 @@ class GemfileDriftChecker def find_drift oss_specs, saas_specs = specs_hash(@oss_lockfile), specs_hash(@saas_lockfile) + oss_deps, saas_deps = deps_hash(@oss_lockfile), deps_hash(@saas_lockfile) shared_gems = oss_specs.keys & saas_specs.keys + shared_deps = oss_deps.keys & saas_deps.keys shared_gems.filter_map do |name| oss_version, saas_version = oss_specs[name], saas_specs[name] - if oss_version != saas_version - { name: name, oss: oss_version, saas: saas_version } + version_drift = oss_version != saas_version + + oss_dep, saas_dep = oss_deps[name], saas_deps[name] + dep_drift = shared_deps.include?(name) && oss_dep != saas_dep + + if version_drift || dep_drift + { name: name, oss: oss_version, saas: saas_version, oss_dep: oss_dep, saas_dep: saas_dep } end end.sort_by { |d| d[:name] } end @@ -45,21 +53,31 @@ class GemfileDriftChecker lockfile.specs.to_h { |spec| [ spec.name, spec.version.to_s ] } end + def deps_hash(lockfile) + lockfile.dependencies.transform_values { |dep| dep.requirement.to_s } + end + def report(drift) if drift.empty? puts "✓ Gemfile.lock and Gemfile.saas.lock are in sync" else puts "✗ Gemfile lock files have drifted!\n\n" - name_width = [ drift.map { |d| d[:name].length }.max, "Gem".length ].max - oss_width = [ drift.map { |d| d[:oss].length }.max, "Gemfile.lock".length ].max - saas_width = [ drift.map { |d| d[:saas].length }.max, "Gemfile.saas.lock".length ].max + spec_drift = drift.select { |d| d[:oss] != d[:saas] } + dep_drift = drift.select { |d| d[:oss_dep] != d[:saas_dep] } - puts " #{"Gem".ljust(name_width)} #{"Gemfile.lock".ljust(oss_width)} Gemfile.saas.lock" - puts " #{"-" * name_width} #{"-" * oss_width} #{"-" * saas_width}" + if spec_drift.any? + puts " Spec versions:" + spec_drift.each do |d| + puts " #{d[:name]}: #{d[:oss]} (Gemfile.lock) vs #{d[:saas]} (Gemfile.saas.lock)" + end + end - drift.each do |d| - puts " #{d[:name].ljust(name_width)} #{d[:oss].ljust(oss_width)} #{d[:saas]}" + if dep_drift.any? + puts " Dependency requirements:" + dep_drift.each do |d| + puts " #{d[:name]}: #{d[:oss_dep]} (Gemfile.lock) vs #{d[:saas_dep]} (Gemfile.saas.lock)" + end end puts "\nRun 'bin/bundle-drift correct' to restore alignment." @@ -74,13 +92,10 @@ class GemfileDriftCorrector puts "\nRestoring alignment (Gemfile.saas.lock is authoritative)...\n\n" - # Save original for diff original_content = File.read(GEMFILE_LOCK) - # Seed Gemfile.lock with Gemfile.saas.lock - Bundler will use these as version hints FileUtils.cp(GEMFILE_SAAS_LOCK, GEMFILE_LOCK) - # Re-lock: Bundler prunes SaaS-only gems while preserving shared versions puts "▸ Re-locking Gemfile (seeded from Gemfile.saas.lock)" unless system("BUNDLE_GEMFILE=Gemfile bundle lock") File.write(GEMFILE_LOCK, original_content) @@ -124,15 +139,22 @@ class GemfileDriftForwarder drift = GemfileDriftChecker.new.check return puts "\nNothing to forward." if drift.empty? - puts "\nForwarding Gemfile.lock versions into Gemfile.saas.lock...\n\n" + puts "\nForwarding Gemfile.lock changes into Gemfile.saas.lock...\n\n" original_content = File.read(GEMFILE_SAAS_LOCK) patched_content = original_content.dup drift.each do |d| - puts " #{d[:name]} (#{d[:saas]}) → #{d[:name]} (#{d[:oss]})" - patched_content.gsub!(/#{Regexp.escape(d[:name])} \(#{Regexp.escape(d[:saas])}([^)]*)\)/) do - "#{d[:name]} (#{d[:oss]}#{$1})" + if d[:oss] != d[:saas] + puts " #{d[:name]}: spec #{d[:saas]} → #{d[:oss]}" + patched_content.gsub!(/#{Regexp.escape(d[:name])} \(#{Regexp.escape(d[:saas])}([^)]*)\)/) do + "#{d[:name]} (#{d[:oss]}#{$1})" + end + end + + if d[:oss_dep] && d[:saas_dep] && d[:oss_dep] != d[:saas_dep] + puts " #{d[:name]}: dep #{d[:saas_dep]} → #{d[:oss_dep]}" + patched_content = patch_dependency_requirement(patched_content, d[:name], d[:saas_dep], d[:oss_dep]) end end @@ -153,6 +175,23 @@ class GemfileDriftForwarder end private + def patch_dependency_requirement(content, name, old_req, new_req) + in_deps = false + content.lines.map do |line| + if line.strip == "DEPENDENCIES" + in_deps = true + elsif in_deps && line.match?(/\A\S/) + in_deps = false + end + + if in_deps + line.sub(/#{Regexp.escape(name)} \(#{Regexp.escape(old_req)}\)/, "#{name} (#{new_req})") + else + line + end + end.join + end + def show_diff(original, patched) require "tempfile" @@ -176,6 +215,95 @@ when "correct" GemfileDriftCorrector.new.correct when "forward" GemfileDriftForwarder.new.forward +when "self-test" + require "minitest/autorun" + require "tmpdir" + + LOCKFILE_TEMPLATE = <<~LOCKFILE + GEM + remote: https://rubygems.org/ + specs: + shared_gem (%{shared_version}) + oss_only_gem (1.0.0) + saas_only_gem (2.0.0) + + PLATFORMS + ruby + + DEPENDENCIES + %{dependencies} + + BUNDLED WITH + 2.6.2 + LOCKFILE + + class GemfileDriftCheckerTest < Minitest::Test + def setup + @original_dir = Dir.pwd + @tmpdir = Dir.mktmpdir("bundle-drift-test") + Dir.chdir(@tmpdir) + end + + def teardown + Dir.chdir(@original_dir) + FileUtils.rm_rf(@tmpdir) + end + + def test_detects_spec_version_drift + write_lockfiles( + oss_version: "1.0.0", oss_deps: " shared_gem (~> 1.0)\n oss_only_gem", + saas_version: "2.0.0", saas_deps: " shared_gem (~> 2.0)\n saas_only_gem" + ) + + drift = GemfileDriftChecker.new.send(:find_drift) + + assert_equal 1, drift.length + assert_equal "shared_gem", drift.first[:name] + end + + def test_detects_dependency_requirement_drift_even_when_spec_versions_match + write_lockfiles( + oss_version: "1.4.0", oss_deps: " shared_gem (~> 1.4)\n oss_only_gem", + saas_version: "1.4.0", saas_deps: " shared_gem (~> 1.3)\n saas_only_gem" + ) + + drift = GemfileDriftChecker.new.send(:find_drift) + + assert_equal 1, drift.length + assert_equal "shared_gem", drift.first[:name] + end + + def test_reports_no_drift_when_specs_and_dependencies_match + write_lockfiles( + oss_version: "1.4.0", oss_deps: " shared_gem (~> 1.4)\n oss_only_gem", + saas_version: "1.4.0", saas_deps: " shared_gem (~> 1.4)\n saas_only_gem" + ) + + drift = GemfileDriftChecker.new.send(:find_drift) + + assert_empty drift + end + + def test_forward_patches_dependency_requirements_in_addition_to_spec_versions + write_lockfiles( + oss_version: "1.4.0", oss_deps: " shared_gem (~> 1.4)\n oss_only_gem", + saas_version: "1.3.2", saas_deps: " shared_gem (~> 1.3)\n saas_only_gem" + ) + + capture_io { GemfileDriftForwarder.new.forward } + + saas_content = File.read("Gemfile.saas.lock") + assert_includes saas_content, "shared_gem (1.4.0)" + assert_includes saas_content, "shared_gem (~> 1.4)" + refute_includes saas_content, "shared_gem (~> 1.3)" + end + + private + def write_lockfiles(oss_version:, oss_deps:, saas_version:, saas_deps:) + File.write("Gemfile.lock", LOCKFILE_TEMPLATE % { shared_version: oss_version, dependencies: oss_deps }) + File.write("Gemfile.saas.lock", LOCKFILE_TEMPLATE % { shared_version: saas_version, dependencies: saas_deps }) + end + end else - abort "Usage: bin/bundle-drift [check|correct|forward]" + abort "Usage: bin/bundle-drift [check|correct|forward|self-test]" end From b07f592aaf10e477da686daa9e3efd1f46d67c6a Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 12:33:27 -0400 Subject: [PATCH 028/129] Fix broken background image after removal (#2817) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ActiveStorage::Record and ApplicationRecord used separate connection pools (from separate `connects_to` calls). This meant `belongs_to touch: true` on attachments silently failed — the card couldn't join the attachment's transaction to receive the deferred touch, so fragment caches were never invalidated after image removal. Fix by delegating `connection_pool` from ActiveStorage::Record to ApplicationRecord so they share a single pool. --- config/initializers/active_storage.rb | 16 ++++++++-------- test/models/storage/no_reuse_test.rb | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/config/initializers/active_storage.rb b/config/initializers/active_storage.rb index 586c292a16..0062d69793 100644 --- a/config/initializers/active_storage.rb +++ b/config/initializers/active_storage.rb @@ -19,15 +19,15 @@ def to_rich_text_attributes(*) end end -# Don't configure replica connections for ActiveStorage::Record. -# When ActiveStorage uses `connects_to`, it creates a separate connection pool -# from ApplicationRecord. This causes after_commit callbacks to fire in -# non-deterministic order - the Attachment's create_variants callback can fire -# before the User model's upload callback, causing FileNotFoundError when -# using `process: :immediately` for variants. -# See: https://github.com/rails/rails/issues/53694 +# ApplicationRecord calls `configure_replica_connections` to set up connection pools for the +# application models. We want ActiveStorage::Record to use the same pools for transactional +# integrity, proper callback invocation, joins, etc., however ActiveStorage::Record inherits from +# ActiveRecord::Base, not ApplicationRecord. This is how we make Active Storage always use the +# ApplicationRecord connection pool. ActiveSupport.on_load(:active_storage_record) do - configure_replica_connections + class << self + delegate :connection_pool, to: "ApplicationRecord" + end end module ActiveStorageControllerExtensions diff --git a/test/models/storage/no_reuse_test.rb b/test/models/storage/no_reuse_test.rb index e876fe50ca..1142e2a2eb 100644 --- a/test/models/storage/no_reuse_test.rb +++ b/test/models/storage/no_reuse_test.rb @@ -57,6 +57,32 @@ class Storage::NoReuseTest < ActiveSupport::TestCase ).count end + test "purge touches the record to invalidate cache" do + card = @board.cards.create!(title: "Card", creator: users(:david)) + card.image.attach(io: file_fixture("moon.jpg").open, filename: "moon.jpg", content_type: "image/jpeg") + + original_updated_at = card.reload.updated_at + + travel 1.second do + card.image.purge + end + + assert card.reload.updated_at > original_updated_at + end + + test "purge_later touches the record to invalidate cache" do + card = @board.cards.create!(title: "Card", creator: users(:david)) + card.image.attach(io: file_fixture("moon.jpg").open, filename: "moon.jpg", content_type: "image/jpeg") + + original_updated_at = card.reload.updated_at + + travel 1.second do + card.image.purge_later + end + + assert card.reload.updated_at > original_updated_at + end + test "purge_later does not purge blob when still attached elsewhere" do file = file_fixture("moon.jpg") blob = ActiveStorage::Blob.create_and_upload! \ From e70047ca0fdedb6bfc8ef0ca750e53252e39da45 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 12:43:01 -0400 Subject: [PATCH 029/129] Default development environment to app.fizzy.localhost (#2822) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using fizzy.localhost causes CORS errors when using minio for Active Storage because the minio endpoint is at minio.fizzy.localhost — a sibling subdomain, not a subdomain of the app host. Switching to app.fizzy.localhost makes both hosts subdomains of fizzy.localhost, resolving the CORS issue. See #2814 for the related minio CORS fix. fizzy.localhost will continue to work if people want to use it, but all docs and scripts have been updated to point to app.fizzy.localhost. --- AGENTS.md | 4 ++-- bin/dev | 2 +- config/environments/development.rb | 3 ++- docs/api/README.md | 6 +++--- docs/api/sections/account.md | 2 +- docs/api/sections/activities.md | 28 ++++++++++++++-------------- docs/api/sections/boards.md | 16 ++++++++-------- docs/api/sections/cards.md | 24 ++++++++++++------------ docs/api/sections/comments.md | 16 ++++++++-------- docs/api/sections/identity.md | 4 ++-- docs/api/sections/notifications.md | 6 +++--- docs/api/sections/pins.md | 14 +++++++------- docs/api/sections/reactions.md | 8 ++++---- docs/api/sections/tags.md | 4 ++-- docs/api/sections/users.md | 10 +++++----- docs/api/sections/webhooks.md | 10 +++++----- docs/development.md | 4 ++-- 17 files changed, 81 insertions(+), 80 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 64c69151aa..f72ef659c2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,7 +14,7 @@ bin/setup # Initial setup (installs gems, creates DB, loads schema) bin/dev # Start development server (runs on port 3006) ``` -Development URL: http://fizzy.localhost:3006 +Development URL: http://app.fizzy.localhost:3006 Login with: david@example.com (development fixtures), password will appear in the browser console ### Testing @@ -156,7 +156,7 @@ Allow people to move between OSS and SAAS Fizzy instances: ### Chrome MCP (Local Dev) -URL: `http://fizzy.localhost:3006` +URL: `http://app.fizzy.localhost:3006` Login: david@example.com (passwordless magic link auth - check rails console for link) Use Chrome MCP tools to interact with the running dev app for UI testing and debugging. diff --git a/bin/dev b/bin/dev index 4c11aa3b04..991de00c78 100755 --- a/bin/dev +++ b/bin/dev @@ -60,7 +60,7 @@ if [ "$USE_TAILSCALE" = "1" ]; then fi echo "Login with david@example.com to: https://$TS_HOSTNAME:$TS_PORT/" else - echo "Login with david@example.com to: http://fizzy.localhost:$PORT/" + echo "Login with david@example.com to: http://app.fizzy.localhost:$PORT/" fi ./bin/rails server -b 0.0.0.0 -p $PORT diff --git a/config/environments/development.rb b/config/environments/development.rb index afa223ced0..730a945dbd 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -86,7 +86,8 @@ end config.hosts = [ - "fizzy.localhost", + "app.fizzy.localhost", + "fizzy.localhost", # here for backwards compat, but will have CORS errors when using minio "localhost", "127.0.0.1", /fizzy-\d+/, # review apps: fizzy-123, fizzy-456:3000 diff --git a/docs/api/README.md b/docs/api/README.md index 065d09e632..12dd705444 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -110,9 +110,9 @@ and we use a dynamic page size where initial pages return fewer results than lat If there are more results to fetch, the response will include a `Link` header with a `rel="next"` link to the next page of results: ```bash -curl -H "Authorization: Bearer put-your-access-token-here" -H "Accept: application/json" -v http://fizzy.localhost:3006/686465299/cards +curl -H "Authorization: Bearer put-your-access-token-here" -H "Accept: application/json" -v http://app.fizzy.localhost:3006/686465299/cards # ... -< link: ; rel="next" +< link: ; rel="next" # ... ``` @@ -138,7 +138,7 @@ curl -X PUT \ -H "Authorization: Bearer put-your-access-token-here" \ -F "user[name]=David H. Hansson" \ -F "user[avatar]=@/path/to/avatar.jpg" \ - http://fizzy.localhost:3006/686465299/users/03f5v9zjw7pz8717a4no1h8a7 + http://app.fizzy.localhost:3006/686465299/users/03f5v9zjw7pz8717a4no1h8a7 ``` ## Rich Text Fields diff --git a/docs/api/sections/account.md b/docs/api/sections/account.md index 5db4e776ea..0360d094db 100644 --- a/docs/api/sections/account.md +++ b/docs/api/sections/account.md @@ -29,7 +29,7 @@ __Response:__ "code": "abc123", "usage_count": 3, "usage_limit": 10, - "url": "http://fizzy.localhost:3006/897362094/join/abc123", + "url": "http://app.fizzy.localhost:3006/897362094/join/abc123", "active": true } ``` diff --git a/docs/api/sections/activities.md b/docs/api/sections/activities.md index 3820bdd289..33bf1bf70b 100644 --- a/docs/api/sections/activities.md +++ b/docs/api/sections/activities.md @@ -65,7 +65,7 @@ __Response:__ "created_at": "2026-03-25T15:11:04.000Z", "description": "David Heinemeier Hansson moved \"Fix mobile login\" to \"Done\"", "particulars": {}, - "url": "http://fizzy.localhost:3006/897362094/cards/42", + "url": "http://app.fizzy.localhost:3006/897362094/cards/42", "eventable_type": "Card", "eventable": { "id": "03f6card042", @@ -82,7 +82,7 @@ __Response:__ "golden": false, "last_active_at": "2026-03-25T15:11:04.000Z", "created_at": "2026-03-25T09:00:00.000Z", - "url": "http://fizzy.localhost:3006/897362094/cards/42" + "url": "http://app.fizzy.localhost:3006/897362094/cards/42" }, "board": { "id": "03f6abc123", @@ -90,7 +90,7 @@ __Response:__ "all_access": true, "created_at": "2026-03-01T10:00:00.000Z", "auto_postpone_period_in_days": 14, - "url": "http://fizzy.localhost:3006/897362094/boards/03f6abc123" + "url": "http://app.fizzy.localhost:3006/897362094/boards/03f6abc123" }, "creator": { "id": "03f5user123", @@ -99,8 +99,8 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2026-03-01T09:00:00.000Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5user123", - "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5user123/avatar" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5user123", + "avatar_url": "http://app.fizzy.localhost:3006/897362094/users/03f5user123/avatar" } }, { @@ -109,7 +109,7 @@ __Response:__ "created_at": "2026-03-25T14:17:22.000Z", "description": "David Heinemeier Hansson commented on \"Fix mobile login\"", "particulars": {}, - "url": "http://fizzy.localhost:3006/897362094/cards/42#comment_03facomment9", + "url": "http://app.fizzy.localhost:3006/897362094/cards/42#comment_03facomment9", "eventable_type": "Comment", "eventable": { "id": "03facomment9", @@ -126,15 +126,15 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2026-03-01T09:00:00.000Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5user123", - "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5user123/avatar" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5user123", + "avatar_url": "http://app.fizzy.localhost:3006/897362094/users/03f5user123/avatar" }, "card": { "id": "03f6card042", - "url": "http://fizzy.localhost:3006/897362094/cards/42" + "url": "http://app.fizzy.localhost:3006/897362094/cards/42" }, - "reactions_url": "http://fizzy.localhost:3006/897362094/cards/42/comments/03facomment9/reactions", - "url": "http://fizzy.localhost:3006/897362094/cards/42/comments/03facomment9" + "reactions_url": "http://app.fizzy.localhost:3006/897362094/cards/42/comments/03facomment9/reactions", + "url": "http://app.fizzy.localhost:3006/897362094/cards/42/comments/03facomment9" }, "board": { "id": "03f6abc123", @@ -142,7 +142,7 @@ __Response:__ "all_access": true, "created_at": "2026-03-01T10:00:00.000Z", "auto_postpone_period_in_days": 14, - "url": "http://fizzy.localhost:3006/897362094/boards/03f6abc123" + "url": "http://app.fizzy.localhost:3006/897362094/boards/03f6abc123" }, "creator": { "id": "03f5user123", @@ -151,8 +151,8 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2026-03-01T09:00:00.000Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5user123", - "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5user123/avatar" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5user123", + "avatar_url": "http://app.fizzy.localhost:3006/897362094/users/03f5user123/avatar" } } ] diff --git a/docs/api/sections/boards.md b/docs/api/sections/boards.md index b3157cdcd3..ccaab44bdb 100644 --- a/docs/api/sections/boards.md +++ b/docs/api/sections/boards.md @@ -16,7 +16,7 @@ __Response:__ "all_access": true, "created_at": "2025-12-05T19:36:35.534Z", "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "url": "http://app.fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", "creator": { "id": "03f5v9zjw7pz8717a4no1h8a7", "name": "David Heinemeier Hansson", @@ -24,7 +24,7 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" } } ] @@ -43,7 +43,7 @@ __Response:__ "all_access": false, "created_at": "2025-12-05T19:36:35.534Z", "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "url": "http://app.fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", "creator": { "id": "03f5v9zjw7pz8717a4no1h8a7", "name": "David Heinemeier Hansson", @@ -51,7 +51,7 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" }, "public_description": "Follow along with public product updates.", "public_description_html": "

Follow along with public product updates.

", @@ -59,7 +59,7 @@ __Response:__ "03f5v9zjw7pz8717a4no1h8a7", "03f5v9zppzlksuj4mxba2nbzn" ], - "public_url": "http://fizzy.localhost:3006/897362094/public/boards/aB3dEfGhIjKlMnOp" + "public_url": "http://app.fizzy.localhost:3006/897362094/public/boards/aB3dEfGhIjKlMnOp" } ``` @@ -157,7 +157,7 @@ HTTP/1.1 201 Created "all_access": true, "created_at": "2025-12-05T19:36:35.534Z", "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "url": "http://app.fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", "creator": { "id": "03f5v9zjw7pz8717a4no1h8a7", "name": "David Heinemeier Hansson", @@ -165,9 +165,9 @@ HTTP/1.1 201 Created "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" }, - "public_url": "http://fizzy.localhost:3006/897362094/public/boards/aB3dEfGhIjKlMnOp" + "public_url": "http://app.fizzy.localhost:3006/897362094/public/boards/aB3dEfGhIjKlMnOp" } ``` diff --git a/docs/api/sections/cards.md b/docs/api/sections/cards.md index 83ca512534..2235788843 100644 --- a/docs/api/sections/cards.md +++ b/docs/api/sections/cards.md @@ -40,14 +40,14 @@ __Response:__ "golden": false, "last_active_at": "2025-12-05T19:38:48.553Z", "created_at": "2025-12-05T19:38:48.540Z", - "url": "http://fizzy.localhost:3006/897362094/cards/4", + "url": "http://app.fizzy.localhost:3006/897362094/cards/4", "board": { "id": "03f5v9zkft4hj9qq0lsn9ohcm", "name": "Fizzy", "all_access": true, "created_at": "2025-12-05T19:36:35.534Z", "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "url": "http://app.fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", "creator": { "id": "03f5v9zjw7pz8717a4no1h8a7", "name": "David Heinemeier Hansson", @@ -55,7 +55,7 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" } }, "creator": { @@ -65,10 +65,10 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" }, - "comments_url": "http://fizzy.localhost:3006/897362094/cards/4/comments", - "reactions_url": "http://fizzy.localhost:3006/897362094/cards/4/reactions" + "comments_url": "http://app.fizzy.localhost:3006/897362094/cards/4/comments", + "reactions_url": "http://app.fizzy.localhost:3006/897362094/cards/4/reactions" } ] ``` @@ -94,14 +94,14 @@ __Response:__ "golden": false, "last_active_at": "2025-12-05T19:38:48.553Z", "created_at": "2025-12-05T19:38:48.540Z", - "url": "http://fizzy.localhost:3006/897362094/cards/4", + "url": "http://app.fizzy.localhost:3006/897362094/cards/4", "board": { "id": "03f5v9zkft4hj9qq0lsn9ohcm", "name": "Fizzy", "all_access": true, "created_at": "2025-12-05T19:36:35.534Z", "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "url": "http://app.fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", "creator": { "id": "03f5v9zjw7pz8717a4no1h8a7", "name": "David Heinemeier Hansson", @@ -109,7 +109,7 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" } }, "column": { @@ -128,10 +128,10 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" }, - "comments_url": "http://fizzy.localhost:3006/897362094/cards/4/comments", - "reactions_url": "http://fizzy.localhost:3006/897362094/cards/4/reactions", + "comments_url": "http://app.fizzy.localhost:3006/897362094/cards/4/comments", + "reactions_url": "http://app.fizzy.localhost:3006/897362094/cards/4/reactions", "steps": [ { "id": "03f8huu0sog76g3s975963b5e", diff --git a/docs/api/sections/comments.md b/docs/api/sections/comments.md index a0854acc22..80a5f13dad 100644 --- a/docs/api/sections/comments.md +++ b/docs/api/sections/comments.md @@ -25,14 +25,14 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" }, "card": { "id": "03f5v9zo9qlcwwpyc0ascnikz", - "url": "http://fizzy.localhost:3006/897362094/cards/03f5v9zo9qlcwwpyc0ascnikz" + "url": "http://app.fizzy.localhost:3006/897362094/cards/03f5v9zo9qlcwwpyc0ascnikz" }, - "reactions_url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions", - "url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz" + "reactions_url": "http://app.fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions", + "url": "http://app.fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz" } ] ``` @@ -59,14 +59,14 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" }, "card": { "id": "03f5v9zo9qlcwwpyc0ascnikz", - "url": "http://fizzy.localhost:3006/897362094/cards/03f5v9zo9qlcwwpyc0ascnikz" + "url": "http://app.fizzy.localhost:3006/897362094/cards/03f5v9zo9qlcwwpyc0ascnikz" }, - "reactions_url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions", - "url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz" + "reactions_url": "http://app.fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions", + "url": "http://app.fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz" } ``` diff --git a/docs/api/sections/identity.md b/docs/api/sections/identity.md index 9c3352095d..706fe66847 100644 --- a/docs/api/sections/identity.md +++ b/docs/api/sections/identity.md @@ -23,7 +23,7 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/users/03f5v9zjw7pz8717a4no1h8a7" } }, { @@ -38,7 +38,7 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:36.783Z", - "url": "http://fizzy.localhost:3006/users/03f5v9zppzlksuj4mxba2nbzn" + "url": "http://app.fizzy.localhost:3006/users/03f5v9zppzlksuj4mxba2nbzn" } } ] diff --git a/docs/api/sections/notifications.md b/docs/api/sections/notifications.md index 9a4bdd562d..6bddff141c 100644 --- a/docs/api/sections/notifications.md +++ b/docs/api/sections/notifications.md @@ -24,15 +24,15 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" }, "card": { "id": "03f5v9zo9qlcwwpyc0ascnikz", "title": "Plain text mentions", "status": "published", - "url": "http://fizzy.localhost:3006/897362094/cards/3" + "url": "http://app.fizzy.localhost:3006/897362094/cards/3" }, - "url": "http://fizzy.localhost:3006/897362094/notifications/03f5va03bpuvkcjemcxl73ho2" + "url": "http://app.fizzy.localhost:3006/897362094/notifications/03f5va03bpuvkcjemcxl73ho2" } ] ``` diff --git a/docs/api/sections/pins.md b/docs/api/sections/pins.md index 0df248698c..19fecacb90 100644 --- a/docs/api/sections/pins.md +++ b/docs/api/sections/pins.md @@ -39,14 +39,14 @@ __Response:__ "golden": false, "last_active_at": "2025-12-05T19:38:48.553Z", "created_at": "2025-12-05T19:38:48.540Z", - "url": "http://fizzy.localhost:3006/897362094/cards/4", + "url": "http://app.fizzy.localhost:3006/897362094/cards/4", "board": { "id": "03f5v9zkft4hj9qq0lsn9ohcm", "name": "Fizzy", "all_access": true, "created_at": "2025-12-05T19:36:35.534Z", "auto_postpone_period_in_days": 30, - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "url": "http://app.fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", "creator": { "id": "03f5v9zjw7pz8717a4no1h8a7", "name": "David Heinemeier Hansson", @@ -54,8 +54,8 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", - "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", + "avatar_url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar" } }, "creator": { @@ -65,10 +65,10 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", - "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", + "avatar_url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar" }, - "comments_url": "http://fizzy.localhost:3006/897362094/cards/4/comments" + "comments_url": "http://app.fizzy.localhost:3006/897362094/cards/4/comments" } ] ``` diff --git a/docs/api/sections/reactions.md b/docs/api/sections/reactions.md index 7ad7b57299..4eb5e78f02 100644 --- a/docs/api/sections/reactions.md +++ b/docs/api/sections/reactions.md @@ -22,9 +22,9 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" }, - "url": "http://fizzy.localhost:3006/897362094/cards/3/reactions/03f5v9zo9qlcwwpyc0ascnikz" + "url": "http://app.fizzy.localhost:3006/897362094/cards/3/reactions/03f5v9zo9qlcwwpyc0ascnikz" } ] ``` @@ -81,9 +81,9 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" }, - "url": "http://fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions/03f5v9zo9qlcwwpyc0ascnikz" + "url": "http://app.fizzy.localhost:3006/897362094/cards/3/comments/03f5v9zo9qlcwwpyc0ascnikz/reactions/03f5v9zo9qlcwwpyc0ascnikz" } ] ``` diff --git a/docs/api/sections/tags.md b/docs/api/sections/tags.md index 4e18163418..89e1c4550c 100644 --- a/docs/api/sections/tags.md +++ b/docs/api/sections/tags.md @@ -14,13 +14,13 @@ __Response:__ "id": "03f5v9zo9qlcwwpyc0ascnikz", "title": "bug", "created_at": "2025-12-05T19:36:35.534Z", - "url": "http://fizzy.localhost:3006/897362094/cards?tag_ids[]=03f5v9zo9qlcwwpyc0ascnikz" + "url": "http://app.fizzy.localhost:3006/897362094/cards?tag_ids[]=03f5v9zo9qlcwwpyc0ascnikz" }, { "id": "03f5v9zo9qlcwwpyc0ascnilz", "title": "feature", "created_at": "2025-12-05T19:36:35.534Z", - "url": "http://fizzy.localhost:3006/897362094/cards?tag_ids[]=03f5v9zo9qlcwwpyc0ascnilz" + "url": "http://app.fizzy.localhost:3006/897362094/cards?tag_ids[]=03f5v9zo9qlcwwpyc0ascnilz" } ] ``` diff --git a/docs/api/sections/users.md b/docs/api/sections/users.md index b30986c10e..0d4d2889a2 100644 --- a/docs/api/sections/users.md +++ b/docs/api/sections/users.md @@ -17,7 +17,7 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" }, { "id": "03f5v9zjysoy0fqs9yg0ei3hq", @@ -26,7 +26,7 @@ __Response:__ "active": true, "email_address": "jason@example.com", "created_at": "2025-12-05T19:36:35.419Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjysoy0fqs9yg0ei3hq" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjysoy0fqs9yg0ei3hq" }, { "id": "03f5v9zk1dtqduod5bkhv3k8m", @@ -35,7 +35,7 @@ __Response:__ "active": true, "email_address": "jz@example.com", "created_at": "2025-12-05T19:36:35.435Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zk1dtqduod5bkhv3k8m" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zk1dtqduod5bkhv3k8m" }, { "id": "03f5v9zk3nw9ja92e7s4h2wbe", @@ -44,7 +44,7 @@ __Response:__ "active": true, "email_address": "kevin@example.com", "created_at": "2025-12-05T19:36:35.451Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zk3nw9ja92e7s4h2wbe" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zk3nw9ja92e7s4h2wbe" } ] ``` @@ -63,7 +63,7 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" } ``` diff --git a/docs/api/sections/webhooks.md b/docs/api/sections/webhooks.md index 28eedfea7a..a4f48b5b14 100644 --- a/docs/api/sections/webhooks.md +++ b/docs/api/sections/webhooks.md @@ -18,13 +18,13 @@ __Response:__ "signing_secret": "p94Bx2HjempCdYB4DTyZkY1b", "subscribed_actions": ["card_published", "card_assigned", "card_closed"], "created_at": "2025-12-05T19:36:35.534Z", - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy/webhooks/03f5v9zkft4hj9qq0lsn9ohcm", + "url": "http://app.fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy/webhooks/03f5v9zkft4hj9qq0lsn9ohcm", "board": { "id": "03f5v9zkft4hj9qq0lsn9ohcy", "name": "Fizzy", "all_access": true, "created_at": "2025-12-05T19:36:35.534Z", - "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy", + "url": "http://app.fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy", "creator": { "id": "03f5v9zjw7pz8717a4no1h8a7", "name": "David Heinemeier Hansson", @@ -32,7 +32,7 @@ __Response:__ "active": true, "email_address": "david@example.com", "created_at": "2025-12-05T19:36:35.401Z", - "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" + "url": "http://app.fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7" } } } @@ -70,7 +70,7 @@ __Response:__ ``` HTTP/1.1 201 Created -Location: http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy/webhooks/03f5v9zkft4hj9qq0lsn9ohcm.json +Location: http://app.fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcy/webhooks/03f5v9zkft4hj9qq0lsn9ohcm.json ``` Returns the created webhook in the response body. @@ -151,7 +151,7 @@ __Response:__ "eventable": { "type": "Card", "id": "03f5v9zkft4hj9qq0lsn9ohdb", - "url": "http://fizzy.localhost:3006/897362094/cards/1" + "url": "http://app.fizzy.localhost:3006/897362094/cards/1" } } } diff --git a/docs/development.md b/docs/development.md index 8fa1e54674..3b7e16e903 100644 --- a/docs/development.md +++ b/docs/development.md @@ -15,7 +15,7 @@ And then run the development server: bin/dev ``` -You'll be able to access the app in development at http://fizzy.localhost:3006. +You'll be able to access the app in development at http://app.fizzy.localhost:3006. To login, enter `david@example.com` and grab the verification code from the browser console to sign in. @@ -62,7 +62,7 @@ The remote CI pipeline will run tests against both SQLite and MySQL. ### Outbound Emails -You can view email previews at http://fizzy.localhost:3006/rails/mailers. +You can view email previews at http://app.fizzy.localhost:3006/rails/mailers. You can enable or disable [`letter_opener`](https://github.com/ryanb/letter_opener) to open sent emails automatically with: From 69daae79f165c28db7c22e05e52de70fa02eb13c Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Thu, 9 Apr 2026 12:54:25 -0400 Subject: [PATCH 030/129] Add board membership read endpoint (#2799) * Add board membership read endpoint * Paginate board membership read endpoint --- app/controllers/boards/accesses_controller.rb | 14 +++ app/views/boards/accesses/index.json.jbuilder | 8 ++ config/routes.rb | 1 + docs/api/sections/boards.md | 50 +++++++++ .../boards/accesses_controller_test.rb | 105 ++++++++++++++++++ 5 files changed, 178 insertions(+) create mode 100644 app/controllers/boards/accesses_controller.rb create mode 100644 app/views/boards/accesses/index.json.jbuilder create mode 100644 test/controllers/boards/accesses_controller_test.rb diff --git a/app/controllers/boards/accesses_controller.rb b/app/controllers/boards/accesses_controller.rb new file mode 100644 index 0000000000..fbb1fe97d7 --- /dev/null +++ b/app/controllers/boards/accesses_controller.rb @@ -0,0 +1,14 @@ +class Boards::AccessesController < ApplicationController + include BoardScoped + + def index + set_page_and_extract_portion_from @board.account.users.active.alphabetically.includes(:identity) + end + + private + def involvement_by_user + @involvement_by_user ||= @board.accesses.where(user_id: @page.records.map(&:id)).pluck(:user_id, :involvement).to_h + end + + helper_method :involvement_by_user +end diff --git a/app/views/boards/accesses/index.json.jbuilder b/app/views/boards/accesses/index.json.jbuilder new file mode 100644 index 0000000000..37498fc1fb --- /dev/null +++ b/app/views/boards/accesses/index.json.jbuilder @@ -0,0 +1,8 @@ +json.board_id @board.id +json.all_access @board.all_access? + +json.users @page.records do |user| + json.partial! "users/user", user: user + json.has_access involvement_by_user.key?(user.id) + json.involvement involvement_by_user[user.id] +end diff --git a/config/routes.rb b/config/routes.rb index 6c01c8d02c..4d5acf9887 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -27,6 +27,7 @@ resources :boards do scope module: :boards do + resources :accesses, only: :index resource :subscriptions resource :involvement resource :publication diff --git a/docs/api/sections/boards.md b/docs/api/sections/boards.md index ccaab44bdb..fcce327628 100644 --- a/docs/api/sections/boards.md +++ b/docs/api/sections/boards.md @@ -136,6 +136,56 @@ __Response:__ Returns `204 No Content` on success. +## Board Accesses + +Board accesses let you see who has access to a board and their involvement level (watching or access only). Any board member can view this information. + +### `GET /:account_slug/boards/:board_id/accesses` + +Returns a paginated list of active account users with their access status for the specified board. + +__Response:__ + +```json +{ + "board_id": "03f5v9zkft4hj9qq0lsn9ohcm", + "all_access": false, + "users": [ + { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", + "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar", + "has_access": true, + "involvement": "watching" + }, + { + "id": "03f5v9zppzlksuj4mxba2nbzn", + "name": "Kevin Clark", + "role": "admin", + "active": true, + "email_address": "kevin@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zppzlksuj4mxba2nbzn", + "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5v9zppzlksuj4mxba2nbzn/avatar", + "has_access": false, + "involvement": null + } + ] +} +``` + +- `has_access` indicates whether the user has access to the board +- `involvement` is `"watching"`, `"access_only"`, or `null` (when the user does not have access) +- When `all_access` is `true`, all active account users have access to the board +- The `users` array contains the current page of results; if there are more users, follow the `Link` response header with `rel="next"` + +To change who has access, use `PUT /:account_slug/boards/:board_id` with the `user_ids` parameter. + ## Board Publications Publishing a board makes it publicly accessible via a shareable link, without requiring authentication. Only board administrators can publish or unpublish a board. diff --git a/test/controllers/boards/accesses_controller_test.rb b/test/controllers/boards/accesses_controller_test.rb new file mode 100644 index 0000000000..6f883f19a2 --- /dev/null +++ b/test/controllers/boards/accesses_controller_test.rb @@ -0,0 +1,105 @@ +require "test_helper" + +class Boards::AccessesControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in_as :kevin + end + + test "index returns active account users with access status" do + board = boards(:writebook) + + get board_accesses_path(board), as: :json + assert_response :success + + body = @response.parsed_body + assert_equal board.id, body["board_id"] + assert body["all_access"] + + user_ids = body["users"].map { |u| u["id"] } + accounts("37s").users.active.each do |user| + assert_includes user_ids, user.id + end + end + + test "index includes has_access and involvement for users with access" do + board = boards(:writebook) + board.access_for(users(:kevin)).update!(involvement: :watching) + + get board_accesses_path(board), as: :json + + kevin_entry = @response.parsed_body["users"].find { |u| u["id"] == users(:kevin).id } + assert kevin_entry["has_access"] + assert_equal "watching", kevin_entry["involvement"] + end + + test "index shows has_access false and nil involvement for users without access" do + board = boards(:private) + + get board_accesses_path(board), as: :json + assert_response :success + + david_entry = @response.parsed_body["users"].find { |u| u["id"] == users(:david).id } + assert_not david_entry["has_access"] + assert_nil david_entry["involvement"] + end + + test "index includes standard user fields" do + get board_accesses_path(boards(:writebook)), as: :json + + user_entry = @response.parsed_body["users"].first + assert user_entry.key?("id") + assert user_entry.key?("name") + assert user_entry.key?("role") + assert user_entry.key?("email_address") + assert user_entry.key?("avatar_url") + end + + test "index requires board access" do + logout_and_sign_in_as :david + board = boards(:private) + + get board_accesses_path(board), as: :json + assert_response :not_found + end + + test "index is accessible to non-admin board members" do + logout_and_sign_in_as :jz + board = boards(:writebook) + + get board_accesses_path(board), as: :json + assert_response :success + end + + test "index paginates account users" do + account = accounts("37s") + board = boards(:private) + + 200.times do |index| + identity = Identity.create!(email_address: "board-membership-#{index}@example.com") + account.users.create!(identity: identity, name: "Board Membership User #{index}", role: :member) + end + + expected_ids = account.users.active.alphabetically.pluck(:id) + actual_ids = [] + next_page = board_accesses_path(board, format: :json) + page_count = 0 + + while next_page + get next_page, as: :json + assert_response :success + + page_count += 1 + actual_ids.concat(@response.parsed_body["users"].map { |user| user["id"] }) + next_page = next_page_from_link_header(@response.headers["Link"]) + end + + assert_equal expected_ids, actual_ids + assert_operator page_count, :>, 1 + end + + private + def next_page_from_link_header(link_header) + url = link_header&.match(/<([^>]+)>;\s*rel="next"/)&.captures&.first + URI.parse(url).request_uri if url + end +end From 1c6141c131f554c925829fd0508e3df489326014 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 9 Apr 2026 19:06:59 +0200 Subject: [PATCH 031/129] Update lexxy to 0.9.5.beta (#2820) * Update lexxy to 0.9.5.beta * Fix syntax highlight controller for lexxy 0.9.5.beta The highlightAll export was renamed to highlightCode. --------- Co-authored-by: Mike Dalessio --- Gemfile | 2 +- Gemfile.lock | 10 +++++----- Gemfile.saas.lock | 10 +++++----- .../controllers/syntax_highlight_controller.js | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Gemfile b/Gemfile index 1ae97bfa45..b073e67c2c 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,7 @@ gem "geared_pagination", "~> 1.2" gem "rqrcode" gem "rouge" gem "jbuilder" -gem "lexxy", "0.9.2.beta" +gem "lexxy", "0.9.5.beta" gem "image_processing", "~> 1.14" gem "platform_agent" gem "aws-sdk-s3", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 1ca42bedd9..b06660cf0b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,7 +15,7 @@ GIT GIT remote: https://github.com/rails/rails.git - revision: 12e24eaf2f0a9613e015653f013dd131317d9bf5 + revision: 75f9e28379ac7418b82fa950cfa81f6147275308 branch: main specs: actioncable (8.2.0.alpha) @@ -46,7 +46,7 @@ GIT rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) - rails-html-sanitizer (~> 1.6) + rails-html-sanitizer (~> 1.7) useragent (~> 0.16) actiontext (8.2.0.alpha) action_text-trix (~> 2.1.16) @@ -61,7 +61,7 @@ GIT builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) - rails-html-sanitizer (~> 1.6) + rails-html-sanitizer (~> 1.7) activejob (8.2.0.alpha) activesupport (= 8.2.0.alpha) globalid (>= 0.3.6) @@ -254,7 +254,7 @@ GEM logger (~> 1.6) letter_opener (1.10.0) launchy (>= 2.2, < 4) - lexxy (0.9.2.beta) + lexxy (0.9.5.beta) rails (>= 8.0.2) lint_roller (1.1.0) logger (1.7.0) @@ -518,7 +518,7 @@ DEPENDENCIES jbuilder kamal letter_opener - lexxy (= 0.9.2.beta) + lexxy (= 0.9.5.beta) mission_control-jobs mittens mocha diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index fc8ec79169..9c095750a3 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -64,7 +64,7 @@ GIT GIT remote: https://github.com/rails/rails.git - revision: 12e24eaf2f0a9613e015653f013dd131317d9bf5 + revision: 75f9e28379ac7418b82fa950cfa81f6147275308 branch: main specs: actioncable (8.2.0.alpha) @@ -95,7 +95,7 @@ GIT rack-session (>= 1.0.1) rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) - rails-html-sanitizer (~> 1.6) + rails-html-sanitizer (~> 1.7) useragent (~> 0.16) actiontext (8.2.0.alpha) action_text-trix (~> 2.1.16) @@ -110,7 +110,7 @@ GIT builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) - rails-html-sanitizer (~> 1.6) + rails-html-sanitizer (~> 1.7) activejob (8.2.0.alpha) activesupport (= 8.2.0.alpha) globalid (>= 0.3.6) @@ -367,7 +367,7 @@ GEM logger (~> 1.6) letter_opener (1.10.0) launchy (>= 2.2, < 4) - lexxy (0.9.2.beta) + lexxy (0.9.5.beta) rails (>= 8.0.2) lint_roller (1.1.0) logger (1.7.0) @@ -724,7 +724,7 @@ DEPENDENCIES jbuilder kamal letter_opener - lexxy (= 0.9.2.beta) + lexxy (= 0.9.5.beta) mission_control-jobs mittens mocha diff --git a/app/javascript/controllers/syntax_highlight_controller.js b/app/javascript/controllers/syntax_highlight_controller.js index cfaf93ba10..9dd82f959e 100644 --- a/app/javascript/controllers/syntax_highlight_controller.js +++ b/app/javascript/controllers/syntax_highlight_controller.js @@ -1,8 +1,8 @@ import { Controller } from "@hotwired/stimulus" -import { highlightAll } from "lexxy" +import { highlightCode } from "lexxy" export default class extends Controller { connect() { - highlightAll() + highlightCode() } } From e422d5b37ed31f0a1c4d5575c9d38793c1c239f1 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Thu, 9 Apr 2026 13:17:02 -0400 Subject: [PATCH 032/129] Add a JSON cards endpoint for workflow columns (#2800) * Add JSON endpoint for cards in workflow columns * Add cards URL to column JSON responses * Add coverage for column cards authorization --- .../boards/columns/cards_controller.rb | 19 ++++ .../boards/columns/cards/index.json.jbuilder | 1 + app/views/columns/_column.json.jbuilder | 1 + config/routes.rb | 6 +- docs/api/sections/columns.md | 93 ++++++++++++++++++- .../boards/columns/cards_controller_test.rb | 29 ++++++ .../boards/columns_controller_test.rb | 3 + 7 files changed, 147 insertions(+), 5 deletions(-) create mode 100644 app/controllers/boards/columns/cards_controller.rb create mode 100644 app/views/boards/columns/cards/index.json.jbuilder create mode 100644 test/controllers/boards/columns/cards_controller_test.rb diff --git a/app/controllers/boards/columns/cards_controller.rb b/app/controllers/boards/columns/cards_controller.rb new file mode 100644 index 0000000000..ae6602f14a --- /dev/null +++ b/app/controllers/boards/columns/cards_controller.rb @@ -0,0 +1,19 @@ +class Boards::Columns::CardsController < ApplicationController + include BoardScoped + + before_action :set_column + + def index + set_page_and_extract_portion_from @column.cards.active.latest.with_golden_first.preloaded + fresh_when etag: @page.records + + respond_to do |format| + format.json + end + end + + private + def set_column + @column = @board.columns.find(params[:column_id]) + end +end diff --git a/app/views/boards/columns/cards/index.json.jbuilder b/app/views/boards/columns/cards/index.json.jbuilder new file mode 100644 index 0000000000..c1dc1dff15 --- /dev/null +++ b/app/views/boards/columns/cards/index.json.jbuilder @@ -0,0 +1 @@ +json.array! @page.records, partial: "cards/card", as: :card diff --git a/app/views/columns/_column.json.jbuilder b/app/views/columns/_column.json.jbuilder index 5bb56bdd6f..16f5604d06 100644 --- a/app/views/columns/_column.json.jbuilder +++ b/app/views/columns/_column.json.jbuilder @@ -1,4 +1,5 @@ json.cache! column do json.(column, :id, :name, :color) json.created_at column.created_at.utc + json.cards_url board_column_cards_url(column.board, column) end diff --git a/config/routes.rb b/config/routes.rb index 4d5acf9887..55262e78e2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -39,7 +39,11 @@ resource :closed end - resources :columns + resources :columns do + scope module: :columns do + resources :cards, only: :index + end + end end resources :cards, only: :create diff --git a/docs/api/sections/columns.md b/docs/api/sections/columns.md index 73bd1c728d..c4fc35d3be 100644 --- a/docs/api/sections/columns.md +++ b/docs/api/sections/columns.md @@ -14,20 +14,22 @@ __Response:__ "id": "03f5v9zkft4hj9qq0lsn9ohcm", "name": "Recording", "color": "var(--color-card-default)", - "created_at": "2025-12-05T19:36:35.534Z" + "created_at": "2025-12-05T19:36:35.534Z", + "cards_url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm/columns/03f5v9zkft4hj9qq0lsn9ohcm/cards" }, { "id": "03f5v9zkft4hj9qq0lsn9ohcn", "name": "Published", "color": "var(--color-card-4)", - "created_at": "2025-12-05T19:36:35.534Z" + "created_at": "2025-12-05T19:36:35.534Z", + "cards_url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm/columns/03f5v9zkft4hj9qq0lsn9ohcn/cards" } ] ``` ## `GET /:account_slug/boards/:board_id/columns/:column_id` -Returns the specified column. +Returns the specified column metadata. __Response:__ @@ -36,10 +38,93 @@ __Response:__ "id": "03f5v9zkft4hj9qq0lsn9ohcm", "name": "In Progress", "color": "var(--color-card-default)", - "created_at": "2025-12-05T19:36:35.534Z" + "created_at": "2025-12-05T19:36:35.534Z", + "cards_url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm/columns/03f5v9zkft4hj9qq0lsn9ohcm/cards" } ``` +## `GET /:account_slug/boards/:board_id/columns/:column_id/cards` + +Returns a paginated list of open cards in the specified workflow column. +This only includes cards triaged into that column. Cards in "Maybe?", "Not Now", and "Done" +are not included. + +The response items have the same shape as `GET /:account_slug/cards`. + +__Response:__ + +```json +[ + { + "id": "03f5vaeq985jlvwv3arl4srq2", + "number": 1, + "title": "First!", + "status": "published", + "description": "Hello, World!", + "description_html": "

Hello, World!

", + "image_url": null, + "has_attachments": false, + "tags": ["programming"], + "closed": false, + "postponed": false, + "golden": false, + "last_active_at": "2025-12-05T19:38:48.553Z", + "created_at": "2025-12-05T19:38:48.540Z", + "url": "http://fizzy.localhost:3006/897362094/cards/4", + "board": { + "id": "03f5v9zkft4hj9qq0lsn9ohcm", + "name": "Fizzy", + "all_access": true, + "created_at": "2025-12-05T19:36:35.534Z", + "auto_postpone_period_in_days": 30, + "url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm", + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", + "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar" + } + }, + "column": { + "id": "03f5v9zkft4hj9qq0lsn9ohcn", + "name": "In Progress", + "color": "var(--color-card-4)", + "created_at": "2025-12-05T19:36:35.534Z", + "cards_url": "http://fizzy.localhost:3006/897362094/boards/03f5v9zkft4hj9qq0lsn9ohcm/columns/03f5v9zkft4hj9qq0lsn9ohcn/cards" + }, + "creator": { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", + "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar" + }, + "assignees": [ + { + "id": "03f5v9zjw7pz8717a4no1h8a7", + "name": "David Heinemeier Hansson", + "role": "owner", + "active": true, + "email_address": "david@example.com", + "created_at": "2025-12-05T19:36:35.401Z", + "url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7", + "avatar_url": "http://fizzy.localhost:3006/897362094/users/03f5v9zjw7pz8717a4no1h8a7/avatar" + } + ], + "has_more_assignees": false, + "comments_url": "http://fizzy.localhost:3006/897362094/cards/4/comments", + "reactions_url": "http://fizzy.localhost:3006/897362094/cards/4/reactions" + } +] +``` + ## `POST /:account_slug/boards/:board_id/columns` Creates a new column on the board. diff --git a/test/controllers/boards/columns/cards_controller_test.rb b/test/controllers/boards/columns/cards_controller_test.rb new file mode 100644 index 0000000000..bb65bdfb5d --- /dev/null +++ b/test/controllers/boards/columns/cards_controller_test.rb @@ -0,0 +1,29 @@ +require "test_helper" + +class Boards::Columns::CardsControllerTest < ActionDispatch::IntegrationTest + setup do + sign_in_as :kevin + end + + test "index as JSON" do + column = columns(:writebook_in_progress) + + get board_column_cards_path(column.board, column), as: :json + + assert_response :success + assert_kind_of Array, @response.parsed_body + assert_equal [ cards(:text).number ], @response.parsed_body.pluck("number") + assert_equal "1", response.headers["X-Total-Count"] + end + + test "cannot access cards on board without access as JSON" do + board = boards(:private) + column = board.columns.create!(name: "Secret") + + logout_and_sign_in_as :jason + + get board_column_cards_path(board, column), as: :json + + assert_response :not_found + end +end diff --git a/test/controllers/boards/columns_controller_test.rb b/test/controllers/boards/columns_controller_test.rb index 9fef675f52..664e91ea15 100644 --- a/test/controllers/boards/columns_controller_test.rb +++ b/test/controllers/boards/columns_controller_test.rb @@ -55,6 +55,7 @@ class Boards::ColumnsControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_equal board.columns.count, @response.parsed_body.count + assert_equal board_column_cards_url(board, board.columns.sorted.first), @response.parsed_body.first["cards_url"] end test "show as JSON" do @@ -64,6 +65,7 @@ class Boards::ColumnsControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_equal column.id, @response.parsed_body["id"] + assert_equal board_column_cards_url(column.board, column), @response.parsed_body["cards_url"] end test "create as JSON" do @@ -76,6 +78,7 @@ class Boards::ColumnsControllerTest < ActionDispatch::IntegrationTest assert_response :created assert_equal board_column_path(board, Column.last, format: :json), @response.headers["Location"] assert_equal "New Column", @response.parsed_body["name"] + assert_equal board_column_cards_url(board, Column.last), @response.parsed_body["cards_url"] end test "update as JSON" do From b64c1e88957f19d9bb6846932abaedd1dd5df7a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 13:18:47 -0400 Subject: [PATCH 033/129] Bump aws-sdk-s3 from 1.216.0 to 1.218.0 (#2768) --- Gemfile.lock | 6 +++--- Gemfile.saas.lock | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index b06660cf0b..ae32084615 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -134,7 +134,7 @@ GEM ast (2.4.3) autotuner (1.1.0) aws-eventstream (1.4.0) - aws-partitions (1.1229.0) + aws-partitions (1.1237.0) aws-sdk-core (3.244.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) @@ -146,8 +146,8 @@ GEM aws-sdk-kms (1.123.0) aws-sdk-core (~> 3, >= 3.244.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.216.0) - aws-sdk-core (~> 3, >= 3.243.0) + aws-sdk-s3 (1.218.0) + aws-sdk-core (~> 3, >= 3.244.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) aws-sigv4 (1.12.1) diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index 9c095750a3..0925ffd665 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -224,7 +224,7 @@ GEM ast (2.4.3) autotuner (1.1.0) aws-eventstream (1.4.0) - aws-partitions (1.1229.0) + aws-partitions (1.1237.0) aws-sdk-core (3.244.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) @@ -236,7 +236,7 @@ GEM aws-sdk-kms (1.123.0) aws-sdk-core (~> 3, >= 3.244.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.216.0) + aws-sdk-s3 (1.218.0) aws-sdk-core (~> 3, >= 3.243.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) From 0c30fa793717408d5bf4bcb3a29db7a235e9aaf0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 13:19:30 -0400 Subject: [PATCH 034/129] Bump kamal from 2.10.1 to 2.11.0 (#2767) * Bump kamal from 2.10.1 to 2.11.0 Bumps [kamal](https://github.com/basecamp/kamal) from 2.10.1 to 2.11.0. - [Release notes](https://github.com/basecamp/kamal/releases) - [Commits](https://github.com/basecamp/kamal/compare/v2.10.1...v2.11.0) --- updated-dependencies: - dependency-name: kamal dependency-version: 2.11.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Sync Gemfile.saas.lock --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] --- Gemfile.lock | 4 ++-- Gemfile.saas.lock | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ae32084615..e2f2735f4d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -236,7 +236,7 @@ GEM json (2.19.3) jwt (3.1.2) base64 - kamal (2.10.1) + kamal (2.11.0) activesupport (>= 7.0) base64 (~> 0.2) bcrypt_pbkdf (~> 1.0) @@ -304,7 +304,7 @@ GEM net-ssh (>= 5.0.0, < 8.0.0) net-smtp (0.5.1) net-protocol - net-ssh (7.3.0) + net-ssh (7.3.2) nio4r (2.7.5) nokogiri (1.19.2-aarch64-linux-gnu) racc (~> 1.4) diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index 0925ffd665..8e1ab5be48 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -349,7 +349,7 @@ GEM json (2.19.3) jwt (3.1.2) base64 - kamal (2.10.1) + kamal (2.11.0) activesupport (>= 7.0) base64 (~> 0.2) bcrypt_pbkdf (~> 1.0) @@ -420,7 +420,7 @@ GEM net-ssh (>= 5.0.0, < 8.0.0) net-smtp (0.5.1) net-protocol - net-ssh (7.3.0) + net-ssh (7.3.2) nio4r (2.7.5) nokogiri (1.19.2-aarch64-linux-gnu) racc (~> 1.4) From 2d9a00ed05a8ce29713084a3eacd0bb8ae37fbb5 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 13:39:00 -0400 Subject: [PATCH 035/129] dep: fix dependency drift --- Gemfile.saas.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index 8e1ab5be48..54d9610348 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -237,7 +237,7 @@ GEM aws-sdk-core (~> 3, >= 3.244.0) aws-sigv4 (~> 1.5) aws-sdk-s3 (1.218.0) - aws-sdk-core (~> 3, >= 3.243.0) + aws-sdk-core (~> 3, >= 3.244.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) aws-sigv4 (1.12.1) From 732126b5dfd4b4659786ddc5b3831fd92c399207 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 13:46:37 -0400 Subject: [PATCH 036/129] Update bundle-drift to handle subdependencies (#2824) --- bin/bundle-drift | 116 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 114 insertions(+), 2 deletions(-) diff --git a/bin/bundle-drift b/bin/bundle-drift index 1a32962d62..1316aa449f 100755 --- a/bin/bundle-drift +++ b/bin/bundle-drift @@ -33,6 +33,7 @@ class GemfileDriftChecker def find_drift oss_specs, saas_specs = specs_hash(@oss_lockfile), specs_hash(@saas_lockfile) oss_deps, saas_deps = deps_hash(@oss_lockfile), deps_hash(@saas_lockfile) + oss_sdeps, saas_sdeps = spec_deps_hash(@oss_lockfile), spec_deps_hash(@saas_lockfile) shared_gems = oss_specs.keys & saas_specs.keys shared_deps = oss_deps.keys & saas_deps.keys @@ -43,8 +44,15 @@ class GemfileDriftChecker oss_dep, saas_dep = oss_deps[name], saas_deps[name] dep_drift = shared_deps.include?(name) && oss_dep != saas_dep - if version_drift || dep_drift - { name: name, oss: oss_version, saas: saas_version, oss_dep: oss_dep, saas_dep: saas_dep } + oss_sd, saas_sd = oss_sdeps[name] || {}, saas_sdeps[name] || {} + subdep_changes = (oss_sd.keys | saas_sd.keys).filter_map do |dep_name| + if oss_sd[dep_name] != saas_sd[dep_name] + { name: dep_name, oss: oss_sd[dep_name], saas: saas_sd[dep_name] } + end + end + + if version_drift || dep_drift || subdep_changes.any? + { name: name, oss: oss_version, saas: saas_version, oss_dep: oss_dep, saas_dep: saas_dep, subdep_changes: subdep_changes } end end.sort_by { |d| d[:name] } end @@ -57,6 +65,12 @@ class GemfileDriftChecker lockfile.dependencies.transform_values { |dep| dep.requirement.to_s } end + def spec_deps_hash(lockfile) + lockfile.specs.to_h do |spec| + [spec.name, spec.dependencies.map { |d| [d.name, d.requirement.to_s] }.sort.to_h] + end + end + def report(drift) if drift.empty? puts "✓ Gemfile.lock and Gemfile.saas.lock are in sync" @@ -80,6 +94,16 @@ class GemfileDriftChecker end end + subdep_drift = drift.select { |d| d[:subdep_changes]&.any? } + if subdep_drift.any? + puts " Spec sub-dependency requirements:" + subdep_drift.each do |d| + d[:subdep_changes].each do |sd| + puts " #{d[:name]} → #{sd[:name]}: #{sd[:oss] || "(absent)"} (Gemfile.lock) vs #{sd[:saas] || "(absent)"} (Gemfile.saas.lock)" + end + end + end + puts "\nRun 'bin/bundle-drift correct' to restore alignment." end end @@ -156,6 +180,15 @@ class GemfileDriftForwarder puts " #{d[:name]}: dep #{d[:saas_dep]} → #{d[:oss_dep]}" patched_content = patch_dependency_requirement(patched_content, d[:name], d[:saas_dep], d[:oss_dep]) end + + if d[:subdep_changes]&.any? + d[:subdep_changes].each do |sd| + if sd[:oss] && sd[:saas] + puts " #{d[:name]} → #{sd[:name]}: subdep #{sd[:saas]} → #{sd[:oss]}" + patched_content = patch_spec_subdependency(patched_content, d[:name], sd[:name], sd[:saas], sd[:oss]) + end + end + end end File.write(GEMFILE_SAAS_LOCK, patched_content) @@ -175,6 +208,23 @@ class GemfileDriftForwarder end private + def patch_spec_subdependency(content, parent_name, dep_name, old_req, new_req) + in_parent_spec = false + content.lines.map do |line| + if line.match?(/\A {4}\S/) + in_parent_spec = line.match?(/\A {4}#{Regexp.escape(parent_name)} \(/) + elsif !line.match?(/\A {6}/) + in_parent_spec = false + end + + if in_parent_spec && line.match?(/\A {6}#{Regexp.escape(dep_name)} \(#{Regexp.escape(old_req)}\)/) + line.sub("#{dep_name} (#{old_req})", "#{dep_name} (#{new_req})") + else + line + end + end.join + end + def patch_dependency_requirement(content, name, old_req, new_req) in_deps = false content.lines.map do |line| @@ -237,6 +287,24 @@ when "self-test" 2.6.2 LOCKFILE + LOCKFILE_WITH_SUBDEPS_TEMPLATE = <<~LOCKFILE + GEM + remote: https://rubygems.org/ + specs: + child_gem (%{child_version}) + parent_gem (%{parent_version}) + child_gem (%{child_req}) + + PLATFORMS + ruby + + DEPENDENCIES + parent_gem (%{parent_dep}) + + BUNDLED WITH + 2.6.2 + LOCKFILE + class GemfileDriftCheckerTest < Minitest::Test def setup @original_dir = Dir.pwd @@ -298,11 +366,55 @@ when "self-test" refute_includes saas_content, "shared_gem (~> 1.3)" end + def test_detects_spec_subdependency_drift_even_when_versions_match + write_lockfiles_with_subdeps( + oss_child_req: "~> 3, >= 3.2.0", + saas_child_req: "~> 3, >= 3.1.0" + ) + + drift = GemfileDriftChecker.new.send(:find_drift) + + assert_equal 1, drift.length + assert_equal "parent_gem", drift.first[:name] + assert_equal 1, drift.first[:subdep_changes].length + assert_equal "child_gem", drift.first[:subdep_changes].first[:name] + end + + def test_no_drift_when_spec_subdependencies_match + write_lockfiles_with_subdeps( + oss_child_req: "~> 3, >= 3.2.0", + saas_child_req: "~> 3, >= 3.2.0" + ) + + drift = GemfileDriftChecker.new.send(:find_drift) + + assert_empty drift + end + + def test_forward_patches_spec_subdependency_requirements + write_lockfiles_with_subdeps( + oss_child_req: "~> 3, >= 3.2.0", + saas_child_req: "~> 3, >= 3.1.0" + ) + + capture_io { GemfileDriftForwarder.new.forward } + + saas_content = File.read("Gemfile.saas.lock") + assert_includes saas_content, "child_gem (~> 3, >= 3.2.0)" + refute_includes saas_content, "child_gem (~> 3, >= 3.1.0)" + end + private def write_lockfiles(oss_version:, oss_deps:, saas_version:, saas_deps:) File.write("Gemfile.lock", LOCKFILE_TEMPLATE % { shared_version: oss_version, dependencies: oss_deps }) File.write("Gemfile.saas.lock", LOCKFILE_TEMPLATE % { shared_version: saas_version, dependencies: saas_deps }) end + + def write_lockfiles_with_subdeps(oss_child_req:, saas_child_req:) + common = { parent_version: "1.0.0", child_version: "3.2.0", parent_dep: "~> 1.0" } + File.write("Gemfile.lock", LOCKFILE_WITH_SUBDEPS_TEMPLATE % common.merge(child_req: oss_child_req)) + File.write("Gemfile.saas.lock", LOCKFILE_WITH_SUBDEPS_TEMPLATE % common.merge(child_req: saas_child_req)) + end end else abort "Usage: bin/bundle-drift [check|correct|forward|self-test]" From e16b52bbba2d39bf84e5adc877864d40dec82be6 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 13:55:33 -0400 Subject: [PATCH 037/129] dep: bump ruby to 3.4.8 (from 3.4.7) (#2823) --- .ruby-version | 2 +- Dockerfile | 2 +- saas/Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.ruby-version b/.ruby-version index 2aa5131992..7921bd0c89 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.4.7 +3.4.8 diff --git a/Dockerfile b/Dockerfile index babd3b6d15..06d93df682 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ # For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html # Make sure RUBY_VERSION matches the Ruby version in .ruby-version -ARG RUBY_VERSION=3.4.7 +ARG RUBY_VERSION=3.4.8 FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base # Rails app lives here diff --git a/saas/Dockerfile b/saas/Dockerfile index 92fd9c4ec6..9353046d92 100644 --- a/saas/Dockerfile +++ b/saas/Dockerfile @@ -1,5 +1,5 @@ # Make sure RUBY_VERSION matches the Ruby version in .ruby-version -ARG RUBY_VERSION=3.4.7 +ARG RUBY_VERSION=3.4.8 FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim AS base # Rails app lives here From 56f47361f9b092124a058590033a76ac39101c53 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 14:03:45 -0400 Subject: [PATCH 038/129] Fix flaky web push test and deduplicate DNS stub helper (#2825) * Extract shared DnsTestHelper from duplicated stub_dns_resolution methods * Fix flaky WebTest by stubbing DNS resolution for push subscription creation --- test/controllers/api/flat_json_params_test.rb | 7 ------- .../users/push_subscriptions_controller_test.rb | 7 ------- test/models/notification/push_target/web_test.rb | 2 ++ test/models/push/subscription_test.rb | 7 ------- test/models/ssrf_protection_test.rb | 7 ------- test/models/webhook/delivery_test.rb | 7 ------- test/test_helper.rb | 2 +- test/test_helpers/dns_test_helper.rb | 9 +++++++++ 8 files changed, 12 insertions(+), 36 deletions(-) create mode 100644 test/test_helpers/dns_test_helper.rb diff --git a/test/controllers/api/flat_json_params_test.rb b/test/controllers/api/flat_json_params_test.rb index 7a9a5ea5d2..77a74f454e 100644 --- a/test/controllers/api/flat_json_params_test.rb +++ b/test/controllers/api/flat_json_params_test.rb @@ -247,11 +247,4 @@ class FlatJsonParamsTest < ActionDispatch::IntegrationTest assert_response :no_content assert_equal "Flat Join", users(:david).reload.name end - - private - def stub_dns_resolution(*ips) - dns_mock = mock("dns") - dns_mock.stubs(:each_address).multiple_yields(*ips) - Resolv::DNS.stubs(:open).yields(dns_mock) - end end diff --git a/test/controllers/users/push_subscriptions_controller_test.rb b/test/controllers/users/push_subscriptions_controller_test.rb index b9f43ff0ad..284d82b77b 100644 --- a/test/controllers/users/push_subscriptions_controller_test.rb +++ b/test/controllers/users/push_subscriptions_controller_test.rb @@ -92,11 +92,4 @@ class Users::PushSubscriptionsControllerTest < ActionDispatch::IntegrationTest assert_response :unprocessable_entity end - - private - def stub_dns_resolution(*ips) - dns_mock = mock("dns") - dns_mock.stubs(:each_address).multiple_yields(*ips) - Resolv::DNS.stubs(:open).yields(dns_mock) - end end diff --git a/test/models/notification/push_target/web_test.rb b/test/models/notification/push_target/web_test.rb index 37f23b557d..dc09e77bf1 100644 --- a/test/models/notification/push_target/web_test.rb +++ b/test/models/notification/push_target/web_test.rb @@ -5,6 +5,8 @@ class Notification::PushTarget::WebTest < ActiveSupport::TestCase @user = users(:david) @notification = notifications(:logo_mentioned_david) + stub_dns_resolution("142.250.185.206") + @user.push_subscriptions.create!( endpoint: "https://fcm.googleapis.com/fcm/send/test123", p256dh_key: "test_key", diff --git a/test/models/push/subscription_test.rb b/test/models/push/subscription_test.rb index 89887599fd..65393c0e90 100644 --- a/test/models/push/subscription_test.rb +++ b/test/models/push/subscription_test.rb @@ -115,11 +115,4 @@ class Push::SubscriptionTest < ActiveSupport::TestCase assert subscription.valid?, "Expected #{endpoint} to be valid, got errors: #{subscription.errors.full_messages}" end end - - private - def stub_dns_resolution(*ips) - dns_mock = mock("dns") - dns_mock.stubs(:each_address).multiple_yields(*ips) - Resolv::DNS.stubs(:open).yields(dns_mock) - end end diff --git a/test/models/ssrf_protection_test.rb b/test/models/ssrf_protection_test.rb index 550909f89a..fc2828b60f 100644 --- a/test/models/ssrf_protection_test.rb +++ b/test/models/ssrf_protection_test.rb @@ -82,11 +82,4 @@ class SsrfProtectionTest < ActiveSupport::TestCase stub_dns_resolution("::93.184.216.34") assert_nil SsrfProtection.resolve_public_ip("compat-public.example.com") end - - private - def stub_dns_resolution(*ips) - dns_mock = mock("dns") - dns_mock.stubs(:each_address).multiple_yields(*ips) - Resolv::DNS.stubs(:open).yields(dns_mock) - end end diff --git a/test/models/webhook/delivery_test.rb b/test/models/webhook/delivery_test.rb index 5c63bc5959..4fc6b2870f 100644 --- a/test/models/webhook/delivery_test.rb +++ b/test/models/webhook/delivery_test.rb @@ -473,11 +473,4 @@ class Webhook::DeliveryTest < ActiveSupport::TestCase assert_equal 200, delivery.response[:code] assert delivery.succeeded? end - - private - def stub_dns_resolution(*ips) - dns_mock = mock("dns") - dns_mock.stubs(:each_address).multiple_yields(*ips) - Resolv::DNS.stubs(:open).yields(dns_mock) - end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 4d85c51f9c..72c8f3b35d 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -45,7 +45,7 @@ class TestCase fixtures :all include ActiveJob::TestHelper - include ActionTextTestHelper, CachingTestHelper, CardTestHelper, ChangeTestHelper, SessionTestHelper + include ActionTextTestHelper, CachingTestHelper, CardTestHelper, ChangeTestHelper, DnsTestHelper, SessionTestHelper include Turbo::Broadcastable::TestHelper # Jobs must carry their own account context via AccountTenanted, diff --git a/test/test_helpers/dns_test_helper.rb b/test/test_helpers/dns_test_helper.rb new file mode 100644 index 0000000000..8119ca01e7 --- /dev/null +++ b/test/test_helpers/dns_test_helper.rb @@ -0,0 +1,9 @@ +module DnsTestHelper + private + + def stub_dns_resolution(*ips) + dns_mock = mock("dns") + dns_mock.stubs(:each_address).multiple_yields(*ips) + Resolv::DNS.stubs(:open).yields(dns_mock) + end +end From 151787a86496bc64545a754d6956ea40ac383fe6 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 17:13:41 -0400 Subject: [PATCH 039/129] Remove dead Tag::Attachable code and tags prompt The tags prompt was added for the Fizzy Do command system, but became dead code when commands were removed in 89af9066. The commands_prompt was cleaned up but tags_prompt was missed. Remove the Tag::Attachable concern, Prompts::TagsController, its views and route, and the tags_prompt helper. Tag still includes ActionText::Attachable directly, which is needed by the data transfer system. --- app/controllers/prompts/tags_controller.rb | 9 --------- app/helpers/rich_text_helper.rb | 4 ---- app/models/tag.rb | 2 +- app/models/tag/attachable.rb | 11 ----------- app/views/prompts/tags/_tag.html.erb | 8 -------- app/views/prompts/tags/index.html.erb | 1 - config/routes.rb | 1 - test/controllers/prompts/tags_controller_test.rb | 12 ------------ 8 files changed, 1 insertion(+), 47 deletions(-) delete mode 100644 app/controllers/prompts/tags_controller.rb delete mode 100644 app/models/tag/attachable.rb delete mode 100644 app/views/prompts/tags/_tag.html.erb delete mode 100644 app/views/prompts/tags/index.html.erb delete mode 100644 test/controllers/prompts/tags_controller_test.rb diff --git a/app/controllers/prompts/tags_controller.rb b/app/controllers/prompts/tags_controller.rb deleted file mode 100644 index 3d32a071e3..0000000000 --- a/app/controllers/prompts/tags_controller.rb +++ /dev/null @@ -1,9 +0,0 @@ -class Prompts::TagsController < ApplicationController - def index - @tags = Current.account.tags.all.alphabetically - - if stale? etag: @tags - render layout: false - end - end -end diff --git a/app/helpers/rich_text_helper.rb b/app/helpers/rich_text_helper.rb index c580b4507a..e40fb8138b 100644 --- a/app/helpers/rich_text_helper.rb +++ b/app/helpers/rich_text_helper.rb @@ -7,10 +7,6 @@ def global_mentions_prompt content_tag "lexxy-prompt", "", trigger: "@", src: prompts_users_path, name: "mention" end - def tags_prompt - content_tag "lexxy-prompt", "", trigger: "#", src: prompts_tags_path, name: "tag" - end - def cards_prompt content_tag "lexxy-prompt", "", trigger: "#", src: prompts_cards_path, name: "card", "insert-editable-text": true, "remote-filtering": true, "supports-space-in-searches": true end diff --git a/app/models/tag.rb b/app/models/tag.rb index 192f0b86e6..d40eeea7b0 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -1,5 +1,5 @@ class Tag < ApplicationRecord - include Attachable, Filterable + include ActionText::Attachable, Filterable belongs_to :account, default: -> { Current.account } has_many :taggings, dependent: :destroy diff --git a/app/models/tag/attachable.rb b/app/models/tag/attachable.rb deleted file mode 100644 index 37d95b2ddd..0000000000 --- a/app/models/tag/attachable.rb +++ /dev/null @@ -1,11 +0,0 @@ -module Tag::Attachable - extend ActiveSupport::Concern - - included do - include ActionText::Attachable - - def attachable_plain_text_representation(...) - "##{title}" - end - end -end diff --git a/app/views/prompts/tags/_tag.html.erb b/app/views/prompts/tags/_tag.html.erb deleted file mode 100644 index 3be999a8ef..0000000000 --- a/app/views/prompts/tags/_tag.html.erb +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/app/views/prompts/tags/index.html.erb b/app/views/prompts/tags/index.html.erb deleted file mode 100644 index 7ff9bbb1fc..0000000000 --- a/app/views/prompts/tags/index.html.erb +++ /dev/null @@ -1 +0,0 @@ -<%= render partial: "prompts/tags/tag", collection: @tags %> diff --git a/config/routes.rb b/config/routes.rb index 55262e78e2..d228d90015 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -190,7 +190,6 @@ namespace :prompts do resources :cards - resources :tags resources :users resources :boards do diff --git a/test/controllers/prompts/tags_controller_test.rb b/test/controllers/prompts/tags_controller_test.rb deleted file mode 100644 index 9ddea6fae8..0000000000 --- a/test/controllers/prompts/tags_controller_test.rb +++ /dev/null @@ -1,12 +0,0 @@ -require "test_helper" - -class Prompts::TagsControllerTest < ActionDispatch::IntegrationTest - setup do - sign_in_as :kevin - end - - test "index" do - get prompts_tags_path - assert_response :success - end -end From 975b8998ef6fc432ce553b43dab3cdb7efe3f6ff Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 17:17:29 -0400 Subject: [PATCH 040/129] Remove ActionText::Attachable from Tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tag was never actually embedded as an action-text-attachment in persisted rich text. It was only used in the Fizzy Do command prompt input which was not stored. The data transfer tests happened to use Tag as a convenient fixture — switch them to User, which is genuinely attachable via mentions. --- app/models/tag.rb | 2 +- .../action_text/rich_text_record_set_test.rb | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/models/tag.rb b/app/models/tag.rb index d40eeea7b0..14d73b4c4d 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -1,5 +1,5 @@ class Tag < ApplicationRecord - include ActionText::Attachable, Filterable + include Filterable belongs_to :account, default: -> { Current.account } has_many :taggings, dependent: :destroy diff --git a/test/models/account/data_transfer/action_text/rich_text_record_set_test.rb b/test/models/account/data_transfer/action_text/rich_text_record_set_test.rb index 2fe2c4b935..3bc4ee0016 100644 --- a/test/models/account/data_transfer/action_text/rich_text_record_set_test.rb +++ b/test/models/account/data_transfer/action_text/rich_text_record_set_test.rb @@ -44,11 +44,11 @@ class Account::DataTransfer::ActionText::RichTextRecordSetTest < ActiveSupport:: end test "transform_body_for_import skips GIDs belonging to another account" do - victim_tag = tags(:web) + victim_user = users(:david) attacker_account = accounts(:initech) - assert_not_equal attacker_account.id, victim_tag.account_id + assert_not_equal attacker_account.id, victim_user.account_id - cross_tenant_gid = victim_tag.to_global_id.to_s + cross_tenant_gid = victim_user.to_global_id.to_s html = %() record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(attacker_account) @@ -59,11 +59,11 @@ class Account::DataTransfer::ActionText::RichTextRecordSetTest < ActiveSupport:: end test "transform_body_for_import converts GIDs belonging to the same account" do - own_tag = tags(:web) + own_user = users(:david) own_account = accounts(:"37s") - assert_equal own_account.id, own_tag.account_id + assert_equal own_account.id, own_user.account_id - same_account_gid = own_tag.to_global_id.to_s + same_account_gid = own_user.to_global_id.to_s html = %() record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(own_account) @@ -74,7 +74,7 @@ class Account::DataTransfer::ActionText::RichTextRecordSetTest < ActiveSupport:: end test "transform_body_for_import handles non-existent record GIDs gracefully" do - nonexistent_gid = "gid://fizzy/Tag/00000000000000000000000000" + nonexistent_gid = "gid://fizzy/User/00000000000000000000000000" html = %() record_set = Account::DataTransfer::ActionText::RichTextRecordSet.new(accounts(:"37s")) From f3f9aec547f50ca3541962d2a0abc973e90647c2 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 9 Apr 2026 17:29:30 -0400 Subject: [PATCH 041/129] Fix missing partial when editing comments with @mentions (#2828) Edge Rails introduced ActionText::Attachable#to_editor_content_attachment_partial_path which defaults to to_partial_path ("users/user"). Override it in User::Mentionable to delegate to to_attachable_partial_path ("users/attachable"), matching the existing display rendering path. --- app/models/user/mentionable.rb | 4 ++++ .../cards/comments_controller_test.rb | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/app/models/user/mentionable.rb b/app/models/user/mentionable.rb index be82f3d95e..87b2c0f21d 100644 --- a/app/models/user/mentionable.rb +++ b/app/models/user/mentionable.rb @@ -8,6 +8,10 @@ module User::Mentionable def to_attachable_partial_path "users/attachable" end + + def to_editor_content_attachment_partial_path + to_attachable_partial_path + end end def mentioned_by(mentioner, at:) diff --git a/test/controllers/cards/comments_controller_test.rb b/test/controllers/cards/comments_controller_test.rb index be5831e39b..5cebe22dea 100644 --- a/test/controllers/cards/comments_controller_test.rb +++ b/test/controllers/cards/comments_controller_test.rb @@ -113,6 +113,22 @@ class Cards::CommentsControllerTest < ActionDispatch::IntegrationTest assert_equal "Updated comment", comment.reload.body.to_plain_text end + test "edit a comment that contains a mention" do + card = cards(:logo) + mentioned_user = users(:jz) + mention_html = ActionText::Attachment.from_attachable(mentioned_user).to_html + comment = card.comments.create!(creator: users(:kevin), body: "#{mention_html} hello") + + get edit_card_comment_path(card, comment) + assert_response :success + assert_select "lexxy-editor" do |editors| + value = editors.first["value"] + attachment = Nokogiri::HTML.fragment(value).at_css("action-text-attachment") + assert_equal mentioned_user.attachable_sgid, attachment["sgid"] + assert_includes attachment["content"], mentioned_user.first_name + end + end + test "destroy as JSON" do comment = comments(:logo_agreement_kevin) From dd42f0a098f74f41946c41ea0f2c5d90769a74ea Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Tue, 14 Apr 2026 18:37:52 +0200 Subject: [PATCH 042/129] Add script to reindex stale search records (#2843) The data import path (Account::DataTransfer) uses insert_all! which bypasses ActiveRecord callbacks, so imported cards and comments never get search records created and are invisible to search and card-table filtering. This script reindexes all published cards and comments created before a cutoff date (default 2026-04-01). The reindex method is an upsert so already-indexed records get a harmless update. Usage: bin/rails runner script/maintenance/reindex_stale_search_records.rb bin/rails runner script/maintenance/reindex_stale_search_records.rb 2026-01-01 --- .../reindex_stale_search_records.rb | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 script/maintenance/reindex_stale_search_records.rb diff --git a/script/maintenance/reindex_stale_search_records.rb b/script/maintenance/reindex_stale_search_records.rb new file mode 100644 index 0000000000..fd848f67d6 --- /dev/null +++ b/script/maintenance/reindex_stale_search_records.rb @@ -0,0 +1,39 @@ +# Reindex cards and comments that may be missing from the search index. +# +# The data import path (Account::DataTransfer) uses insert_all! which bypasses +# ActiveRecord callbacks, so imported cards and comments never get search records +# created. This script reindexes cards and comments created before a cutoff date. +# +# Usage: +# bin/rails runner script/maintenance/reindex_stale_search_records.rb # default cutoff: 2025-11-13 +# bin/rails runner script/maintenance/reindex_stale_search_records.rb 2026-01-01 # custom cutoff + +cutoff = Date.parse(ARGV[0] || "2025-11-13") + +puts "Reindexing cards and comments created before #{cutoff}..." + +cards = Card.published.where("created_at < ?", cutoff).includes(:rich_text_description) +card_count = cards.count +puts "Found #{card_count} cards to reindex" + +reindexed_cards = 0 +cards.find_each do |card| + card.reindex + reindexed_cards += 1 + print "\rCards: #{reindexed_cards}/#{card_count}" if reindexed_cards % 100 == 0 +end +puts "\rCards: #{reindexed_cards}/#{card_count}" + +comments = Comment.joins(:card).merge(Card.published).where("comments.created_at < ?", cutoff).includes(:rich_text_body, :card) +comment_count = comments.count +puts "Found #{comment_count} comments to reindex" + +reindexed_comments = 0 +comments.find_each do |comment| + comment.reindex + reindexed_comments += 1 + print "\rComments: #{reindexed_comments}/#{comment_count}" if reindexed_comments % 100 == 0 +end +puts "\rComments: #{reindexed_comments}/#{comment_count}" + +puts "Done! Reindexed #{reindexed_cards} cards and #{reindexed_comments} comments." From bb54b859dcb1507bea4820ab5eb9551311030766 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Tue, 14 Apr 2026 13:14:14 -0400 Subject: [PATCH 043/129] Add workflow column filtering to cards (#2787) --- app/models/filter.rb | 1 + app/models/filter/fields.rb | 10 +++++++++- app/models/filter/params.rb | 1 + docs/api/sections/cards.md | 6 ++++++ test/controllers/cards_controller_test.rb | 14 ++++++++++++++ test/models/filter_test.rb | 11 +++++++++++ 6 files changed, 42 insertions(+), 1 deletion(-) diff --git a/app/models/filter.rb b/app/models/filter.rb index 9bfefe176a..ab302fc1de 100644 --- a/app/models/filter.rb +++ b/app/models/filter.rb @@ -35,6 +35,7 @@ def cards result = terms.reduce(result) do |result, term| result.mentioning(term, user: creator) end + result = result.where(column_id: column_ids) if column_ids.present? result.distinct end diff --git a/app/models/filter/fields.rb b/app/models/filter/fields.rb index 0e1c62e0a4..a41d5ce4a5 100644 --- a/app/models/filter/fields.rb +++ b/app/models/filter/fields.rb @@ -31,7 +31,7 @@ def indexed_by_human_name(index) included do store_accessor :fields, :assignment_status, :indexed_by, :sorted_by, :terms, - :card_ids, :creation, :closure + :card_ids, :creation, :closure, :column_ids def assignment_status super.to_s.inquiry @@ -60,6 +60,14 @@ def terms def terms=(value) super(Array(value).filter(&:present?)) end + + def column_ids + Array(super).filter(&:present?).uniq + end + + def column_ids=(value) + super(Array(value).filter(&:present?).uniq) + end end def with(**fields) diff --git a/app/models/filter/params.rb b/app/models/filter/params.rb index 586a758855..c934970351 100644 --- a/app/models/filter/params.rb +++ b/app/models/filter/params.rb @@ -8,6 +8,7 @@ module Filter::Params :creation, :closure, card_ids: [], + column_ids: [], assignee_ids: [], creator_ids: [], closer_ids: [], diff --git a/docs/api/sections/cards.md b/docs/api/sections/cards.md index 2235788843..f71a75246a 100644 --- a/docs/api/sections/cards.md +++ b/docs/api/sections/cards.md @@ -16,6 +16,7 @@ __Query Parameters:__ | `creator_ids[]` | Filter by card creator ID(s) | | `closer_ids[]` | Filter by user ID(s) who closed the cards | | `card_ids[]` | Filter to specific card ID(s) | +| `column_ids[]` | Filter by workflow column ID(s) | | `indexed_by` | Filter by: `all` (default), `closed`, `not_now`, `stalled`, `postponing_soon`, `golden` | | `sorted_by` | Sort order: `latest` (default), `newest`, `oldest` | | `assignment_status` | Filter by assignment status: `unassigned` | @@ -23,6 +24,11 @@ __Query Parameters:__ | `closure` | Filter by closure date: `today`, `yesterday`, `thisweek`, `lastweek`, `thismonth`, `lastmonth`, `thisyear`, `lastyear` | | `terms[]` | Search terms to filter cards | +Repeated `column_ids[]` values are ORed together. Other filters combine with AND. + +Example: +- `column_ids[]=03f...` — cards in a workflow column by ID + __Response:__ ```json diff --git a/test/controllers/cards_controller_test.rb b/test/controllers/cards_controller_test.rb index f582aa9c09..2b51a7cb89 100644 --- a/test/controllers/cards_controller_test.rb +++ b/test/controllers/cards_controller_test.rb @@ -15,6 +15,20 @@ class CardsControllerTest < ActionDispatch::IntegrationTest assert_response :success end + test "index as JSON can filter by workflow column id" do + get cards_path(format: :json), params: { column_ids: [ columns(:writebook_in_progress).id ] } + assert_response :success + + assert_equal [ cards(:text).number ], @response.parsed_body.pluck("number") + end + + test "index as JSON can OR multiple workflow column ids" do + get cards_path(format: :json), params: { column_ids: [ columns(:writebook_triage).id, columns(:writebook_in_progress).id ] } + assert_response :success + + assert_equal [ cards(:logo).number, cards(:layout).number, cards(:text).number ].sort, @response.parsed_body.pluck("number").sort + end + test "create a new draft" do assert_difference -> { Card.count }, 1 do post board_cards_path(boards(:writebook)) diff --git a/test/models/filter_test.rb b/test/models/filter_test.rb index bb41f3e418..7fb7b6ae32 100644 --- a/test/models/filter_test.rb +++ b/test/models/filter_test.rb @@ -166,6 +166,17 @@ class FilterTest < ActiveSupport::TestCase assert_not users(:david).filters.new(board_ids: [ boards(:writebook).id ]).used?(ignore_boards: true) end + test "column ids filter cards by workflow columns" do + assert_equal [ cards(:text) ], users(:david).filters.new(column_ids: [ columns(:writebook_in_progress).id ]).cards.to_a + assert_equal [ cards(:logo), cards(:layout) ].sort_by(&:id), users(:david).filters.new(column_ids: [ columns(:writebook_triage).id ]).cards.to_a.sort_by(&:id) + end + + test "column ids are ORed together" do + filter = users(:david).filters.new(column_ids: [ columns(:writebook_triage).id, columns(:writebook_in_progress).id ]) + + assert_equal [ cards(:logo), cards(:layout), cards(:text) ].sort_by(&:id), filter.cards.to_a.sort_by(&:id) + end + test "board titles are scoped to creator's account" do # Give mike (initech) access to the board in his account boards(:miltons_wish_list).accesses.grant_to(users(:mike)) From 89a1cf43fb51d8c5ca9cd4d9a77396e58ec8c1e3 Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Tue, 14 Apr 2026 13:51:55 -0400 Subject: [PATCH 044/129] Add timeout to system package install step (#2839) * Add timeout to reusable test workflow * Add timeout to system package install step * Retry CI * Retry CI again --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e09deacfb4..4f6b81582f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,6 +54,7 @@ jobs: steps: - name: Install system packages + timeout-minutes: 10 run: sudo apt-get update && sudo apt-get install --no-install-recommends -y libsqlite3-0 libvips curl ffmpeg - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 From abd59567e38335fb73da47415d6b7fe68ef48f9c Mon Sep 17 00:00:00 2001 From: Rob Zolkos Date: Tue, 14 Apr 2026 17:35:41 -0400 Subject: [PATCH 045/129] Add indexed_by=maybe to cards (#2827) * Add indexed_by=maybe to cards --- app/models/card.rb | 1 + docs/api/sections/cards.md | 2 +- test/controllers/cards_controller_test.rb | 7 +++++++ test/models/filter_test.rb | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/models/card.rb b/app/models/card.rb index c3c0b9173b..90d3358b8e 100644 --- a/app/models/card.rb +++ b/app/models/card.rb @@ -30,6 +30,7 @@ class Card < ApplicationRecord when "stalled" then stalled when "postponing_soon" then postponing_soon when "closed" then closed + when "maybe" then awaiting_triage when "not_now" then postponed.latest when "golden" then golden when "draft" then drafted diff --git a/docs/api/sections/cards.md b/docs/api/sections/cards.md index f71a75246a..1597b98e33 100644 --- a/docs/api/sections/cards.md +++ b/docs/api/sections/cards.md @@ -17,7 +17,7 @@ __Query Parameters:__ | `closer_ids[]` | Filter by user ID(s) who closed the cards | | `card_ids[]` | Filter to specific card ID(s) | | `column_ids[]` | Filter by workflow column ID(s) | -| `indexed_by` | Filter by: `all` (default), `closed`, `not_now`, `stalled`, `postponing_soon`, `golden` | +| `indexed_by` | Filter by: `all` (default), `maybe`, `closed`, `not_now`, `stalled`, `postponing_soon`, `golden` | | `sorted_by` | Sort order: `latest` (default), `newest`, `oldest` | | `assignment_status` | Filter by assignment status: `unassigned` | | `creation` | Filter by creation date: `today`, `yesterday`, `thisweek`, `lastweek`, `thismonth`, `lastmonth`, `thisyear`, `lastyear` | diff --git a/test/controllers/cards_controller_test.rb b/test/controllers/cards_controller_test.rb index 2b51a7cb89..6c8f375e34 100644 --- a/test/controllers/cards_controller_test.rb +++ b/test/controllers/cards_controller_test.rb @@ -29,6 +29,13 @@ class CardsControllerTest < ActionDispatch::IntegrationTest assert_equal [ cards(:logo).number, cards(:layout).number, cards(:text).number ].sort, @response.parsed_body.pluck("number").sort end + test "index as JSON can filter by maybe index" do + get cards_path(format: :json), params: { indexed_by: "maybe" } + assert_response :success + + assert_equal [ cards(:buy_domain).number ], @response.parsed_body.pluck("number") + end + test "create a new draft" do assert_difference -> { Card.count }, 1 do post board_cards_path(boards(:writebook)) diff --git a/test/models/filter_test.rb b/test/models/filter_test.rb index 7fb7b6ae32..de89161417 100644 --- a/test/models/filter_test.rb +++ b/test/models/filter_test.rb @@ -23,6 +23,9 @@ class FilterTest < ActiveSupport::TestCase filter = users(:david).filters.new indexed_by: "closed" assert_equal [ cards(:shipping) ], filter.cards + filter = users(:david).filters.new indexed_by: "maybe", board_ids: [ boards(:writebook).id ] + assert_equal [ cards(:buy_domain) ], filter.cards + cards(:shipping).postpone filter = users(:david).filters.new indexed_by: "not_now" assert_includes filter.cards, cards(:shipping) From f66fa886bc61a6579f310d082dfdef8c5d53356b Mon Sep 17 00:00:00 2001 From: "Stanko K.R." Date: Wed, 15 Apr 2026 17:31:10 +0200 Subject: [PATCH 046/129] Return apostrophes to our preferred style --- app/views/sessions/new.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index aba27d5406..fa2892b901 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -11,13 +11,13 @@
<% if Account.accepting_signups? %> -

New here? <%= link_to "Sign up", new_signup_path %> to create an account. Already have an account? Enter your email and we'll get you signed in.

+

New here? <%= link_to "Sign up", new_signup_path %> to create an account. Already have an account? Enter your email and we’ll get you signed in.

<% else %> -

Enter your email and we'll get you signed in.

+

Enter your email and we’ll get you signed in.

<% end %> <% end %> From 500dd78e40a6e4fcfd7e08829153e3a265d05875 Mon Sep 17 00:00:00 2001 From: "Stanko K.R." Date: Wed, 15 Apr 2026 17:39:13 +0200 Subject: [PATCH 047/129] Fix failing OSS tests --- test/integration/notifications_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/notifications_test.rb b/test/integration/notifications_test.rb index f581fb5e94..c615328ec1 100644 --- a/test/integration/notifications_test.rb +++ b/test/integration/notifications_test.rb @@ -9,6 +9,7 @@ class NotificationDeliveryTest < ActiveSupport::TestCase @card.assignments.destroy_all @assignee.notifications.destroy_all + stub_dns_resolution("142.250.185.206") stub_web_push_pool @original_targets = Notification.push_targets.dup From 8f3086daa996d764b0705dd36921a89a69d7805e Mon Sep 17 00:00:00 2001 From: Alexander Zaytsev Date: Wed, 15 Apr 2026 20:54:11 +0200 Subject: [PATCH 048/129] Pretty-print dev server URL and login in `bin/dev` (#2808) * Make dev server URL and login info look nicer * DRY * Adjust comments * Adjust comments --- bin/dev | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/bin/dev b/bin/dev index 991de00c78..c8174be613 100755 --- a/bin/dev +++ b/bin/dev @@ -4,6 +4,15 @@ PORT=3006 USE_TAILSCALE=0 USE_PUSH=0 +if [ -t 1 ]; then + c_bar='\033[2m▎\033[0m' # dim + c_label='\033[37m' # gray + c_url='\033[96m' # cyan + c_reset='\033[0m' +else + c_bar='▎' c_label='' c_url='' c_reset='' +fi + for arg in "$@"; do case $arg in --tailscale) USE_TAILSCALE=1 ;; @@ -58,9 +67,14 @@ if [ "$USE_TAILSCALE" = "1" ]; then echo "Error: tailscale serve failed. On Linux, run once: sudo tailscale set --operator=\$USER" >&2 exit 1 fi - echo "Login with david@example.com to: https://$TS_HOSTNAME:$TS_PORT/" + DEV_URL="https://$TS_HOSTNAME:$TS_PORT/" else - echo "Login with david@example.com to: http://app.fizzy.localhost:$PORT/" + DEV_URL="http://app.fizzy.localhost:$PORT/" fi +printf "\n" +printf " ${c_bar} ${c_label}URL${c_reset} ${c_url}${DEV_URL}${c_reset}\n" +printf " ${c_bar} ${c_label}Login${c_reset} david@example.com\n" +printf "\n" + ./bin/rails server -b 0.0.0.0 -p $PORT From 9a27ca8b421c3803c837e908abc786931a89bd0d Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 16 Apr 2026 15:43:55 -0400 Subject: [PATCH 049/129] Scope clear_search_records to the account being destroyed (#2847) Account::Searchable#clear_search_records called Search::Record.for(id).destroy_all which deleted every row in the shard's table, wiping search records belonging to every other account that happened to hash to the same shard. ref: https://3.basecamp.com/2914079/buckets/27/card_tables/cards/9782824728 --- app/models/account/searchable.rb | 2 +- test/models/account/incineratable_test.rb | 41 +++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/app/models/account/searchable.rb b/app/models/account/searchable.rb index b06a44ed32..5e5cc3c594 100644 --- a/app/models/account/searchable.rb +++ b/app/models/account/searchable.rb @@ -9,6 +9,6 @@ module Account::Searchable private def clear_search_records - Search::Record.for(id).destroy_all + Search::Record.for(id).where(account_id: id).destroy_all end end diff --git a/test/models/account/incineratable_test.rb b/test/models/account/incineratable_test.rb index 7f69bed0ba..cb6e6560ba 100644 --- a/test/models/account/incineratable_test.rb +++ b/test/models/account/incineratable_test.rb @@ -176,4 +176,45 @@ class Account::IncineratableTest < ActiveSupport::TestCase # Search records (sharded) assert_empty Search::Record.for(account_id).where(account_id: account_id) end + + test "incinerating an account clears its own search records but preserves others on the same shard" do + doomed = accounts(:initech) + shard = Search::Record.for(doomed.id) + + doomed_card = cards(:radio) + doomed_record = shard.create!( + account_id: doomed_card.account_id, + searchable_type: "Card", + searchable_id: doomed_card.id, + card_id: doomed_card.id, + board_id: doomed_card.board_id, + title: "doomed", + content: "should be destroyed", + created_at: Time.current + ) + + # Simulate a shard collision: plant a record belonging to a different + # account directly on doomed's shard, as would happen in production when + # two accounts' UUIDs hash to the same shard. + foreign_card = cards(:logo) + foreign_record = shard.create!( + account_id: foreign_card.account_id, + searchable_type: "Card", + searchable_id: foreign_card.id, + card_id: foreign_card.id, + board_id: foreign_card.board_id, + title: "foreign", + content: "should survive", + created_at: Time.current + ) + + Current.account = doomed + Current.session = Session.new(identity: identities(:mike)) + doomed.incinerate + + assert_not shard.exists?(id: doomed_record.id), + "the incinerated account's search record should be destroyed" + assert shard.exists?(id: foreign_record.id), + "another account's search record on the same shard should survive" + end end From 466b215ef83dfe64aea26bec3e7bdea3626cb321 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 16 Apr 2026 19:40:02 -0400 Subject: [PATCH 050/129] Add SearchReindexJob to repopulate the search index (#2850) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rebuilds search records for every published Card and every Comment on a published Card. Intended for manual invocation after a search-index loss event — not a recurring job. Uses ActiveJob::Continuable so the work survives worker restarts and resumes from the last-processed id. The job is idempotent. Removes script/maintenance/reindex_stale_search_records.rb, which was written against a different hypothesis (a date-cutoff backfill) and is superseded by this unconditional repair job. --- app/jobs/search_reindex_job.rb | 60 ++++++++++++++ .../reindex_stale_search_records.rb | 39 --------- test/jobs/search_reindex_job_test.rb | 82 +++++++++++++++++++ 3 files changed, 142 insertions(+), 39 deletions(-) create mode 100644 app/jobs/search_reindex_job.rb delete mode 100644 script/maintenance/reindex_stale_search_records.rb create mode 100644 test/jobs/search_reindex_job_test.rb diff --git a/app/jobs/search_reindex_job.rb b/app/jobs/search_reindex_job.rb new file mode 100644 index 0000000000..84fadaa8ce --- /dev/null +++ b/app/jobs/search_reindex_job.rb @@ -0,0 +1,60 @@ +# Repair task — reindexes every searchable Card and Comment in the database. +# Intended to be invoked manually after a search-index loss event. Not a recurring job. +# +# Idempotent: Searchable#reindex upserts by (searchable_type, searchable_id). +# Continuable: if the worker is interrupted, the job resumes from the last-processed id. +# +# `rich_text_limit` is a safety valve against unbounded bodies: records whose rich text +# exceeds the limit (in bytes) are filtered out at the SQL level, so they never materialize +# in Ruby. Without it, a single pathological body can stall the batch query or OOM the +# worker during preload, which has happened in practice. +# +# Usage: +# SearchReindexJob.perform_later +# SearchReindexJob.perform_later(batch_size: 500, log_every: 100, rich_text_limit: 50_000) +class SearchReindexJob < ApplicationJob + include ActiveJob::Continuable + + queue_as :backend + + def perform(batch_size: 100, log_every: 1000, rich_text_limit: 100_000) + step :cards do |step| + processed = 0 + Card.published + .left_joins(:rich_text_description) + .where("action_text_rich_texts.body IS NULL OR OCTET_LENGTH(action_text_rich_texts.body) <= ?", rich_text_limit) + .includes(:rich_text_description) + .find_each(start: step.cursor, batch_size: batch_size) do |card| + safely_reindex(card) + processed += 1 + log_progress(:cards, processed, card.id) if (processed % log_every).zero? + step.advance! from: card.id + end + end + + step :comments do |step| + processed = 0 + Comment.joins(:card).merge(Card.published) + .left_joins(:rich_text_body) + .where("action_text_rich_texts.body IS NULL OR OCTET_LENGTH(action_text_rich_texts.body) <= ?", rich_text_limit) + .includes(:rich_text_body, :card) + .find_each(start: step.cursor, batch_size: batch_size) do |comment| + safely_reindex(comment) + processed += 1 + log_progress(:comments, processed, comment.id) if (processed % log_every).zero? + step.advance! from: comment.id + end + end + end + + private + def safely_reindex(record) + record.reindex + rescue StandardError => e + Rails.error.report(e, context: { record_type: record.class.name, record_id: record.id }) + end + + def log_progress(step_name, count, cursor) + Rails.logger.info { "SearchReindexJob: step=#{step_name} processed=#{count} cursor=#{cursor}" } + end +end diff --git a/script/maintenance/reindex_stale_search_records.rb b/script/maintenance/reindex_stale_search_records.rb deleted file mode 100644 index fd848f67d6..0000000000 --- a/script/maintenance/reindex_stale_search_records.rb +++ /dev/null @@ -1,39 +0,0 @@ -# Reindex cards and comments that may be missing from the search index. -# -# The data import path (Account::DataTransfer) uses insert_all! which bypasses -# ActiveRecord callbacks, so imported cards and comments never get search records -# created. This script reindexes cards and comments created before a cutoff date. -# -# Usage: -# bin/rails runner script/maintenance/reindex_stale_search_records.rb # default cutoff: 2025-11-13 -# bin/rails runner script/maintenance/reindex_stale_search_records.rb 2026-01-01 # custom cutoff - -cutoff = Date.parse(ARGV[0] || "2025-11-13") - -puts "Reindexing cards and comments created before #{cutoff}..." - -cards = Card.published.where("created_at < ?", cutoff).includes(:rich_text_description) -card_count = cards.count -puts "Found #{card_count} cards to reindex" - -reindexed_cards = 0 -cards.find_each do |card| - card.reindex - reindexed_cards += 1 - print "\rCards: #{reindexed_cards}/#{card_count}" if reindexed_cards % 100 == 0 -end -puts "\rCards: #{reindexed_cards}/#{card_count}" - -comments = Comment.joins(:card).merge(Card.published).where("comments.created_at < ?", cutoff).includes(:rich_text_body, :card) -comment_count = comments.count -puts "Found #{comment_count} comments to reindex" - -reindexed_comments = 0 -comments.find_each do |comment| - comment.reindex - reindexed_comments += 1 - print "\rComments: #{reindexed_comments}/#{comment_count}" if reindexed_comments % 100 == 0 -end -puts "\rComments: #{reindexed_comments}/#{comment_count}" - -puts "Done! Reindexed #{reindexed_cards} cards and #{reindexed_comments} comments." diff --git a/test/jobs/search_reindex_job_test.rb b/test/jobs/search_reindex_job_test.rb new file mode 100644 index 0000000000..da238e3c50 --- /dev/null +++ b/test/jobs/search_reindex_job_test.rb @@ -0,0 +1,82 @@ +require "test_helper" + +class SearchReindexJobTest < ActiveJob::TestCase + test "reindexes cards and comments after their search records are nuked" do + card = cards(:logo) + comment = comments(:logo_1) + + card.reindex + comment.reindex + + card_shard = Search::Record.for(card.account_id) + comment_shard = Search::Record.for(comment.account_id) + + assert card_shard.exists?(searchable_type: "Card", searchable_id: card.id) + assert comment_shard.exists?(searchable_type: "Comment", searchable_id: comment.id) + + card_shard.delete_all + comment_shard.delete_all unless comment_shard == card_shard + + assert_not card_shard.exists?(searchable_type: "Card", searchable_id: card.id) + assert_not comment_shard.exists?(searchable_type: "Comment", searchable_id: comment.id) + + SearchReindexJob.perform_now + + assert card_shard.exists?(searchable_type: "Card", searchable_id: card.id) + assert comment_shard.exists?(searchable_type: "Comment", searchable_id: comment.id) + end + + test "skips records whose rich text exceeds rich_text_limit" do + Current.account = accounts(:"37s") + Current.session = Session.new(identity: identities(:david)) + + big_card = boards(:writebook).cards.create!( + creator: users(:david), + title: "too big to index", + status: :published, + description: "x" * 5_000 + ) + + nuke_search_records + + SearchReindexJob.perform_now(rich_text_limit: 1_000) + + shard = Search::Record.for(big_card.account_id) + assert_not shard.exists?(searchable_type: "Card", searchable_id: big_card.id) + end + + test "does not index drafted cards or their comments" do + Current.account = accounts(:"37s") + Current.session = Session.new(identity: identities(:david)) + + card = boards(:writebook).cards.create!( + creator: users(:david), + title: "will be drafted", + status: :published + ) + comment = card.comments.create!(creator: users(:david), body: "on a card that will be drafted") + card.update!(status: :drafted) + + nuke_search_records + + SearchReindexJob.perform_now + + shard = Search::Record.for(card.account_id) + assert_not shard.exists?(searchable_type: "Card", searchable_id: card.id) + assert_not shard.exists?(searchable_type: "Comment", searchable_id: comment.id) + end + + private + def sqlite? + ActiveRecord::Base.connection.adapter_name == "SQLite" + end + + def nuke_search_records + if sqlite? + ActiveRecord::Base.connection.execute("DELETE FROM search_records") + ActiveRecord::Base.connection.execute("DELETE FROM search_records_fts") + else + Search::Record::Trilogy::SHARD_CLASSES.each(&:delete_all) + end + end +end From b5ea94e99f20a9b18130bf268a0e712877cfd14f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 17:03:49 -0700 Subject: [PATCH 051/129] Bump selenium-webdriver from 4.41.0 to 4.43.0 in the development-dependencies group (#2855) * Bump selenium-webdriver in the development-dependencies group Bumps the development-dependencies group with 1 update: [selenium-webdriver](https://github.com/SeleniumHQ/selenium). Updates `selenium-webdriver` from 4.41.0 to 4.43.0 - [Release notes](https://github.com/SeleniumHQ/selenium/releases) - [Changelog](https://github.com/SeleniumHQ/selenium/blob/trunk/rb/CHANGES) - [Commits](https://github.com/SeleniumHQ/selenium/compare/selenium-4.41.0...selenium-4.43.0) --- updated-dependencies: - dependency-name: selenium-webdriver dependency-version: 4.43.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies ... Signed-off-by: dependabot[bot] * Sync Gemfile.saas.lock --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] --- Gemfile.lock | 2 +- Gemfile.saas.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index e2f2735f4d..1ecbb30ee1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -414,7 +414,7 @@ GEM ruby2_keywords (0.0.5) rubyzip (3.2.2) securerandom (0.4.1) - selenium-webdriver (4.41.0) + selenium-webdriver (4.43.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index 54d9610348..c871b39dab 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -571,7 +571,7 @@ GEM ruby2_keywords (0.0.5) rubyzip (3.2.2) securerandom (0.4.1) - selenium-webdriver (4.41.0) + selenium-webdriver (4.43.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) From f9daf091d79821d3ca87cb12a7edd3f9cd2e9c05 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 17:04:01 -0700 Subject: [PATCH 052/129] Bump the github-actions group across 1 directory with 3 updates (#2856) Bumps the github-actions group with 3 updates in the / directory: [ruby/setup-ruby](https://github.com/ruby/setup-ruby), [docker/login-action](https://github.com/docker/login-action) and [docker/build-push-action](https://github.com/docker/build-push-action). Updates `ruby/setup-ruby` from 1.295.0 to 1.300.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/319994f95fa847cf3fb3cd3dbe89f6dcde9f178f...e65c17d16e57e481586a6a5a0282698790062f92) Updates `docker/login-action` from 4.0.0 to 4.1.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/b45d80f862d83dbcd57f89517bcf500b2ab88fb2...4907a6ddec9925e35a0a9e82d7399ccc52663121) Updates `docker/build-push-action` from 7.0.0 to 7.1.0 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/d08e5c354a6adb9ed34480a06d141179aa583294...bcafcacb16a39f128d818304e6c9c0c18556b85f) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.300.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: docker/login-action dependency-version: 4.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: docker/build-push-action dependency-version: 7.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci-checks.yml | 6 +++--- .github/workflows/dependabot-sync-saas-lockfile.yml | 2 +- .github/workflows/publish-image.yml | 6 +++--- .github/workflows/test.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index c410061c96..d3914c5143 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0 with: ruby-version: .ruby-version bundler-cache: true @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0 with: ruby-version: .ruby-version bundler-cache: true @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0 with: ruby-version: .ruby-version bundler-cache: true diff --git a/.github/workflows/dependabot-sync-saas-lockfile.yml b/.github/workflows/dependabot-sync-saas-lockfile.yml index 4191cd684f..227967a503 100644 --- a/.github/workflows/dependabot-sync-saas-lockfile.yml +++ b/.github/workflows/dependabot-sync-saas-lockfile.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 # zizmor: ignore[artipacked] -- credentials needed for git push - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0 with: ruby-version: .ruby-version diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 41d4a9a385..48d8b658b7 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -49,7 +49,7 @@ jobs: uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 - name: Log in to GHCR - uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -84,7 +84,7 @@ jobs: - name: Build and push (${{ matrix.platform }}) id: build - uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 + uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0 with: context: . file: Dockerfile @@ -125,7 +125,7 @@ jobs: uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 - name: Log in to GHCR - uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 + uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f6b81582f..ee6243a70a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,7 +61,7 @@ jobs: with: persist-credentials: false - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0 with: ruby-version: .ruby-version bundler-cache: true From e6c5cd51a0b2eb3f9eab3bb39da269a90e52cd62 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Wed, 22 Apr 2026 16:17:27 -0400 Subject: [PATCH 053/129] dep: update queenbee and audits1984 to avoid deprecation warnings (#2875) --- Gemfile.saas | 2 +- Gemfile.saas.lock | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Gemfile.saas b/Gemfile.saas index 384f5b4b72..8856523e00 100644 --- a/Gemfile.saas +++ b/Gemfile.saas @@ -8,7 +8,7 @@ gem "actionpack-xml_parser" # needed by queenbee for XML request body parsing gem "queenbee", bc: "queenbee-plugin" gem "fizzy-saas", path: "saas" gem "console1984", bc: "console1984" -gem "audits1984", bc: "audits1984", branch: "flavorjones/coworker-api" +gem "audits1984", bc: "audits1984" # Native push notifications (iOS/Android) gem "action_push_native" diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index c871b39dab..77c441ae18 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -1,7 +1,6 @@ GIT remote: https://github.com/basecamp/audits1984 - revision: 422b8ff25820c828b7cf09aff4923fd8cc2c6795 - branch: flavorjones/coworker-api + revision: 4271a8e1f02f0f35d749c938bf4dcccf902b4190 specs: audits1984 (0.1.7) console1984 @@ -23,7 +22,7 @@ GIT GIT remote: https://github.com/basecamp/queenbee-plugin - revision: 14312a940471e20617b38cdec7c092a01567d18b + revision: c0119be5940edb3739d4bb591c1a5c7064881638 specs: queenbee (3.2.0) activeresource From 5f45e54a0711478983900a60e504ef96ad2fbe83 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 27 Apr 2026 18:07:26 -0400 Subject: [PATCH 054/129] dep: update nokogiri to v1.19.3 (#2887) --- Gemfile.lock | 16 ++++++++-------- Gemfile.saas.lock | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1ecbb30ee1..b0397e4e61 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -306,21 +306,21 @@ GEM net-protocol net-ssh (7.3.2) nio4r (2.7.5) - nokogiri (1.19.2-aarch64-linux-gnu) + nokogiri (1.19.3-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.19.2-aarch64-linux-musl) + nokogiri (1.19.3-aarch64-linux-musl) racc (~> 1.4) - nokogiri (1.19.2-arm-linux-gnu) + nokogiri (1.19.3-arm-linux-gnu) racc (~> 1.4) - nokogiri (1.19.2-arm-linux-musl) + nokogiri (1.19.3-arm-linux-musl) racc (~> 1.4) - nokogiri (1.19.2-arm64-darwin) + nokogiri (1.19.3-arm64-darwin) racc (~> 1.4) - nokogiri (1.19.2-x86_64-darwin) + nokogiri (1.19.3-x86_64-darwin) racc (~> 1.4) - nokogiri (1.19.2-x86_64-linux-gnu) + nokogiri (1.19.3-x86_64-linux-gnu) racc (~> 1.4) - nokogiri (1.19.2-x86_64-linux-musl) + nokogiri (1.19.3-x86_64-linux-musl) racc (~> 1.4) openssl (4.0.0) ostruct (0.6.3) diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index 77c441ae18..3418dd5276 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -421,21 +421,21 @@ GEM net-protocol net-ssh (7.3.2) nio4r (2.7.5) - nokogiri (1.19.2-aarch64-linux-gnu) + nokogiri (1.19.3-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.19.2-aarch64-linux-musl) + nokogiri (1.19.3-aarch64-linux-musl) racc (~> 1.4) - nokogiri (1.19.2-arm-linux-gnu) + nokogiri (1.19.3-arm-linux-gnu) racc (~> 1.4) - nokogiri (1.19.2-arm-linux-musl) + nokogiri (1.19.3-arm-linux-musl) racc (~> 1.4) - nokogiri (1.19.2-arm64-darwin) + nokogiri (1.19.3-arm64-darwin) racc (~> 1.4) - nokogiri (1.19.2-x86_64-darwin) + nokogiri (1.19.3-x86_64-darwin) racc (~> 1.4) - nokogiri (1.19.2-x86_64-linux-gnu) + nokogiri (1.19.3-x86_64-linux-gnu) racc (~> 1.4) - nokogiri (1.19.2-x86_64-linux-musl) + nokogiri (1.19.3-x86_64-linux-musl) racc (~> 1.4) openssl (4.0.0) os (1.1.4) From ab78162f397119911df6600293e55c62355783ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 May 2026 22:06:12 +0000 Subject: [PATCH 055/129] Bump net-imap from 0.6.3 to 0.6.4 Bumps [net-imap](https://github.com/ruby/net-imap) from 0.6.3 to 0.6.4. - [Release notes](https://github.com/ruby/net-imap/releases) - [Commits](https://github.com/ruby/net-imap/compare/v0.6.3...v0.6.4) --- updated-dependencies: - dependency-name: net-imap dependency-version: 0.6.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index b0397e4e61..a917e85868 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -291,7 +291,7 @@ GEM msgpack (1.8.0) net-http-persistent (4.0.8) connection_pool (>= 2.2.4, < 4) - net-imap (0.6.3) + net-imap (0.6.4) date net-protocol net-pop (0.1.2) From d5e366bcfc17674c03a8af27968f646912d9506b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 4 May 2026 22:06:23 +0000 Subject: [PATCH 056/129] Sync Gemfile.saas.lock --- Gemfile.saas.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index 3418dd5276..18dc23c853 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -406,7 +406,7 @@ GEM uri (>= 0.11.1) net-http-persistent (4.0.8) connection_pool (>= 2.2.4, < 4) - net-imap (0.6.3) + net-imap (0.6.4) date net-protocol net-pop (0.1.2) From 661ee9c2ae581a09be689f4756c6c81a80c22c56 Mon Sep 17 00:00:00 2001 From: Matthew Kent Date: Wed, 13 May 2026 13:34:05 -0700 Subject: [PATCH 057/129] Add our standard section on setting maintenance mode. --- saas/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/saas/README.md b/saas/README.md index bec3b279f2..540c1aaae6 100644 --- a/saas/README.md +++ b/saas/README.md @@ -89,6 +89,22 @@ Staging is primarily intended for testing infrastructure changes. It uses produc - https://app.fizzy-staging.com/ +## Maintenance mode + +To take production offline for maintenance, run `kamal-proxy stop` on the load balancers via `knife ssh`: + +```bash +knife ssh 'hostname:fizzy-lb-*' "sudo docker exec fizzy-load-balancer kamal-proxy stop fizzy --message='Sorry! Fizzy is undergoing some maintenance and will be back shortly.'" +``` + +Verify maintenance is enabled by visiting https://app.fizzy.do/. + +To lift maintenance mode: + +```bash +knife ssh 'hostname:fizzy-lb-*' 'sudo docker exec fizzy-load-balancer kamal-proxy resume fizzy' +``` + ## License fizzy-saas is released under the [O'Saasy License](LICENSE.md). From 99b3d25c7d6da0c33edb3010c65de4d88a01b4bf Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 29 May 2026 13:49:26 -0400 Subject: [PATCH 058/129] =?UTF-8?q?Upgrade=20lexxy=200.9.5.beta=20?= =?UTF-8?q?=E2=86=92=200.9.14.beta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Assisted by Claude --- Gemfile | 2 +- Gemfile.lock | 4 ++-- Gemfile.saas.lock | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index b073e67c2c..9068352209 100644 --- a/Gemfile +++ b/Gemfile @@ -27,7 +27,7 @@ gem "geared_pagination", "~> 1.2" gem "rqrcode" gem "rouge" gem "jbuilder" -gem "lexxy", "0.9.5.beta" +gem "lexxy", "0.9.14.beta" gem "image_processing", "~> 1.14" gem "platform_agent" gem "aws-sdk-s3", require: false diff --git a/Gemfile.lock b/Gemfile.lock index a917e85868..0681afbd2b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -254,7 +254,7 @@ GEM logger (~> 1.6) letter_opener (1.10.0) launchy (>= 2.2, < 4) - lexxy (0.9.5.beta) + lexxy (0.9.14.beta) rails (>= 8.0.2) lint_roller (1.1.0) logger (1.7.0) @@ -518,7 +518,7 @@ DEPENDENCIES jbuilder kamal letter_opener - lexxy (= 0.9.5.beta) + lexxy (= 0.9.14.beta) mission_control-jobs mittens mocha diff --git a/Gemfile.saas.lock b/Gemfile.saas.lock index 18dc23c853..0e372739e0 100644 --- a/Gemfile.saas.lock +++ b/Gemfile.saas.lock @@ -366,7 +366,7 @@ GEM logger (~> 1.6) letter_opener (1.10.0) launchy (>= 2.2, < 4) - lexxy (0.9.5.beta) + lexxy (0.9.14.beta) rails (>= 8.0.2) lint_roller (1.1.0) logger (1.7.0) @@ -723,7 +723,7 @@ DEPENDENCIES jbuilder kamal letter_opener - lexxy (= 0.9.5.beta) + lexxy (= 0.9.14.beta) mission_control-jobs mittens mocha From 995fab12256b22fe44f9db7366803453d7895f23 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 29 May 2026 13:49:32 -0400 Subject: [PATCH 059/129] Update toolbar dropdown CSS for lexxy's new menu structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lexxy reworked toolbar dropdowns from
/ (with the [open] attribute) to a