Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore] merge release/13.4 #15100

Merged
merged 13 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ Finally you will need to activate the GitLab module under [Project settings](../

Seeing the **GitLab** tab requires **Show GitLab content** permission, so this permission needs to be granted to all roles in a project allowed to see the tab.

![Grant permission to show GitLab content to user roles in OpenProject](openproject-system-guide-gitlab-integration-gitlab-content-role-permission.png)

### GitLab

In GitLab you have to set up a webhook in each repository to be integrated with OpenProject. For that navigate to **Settings** -> **Webhooks** and click on **Add new webhook**.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/user-guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Please choose the module or feature you want to learn more about.
| [Forums](forums) | How to manage forums to discuss and comment on topics. |
| [Gantt chart](gantt-chart) | How to create and manage a project plan in a Gantt chart. |
| [GitHub](../system-admin-guide/integrations/github-integration/) | How to manage the GitHub integration. |
| [GitLab](../system-admin-guide/integrations/gitlab-integration/) | How to manage the GitLab integration. |
| [Meetings](meetings) | How to manage meetings to create and share meeting agenda and meeting minutes. |
| [Members](members) | How to manage Members in a project. |
| [News](news) | How to create and manage News for your projects. |
Expand All @@ -53,3 +54,4 @@ Please choose the module or feature you want to learn more about.
| [Time and costs](time-and-costs) | How to track time and costs in OpenProject and report spent time and costs. |
| [Wiki](wiki) | How to create and manage a wiki to collaboratively document and share information. |
| [Work packages](work-packages) | How to manage your work in a project. |

1 change: 0 additions & 1 deletion lib/open_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def self.httpx
# 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def to_changes_format(references, key)
end

def merge_reference_journals_by_id(new_journals, old_journals, id_key, value)
all_associated_journal_ids = new_journals.pluck(id_key) | old_journals.pluck(id_key)
all_associated_journal_ids = (new_journals.pluck(id_key) | old_journals.pluck(id_key)).compact

all_associated_journal_ids.index_with do |id|
[select_and_combine_journals(old_journals, id, id_key, value),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module InstanceMethods
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"
end

Expand Down
2 changes: 1 addition & 1 deletion modules/bim/app/seeders/bim/basic_data/setting_seeder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module BasicData
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"
end

Expand Down
13 changes: 12 additions & 1 deletion modules/bim/spec/seeders/root_seeder_bim_edition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ def group_name(reference)
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
expect(Relation.follows.count).to eq 35
expect(WorkPackage.where.not(parent: nil).count).to eq 55
Expand Down Expand Up @@ -210,7 +215,13 @@ def group_name(reference)

before_all 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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module InstanceMethods
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"
end

Expand Down
2 changes: 1 addition & 1 deletion modules/costs/lib/costs/patches/setting_seeder_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module InstanceMethods
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"
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module InstanceMethods
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"
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module InstanceMethods
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"
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@
expect(subject.errors.to_hash)
.to eq({ password: ["could not be validated. Please check your storage connection and try again."] })

# twice due to HTTPX retry plugin being enabled.
expect(credentials_request).to have_been_made.twice
expect(credentials_request).to have_been_made.once
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@

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

Expand All @@ -205,8 +204,7 @@
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
Expand Down
26 changes: 26 additions & 0 deletions spec/lib/acts_as_journalized/journable_differ_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,31 @@
)
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"])
end
end
end
end
17 changes: 16 additions & 1 deletion spec/seeders/root_seeder_standard_edition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@
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 "creates different types of queries" do
count_by_type = View.group(:type).count
expect(count_by_type).to eq(
Expand Down Expand Up @@ -233,7 +242,13 @@
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
Expand Down
Loading