From 686e2f535ae05ecb532d8052c887bf6d70374d72 Mon Sep 17 00:00:00 2001 From: Przemyslaw Delewski <102958445+pdelewski@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:15:32 +0100 Subject: [PATCH] Revert UseCommonTable global flag (#960) I have to revert it temporarily as integration tests failing https://github.com/QuesmaOrg/quesma/actions/runs/11719484324/job/32643244756 --- quesma/quesma/config/config_v2.go | 24 ------------------- quesma/quesma/config/config_v2_test.go | 1 + .../config/test_configs/has_common_table.yaml | 2 +- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/quesma/quesma/config/config_v2.go b/quesma/quesma/config/config_v2.go index fc16cbdca..a3f2cf550 100644 --- a/quesma/quesma/config/config_v2.go +++ b/quesma/quesma/config/config_v2.go @@ -48,7 +48,6 @@ type QuesmaNewConfiguration struct { Processors []Processor `koanf:"processors"` Pipelines []Pipeline `koanf:"pipelines"` DisableTelemetry bool `koanf:"disableTelemetry"` - UseCommonTable bool `koanf:"useCommonTable"` // global setting } type LoggingConfiguration struct { @@ -528,8 +527,6 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { conf.Logging.RemoteLogDrainUrl = nil } - conf.CreateCommonTable = c.UseCommonTable - conf.InstallationId = c.InstallationId conf.LicenseKey = c.LicenseKey @@ -568,10 +565,6 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { if val, exists := target.properties["useCommonTable"]; exists { conf.CreateCommonTable = val == "true" conf.UseCommonTableForWildcard = val == "true" - } else { - // inherit global setting - conf.CreateCommonTable = c.UseCommonTable - conf.UseCommonTableForWildcard = c.UseCommonTable } } @@ -607,9 +600,6 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { } if val, exists := target.properties["useCommonTable"]; exists { processedConfig.UseCommonTable = val == "true" - } else { - // inherit global setting - processedConfig.UseCommonTable = c.UseCommonTable } if val, exists := target.properties["tableName"]; exists { processedConfig.Override = val.(string) @@ -670,10 +660,6 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { if val, exists := target.properties["useCommonTable"]; exists { conf.CreateCommonTable = val == "true" conf.UseCommonTableForWildcard = val == "true" - } else { - // inherit global setting - conf.CreateCommonTable = c.UseCommonTable - conf.UseCommonTableForWildcard = c.UseCommonTable } } if defaultConfig.SchemaOverrides != nil { @@ -700,10 +686,6 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { if val, exists := target.properties["useCommonTable"]; exists { conf.CreateCommonTable = val == "true" conf.UseCommonTableForWildcard = val == "true" - } else { - // inherit global setting - conf.CreateCommonTable = c.UseCommonTable - conf.UseCommonTableForWildcard = c.UseCommonTable } } if ingestProcessorDefaultIndexConfig.SchemaOverrides != nil { @@ -748,9 +730,6 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { } if val, exists := target.properties["useCommonTable"]; exists { processedConfig.UseCommonTable = val == true - } else { - // inherit global setting - processedConfig.UseCommonTable = c.UseCommonTable } if val, exists := target.properties["tableName"]; exists { processedConfig.Override = val.(string) @@ -800,9 +779,6 @@ func (c *QuesmaNewConfiguration) TranslateToLegacyConfig() QuesmaConfiguration { } if val, exists := target.properties["useCommonTable"]; exists { processedConfig.UseCommonTable = val == true - } else { - // inherit global setting - processedConfig.UseCommonTable = c.UseCommonTable } if val, exists := target.properties["tableName"]; exists { processedConfig.Override = val.(string) diff --git a/quesma/quesma/config/config_v2_test.go b/quesma/quesma/config/config_v2_test.go index bf20feeef..cfb9fc1d6 100644 --- a/quesma/quesma/config/config_v2_test.go +++ b/quesma/quesma/config/config_v2_test.go @@ -269,6 +269,7 @@ func TestTargetNewVariant(t *testing.T) { } func TestUseCommonTableGlobalProperty(t *testing.T) { + t.Skip() os.Setenv(configFileLocationEnvVar, "./test_configs/use_common_table_global_property.yaml") cfg := LoadV2Config() if err := cfg.Validate(); err != nil { diff --git a/quesma/quesma/config/test_configs/has_common_table.yaml b/quesma/quesma/config/test_configs/has_common_table.yaml index 01bbf075c..6bc80de57 100644 --- a/quesma/quesma/config/test_configs/has_common_table.yaml +++ b/quesma/quesma/config/test_configs/has_common_table.yaml @@ -67,4 +67,4 @@ pipelines: - name: my-elasticsearch-proxy-write frontendConnectors: [ elastic-ingest ] processors: [ IP ] - backendConnectors: [ E, C ] + backendConnectors: [ E, C ] \ No newline at end of file