-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/10.6' into dev
- Loading branch information
Showing
41 changed files
with
735 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
OpenProject::Application.configure do | ||
config.after_initialize do | ||
slow_sql_threshold = OpenProject::Configuration.sql_slow_query_threshold.to_i | ||
return if slow_sql_threshold == 0 | ||
|
||
ActiveSupport::Notifications.subscribe("sql.active_record") do |_name, start, finish, _id, data| | ||
# Skip transaction that may be blocked | ||
next if data[:sql].match(/BEGIN|COMMIT/) | ||
|
||
# Skip smaller durations | ||
duration = ((finish - start) * 1000).round(4) | ||
next if duration <= slow_sql_threshold | ||
|
||
payload = { | ||
duration: duration, | ||
time: start.iso8601, | ||
cached: !!data[:cache], | ||
sql: data[:sql], | ||
} | ||
|
||
sql_log_string = data[:sql].strip.gsub(/(^([\s]+)?$\n)/, "") | ||
OpenProject.logger.warn "Encountered slow SQL (#{payload[:duration]} ms): #{sql_log_string}", | ||
payload: payload, | ||
# Hash of the query for reference/fingerprinting | ||
reference: Digest::SHA1.hexdigest(data[:sql]) | ||
rescue StandardError => e | ||
OpenProject.logger.error "Failed to record slow SQL query: #{e}" | ||
end | ||
end | ||
end |
22 changes: 22 additions & 0 deletions
22
db/migrate/20200625133727_fix_inherited_group_member_roles.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class FixInheritedGroupMemberRoles < ActiveRecord::Migration[6.0] | ||
def up | ||
# Delete all member roles that should be inherited by groups | ||
MemberRole.where.not(inherited_from: nil).delete_all | ||
|
||
# For all group memberships, recreate the member_roles for all users | ||
# which will auto-create members for the users if necessary | ||
MemberRole | ||
.joins(member: [:principal]) | ||
.includes(member: %i[principal member_roles]) | ||
.where("#{Principal.table_name}.type" => 'Group') | ||
.find_each do |member_role| | ||
|
||
# Recreate member_roles for all group members | ||
member_role.send :add_role_to_group_users | ||
end | ||
end | ||
|
||
def down | ||
# Nothing to do | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
docs/installation-and-operations/installation/kubernetes/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
sidebar_navigation: false | ||
--- | ||
|
||
# Kubernetes | ||
|
||
Kubernetes is a container orchestration tool. As such it can use the | ||
OpenProject docker container in the same manner as shown in the [docker section](../docker/#recommended-usage). | ||
|
||
You can translate OpenProject's [`docker-compose.yml`](https://github.com/opf/openproject/blob/stable/10/docker-compose.yml) | ||
for use in Kubernetes using [Kompose](https://github.com/kubernetes/kompose) | ||
as described in the Kubernetes [documentation](https://kubernetes.io/docs/tasks/configure-pod-container/translate-compose-kubernetes/). |
Oops, something went wrong.