diff --git a/Gemfile b/Gemfile index 1984dc71d..8c43ff533 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem "turbo-rails" # Deployment and drivers gem "active_record-tenanted", bc: "active_record-tenanted" gem "bootsnap", require: false -gem "kamal", require: false +gem "kamal", bc: "kamal", ref: "344e2d79", require: false gem "puma", ">= 5.0" gem "solid_cable", ">= 3.0" gem "solid_cache", "~> 1.0" diff --git a/Gemfile.lock b/Gemfile.lock index d761017df..701715d6d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,6 +15,23 @@ GIT railties (>= 8.1.alpha) zeitwerk +GIT + remote: https://github.com/basecamp/kamal + revision: 344e2d7995e0134aa52f195a984d8d5e24e31d94 + ref: 344e2d79 + specs: + kamal (2.6.1) + activesupport (>= 7.0) + base64 (~> 0.2) + bcrypt_pbkdf (~> 1.0) + concurrent-ruby (~> 1.2) + dotenv (~> 3.1) + ed25519 (~> 1.4) + net-ssh (~> 7.3) + sshkit (>= 1.23.0, < 2.0) + thor (~> 1.3) + zeitwerk (>= 2.6.18, < 3.0) + GIT remote: https://github.com/basecamp/rails-structured-logging revision: 76960cb5c15fc2b6b5f7542e05d7dcc031cef9e6 @@ -246,17 +263,6 @@ GEM activesupport (>= 5.0.0) jmespath (1.6.2) json (2.12.2) - kamal (2.6.1) - activesupport (>= 7.0) - base64 (~> 0.2) - bcrypt_pbkdf (~> 1.0) - concurrent-ruby (~> 1.2) - dotenv (~> 3.1) - ed25519 (~> 1.4) - net-ssh (~> 7.3) - sshkit (>= 1.23.0, < 2.0) - thor (~> 1.3) - zeitwerk (>= 2.6.18, < 3.0) language_server-protocol (3.17.0.5) lint_roller (1.1.0) logger (1.7.0) @@ -511,7 +517,7 @@ DEPENDENCIES image_processing (~> 1.14) importmap-rails jbuilder - kamal + kamal! mission_control-jobs platform_agent propshaft diff --git a/app/helpers/html_helper.rb b/app/helpers/html_helper.rb index f61da26c1..82a18722d 100644 --- a/app/helpers/html_helper.rb +++ b/app/helpers/html_helper.rb @@ -34,7 +34,16 @@ module HtmlHelper def auto_link_urls(linked_content) linked_content.gsub!(URL_REGEXP) do |match| - %(#{match}) + url, trailing_punct = extract_url_and_punctuation(match) + %(#{url}#{trailing_punct}) + end + end + + def extract_url_and_punctuation(url_match) + if url_match.end_with?(".", "?", ",", ":") + [ url_match[..-2], url_match[-1] ] + else + [ url_match, "" ] end end diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 8dab7c110..53a3a0797 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -2,7 +2,7 @@ module NotificationsHelper def event_notification_title(event) case event_notification_action(event) when "comment_created" then "RE: #{card_notification_title(event.eventable.card)}" - when "card_assigned" then "Assigned to #{event.assignees.pluck(:name).to_sentence}: #{card_notification_title(event.eventable)}" + when "card_assigned" then "Assigned to #{event.assignees.none? ? "self" : event.assignees.pluck(:name).to_sentence}: #{card_notification_title(event.eventable)}" else card_notification_title(event.eventable) end end diff --git a/app/models/card/entropy.rb b/app/models/card/entropy.rb index b0eded7a3..0b6f6e4aa 100644 --- a/app/models/card/entropy.rb +++ b/app/models/card/entropy.rb @@ -10,7 +10,7 @@ module Card::Entropy scope :stagnated, -> { doing.where(last_active_at: ..AUTO_RECONSIDER_PERIOD.ago) } scope :due_to_be_closed, -> { considering.in_auto_closing_collection.where("last_active_at <= DATETIME('now', '-' || auto_close_period || ' seconds')") } - delegate :auto_closing?, :auto_close_period, to: :collection + delegate :auto_close_period, to: :collection end class_methods do @@ -26,11 +26,19 @@ module Card::Entropy end def subject_to_entropy? - doing? || (auto_closing? && considering?) + auto_reconsidering? || auto_closing? + end + + def auto_reconsidering? + doing? && last_active_at + end + + def auto_closing? + considering? && collection.auto_closing? && last_active_at end def auto_close_at - last_active_at + auto_close_period if auto_closing? && last_active_at + last_active_at + auto_close_period if auto_closing? end def days_until_close @@ -38,10 +46,14 @@ module Card::Entropy end def auto_reconsider_at - last_active_at + AUTO_RECONSIDER_PERIOD if last_active_at + last_active_at + AUTO_RECONSIDER_PERIOD if auto_reconsidering? end def days_until_reconsider (auto_reconsider_at.to_date - Date.current).to_i if auto_reconsider_at end + + def entropy_cleaned_at + auto_close_at || auto_reconsider_at + end end diff --git a/app/models/workflow/stage.rb b/app/models/workflow/stage.rb index 2cc0eb78f..8966d0000 100644 --- a/app/models/workflow/stage.rb +++ b/app/models/workflow/stage.rb @@ -1,5 +1,5 @@ class Workflow::Stage < ApplicationRecord - belongs_to :workflow + belongs_to :workflow, touch: true before_validation :assign_random_color, on: :create diff --git a/app/views/cards/display/_preview.html.erb b/app/views/cards/display/_preview.html.erb index 071630a8d..f976117a8 100644 --- a/app/views/cards/display/_preview.html.erb +++ b/app/views/cards/display/_preview.html.erb @@ -1,4 +1,4 @@ -<% cache card do %> +<% cache [ card, card.collection.workflow ] do %> <%= card_article_tag card, class: "card" do %>