[GitHub] [incubator-dlab] ppapou commented on a change in pull request #842: [DLAB-1935] Audit adjustments

2020-08-07 Thread GitBox


ppapou commented on a change in pull request #842:
URL: https://github.com/apache/incubator-dlab/pull/842#discussion_r467085832



##
File path: 
services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ProjectServiceImpl.java
##
@@ -344,10 +344,14 @@ private String getUpdateBudgetAudit(ProjectDTO p) {
if (!configuration.isAuditEnabled()) {
return null;
}
-   Integer value = 
Optional.ofNullable(get(p.getName()).getBudget())
+   ProjectDTO projectDTO = get(p.getName());
+   Integer value = Optional.ofNullable(projectDTO.getBudget())
.map(BudgetDTO::getValue)
.orElse(null);
-   return String.format(AUDIT_UPDATE_BUDGET, value, 
p.getBudget().getValue());
+   boolean monthlyBudget = 
Optional.ofNullable(projectDTO.getBudget())

Review comment:
   Primitive has been changed 





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@dlab.apache.org
For additional commands, e-mail: dev-h...@dlab.apache.org



[GitHub] [incubator-dlab] ppapou commented on a change in pull request #842: [DLAB-1935] Audit adjustments

2020-08-06 Thread GitBox


ppapou commented on a change in pull request #842:
URL: https://github.com/apache/incubator-dlab/pull/842#discussion_r466473860



##
File path: 
services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ProjectServiceImpl.java
##
@@ -344,10 +344,11 @@ private String getUpdateBudgetAudit(ProjectDTO p) {
if (!configuration.isAuditEnabled()) {
return null;
}
-   Integer value = 
Optional.ofNullable(get(p.getName()).getBudget())
+   ProjectDTO dbProject = get(p.getName());

Review comment:
   Variable has been renamed





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@dlab.apache.org
For additional commands, e-mail: dev-h...@dlab.apache.org



[GitHub] [incubator-dlab] ppapou commented on a change in pull request #842: [DLAB-1935] Audit adjustments

2020-08-06 Thread GitBox


ppapou commented on a change in pull request #842:
URL: https://github.com/apache/incubator-dlab/pull/842#discussion_r466473681



##
File path: 
services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ProjectServiceImpl.java
##
@@ -344,10 +344,11 @@ private String getUpdateBudgetAudit(ProjectDTO p) {
if (!configuration.isAuditEnabled()) {
return null;
}
-   Integer value = 
Optional.ofNullable(get(p.getName()).getBudget())
+   ProjectDTO dbProject = get(p.getName());
+   Integer value = Optional.ofNullable(dbProject.getBudget())
.map(BudgetDTO::getValue)
.orElse(null);
-   boolean monthlyBudget = 
get(p.getName()).getBudget().isMonthlyBudget();
+   boolean monthlyBudget = dbProject.getBudget().isMonthlyBudget();

Review comment:
   Optional interface has been added





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@dlab.apache.org
For additional commands, e-mail: dev-h...@dlab.apache.org



[GitHub] [incubator-dlab] ppapou commented on a change in pull request #842: [DLAB-1935] Audit adjustments

2020-08-05 Thread GitBox


ppapou commented on a change in pull request #842:
URL: https://github.com/apache/incubator-dlab/pull/842#discussion_r465781327



##
File path: 
services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/ComputationalServiceImplTest.java
##
@@ -667,7 +668,8 @@ public void 
testUpdateSparkClusterConfigWhenClusterIsNotFound() {
 when(exploratoryDAO.fetchExploratoryFields(anyString(), anyString(), 
anyString(), anyBoolean())).thenReturn(userInstanceDto);
 try {
 computationalService.updateSparkClusterConfig(getUserInfo(), 
PROJECT, EXPLORATORY_NAME,
-COMP_NAME + "X", config);
+COMP_NAME + "X", config,
+String.format(COMPUTATIONAL_RECONFIGURE_MESSAGE, 
COMP_NAME, NOTE_BOOK_NAME));

Review comment:
   Computational call is inline





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@dlab.apache.org
For additional commands, e-mail: dev-h...@dlab.apache.org



[GitHub] [incubator-dlab] ppapou commented on a change in pull request #842: [DLAB-1935] Audit adjustments

2020-08-05 Thread GitBox


ppapou commented on a change in pull request #842:
URL: https://github.com/apache/incubator-dlab/pull/842#discussion_r465781010



##
File path: 
services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/ComputationalServiceImplTest.java
##
@@ -613,13 +615,13 @@ public void testUpdateSparkClusterConfig() {
 final List config = Collections.singletonList(new 
ClusterConfig());
 
userInstanceDto.setResources(Collections.singletonList(getUserComputationalResource(RUNNING,
 COMP_NAME)));
 when(exploratoryDAO.fetchExploratoryFields(anyString(), anyString(), 
anyString(), anyBoolean())).thenReturn(userInstanceDto);
-when(requestBuilder.newClusterConfigUpdate(any(UserInfo.class), 
any(UserInstanceDTO.class),
-any(UserComputationalResource.class), 
anyListOf(ClusterConfig.class), any(EndpointDTO.class)))
-.thenReturn(clusterConfigDTO);
+when(requestBuilder.newClusterConfigUpdate(any(UserInfo.class), 
any(UserInstanceDTO.class), any(UserComputationalResource.class),
+anyListOf(ClusterConfig.class),
+any(EndpointDTO.class))).thenReturn(clusterConfigDTO);

Review comment:
   Format has been restored





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@dlab.apache.org
For additional commands, e-mail: dev-h...@dlab.apache.org



[GitHub] [incubator-dlab] ppapou commented on a change in pull request #842: [DLAB-1935] Audit adjustments

2020-08-05 Thread GitBox


ppapou commented on a change in pull request #842:
URL: https://github.com/apache/incubator-dlab/pull/842#discussion_r465780574



##
File path: 
services/self-service/src/main/java/com/epam/dlab/backendapi/service/ComputationalService.java
##
@@ -65,7 +65,7 @@ boolean createDataEngineService(UserInfo userInfo, String 
resourceName, Computat
 void startSparkCluster(UserInfo userInfo, String exploratoryName, String 
computationalName, String project, String auditInfo);
 
 void updateSparkClusterConfig(UserInfo userInfo, String project, String 
exploratoryName, String computationalName,
-  List config);
+  List config, String 
auditMessage);

Review comment:
   Variables names are renamed





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@dlab.apache.org
For additional commands, e-mail: dev-h...@dlab.apache.org



[GitHub] [incubator-dlab] ppapou commented on a change in pull request #842: [DLAB-1935] Audit adjustments

2020-08-05 Thread GitBox


ppapou commented on a change in pull request #842:
URL: https://github.com/apache/incubator-dlab/pull/842#discussion_r465780262



##
File path: 
services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/ProjectServiceImpl.java
##
@@ -344,7 +344,8 @@ private String getUpdateBudgetAudit(ProjectDTO p) {
Integer value = 
Optional.ofNullable(get(p.getName()).getBudget())
.map(BudgetDTO::getValue)
.orElse(null);
-   return String.format(AUDIT_UPDATE_BUDGET, value, 
p.getBudget().getValue());
+   boolean monthlyBudget = 
get(p.getName()).getBudget().isMonthlyBudget();

Review comment:
   Code base has been adjusted





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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: dev-unsubscr...@dlab.apache.org
For additional commands, e-mail: dev-h...@dlab.apache.org