Project

General

Profile

Actions

Feature #42880

closed

Make 'auto watch issues' default user settings configurable

Added by Jan Catrysse 3 months ago. Updated 10 days ago.

Status:
Closed
Priority:
Normal
Category:
Accounts / authentication
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

  1. Exposed the new setting in the administration UI, so administrators can choose which events trigger auto watching by default
  2. Initialized user preferences to use the configured default auto-watch options when creating new users
  3. Added a new setting in config/settings.yml that lists the default automatic watch options for new users
  4. Updated unit tests to verify both the configurable default and the built-in fallback options

Files

auto_watch_default_settings.patch (3.85 KB) auto_watch_default_settings.patch Jan Catrysse, 2025-06-16 20:42
Actions #1

Updated by Go MAEDA 3 months ago

  • Target version set to Candidate for next major release
Actions #2

Updated by Go MAEDA 2 months ago

  • Target version changed from Candidate for next major release to 6.1.0

Setting the target version to 6.1.0.

Actions #3

Updated by Marius BĂLTEANU 11 days ago

  • Status changed from New to Resolved
  • Assignee set to Marius BĂLTEANU
  • Resolution set to Fixed

Feature added, thanks!

Actions #4

Updated by Katsuya HIDAKA 10 days ago

It seems that commit r23956 caused the following test to fail:
https://github.com/redmine/redmine/actions/runs/17525877800/job/49776196037#step:5:49

Failure:
UserPreferenceTest#test_auto_watch_on_should_default_to_options [test/unit/user_preference_test.rb:72]:
--- expected
+++ actual
@@ -1 +1 @@
-["issue_created", "issue_contributed_to"]
+"" 

bin/rails test test/unit/user_preference_test.rb:69

Note that several other tests are also failing, but I believe those are due to a different cause.

Actions #5

Updated by Katsuya HIDAKA 10 days ago

Here is the patch for #note-4.

diff --git a/test/unit/user_preference_test.rb b/test/unit/user_preference_test.rb
index fd51b1d9f..582520402 100644
--- a/test/unit/user_preference_test.rb
+++ b/test/unit/user_preference_test.rb
@@ -67,10 +67,8 @@ class UserPreferenceTest < ActiveSupport::TestCase
   end

   def test_auto_watch_on_should_default_to_options
-    with_settings :default_users_auto_watch_on => nil do
-      preference = UserPreference.new
-      assert_equal %w[issue_created issue_contributed_to], preference.auto_watch_on
-    end
+    preference = UserPreference.new
+    assert_equal %w[issue_created issue_contributed_to], preference.auto_watch_on
   end

   def test_create

Actions #6

Updated by Marius BĂLTEANU 10 days ago

I've fixed for now the test by removing the invalid with_settings :default_users_auto_watch_on => nil, I'm going to review the cases later.

Actions #7

Updated by Marius BĂLTEANU 10 days ago

Katsuya HIDAKA wrote in #note-5:

Here is the patch for #note-4.
[...]

Thanks, I've already applied the same changes, please see my previous note.

Actions #8

Updated by Marius BĂLTEANU 10 days ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF