Skip to content

Commit

Permalink
Merge pull request #567 from iExecBlockchainComputing/release/8.0.1
Browse files Browse the repository at this point in the history
Release/8.0.1
  • Loading branch information
jbern0rd authored Mar 20, 2023
2 parents cb45b21 + 219cd89 commit 1e6d93d
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 196 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file.

## [[8.0.1]](https://github.com/iExecBlockchainComputing/iexec-core/releases/tag/v8.0.1) 2023-03-20

### Bug Fixes
- Remove explicit version on `micrometer-registry-prometheus` dependency. (#563)
- Send a `TaskNotificationType` to worker with a 2XX HTTP status code. (#564)
- Remove `com.iexec.core.dataset` package. (#565)
- Improve log on `canUpdateReplicateStatus` method. (#566)

## [[8.0.0]](https://github.com/iExecBlockchainComputing/iexec-core/releases/tag/v8.0.0) 2023-03-08

### New Features
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ dependencies {
// graylog
implementation 'biz.paluch.logging:logstash-gelf:1.5.1'

implementation 'io.micrometer:micrometer-registry-prometheus:1.8.1'
// observability
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'

// mongock
implementation "com.github.cloudyrock.mongock:mongock-spring-v5:${mongockVersion}"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=8.0.0
version=8.0.1
iexecCommonVersion=7.0.0
iexecBlockchainAdapterVersion=8.0.0
iexecResultVersion=8.0.0
Expand Down
32 changes: 0 additions & 32 deletions src/main/java/com/iexec/core/dataset/DataSet.java

This file was deleted.

64 changes: 0 additions & 64 deletions src/main/java/com/iexec/core/dataset/DataSetController.java

This file was deleted.

27 changes: 0 additions & 27 deletions src/main/java/com/iexec/core/dataset/DataSetRepository.java

This file was deleted.

66 changes: 0 additions & 66 deletions src/main/java/com/iexec/core/dataset/DataSetService.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.iexec.common.replicate.*;
import com.iexec.core.security.JwtTokenProvider;
import com.iexec.core.worker.WorkerService;
import feign.FeignException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand Down Expand Up @@ -89,6 +90,8 @@ public ResponseEntity<List<TaskNotification>> getMissedTaskNotifications(
* <p>
* The scheduler response can only be null on authentication failures.
* In all other situations, a notification must be sent and the body cannot be null.
* To avoid body deserialization from a {@link FeignException}, a notification with a non-null body
* is sent with a 2XX HTTP status code.
*
* @param bearerToken Authentication token of a worker.
* @param chainTaskId ID of the task on which the worker has an update.
Expand Down Expand Up @@ -135,7 +138,7 @@ public ResponseEntity<TaskNotificationType> updateReplicateStatus(
return replicatesService
.updateReplicateStatus(chainTaskId, walletAddress, statusUpdate, updateReplicateStatusArgs)
.map(ResponseEntity::ok)
.orElse(ResponseEntity.status(HttpStatus.FORBIDDEN)
.orElse(ResponseEntity.status(HttpStatus.ACCEPTED)
.body(TaskNotificationType.PLEASE_ABORT));
case ALREADY_REPORTED:
return ResponseEntity.status(HttpStatus.ALREADY_REPORTED)
Expand All @@ -144,7 +147,7 @@ public ResponseEntity<TaskNotificationType> updateReplicateStatus(
case BAD_WORKFLOW_TRANSITION:
case GENERIC_CANT_UPDATE:
default:
return ResponseEntity.status(HttpStatus.FORBIDDEN)
return ResponseEntity.status(HttpStatus.ACCEPTED)
.body(TaskNotificationType.PLEASE_ABORT);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ public ReplicateStatusUpdateError canUpdateReplicateStatus(String chainTaskId,

boolean hasAlreadyTransitionedToStatus = replicate.containsStatus(newStatus);
if (hasAlreadyTransitionedToStatus) {
log.warn("Cannot update replicate, status {} already reported.", newStatus);
log.warn("Cannot update replicate, status already reported {}",
getStatusUpdateLogs(chainTaskId, replicate, statusUpdate));
return ReplicateStatusUpdateError.ALREADY_REPORTED;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ void shouldNotUpdateReplicateSinceUnauthorized() {
}

@Test
void shouldNotUpdateReplicateSinceForbidden() {
void shouldReturnPleaseAbortSinceCantUpdate() {
when(jwtTokenProvider.getWalletAddressFromBearerToken(TOKEN))
.thenReturn(WALLET_ADDRESS);
when(replicatesService.computeUpdateReplicateStatusArgs(CHAIN_TASK_ID, WALLET_ADDRESS, UPDATE))
Expand All @@ -239,7 +239,7 @@ void shouldNotUpdateReplicateSinceForbidden() {
ResponseEntity<TaskNotificationType> response =
replicatesController.updateReplicateStatus(TOKEN, CHAIN_TASK_ID, UPDATE);

assertThat(response.getStatusCode()).isEqualTo(HttpStatus.FORBIDDEN);
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.ACCEPTED);
assertThat(response.getBody()).isEqualTo(TaskNotificationType.PLEASE_ABORT);
}

Expand Down

0 comments on commit 1e6d93d

Please sign in to comment.