Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e23abf8
Better handling of timeouts
matthewhorridge Aug 12, 2025
81ac9ab
Upgrade webprotege-ipc
matthewhorridge Aug 13, 2025
fd7e88f
Set correlationId on call to get form descriptors
matthewhorridge Aug 13, 2025
a2b2082
Fixes https://github.com/who-icatx/icatx-project/issues/269
matthewhorridge Aug 13, 2025
c043524
Merge pull request #36 from protegeproject/fix-import-forms
matthewhorridge Aug 27, 2025
59d7af5
Bump version to 2.0.8
github-actions[bot] Aug 27, 2025
fe0a23e
Merge pull request #35 from protegeproject/fix-forms-download
matthewhorridge Aug 27, 2025
9541be1
Bump version to 2.0.9
github-actions[bot] Aug 27, 2025
cedd9c8
Update backend-api to 4.0.0
matthewhorridge Oct 8, 2025
8c7a4e0
Merge pull request #40 from protegeproject/async-events
matthewhorridge Oct 8, 2025
f7fce38
Bump version to 3.0.1
github-actions[bot] Oct 8, 2025
51e58f9
Renames keycloak-admin path element to keycloak. See https://github.c…
matthewhorridge Dec 15, 2025
7fa4fff
Update base image to eclipse-temurin:21-jre because openjdk:17 is no …
matthewhorridge Dec 15, 2025
42fd17d
Merge pull request #42 from protegeproject/keycloak-cleanup
matthewhorridge Dec 15, 2025
95fafcc
Bump version to 3.0.2
github-actions[bot] Dec 15, 2025
b74881c
Merge remote-tracking branch 'origin/main' into main-who
AlexSilaghiWBT Feb 16, 2026
0039626
debug docker
AlexSilaghiWBT Feb 17, 2026
278da67
debug docker
AlexSilaghiWBT Feb 17, 2026
49acb39
debug docker
AlexSilaghiWBT Feb 17, 2026
800547d
debug docker
AlexSilaghiWBT Feb 17, 2026
edbd998
debug docker
AlexSilaghiWBT Feb 17, 2026
5ff40ff
debug docker
AlexSilaghiWBT Feb 17, 2026
916c71e
debug docker
AlexSilaghiWBT Feb 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock
DOCKER_HOST: unix:///var/run/docker.sock
TESTCONTAINERS_RYUK_DISABLED: "true"
TESTCONTAINERS_CHECKS_DISABLE: "true"

steps:
- uses: actions/checkout@v3
Expand All @@ -19,5 +24,21 @@ jobs:
with:
java-version: '17'
distribution: 'adopt'
- name: Debug Docker (Testcontainers)
run: |
echo "=== whoami ==="
whoami
echo "=== groups ==="
groups
echo "=== id ==="
id
echo "=== DOCKER_HOST ==="
echo "${DOCKER_HOST:-<not set>}"
echo "=== Docker socket ==="
ls -la /var/run/docker.sock 2>&1 || true
echo "=== docker info ==="
docker info 2>&1 || true
echo "=== docker run hello-world ==="
docker run --rm hello-world 2>&1 || true
- name: Build with Maven
run: mvn --batch-mode package
21 changes: 21 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
outputs:
version: ${{ steps.release-outputs.outputs.version }}
service: ${{ steps.release-outputs.outputs.service }}
env:
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock
DOCKER_HOST: unix:///var/run/docker.sock
TESTCONTAINERS_RYUK_DISABLED: "true"
TESTCONTAINERS_CHECKS_DISABLE: "true"

steps:
- name: Login to Docker Hub
Expand Down Expand Up @@ -69,6 +74,22 @@ jobs:
git tag ${{ steps.bump.outputs.new_base_version }}
git push origin HEAD:${GITHUB_REF##*/}
git push origin ${{ steps.bump.outputs.new_base_version }}
- name: Debug Docker (Testcontainers)
run: |
echo "=== whoami ==="
whoami
echo "=== groups ==="
groups
echo "=== id ==="
id
echo "=== DOCKER_HOST ==="
echo "${DOCKER_HOST:-<not set>}"
echo "=== Docker socket ==="
ls -la /var/run/docker.sock 2>&1 || true
echo "=== docker info ==="
docker info 2>&1 || true
echo "=== docker run hello-world ==="
docker run --rm hello-world 2>&1 || true
- name: Build package
run: mvn --batch-mode clean package
- name: Build and push image
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17-jre-jammy
FROM eclipse-temurin:21-jre
MAINTAINER protege.stanford.edu

EXPOSE 7777
Expand Down
7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>minio</artifactId>
<version>1.19.7</version>
<version>1.21.3</version>
<scope>test</scope>
</dependency>

Expand All @@ -97,7 +97,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.18.1</version>
<version>1.21.4</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -120,12 +120,13 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<version>1.21.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>rabbitmq</artifactId>
<version>1.19.7</version>
<version>1.21.4</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ public FormsController(RpcClient rpcClient, ObjectMapper objectMapper) {
@GetMapping("/data/projects/{projectId}/forms")
public ResponseEntity<Map<String, Object>> getForms(@PathVariable(PROJECT_ID) ProjectId projectId,
@AuthenticationPrincipal Jwt jwt) {
return rpcClient.call(jwt, GET_FORM_DESCRIPTORS, Map.of(PROJECT_ID, projectId));
try {
CorrelationMDCUtil.setCorrelationId(UUID.randomUUID().toString());
return rpcClient.call(jwt, GET_FORM_DESCRIPTORS, Map.of(PROJECT_ID, projectId));
} finally {
CorrelationMDCUtil.clearCorrelationId();
}
}

@PostMapping("/data/projects/{projectId}/forms")
Expand All @@ -51,6 +56,7 @@ public ResponseEntity<Map<String, Object>> setForms(@PathVariable(PROJECT_ID) Pr
// formDescriptors
// formSelectors
try {
CorrelationMDCUtil.setCorrelationId(UUID.randomUUID().toString());
var tree = objectMapper.readValue(forms, new TypeReference<Map<String, Object>>() {});
var params = new LinkedHashMap<>(tree);
params.put("changeRequestId", ChangeRequestId.generate());
Expand All @@ -59,6 +65,8 @@ public ResponseEntity<Map<String, Object>> setForms(@PathVariable(PROJECT_ID) Pr

} catch (JsonProcessingException e) {
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, e.getMessage());
} finally {
CorrelationMDCUtil.clearCorrelationId();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.AmqpTimeoutException;
import org.springframework.amqp.core.AmqpMessageReturnedException;
import org.springframework.amqp.core.AmqpReplyTimeoutException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatusCode;
Expand All @@ -19,6 +22,8 @@
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.TimeoutException;

/**
* Matthew Horridge
Expand Down Expand Up @@ -76,11 +81,22 @@ private CompletableFuture<RpcResponse> sendMessage(RpcRequest request, String ac
payload, userId);
return reply
.exceptionally(e -> {
if(e instanceof CompletionException completionException) {
if(completionException.getCause() instanceof AmqpReplyTimeoutException timeoutException) {
logger.error("Timeout while waiting for reply to message on channel {}: {}", request.methodName(), timeoutException.getMessage(), e);
throw new ResponseStatusException(HttpStatus.GATEWAY_TIMEOUT, "Timed out while waiting for reply to message on channel " + request.methodName(), timeoutException);
}
else if(completionException.getCause() instanceof AmqpMessageReturnedException messageReturnedException) {
logger.error("Message returned: {}", messageReturnedException.getMessage(), e);
throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, "Message to channel " + request.methodName() + " was returned");
}
}
if (e instanceof ProjectUnderMaintenanceException) {
throw (ProjectUnderMaintenanceException) e;
}
logger.error("Error during send and receive: {}. Returning failed future with ResponseStatusException HTTP 500 Internal Server Error", e.getMessage(), e);
throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, e.getMessage(), e);

})
.thenCompose(msg -> {
try {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ spring.security.oauth2:
authorization-grant-type: authorization_code
scope: openid
provider.keycloak:
issuer-uri: http://webprotege-local.edu/keycloak-admin/realms/webprotege
issuer-uri: http://webprotege-local.edu/keycloak/realms/webprotege
user-name-attribute: preferred_username
resourceserver.jwt.issuer-uri: http://webprotege-local.edu/keycloak-admin/realms/webprotege
resourceserver.jwt.issuer-uri: http://webprotege-local.edu/keycloak/realms/webprotege