jsinovassin commented on code in PR #742:
URL: https://github.com/apache/unomi/pull/742#discussion_r2642682728
##########
tools/shell-commands/src/main/java/org/apache/unomi/shell/services/internal/UnomiManagementServiceImpl.java:
##########
@@ -194,47 +204,47 @@ public void startUnomi(String selectedStartFeatures,
boolean mustStartFeatures,
}
}
- private void doStartUnomi(String selectedStartFeatures, boolean
mustStartFeatures) throws Exception {
- List<String> features = startFeatures.get(selectedStartFeatures);
- if (features == null || features.isEmpty()) {
- LOGGER.warn("No features configured for start features
configuration: {}", selectedStartFeatures);
+ private void doStartUnomi(String distribution, boolean
mustStartDistribution) throws Exception {
+ if (distribution == null || distribution.isEmpty()) {
+ LOGGER.warn("No distribution provided, unable to start Unomi.");
return;
}
- features.addAll(getAdditionalFeaturesToInstall());
-
- LOGGER.info("Installing features for start features configuration:
{}", selectedStartFeatures);
- for (String featureName : features) {
- try {
- Feature feature = featuresService.getFeature(featureName);
- if (feature == null) {
- LOGGER.error("Feature not found: {}", featureName);
- continue;
+ try {
+ Feature feature = featuresService.getFeature(distribution);
+ if (feature == null) {
+ LOGGER.error("Distribution feature not found: {}",
distribution);
+ return;
+ }
+ for (Dependency dependency : feature.getDependencies()) {
+ if
(!installedDistributionDependencies.contains(dependency.getName())) {
+ LOGGER.info("Installing distribution feature's dependency:
{}", dependency.getName());
+ featuresService.installFeature(dependency.getName(),
dependency.getVersion(), EnumSet.of(FeaturesService.Option.NoAutoStartBundles));
+
installedDistributionDependencies.add(dependency.getName());
}
-
- if (!installedFeatures.contains(featureName)) {
- LOGGER.info("Installing feature: {}", featureName);
+ }
+ for (String featureName : getAdditionalFeaturesToInstall()) {
Review Comment:
With you implementation it seems that it's not necessary to manage
additional features like it's done here.
It could be managed trough a distribution.
It would avoid to manage features in two different ways.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]