Merge commit '3a8370e1f459f5cf9695a610102ae6e53df36714' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2023-08-21 21:07:39 +02:00
44 changed files with 502 additions and 231 deletions

View File

@@ -0,0 +1,18 @@
# frozen_string_literal: true
module Chewy
module IndexExtensions
def index_preset(base_options = {})
case ENV['ES_PRESET'].presence
when 'single_node_cluster', nil
base_options.merge(number_of_replicas: 0)
when 'small_cluster'
base_options.merge(number_of_replicas: 1)
when 'large_cluster'
base_options.merge(number_of_replicas: 1, number_of_shards: (base_options[:number_of_shards] || 1) * 2)
end
end
end
end
Chewy::Index.extend(Chewy::IndexExtensions)

View File

@@ -0,0 +1,11 @@
# frozen_string_literal: true
module Chewy
module SettingsExtensions
def enabled?
settings[:enabled]
end
end
end
Chewy.extend(Chewy::SettingsExtensions)

View File

@@ -49,8 +49,8 @@ namespace :repo do
File.open(path, 'r') do |file|
file.each_line do |line|
if line.start_with?('-')
new_line = line.gsub(/#([[:digit:]]+)*/) do |pull_request_reference|
pull_request_number = pull_request_reference[1..]
new_line = line.gsub(/[(]#([[:digit:]]+)[)]\Z/) do |pull_request_reference|
pull_request_number = pull_request_reference[2..-2]
response = nil
loop do
@@ -66,7 +66,7 @@ namespace :repo do
end
pull_request = Oj.load(response.to_s)
"[#{pull_request['user']['login']}](#{pull_request['html_url']})"
"([#{pull_request['user']['login']}](#{pull_request['html_url']}))"
end
tmp.puts new_line