Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Merge remote-tracking branch 'origin/release/13.4' into dev

ulferts3e6a89a922a4
diff --cc lib/open_project.rb
index 3df1ddc1bf9,4f54a66e4ee..bd59f0c0854
--- a/lib/open_project.rb
+++ b/lib/open_project.rb
@@@ -52,8 -52,6 +52,7 @@@ module OpenProjec
# And old connections will not be closed properly which could lead to EMFILE error.
Thread.current[:httpx_session] ||= begin
session = HTTPX
- .plugin(:persistent) # persistent plugin enables retries plugin under the hood
+ .plugin(:oauth)
.plugin(:basic_auth)
.plugin(:webdav)
.with(
diff --cc modules/backlogs/lib/open_project/backlogs/patches/setting_seeder_patch.rb
index 5685dd37888,4633235c7e1..55cb1ffb49c
--- a/modules/backlogs/lib/open_project/backlogs/patches/setting_seeder_patch.rb
+++ b/modules/backlogs/lib/open_project/backlogs/patches/setting_seeder_patch.rb
@@@ -37,8 -37,8 +37,8 @@@ module OpenProject::Backlogs::Patches::
def data
original_data = super
- unless original_data["default_projects_modules"].include? "backlogs"
- if original_data['default_projects_modules']&.exclude? 'backlogs'
- original_data['default_projects_modules'] << 'backlogs'
++ if original_data["default_projects_modules"]&.exclude? "backlogs"
+ original_data["default_projects_modules"] << "backlogs"
end
original_data
diff --cc modules/bim/app/seeders/bim/basic_data/setting_seeder.rb
index 618e87bbaa6,352fbbf6eea..808b3d95dc7
--- a/modules/bim/app/seeders/bim/basic_data/setting_seeder.rb
+++ b/modules/bim/app/seeders/bim/basic_data/setting_seeder.rb
@@@ -30,11 -30,11 +30,11 @@@ module Bi
class SettingSeeder < ::BasicData::SettingSeeder
def data
super.tap do |original_data|
- unless original_data["default_projects_modules"].include? "bim"
- if original_data['default_projects_modules']&.exclude? 'bim'
- original_data['default_projects_modules'] << 'bim'
++ if original_data["default_projects_modules"]&.exclude? "bim"
+ original_data["default_projects_modules"] << "bim"
end
- original_data['attachment_max_size'] = 512 * 1024 # 512MB
+ original_data["attachment_max_size"] = 512 * 1024 # 512MB
end
end
end
diff --cc modules/bim/spec/seeders/root_seeder_bim_edition_spec.rb
index 56f195dbce1,6101e309591..b1f1f95d397
--- a/modules/bim/spec/seeders/root_seeder_bim_edition_spec.rb
+++ b/modules/bim/spec/seeders/root_seeder_bim_edition_spec.rb
@@@ -60,7 -60,12 +60,12 @@@ RSpec.describe RootSeeder
expect(Boards::Grid.count).to eq 2
end
+ it "adds the BIM module to the default_projects_modules setting" do
+ default_modules = Setting.find_by(name: "default_projects_modules").value
+ expect(default_modules).to include("bim")
+ end
+
- it 'creates follows and parent-child relations' do
+ it "creates follows and parent-child relations" do
expect(Relation.follows.count).to eq 35
expect(WorkPackage.where.not(parent: nil).count).to eq 55
end
@@@ -209,8 -214,14 +214,14 @@@
shared_let(:root_seeder) { described_class.new(seed_development_data: true) }
before_all do
- with_edition('bim') do
+ with_edition("bim") do
- root_seeder.seed_data!
+ RSpec::Mocks.with_temporary_scope do
+ # opportunistic way to add a test for bug #53611 without extending the testing time
+ allow(Settings::Definition["default_projects_modules"])
+ .to receive(:writable?).and_return(false)
+
+ root_seeder.seed_data!
+ end
end
end
diff --cc modules/boards/lib/open_project/boards/patches/setting_seeder_patch.rb
index 33d746e1f3e,89b9c47a6dd..d270ecfac04
--- a/modules/boards/lib/open_project/boards/patches/setting_seeder_patch.rb
+++ b/modules/boards/lib/open_project/boards/patches/setting_seeder_patch.rb
@@@ -35,8 -35,8 +35,8 @@@ module OpenProject::Boards::Patches::Se
def data
original_data = super
- unless original_data["default_projects_modules"].include? "board_view"
- if original_data['default_projects_modules']&.exclude? 'board_view'
- original_data['default_projects_modules'] << 'board_view'
++ if original_data["default_projects_modules"]&.exclude? "board_view"
+ original_data["default_projects_modules"] << "board_view"
end
original_data
diff --cc modules/costs/lib/costs/patches/setting_seeder_patch.rb
index fe6935d4b47,d6ad8877ebf..b1fe5c22724
--- a/modules/costs/lib/costs/patches/setting_seeder_patch.rb
+++ b/modules/costs/lib/costs/patches/setting_seeder_patch.rb
@@@ -35,8 -35,8 +35,8 @@@ module Costs::Patches::SettingSeederPat
def data
original_data = super
- unless original_data["default_projects_modules"].include? "costs"
- if original_data['default_projects_modules']&.exclude? 'costs'
- original_data['default_projects_modules'] << 'costs'
++ if original_data["default_projects_modules"]&.exclude? "costs"
+ original_data["default_projects_modules"] << "costs"
end
original_data
diff --cc modules/meeting/lib/open_project/meeting/patches/setting_seeder_patch.rb
index 4e49dc806c9,c00c3617eca..43ff3e7f74b
--- a/modules/meeting/lib/open_project/meeting/patches/setting_seeder_patch.rb
+++ b/modules/meeting/lib/open_project/meeting/patches/setting_seeder_patch.rb
@@@ -35,8 -35,8 +35,8 @@@ module OpenProject::Meeting::Patches::S
def data
original_data = super
- unless original_data["default_projects_modules"].include? "meetings"
- if original_data['default_projects_modules']&.exclude? 'meetings'
- original_data['default_projects_modules'] << 'meetings'
++ if original_data["default_projects_modules"]&.exclude? "meetings"
+ original_data["default_projects_modules"] << "meetings"
end
original_data
diff --cc modules/reporting/lib/open_project/reporting/patches/setting_seeder_patch.rb
index 8a23156abf1,f91de7dbedf..dee328ea37b
--- a/modules/reporting/lib/open_project/reporting/patches/setting_seeder_patch.rb
+++ b/modules/reporting/lib/open_project/reporting/patches/setting_seeder_patch.rb
@@@ -35,8 -35,8 +35,8 @@@ module OpenProject::Reporting::Patches:
def data
original_data = super
- unless original_data["default_projects_modules"].include? "reporting_module"
- if original_data['default_projects_modules']&.exclude? 'reporting_module'
- original_data['default_projects_modules'] << 'reporting_module'
++ if original_data["default_projects_modules"]&.exclude? "reporting_module"
+ original_data["default_projects_modules"] << "reporting_module"
end
original_data
diff --cc modules/storages/spec/contracts/storages/storages/shared_contract_examples.rb
index 2132f5dde83,a1e03f0027a..d4c141e4849
--- a/modules/storages/spec/contracts/storages/storages/shared_contract_examples.rb
+++ b/modules/storages/spec/contracts/storages/storages/shared_contract_examples.rb
@@@ -184,29 -184,27 +184,27 @@@ RSpec.shared_examples_for "nextcloud st
stub_config_check
end
- context 'when connection fails' do
- context 'when server capabilities request times out' do
+ context "when connection fails" do
+ context "when server capabilities request times out" do
let(:timeout_server_capabilities) { true }
- include_examples 'contract is invalid', host: :cannot_be_connected_to
+ include_examples "contract is invalid", host: :cannot_be_connected_to
- it 'retries failed request once' do
+ it "retries failed request once" do
contract.validate
- # twice due to HTTPX retry plugin being enabled.
- expect(stub_server_capabilities).to have_been_made.twice
+ expect(stub_server_capabilities).to have_been_made.once
end
end
- context 'when server config check request times out' do
+ context "when server config check request times out" do
let(:timeout_server_config_check) { true }
- include_examples 'contract is invalid', host: :cannot_be_connected_to
+ include_examples "contract is invalid", host: :cannot_be_connected_to
- it 'retries failed request once' do
+ it "retries failed request once" do
contract.validate
- # twice due to HTTPX retry plugin being enabled.
- expect(stub_config_check).to have_been_made.twice
+ expect(stub_config_check).to have_been_made.once
end
end
end
diff --cc spec/lib/acts_as_journalized/journable_differ_spec.rb
index f1572ee21b8,a6c6ccf0fd0..7e6fc6bd6b8
--- a/spec/lib/acts_as_journalized/journable_differ_spec.rb
+++ b/spec/lib/acts_as_journalized/journable_differ_spec.rb
@@@ -131,5 -131,31 +131,31 @@@ RSpec.describe Acts::Journalized::Journ
)
end
end
+
+ context "with a default custom value" do
+ let(:original) do
+ build(:work_package,
+ custom_values: [
+ build_stubbed(:work_package_custom_value, custom_field_id: nil, value: nil),
+ build_stubbed(:work_package_custom_value, custom_field_id: nil, value: ""),
+ build_stubbed(:work_package_custom_value, custom_field_id: 2, value: 1)
+ ])
+ end
+
+ let(:changed) do
+ build(:work_package,
+ custom_values: [
+ build_stubbed(:work_package_custom_value, custom_field_id: 1, value: "t"),
+ build_stubbed(:work_package_custom_value, custom_field_id: 2, value: 2)
+ ])
+ end
+
+ it "returns the changes" do
+ params = [original, changed, "custom_values", "custom_field", :custom_field_id, :value]
+ expect(described_class.association_changes(*params))
+ .to eql("custom_field_1" => [nil, "t"],
- "custom_field_2" => ["1", "2"])
++ "custom_field_2" => ["1", "2"])
+ end
+ end
end
end
diff --cc spec/seeders/root_seeder_standard_edition_spec.rb
index 9ee7cf63033,fb12568d07b..2799ccf8e7e
--- a/spec/seeders/root_seeder_standard_edition_spec.rb
+++ b/spec/seeders/root_seeder_standard_edition_spec.rb
@@@ -64,16 -64,25 +64,25 @@@ RSpec.describe RootSeeder
expect(Boards::Grid.count { |grid| grid.options.has_key?(:filters) }).to eq 1
end
+ it "links work packages to their version" do
+ count_by_version = WorkPackage.joins(:version).group("versions.name").count
+ # testing with strings would fail for the German language test
+ # 'Bug Backlog' => 1,
+ # 'Sprint 1' => 8,
+ # 'Product Backlog' => 7
+ expect(count_by_version.values).to contain_exactly(1, 8, 7)
+ end
+
+ it "adds the backlogs, board, costs, meetings, and reporting modules to the default_projects_modules setting" do
+ default_modules = Setting.find_by(name: "default_projects_modules").value
+ expect(default_modules).to include("backlogs")
+ expect(default_modules).to include("board_view")
+ expect(default_modules).to include("costs")
+ expect(default_modules).to include("meetings")
+ expect(default_modules).to include("reporting_module")
+ end
+
- it 'links work packages to their version' do
- count_by_version = WorkPackage.joins(:version).group('versions.name').count
- # testing with strings would fail for the German language test
- # 'Bug Backlog' => 1,
- # 'Sprint 1' => 8,
- # 'Product Backlog' => 7
- expect(count_by_version.values).to contain_exactly(1, 8, 7)
- end
-
- it 'creates different types of queries' do
+ it "creates different types of queries" do
count_by_type = View.group(:type).count
expect(count_by_type).to eq(
"work_packages_table" => 7,
@@@ -233,10 -242,16 +242,16 @@@
shared_let(:root_seeder) { described_class.new(seed_development_data: true) }
before_all do
- root_seeder.seed_data!
+ RSpec::Mocks.with_temporary_scope do
+ # opportunistic way to add a test for bug #53611 without extending the testing time
+ allow(Settings::Definition["default_projects_modules"])
+ .to receive(:writable?).and_return(false)
+
+ root_seeder.seed_data!
+ end
end
- it 'creates 1 additional admin user with German locale' do
+ it "creates 1 additional admin user with German locale" do
admins = User.not_builtin.where(admin: true)
expect(admins.count).to eq 2
expect(admins.pluck(:language)).to match_array(%w[en de])