MINOR: Fix app marketplace migrations (#21360)

* Fix app marketplace migrations

* Fix test
This commit is contained in:
IceS2 2025-05-22 15:13:00 +02:00 committed by GitHub
parent 2da78cd7fd
commit 6f4204731f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 27 additions and 13 deletions

View File

@ -27,11 +27,13 @@ WHERE serviceType = 'Tableau';
-- Add runtime: enabled for AutoPilot
UPDATE apps_marketplace
SET json = JSON_SET(
json,
'$.runtime.enabled',
true
)
SET json =
CASE
WHEN JSON_EXTRACT(json, '$.runtime') IS NULL THEN
JSON_MERGE_PATCH(json, JSON_OBJECT('runtime', JSON_OBJECT('enabled', true)))
ELSE
JSON_SET(json, '$.runtime.enabled', true)
END
WHERE name = 'AutoPilotApplication';
-- Update workflow settings with default values if present

View File

@ -33,12 +33,24 @@ WHERE serviceType = 'Tableau';
-- Add runtime: enabled for AutoPilot
UPDATE apps_marketplace
SET json = jsonb_set(
json::jsonb,
'{runtime,enabled}',
'true'
)
where name = 'AutoPilotApplication';
SET json =
CASE
WHEN json::jsonb -> 'runtime' IS NULL THEN
jsonb_set(
json::jsonb,
'{runtime}',
jsonb_build_object('enabled', true),
true
)
ELSE
jsonb_set(
json::jsonb,
'{runtime,enabled}',
'true',
true
)
END
WHERE name = 'AutoPilotApplication';
-- Update workflow settings with default values if present
UPDATE openmetadata_settings

View File

@ -698,9 +698,9 @@ class SystemResourceTest extends OpenMetadataApplicationTest {
JsonUtils.convertValue(setting.getConfigValue(), WorkflowSettings.class);
// Assert default values
assertEquals(50, workflowSettings.getExecutorConfiguration().getCorePoolSize());
assertEquals(10, workflowSettings.getExecutorConfiguration().getCorePoolSize());
assertEquals(1000, workflowSettings.getExecutorConfiguration().getQueueSize());
assertEquals(100, workflowSettings.getExecutorConfiguration().getMaxPoolSize());
assertEquals(20, workflowSettings.getExecutorConfiguration().getMaxPoolSize());
assertEquals(20, workflowSettings.getExecutorConfiguration().getTasksDuePerAcquisition());
assertEquals(7, workflowSettings.getHistoryCleanUpConfiguration().getCleanAfterNumberOfDays());