Skip to content
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
8 changes: 4 additions & 4 deletions lib/reforge/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ module DATASOURCES
DEFAULT_MAX_EVAL_SUMMARIES = 100_000

DEFAULT_SOURCES = [
"https://belt.prefab.cloud",
"https://suspenders.prefab.cloud",
"https://primary.reforge.com",
"https://secondary.reforge.com",
].freeze

private def init(
Expand Down Expand Up @@ -116,9 +116,9 @@ module DATASOURCES
@config_sources = @sources

@telemetry_destination = @sources.select do |source|
source.start_with?('https://') && (source.include?("belt") || source.include?("suspenders"))
source.start_with?('https://') && (source.include?("primary") || source.include?("secondary") || source.include?("belt") || source.include?("suspenders"))
end.map do |source|
source.sub(/(belt|suspenders)\./, 'telemetry.')
source.sub(/(primary|secondary)\./, 'telemetry.').sub(/(belt|suspenders)\./, 'telemetry.')
end[0]

if reforge_api_url
Expand Down
2 changes: 1 addition & 1 deletion lib/reforge/sse_config_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def source
@source_index = 0
end

return @prefab_options.sse_sources[@source_index].sub(/(belt|suspenders)\./, 'stream.')
return @prefab_options.sse_sources[@source_index].sub(/(primary|secondary)\./, 'stream.').sub(/(belt|suspenders)\./, 'stream.')
end
end
end
4 changes: 2 additions & 2 deletions test/integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ def base_client_options
prefab_datasources: Reforge::Options::DATASOURCES::ALL,
sdk_key: ENV['REFORGE_INTEGRATION_TEST_SDK_KEY'],
sources: [
'https://belt.staging-prefab.cloud',
'https://suspenders.staging-prefab.cloud',
'https://primary.goatsofreforge.com',
'https://secondary.goatsofreforge.com',
],
global_context: @global_context || {},
}.merge(@client_overrides))
Expand Down
6 changes: 3 additions & 3 deletions test/test_sse_config_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class TestSSEConfigClient < Minitest::Test
def test_client
sources = [
'https://belt.staging-prefab.cloud/'
'https://primary.goatsofreforge.com'
]

options = Reforge::Options.new(sources: sources, sdk_key: ENV.fetch('REFORGE_INTEGRATION_TEST_SDK_KEY', nil))
Expand All @@ -17,7 +17,7 @@ def test_client
client = Reforge::SSEConfigClient.new(options, config_loader)

assert_equal 4, client.headers['Last-Event-ID']
assert_equal "https://stream.staging-prefab.cloud", client.source
assert_equal "https://stream.goatsofreforge.com", client.source

result = nil

Expand All @@ -37,7 +37,7 @@ def test_client
def test_failing_over
sources = [
'https://does.not.exist.staging-prefab.cloud/',
'https://api.staging-prefab.cloud/'
'https://api.goatsofreforge.com/'
]

prefab_options = Reforge::Options.new(sources: sources, sdk_key: ENV.fetch('REFORGE_INTEGRATION_TEST_SDK_KEY', nil))
Expand Down