diff --git a/openmetadata-docs/content/v1.3.x/deployment/ingestion/external/gcs-composer.md b/openmetadata-docs/content/v1.3.x/deployment/ingestion/external/gcs-composer.md index c3f5f5c5b7e..02e028ba279 100644 --- a/openmetadata-docs/content/v1.3.x/deployment/ingestion/external/gcs-composer.md +++ b/openmetadata-docs/content/v1.3.x/deployment/ingestion/external/gcs-composer.md @@ -13,7 +13,7 @@ This approach has been last tested against: - Composer version 2.5.4 - Airflow version 2.6.3 -It also requires the ingestion package to be at least `openmetadata-ingestion==1.3.1.0`. +It also requires the ingestion package to be at least `openmetadata-ingestion==1.3.0.1`. ## Using the Python Operator diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/apps/AbstractNativeApplication.java b/openmetadata-service/src/main/java/org/openmetadata/service/apps/AbstractNativeApplication.java index aa4ece63680..ab7ddaa8b76 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/apps/AbstractNativeApplication.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/apps/AbstractNativeApplication.java @@ -218,6 +218,14 @@ public class AbstractNativeApplication implements NativeApplication { /* Not needed by default */ } + @Override + public void raisePreviewMessage(App app) { + throw AppException.byMessage( + app.getName(), + "Preview", + "App is in Preview Mode. Enable it from the server configuration."); + } + public static AppRuntime getAppRuntime(App app) { return JsonUtils.convertValue(app.getRuntime(), ScheduledExecutionContext.class); } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/apps/AppException.java b/openmetadata-service/src/main/java/org/openmetadata/service/apps/AppException.java index dc8dcba8276..7387e59ea86 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/apps/AppException.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/apps/AppException.java @@ -6,7 +6,7 @@ import org.openmetadata.sdk.exception.WebServiceException; public class AppException extends WebServiceException { private static final String BY_NAME_MESSAGE = "Application [%s] Exception [%s] due to [%s]."; - private static final String ERROR_TYPE = "PIPELINE_SERVICE_ERROR"; + private static final String ERROR_TYPE = "APPLICATION_ERROR"; public AppException(String message) { super(Response.Status.BAD_REQUEST, ERROR_TYPE, message); diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/apps/ApplicationHandler.java b/openmetadata-service/src/main/java/org/openmetadata/service/apps/ApplicationHandler.java index 987e518d788..24ed7b716da 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/apps/ApplicationHandler.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/apps/ApplicationHandler.java @@ -45,6 +45,7 @@ public class ApplicationHandler { && !nullOrEmpty(privateConfiguration.getAppsPrivateConfiguration())) { for (AppPrivateConfig appPrivateConfig : privateConfiguration.getAppsPrivateConfiguration()) { if (app.getName().equals(appPrivateConfig.getName())) { + app.setPreview(appPrivateConfig.getPreview()); app.setPrivateConfiguration(appPrivateConfig.getParameters()); } } @@ -79,6 +80,12 @@ public class ApplicationHandler { clz.getDeclaredConstructor(CollectionDAO.class, SearchRepository.class) .newInstance(daoCollection, searchRepository); + // Raise preview message if the app is in Preview mode + if (Boolean.TRUE.equals(app.getPreview())) { + Method preview = resource.getClass().getMethod("raisePreviewMessage", App.class); + preview.invoke(resource, app); + } + // Call init Method Method initMethod = resource.getClass().getMethod("init", App.class); initMethod.invoke(resource, app); @@ -96,14 +103,13 @@ public class ApplicationHandler { Method scheduleMethod = resource.getClass().getMethod(methodName); scheduleMethod.invoke(resource); - } catch (NoSuchMethodException - | InstantiationException - | IllegalAccessException - | InvocationTargetException e) { + } catch (NoSuchMethodException | InstantiationException | IllegalAccessException e) { LOG.error("Exception encountered", e); - throw new UnhandledServerException(e.getCause().getMessage()); + throw new UnhandledServerException(e.getMessage()); } catch (ClassNotFoundException e) { - throw new UnhandledServerException(e.getCause().getMessage()); + throw new UnhandledServerException(e.getMessage()); + } catch (InvocationTargetException e) { + throw new AppException(e.getTargetException().getMessage()); } } } diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/apps/NativeApplication.java b/openmetadata-service/src/main/java/org/openmetadata/service/apps/NativeApplication.java index 58e6edb8d2c..206a612766d 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/apps/NativeApplication.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/apps/NativeApplication.java @@ -13,5 +13,7 @@ public interface NativeApplication extends Job { void configure(); + void raisePreviewMessage(App app); + default void startApp(JobExecutionContext jobExecutionContext) {} } diff --git a/openmetadata-spec/src/main/resources/json/schema/configuration/appsPrivateConfiguration.json b/openmetadata-spec/src/main/resources/json/schema/configuration/appsPrivateConfiguration.json index f0e1672ea96..0ac3ba5b7c3 100644 --- a/openmetadata-spec/src/main/resources/json/schema/configuration/appsPrivateConfiguration.json +++ b/openmetadata-spec/src/main/resources/json/schema/configuration/appsPrivateConfiguration.json @@ -16,6 +16,11 @@ "type": "string", "description": "Application Name" }, + "preview": { + "type": "boolean", + "description": "Flag to enable/disable preview for the application. If the app is in preview mode, it can't be installed.", + "default": false + }, "parameters": { "javaType": "org.openmetadata.schema.api.configuration.apps.Parameters", "description": "Parameters to initialize the Applications.", diff --git a/openmetadata-spec/src/main/resources/json/schema/entity/applications/app.json b/openmetadata-spec/src/main/resources/json/schema/entity/applications/app.json index a31042d4127..5ef279bc9c6 100644 --- a/openmetadata-spec/src/main/resources/json/schema/entity/applications/app.json +++ b/openmetadata-spec/src/main/resources/json/schema/entity/applications/app.json @@ -210,6 +210,11 @@ "description": "Application Private configuration loaded at runtime.", "$ref": "./configuration/applicationConfig.json#/definitions/privateConfig" }, + "preview": { + "type": "boolean", + "description": "Flag to enable/disable preview for the application. If the app is in preview mode, it can't be installed.", + "default": false + }, "pipelines": { "description": "References to pipelines deployed for this database service to extract metadata, usage, lineage etc..", "$ref": "../../type/entityReferenceList.json"