From 187c6ecb523301096e2e06878a77046cc9725217 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 15 Sep 2022 19:26:33 +0200 Subject: [PATCH 01/12] Add devcontainer setup --- .devcontainer/devcontainer.json | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..7a497363 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,35 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/docker-existing-docker-compose +// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml. +{ + "name": "Retrospring", + + // Update the 'dockerComposeFile' list if you have more compose files or use different names. + // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. + "dockerComposeFile": [ + "../docker-compose.yml" + ], + + // The 'service' property is the name of the service for the container that VS Code should + // use. Update this value and .devcontainer/docker-compose.yml to the real service name. + "service": "web", + + // The optional 'workspaceFolder' property is the path VS Code should open by default when + // connected. This is typically a file mount in .devcontainer/docker-compose.yml + "workspaceFolder": "/app", + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Uncomment the next line if you want start specific services in your Docker Compose config. + // "runServices": [], + + // Uncomment the next line if you want to keep your containers running after VS Code shuts down. + // "shutdownAction": "none", + + // Uncomment the next line to run commands after the container is created - for example installing curl. + // "postCreateCommand": "apt-get update && apt-get install -y curl", + + // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "app" +} From b5cff7e1dea548f9d580420eef53685c4e441561 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Thu, 15 Sep 2022 23:29:56 +0200 Subject: [PATCH 02/12] Adjust spacing in devcontainer.json --- .devcontainer/devcontainer.json | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7a497363..8256390f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,34 +2,34 @@ // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/docker-existing-docker-compose // If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml. { - "name": "Retrospring", + "name": "Retrospring", - // Update the 'dockerComposeFile' list if you have more compose files or use different names. - // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. - "dockerComposeFile": [ - "../docker-compose.yml" - ], + // Update the 'dockerComposeFile' list if you have more compose files or use different names. + // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. + "dockerComposeFile": [ + "../docker-compose.yml" + ], - // The 'service' property is the name of the service for the container that VS Code should - // use. Update this value and .devcontainer/docker-compose.yml to the real service name. - "service": "web", + // The 'service' property is the name of the service for the container that VS Code should + // use. Update this value and .devcontainer/docker-compose.yml to the real service name. + "service": "web", - // The optional 'workspaceFolder' property is the path VS Code should open by default when - // connected. This is typically a file mount in .devcontainer/docker-compose.yml - "workspaceFolder": "/app", + // The optional 'workspaceFolder' property is the path VS Code should open by default when + // connected. This is typically a file mount in .devcontainer/docker-compose.yml + "workspaceFolder": "/app", - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], - // Uncomment the next line if you want start specific services in your Docker Compose config. - // "runServices": [], + // Uncomment the next line if you want start specific services in your Docker Compose config. + // "runServices": [], - // Uncomment the next line if you want to keep your containers running after VS Code shuts down. - // "shutdownAction": "none", + // Uncomment the next line if you want to keep your containers running after VS Code shuts down. + // "shutdownAction": "none", - // Uncomment the next line to run commands after the container is created - for example installing curl. - // "postCreateCommand": "apt-get update && apt-get install -y curl", + // Uncomment the next line to run commands after the container is created - for example installing curl. + // "postCreateCommand": "apt-get update && apt-get install -y curl", - // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "app" + // Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "app" } From 049f92e138e55fb1496eaa9b745fe0ee40b004f4 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 6 Nov 2022 14:59:56 +0100 Subject: [PATCH 03/12] Add inbox locking setting to user --- app/models/user.rb | 4 +++ ...0221106130744_add_inbox_locked_to_users.rb | 9 ++++++ db/schema.rb | 29 ++++++++++--------- 3 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 db/migrate/20221106130744_add_inbox_locked_to_users.rb diff --git a/app/models/user.rb b/app/models/user.rb index a8f57dd5..2098f825 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -169,6 +169,10 @@ class User < ApplicationRecord !self.export_processing end + def inbox_locked? + privacy_lock_inbox + end + # %w[admin moderator].each do |m| # define_method(m) { raise "not allowed: #{m}" } # define_method(m+??) { raise "not allowed: #{m}?"} diff --git a/db/migrate/20221106130744_add_inbox_locked_to_users.rb b/db/migrate/20221106130744_add_inbox_locked_to_users.rb new file mode 100644 index 00000000..e063ad2d --- /dev/null +++ b/db/migrate/20221106130744_add_inbox_locked_to_users.rb @@ -0,0 +1,9 @@ +class AddInboxLockedToUsers < ActiveRecord::Migration[6.1] + def up + add_column :users, :privacy_lock_inbox, :boolean, default: false + end + + def down + remove_column :users, :privacy_lock_inbox + end +end diff --git a/db/schema.rb b/db/schema.rb index 3f035379..e2934483 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_08_20_163035) do +ActiveRecord::Schema.define(version: 2022_11_06_130744) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -31,8 +31,8 @@ ActiveRecord::Schema.define(version: 2022_08_20_163035) do t.string "identifier" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false - t.bigint "question_id" t.bigint "user_id" + t.bigint "question_id" t.index ["identifier"], name: "index_anonymous_blocks_on_identifier" t.index ["question_id"], name: "index_anonymous_blocks_on_question_id" t.index ["user_id"], name: "index_anonymous_blocks_on_user_id" @@ -46,8 +46,6 @@ ActiveRecord::Schema.define(version: 2022_08_20_163035) do t.datetime "created_at" t.datetime "updated_at" t.integer "smile_count", default: 0, null: false - t.datetime "deleted_at" - t.index ["deleted_at"], name: "index_answers_on_deleted_at" t.index ["question_id"], name: "index_answers_on_question_id" t.index ["user_id", "created_at"], name: "index_answers_on_user_id_and_created_at" end @@ -60,8 +58,6 @@ ActiveRecord::Schema.define(version: 2022_08_20_163035) do t.text "content" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false - t.datetime "deleted_at" - t.index ["deleted_at"], name: "index_appendables_on_deleted_at" t.index ["parent_id", "parent_type"], name: "index_appendables_on_parent_id_and_parent_type" t.index ["user_id", "created_at"], name: "index_appendables_on_user_id_and_created_at" end @@ -73,9 +69,7 @@ ActiveRecord::Schema.define(version: 2022_08_20_163035) do t.datetime "created_at" t.datetime "updated_at" t.integer "smile_count", default: 0, null: false - t.datetime "deleted_at" t.index ["answer_id"], name: "index_comments_on_answer_id" - t.index ["deleted_at"], name: "index_comments_on_deleted_at" t.index ["user_id", "created_at"], name: "index_comments_on_user_id_and_created_at" end @@ -108,10 +102,10 @@ ActiveRecord::Schema.define(version: 2022_08_20_163035) do end create_table "mute_rules", id: :bigint, default: -> { "gen_timestamp_id('mute_rules'::text)" }, force: :cascade do |t| + t.bigint "user_id" t.string "muted_phrase" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.bigint "user_id" t.index ["user_id"], name: "index_mute_rules_on_user_id" end @@ -150,8 +144,6 @@ ActiveRecord::Schema.define(version: 2022_08_20_163035) do t.datetime "updated_at" t.integer "answer_count", default: 0, null: false t.boolean "direct", default: false, null: false - t.datetime "deleted_at" - t.index ["deleted_at"], name: "index_questions_on_deleted_at" t.index ["user_id", "created_at"], name: "index_questions_on_user_id_and_created_at" end @@ -202,6 +194,16 @@ ActiveRecord::Schema.define(version: 2022_08_20_163035) do t.index ["user_id"], name: "index_services_on_user_id" end + create_table "settings", id: :serial, force: :cascade do |t| + t.string "var", null: false + t.text "value" + t.integer "thing_id" + t.string "thing_type", limit: 30 + t.datetime "created_at" + t.datetime "updated_at" + t.index ["thing_type", "thing_id", "var"], name: "index_settings_on_thing_type_and_thing_id_and_var", unique: true + end + create_table "subscriptions", id: :serial, force: :cascade do |t| t.bigint "user_id", null: false t.bigint "answer_id", null: false @@ -300,9 +302,8 @@ ActiveRecord::Schema.define(version: 2022_08_20_163035) do t.datetime "export_created_at" t.string "otp_secret_key" t.integer "otp_module", default: 0, null: false - t.datetime "deleted_at" + t.boolean "privacy_lock_inbox", default: false t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true - t.index ["deleted_at"], name: "index_users_on_deleted_at" t.index ["email"], name: "index_users_on_email", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true t.index ["screen_name"], name: "index_users_on_screen_name", unique: true @@ -316,5 +317,7 @@ ActiveRecord::Schema.define(version: 2022_08_20_163035) do t.index ["user_id"], name: "index_users_roles_on_user_id" end + add_foreign_key "anonymous_blocks", "questions" + add_foreign_key "anonymous_blocks", "users" add_foreign_key "profiles", "users" end From f6c28eefbd7be9798ac77602ffce4f2a17be25c0 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 6 Nov 2022 15:00:28 +0100 Subject: [PATCH 04/12] Add inbox locking setting to privacy settings --- app/controllers/settings/privacy_controller.rb | 3 ++- app/views/settings/privacy/edit.html.haml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/settings/privacy_controller.rb b/app/controllers/settings/privacy_controller.rb index f85201f1..7921ef08 100644 --- a/app/controllers/settings/privacy_controller.rb +++ b/app/controllers/settings/privacy_controller.rb @@ -6,7 +6,8 @@ class Settings::PrivacyController < ApplicationController def edit; end def update - user_attributes = params.require(:user).permit(:privacy_allow_anonymous_questions, + user_attributes = params.require(:user).permit(:privacy_lock_inbox, + :privacy_allow_anonymous_questions, :privacy_allow_public_timeline, :privacy_allow_stranger_answers, :privacy_show_in_search) diff --git a/app/views/settings/privacy/edit.html.haml b/app/views/settings/privacy/edit.html.haml index e2287aad..55465898 100644 --- a/app/views/settings/privacy/edit.html.haml +++ b/app/views/settings/privacy/edit.html.haml @@ -1,6 +1,7 @@ .card .card-body = bootstrap_form_for(current_user, url: settings_privacy_path, method: :patch, data: { turbo: false }) do |f| + = f.check_box :privacy_lock_inbox = f.check_box :privacy_allow_anonymous_questions = f.check_box :privacy_allow_public_timeline = f.check_box :privacy_allow_stranger_answers From fa12b19b8ad63165e152fe6ca7fb86218579cd18 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 6 Nov 2022 15:01:01 +0100 Subject: [PATCH 05/12] Prevent questions being sent to users that lock their inbox --- app/workers/question_worker.rb | 1 + lib/errors.rb | 3 +++ lib/use_case/question/create.rb | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/app/workers/question_worker.rb b/app/workers/question_worker.rb index 0416244a..e6d78007 100644 --- a/app/workers/question_worker.rb +++ b/app/workers/question_worker.rb @@ -12,6 +12,7 @@ class QuestionWorker question = Question.find(question_id) user.followers.each do |f| + next if f.inbox_locked? next if MuteRule.where(user: f).any? { |rule| rule.applies_to? question } Inbox.create(user_id: f.id, question_id: question_id, new: true) diff --git a/lib/errors.rb b/lib/errors.rb index 5414f7f8..5d94f3cd 100644 --- a/lib/errors.rb +++ b/lib/errors.rb @@ -35,6 +35,9 @@ module Errors class SelfAction < Forbidden end + class InboxLocked < Forbidden + end + class FollowingSelf < SelfAction end diff --git a/lib/use_case/question/create.rb b/lib/use_case/question/create.rb index 7ec5b7fc..05c9ad1b 100644 --- a/lib/use_case/question/create.rb +++ b/lib/use_case/question/create.rb @@ -14,6 +14,7 @@ module UseCase option :direct, type: Types::Params::Bool, default: proc { true } def call + check_lock check_anonymous_rules check_blocks @@ -42,6 +43,10 @@ module UseCase private + def check_lock + raise Errors::InboxLocked if target_user.inbox_locked? + end + def check_anonymous_rules if !source_user_id && !anonymous # We can not create a non-anonymous question without a source user From 38332194c7a75c6431ada7726f4272e8aaaf5de7 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 6 Nov 2022 15:01:20 +0100 Subject: [PATCH 06/12] Show message in questionbox that user locked their inbox --- app/views/application/_questionbox.html.haml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/application/_questionbox.html.haml b/app/views/application/_questionbox.html.haml index fd9ceb36..1bb6d725 100644 --- a/app/views/application/_questionbox.html.haml +++ b/app/views/application/_questionbox.html.haml @@ -14,6 +14,9 @@ - elsif user_signed_in? && user.blocking?(current_user) .text-center %strong= t(".status.blocked") + - elsif user.inbox_locked? + .text-center + %strong= t(".status.locked") - else - if user_signed_in? || user.privacy_allow_anonymous_questions? #question-box{ data: { controller: "character-count", "character-count-max-value": 512 }} From 8bdf00e0e8b1bb8675d11186ac29aa9045949eb8 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 6 Nov 2022 15:01:39 +0100 Subject: [PATCH 07/12] Add locales for inbox locking --- config/locales/activerecord.en.yml | 1 + config/locales/errors.en.yml | 1 + config/locales/views.en.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml index cb5881a7..9863908f 100644 --- a/config/locales/activerecord.en.yml +++ b/config/locales/activerecord.en.yml @@ -67,6 +67,7 @@ en: remember_created_at: "Remember me set at" password: "Password" password_confirmation: "Confirm your password" + privacy_lock_inbox: "Lock inbox and don't allow new questions" privacy_allow_anonymous_questions: "Allow anonymous questions" privacy_allow_public_timeline: "Show your answers in the public timeline" privacy_allow_stranger_answers: "Allow other people to answer your questions" diff --git a/config/locales/errors.en.yml b/config/locales/errors.en.yml index c00de3cd..d5e1ff32 100644 --- a/config/locales/errors.en.yml +++ b/config/locales/errors.en.yml @@ -6,6 +6,7 @@ en: param_is_missing: "param is missing" forbidden: "This is illegal, you know" + inbox_locked: "This user currently does not accept questions" blocked: "You have been blocked from performing this request" other_blocked_self: "You have been blocked by this user" asking_other_blocked_self: "You have been blocked from asking this user questions" diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index 732e4891..0fc0891f 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -123,6 +123,7 @@ en: banned: "This user got hit with ye olde banhammer." blocking: "You are blocking this user." blocked: "This user has blocked you." + locked: "This user currently does not accept questions." devise: registrations: edit: From fdf42d4169a31f594d84ec0c2f697648f6058209 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 6 Nov 2022 15:02:12 +0100 Subject: [PATCH 08/12] Add tests for inbox locking --- .../ajax/question_controller_spec.rb | 17 +++++++++++++++++ spec/workers/question_worker_spec.rb | 11 +++++++++++ 2 files changed, 28 insertions(+) diff --git a/spec/controllers/ajax/question_controller_spec.rb b/spec/controllers/ajax/question_controller_spec.rb index cd3166a4..cbb1a0f1 100644 --- a/spec/controllers/ajax/question_controller_spec.rb +++ b/spec/controllers/ajax/question_controller_spec.rb @@ -328,6 +328,23 @@ describe Ajax::QuestionController, :ajax_controller, type: :controller do include_examples "does not create the question" end end + + context "when users inbox is locked" do + let(:user_allows_anonymous_questions) { true } + let(:expected_response) do + { + "success" => false, + "status" => "inbox_locked", + "message" => anything + } + end + + before do + target_user.update(privacy_lock_inbox: true) + end + + include_examples "does not create the question" + end end context "when rcpt is followers" do diff --git a/spec/workers/question_worker_spec.rb b/spec/workers/question_worker_spec.rb index 94f45a50..6753f619 100644 --- a/spec/workers/question_worker_spec.rb +++ b/spec/workers/question_worker_spec.rb @@ -40,5 +40,16 @@ describe QuestionWorker do .to(4) ) end + + it "respects inbox locks" do + user.followers.first.update(privacy_lock_inbox: true) + + expect { subject } + .to( + change { Inbox.where(user_id: user.followers.ids, question_id: question_id, new: true).count } + .from(0) + .to(4) + ) + end end end From 3f6e61e39bcd5a01d0e2b02ad35eb858ecd5c1b7 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 6 Nov 2022 15:21:19 +0100 Subject: [PATCH 09/12] Remove non-existent table from schema --- db/schema.rb | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index e2934483..1c9173f3 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -194,16 +194,6 @@ ActiveRecord::Schema.define(version: 2022_11_06_130744) do t.index ["user_id"], name: "index_services_on_user_id" end - create_table "settings", id: :serial, force: :cascade do |t| - t.string "var", null: false - t.text "value" - t.integer "thing_id" - t.string "thing_type", limit: 30 - t.datetime "created_at" - t.datetime "updated_at" - t.index ["thing_type", "thing_id", "var"], name: "index_settings_on_thing_type_and_thing_id_and_var", unique: true - end - create_table "subscriptions", id: :serial, force: :cascade do |t| t.bigint "user_id", null: false t.bigint "answer_id", null: false From 5f97b87f3c94dc7e2cdd049299bf11c78a0cc63a Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 6 Nov 2022 15:23:05 +0100 Subject: [PATCH 10/12] Fix rubocop offenses --- db/migrate/20221106130744_add_inbox_locked_to_users.rb | 2 ++ spec/workers/question_worker_spec.rb | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/db/migrate/20221106130744_add_inbox_locked_to_users.rb b/db/migrate/20221106130744_add_inbox_locked_to_users.rb index e063ad2d..295ebca7 100644 --- a/db/migrate/20221106130744_add_inbox_locked_to_users.rb +++ b/db/migrate/20221106130744_add_inbox_locked_to_users.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AddInboxLockedToUsers < ActiveRecord::Migration[6.1] def up add_column :users, :privacy_lock_inbox, :boolean, default: false diff --git a/spec/workers/question_worker_spec.rb b/spec/workers/question_worker_spec.rb index 6753f619..de116e73 100644 --- a/spec/workers/question_worker_spec.rb +++ b/spec/workers/question_worker_spec.rb @@ -6,7 +6,7 @@ describe QuestionWorker do describe "#perform" do let(:user) { FactoryBot.create(:user) } let(:user_id) { user.id } - let(:question) { FactoryBot.create(:question, user: user) } + let(:question) { FactoryBot.create(:question, user:) } let(:question_id) { question.id } before do @@ -21,7 +21,7 @@ describe QuestionWorker do it "places the question in the inbox of the user's followers" do expect { subject } .to( - change { Inbox.where(user_id: user.followers.ids, question_id: question_id, new: true).count } + change { Inbox.where(user_id: user.followers.ids, question_id:, new: true).count } .from(0) .to(5) ) @@ -35,7 +35,7 @@ describe QuestionWorker do expect { subject } .to( - change { Inbox.where(user_id: user.followers.ids, question_id: question_id, new: true).count } + change { Inbox.where(user_id: user.followers.ids, question_id:, new: true).count } .from(0) .to(4) ) @@ -46,7 +46,7 @@ describe QuestionWorker do expect { subject } .to( - change { Inbox.where(user_id: user.followers.ids, question_id: question_id, new: true).count } + change { Inbox.where(user_id: user.followers.ids, question_id:, new: true).count } .from(0) .to(4) ) From 0add320c7b2f771cf86a5f0b6b1057971e16304f Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Sun, 13 Nov 2022 13:58:31 +0100 Subject: [PATCH 11/12] remove capybara obsoletes #784 --- Gemfile | 2 -- Gemfile.lock | 19 ------------------- spec/rails_helper.rb | 2 -- 3 files changed, 23 deletions(-) diff --git a/Gemfile b/Gemfile index 1cceaaea..114a5228 100644 --- a/Gemfile +++ b/Gemfile @@ -80,13 +80,11 @@ gem "puma" group :development, :test do gem "better_errors" gem "bullet" - gem "capybara" gem "database_cleaner" gem "factory_bot_rails", require: false gem "faker" gem "haml_lint", require: false gem "letter_opener" # Use this just in local test environments - gem "poltergeist" gem "rails-controller-testing" gem "rake" gem "rspec-its", "~> 1.3" diff --git a/Gemfile.lock b/Gemfile.lock index f7d5f60d..070b237d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -95,15 +95,6 @@ GEM bullet (7.0.3) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) - capybara (3.37.1) - addressable - matrix - mini_mime (>= 0.1.3) - nokogiri (~> 1.8) - rack (>= 1.6.0) - rack-test (>= 0.6.3) - regexp_parser (>= 1.5, < 3.0) - xpath (~> 3.2) carrierwave (2.1.0) activemodel (>= 5.0.0) activesupport (>= 5.0.0) @@ -112,7 +103,6 @@ GEM mimemagic (>= 0.3.0) mini_mime (>= 0.1.3) chunky_png (1.4.0) - cliver (0.3.2) coderay (1.1.3) colorize (0.8.1) concurrent-ruby (1.1.10) @@ -261,7 +251,6 @@ GEM mail (2.7.1) mini_mime (>= 0.1.1) marcel (1.0.2) - matrix (0.4.2) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) method_source (1.0.0) @@ -315,10 +304,6 @@ GEM pg (1.4.4) pghero (3.0.1) activerecord (>= 6) - poltergeist (1.18.1) - capybara (>= 2.1, < 4) - cliver (~> 0.3.1) - websocket-driver (>= 0.2.0) public_suffix (4.0.7) puma (6.0.0) nio4r (~> 2.0) @@ -521,8 +506,6 @@ GEM websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - xpath (3.2.0) - nokogiri (~> 1.8) zeitwerk (2.6.5) PLATFORMS @@ -536,7 +519,6 @@ DEPENDENCIES bootsnap bootstrap_form (~> 4.5) bullet - capybara carrierwave (~> 2.0) carrierwave_backgrounder! colorize @@ -571,7 +553,6 @@ DEPENDENCIES omniauth-twitter pg pghero - poltergeist puma questiongenerator (~> 1.0) rails (~> 6.1) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index e0552d11..c6b03bd1 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -10,8 +10,6 @@ require "rspec/rails" # Add additional requires below this line. Rails is not loaded until this point! require "rspec/its" require "devise" -require "capybara/rails" -require "capybara/rspec" require "rspec-sidekiq" # Requires supporting ruby files with custom matchers and macros, etc, in From 817ee1bdb85678e3e9fbfe1ed2042609bb5f0cb0 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 6 Nov 2022 13:20:14 +0100 Subject: [PATCH 12/12] Switch to Node 14 --- .docker/ruby/Dockerfile | 4 ++-- .github/workflows/retrospring.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.docker/ruby/Dockerfile b/.docker/ruby/Dockerfile index f9480dc2..205ec80a 100644 --- a/.docker/ruby/Dockerfile +++ b/.docker/ruby/Dockerfile @@ -8,7 +8,7 @@ ARG GID=1000 RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - RUN apt-get update -qq \ && apt-get install -y --no-install-recommends build-essential \ @@ -47,4 +47,4 @@ COPY . /app ENTRYPOINT ["entrypoint.sh"] EXPOSE 3000 -CMD ["rails", "server", "-b", "0.0.0.0"] \ No newline at end of file +CMD ["rails", "server", "-b", "0.0.0.0"] diff --git a/.github/workflows/retrospring.yml b/.github/workflows/retrospring.yml index d0147b68..1dd575e5 100644 --- a/.github/workflows/retrospring.yml +++ b/.github/workflows/retrospring.yml @@ -48,10 +48,10 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - - name: Set up Node 12 + - name: Set up Node 14 uses: actions/setup-node@v3 with: - node-version: '12' + node-version: '14' - name: Copy default configuration run: | cp config/database.yml.postgres config/database.yml