Skip to content

Conversation

@theghost5800
Copy link
Contributor

No description provided.

pom.xml Outdated
<jackson.databind.version>2.19.1</jackson.databind.version>
<liquibase.version>4.32.0</liquibase.version>
<liquibase-slf4j.version>5.1.0</liquibase-slf4j.version>
<cloudfoundry-client.version>2.58.0</cloudfoundry-client.version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change in adopted cloudfoundrry client is done temporary to test the change. Before merge It will be necessary to adopt new release of cf-java-client or just move whole project into multiapps-controller 😆

Comment on lines 45 to 51
Map<String, Boolean> appFeatures = (Map<String, Boolean>) PropertiesUtil.getPropertyValue(parametersList,
SupportedParameters.APP_FEATURES,
Collections.emptyMap());
Map<String, Boolean> appFeaturesWithOverriddenSsh = new HashMap<>(appFeatures);
if (isSshEnabled != null && !appFeatures.containsKey(Constants.APP_FEATURE_SSH)) {
appFeaturesWithOverriddenSsh.put(Constants.APP_FEATURE_SSH, isSshEnabled);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract this logic in separate method like:

Map<String, Boolean> appFeatures = getNormalizedAppFeatures(parametersList, isSshEnabled);

Also do we need to use two Map objects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is necessary in case when app-features parameter is not set and still ssh-enabled is used. This is done in order to be backwards compatible.

// (48) app-features parameter with multiple features enabled/disabled
Arguments.of(
"/mta/app-features/mtad-app-features.yaml", "/mta/app-features/config-app-features.mtaext", "/mta/cf-platform.json", null, null, false,
new String[] { "feature-app" }, // mtaArchiveModules
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract constants

</extensionElements>
</callActivity>
<sequenceFlow id="sid-26C87D1E-88D5-47E3-907B-0F8EBBCD2C36" sourceRef="executeTasksCallActivity" targetRef="publishProvidedDependenciesTask"></sequenceFlow>
<callActivity id="hooksCallActivity" name="Execute Hooks Call Activity" flowable:async="true" calledElement="${hookProcessGetter.get(hookForExecution, execution)}" flowable:calledElementType="key" flowable:inheritVariables="false" flowable:completeAsync="true" flowable:fallbackToDefaultTenant="false">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is removed inheritVariables="false"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really interesting topic how was set at first place because flowable modeler did remove this explicit set to false.

Copy link
Contributor

@s-yonkov-yonkov s-yonkov-yonkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check comments

}

@SuppressWarnings("unchecked")
private Map<String, Boolean> getAppFeatures(List<Map<String, Object>> parametersList, Boolean isSshEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method does too many things, split it and reduce number of params

String healthCheckHttpEndpoint = (String) PropertiesUtil.getPropertyValue(parametersList,
SupportedParameters.HEALTH_CHECK_HTTP_ENDPOINT,
getDefaultHealthCheckHttpEndpoint(healthCheckType));
Boolean isSshEnabled = (Boolean) PropertiesUtil.getPropertyValue(parametersList, SupportedParameters.ENABLE_SSH, null);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will we depracate this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have such discussion yet but most probably yes because app-feature parameter will unite all similar settings including ssh enablement. With this change if ssh-enabled and app-features: ssh: true/false were specified, it will print warning and will ignore ssh-enabled parameter value.

return !StringUtils.isBlank(newCommand) && !Objects.equals(newCommand, existingProcess.getCommand());
}

private boolean isAppFeaturesChanged(Map<String, Boolean> newAppFeatures, Map<String, Boolean> existingAppFeatures) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to areAppFeaturesChanged ?

Comment on lines +55 to +57
return newAppFeatures.entrySet()
.stream()
.anyMatch(newAppFeature -> !Objects.equals(newAppFeature.getValue(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will happen if someone deletes their app features from the descriptor?
this will result in false, and we will not modify the already existing app features -> in context of cf deploy
in blue-green we will creata a new app and it will have the CF defaults?
Is this an inconsisteny and should we provide default values for app features?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's not good idea to set default values on our own, it is already done by cloudfoundry itself. In the case where application already exist is interesting what to do because we cannot just get default values from cf, the only app feature which is configured per space is ssh enablement - https://v3-apidocs.cloudfoundry.org/version/3.196.0/#list-space-features
if we set explicitly now default values for app features, in future when new app features are added we won't have default values for them. The whole feature parameter is implemented in a way that allows customers easily to specify all app feature parameters in the future.

JIRA:LMCROSSITXSADEPLOY-3111
JIRA:LMCROSSITXSADEPLOY-3111
JIRA:LMCROSSITXSADEPLOY-3111
@sonarqubecloud
Copy link

sonarqubecloud bot commented Aug 5, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
71.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@theghost5800 theghost5800 merged commit 6e0d425 into master Aug 5, 2025
7 of 8 checks passed
@theghost5800 theghost5800 deleted the fileBasedBindings branch August 5, 2025 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants