Skip to content

Commit a09d422

Browse files
authored
Feature/update dependencies (#7)
* update dependencies * update material ui * change color picker * update nivo * support neo4j 5.x * update to neo4j 5.1.0-community * fix image name for lokal build
1 parent 47d9d2c commit a09d422

32 files changed

+17174
-51220
lines changed

backend/csv2json/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<dependency>
1717
<groupId>com.fasterxml.jackson.core</groupId>
1818
<artifactId>jackson-databind</artifactId>
19-
<version>2.12.3</version>
19+
<version>2.12.7.1</version>
2020
</dependency>
2121

2222
<dependency>

backend/server/pom.xml

+18-8
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
<properties>
1616
<compiler-plugin.version>3.8.1</compiler-plugin.version>
17-
<maven.compiler.parameters>true</maven.compiler.parameters>
17+
<failsafe.useModulePath>false</failsafe.useModulePath>
18+
<maven.compiler.release>17</maven.compiler.release>
1819
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1920
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
20-
<quarkus-plugin.version>2.7.1.Final</quarkus-plugin.version>
2121
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
22-
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
23-
<quarkus.platform.version>2.7.5.Final</quarkus.platform.version>
24-
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
22+
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
23+
<quarkus.platform.version>2.13.3.Final</quarkus.platform.version>
24+
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
2525
</properties>
2626
<dependencyManagement>
2727
<dependencies>
@@ -84,17 +84,18 @@
8484
<version>5.3</version>
8585
</dependency>
8686
<dependency>
87-
<groupId>io.quarkus</groupId>
87+
<groupId>io.quarkiverse.neo4j</groupId>
8888
<artifactId>quarkus-neo4j</artifactId>
89+
<version>1.6.0</version>
8990
</dependency>
9091
</dependencies>
9192

9293
<build>
9394
<plugins>
9495
<plugin>
95-
<groupId>io.quarkus</groupId>
96+
<groupId>${quarkus.platform.group-id}</groupId>
9697
<artifactId>quarkus-maven-plugin</artifactId>
97-
<version>${quarkus-plugin.version}</version>
98+
<version>${quarkus.platform.version}</version>
9899
<extensions>true</extensions>
99100
<executions>
100101
<execution>
@@ -106,6 +107,15 @@
106107
</execution>
107108
</executions>
108109
</plugin>
110+
<plugin>
111+
<artifactId>maven-compiler-plugin</artifactId>
112+
<version>${compiler-plugin.version}</version>
113+
<configuration>
114+
<compilerArgs>
115+
<arg>-parameters</arg>
116+
</compilerArgs>
117+
</configuration>
118+
</plugin>
109119
<plugin>
110120
<artifactId>maven-surefire-plugin</artifactId>
111121
<version>${surefire-plugin.version}</version>

backend/server/src/main/java/com/prodyna/mifune/api/ApocalypseResource.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ public Multi<String> apocalypseNow() {
7474
Supplier<CompletionStage<Long>> dropIndex =
7575
() ->
7676
session
77-
.runAsync("""
78-
call db.indexes() yield name
79-
return name
80-
""")
77+
.runAsync(
78+
"""
79+
show index yield name
80+
return name
81+
""")
8182
.thenCompose(
8283
cursor ->
8384
cursor.forEachAsync(
@@ -90,7 +91,7 @@ public Multi<String> apocalypseNow() {
9091
() ->
9192
session
9293
.runAsync("""
93-
call db.constraints() yield name
94+
show constraints yield name
9495
return name
9596
""")
9697
.thenCompose(

backend/server/src/main/java/com/prodyna/mifune/core/ImportService.java

+34-13
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
import org.eclipse.microprofile.config.inject.ConfigProperty;
6363
import org.jboss.logging.Logger;
6464
import org.neo4j.driver.Driver;
65+
import org.neo4j.driver.reactive.RxSession;
6566
import org.reactivestreams.FlowAdapters;
6667
import org.reactivestreams.Processor;
6768

@@ -86,6 +87,10 @@ public class ImportService {
8687

8788
@Inject protected SourceService sourceService;
8889

90+
static Uni<Void> sessionFinalizer(RxSession session) {
91+
return Uni.createFrom().publisher(session.close());
92+
}
93+
8994
public Uni<String> runImport(UUID domainId) {
9095

9196
if (pipelineMap.containsKey(domainId)) {
@@ -155,7 +160,6 @@ private Cancellable startImportTask(UUID domainId, Domain domain, Graph graph) {
155160
private MultiFlatten<JsonNode, Long> createImportTask(
156161
UUID domainId, Domain domain, String cypher, Processor<List<String>, JsonNode> publisher) {
157162
var counter = new AtomicLong(1L);
158-
var session = driver.asyncSession();
159163
return Multi.createFrom()
160164
.publisher(publisher)
161165
.emitOn(Infrastructure.getDefaultWorkerPool())
@@ -165,19 +169,36 @@ private MultiFlatten<JsonNode, Long> createImportTask(
165169
var entry =
166170
new ObjectMapper()
167171
.convertValue(node, new TypeReference<HashMap<String, Object>>() {});
168-
var s = driver.asyncSession();
169172
return Uni.createFrom()
170-
.completionStage(
171-
s.runAsync(cypher, Map.of("model", entry, "domainId", domainId.toString()))
172-
.exceptionally(
173-
e -> {
174-
log.errorf(
175-
" Failed item import in file: %s on lines: %s msg: %s",
176-
domain.getFile(), node.get("lines"), e.getMessage(), e);
177-
return null;
178-
})
179-
.thenCompose(x1 -> session.closeAsync())
180-
.thenApply(v -> counter.getAndIncrement()));
173+
.emitter(
174+
emitter ->
175+
Multi.createFrom()
176+
.resource(
177+
driver::rxSession,
178+
session ->
179+
session.writeTransaction(
180+
tx ->
181+
tx.run(
182+
cypher,
183+
Map.of(
184+
"model",
185+
entry,
186+
"domainId",
187+
domainId.toString()))
188+
.records()))
189+
.withFinalizer(ImportService::sessionFinalizer)
190+
.map(v -> counter.getAndIncrement())
191+
.onFailure()
192+
.invoke(
193+
(throwable) ->
194+
log.errorf(
195+
" Failed item import in file: %s on lines: %s msg: %s",
196+
domain.getFile(),
197+
node.get("lines"),
198+
throwable.getMessage(),
199+
throwable))
200+
.subscribe()
201+
.with(emitter::complete));
181202
});
182203
}
183204

backend/server/src/main/java/com/prodyna/mifune/core/schema/CypherUpdateContext.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ private String toCypher(
8282
if (!c.existChecks.isEmpty()) {
8383
checks =
8484
c.existChecks.stream()
85-
.map("exists(%s)"::formatted)
85+
.map("%s is not null"::formatted)
8686
.collect(Collectors.joining(" and ", "where 1=1 and ", ""));
8787
}
8888

8989
var currentCounter = counter.incrementAndGet();
9090
var subContext =
9191
"""
9292
call {
93-
return %s union
93+
return 1 as result_%s union
9494
with %s
9595
%s
96-
return %s
96+
return 1 as result_%s
9797
}
9898
"""
9999
.formatted(

backend/server/src/main/resources/application.properties

+14
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ Local Settings
7272
%local.quarkus.oidc.tenant-enabled=false
7373
%local.quarkus.oidc.auth-server-url=http://unused-auth-url
7474

75+
quarkus.neo4j.devservices.image-name=neo4j:5.1.0-community
76+
quarkus.neo4j.devservices.bolt-port=7688
77+
quarkus.neo4j.devservices.http-port=7475
7578

7679
TEST Settings
7780
%test.mifune.disable.authorization=true
@@ -95,7 +98,10 @@ TEST Settings
9598
%dev.vertx.static.content=../../ui/build
9699

97100

101+
98102
#dev with security
103+
#quarkus.neo4j.devservices.http-port=7475
104+
#quarkus.neo4j.devservices.bolt-port=7688
99105
#%dev.mifune.disable.authorization=false
100106
#%dev.quarkus.oidc.tenant-enabled=true
101107
#%dev.mifune.root.path.api=http://localhost:8080
@@ -109,3 +115,11 @@ TEST Settings
109115
#%dev.quarkus.oidc.auth-server-url=http://localhost:8888/auth/realms/mifune
110116
#%dev.quarkus.oidc.client-id=mifune-server
111117

118+
%dev.quarkus.http.auth.permission.public.paths=\
119+
${quarkus.http.root-path},\
120+
${quarkus.http.root-path}ui/*,\
121+
${quarkus.http.root-path}${quarkus.http.non-application-root-path}/dev/*,\
122+
${quarkus.http.root-path}${quarkus.http.non-application-root-path}/swagger-ui/*,\
123+
${quarkus.http.root-path}${quarkus.http.non-application-root-path}/openapi
124+
%dev.quarkus.http.auth.permission.public.policy=permit
125+

backend/server/src/test/java/com/prodyna/mifune/core/GraphModelUpdateTest.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ public void testMergeRelationSameNodeModel() throws IOException {
151151
on match set domain.lines = domain.lines + [x in $model.lines where not x in domain.lines | x]
152152
with *
153153
call {
154-
return 1 union
154+
return 1 as result_1 union
155155
with var_1
156156
unwind $model.user.friend as var_2
157157
merge(var_3:User {id:var_2.user.id})
158158
set var_3.name = coalesce(var_2.user.name, var_3.name)
159159
merge(var_1)-[friend:FRIEND]->(var_3)
160160
set friend.since = coalesce(var_2.since, friend.since)
161161
with *
162-
return 1
162+
return 1 as result_1
163163
}
164164
return 'done'
165165
""";
@@ -247,13 +247,13 @@ public void testMergeRelationBetweenTwoNodeModels() throws IOException {
247247
on match set domain.lines = domain.lines + [x in $model.lines where not x in domain.lines | x]
248248
with *
249249
call {
250-
return 1 union
250+
return 1 as result_1 union
251251
with var_1
252-
with * where 1=1 and exists($model.user.hasCar.car.id)
252+
with * where 1=1 and $model.user.hasCar.car.id is not null
253253
merge(var_2:Car {id:$model.user.hasCar.car.id})
254254
merge(var_1)-[hasCar:HAS_CAR]->(var_2)
255255
with *
256-
return 1
256+
return 1 as result_1
257257
}
258258
return 'done'
259259
""";
@@ -350,14 +350,14 @@ public void testMergeRelationBetweenTwoNodeModelsWithProperty() throws IOExcepti
350350
on match set domain.lines = domain.lines + [x in $model.lines where not x in domain.lines | x]
351351
with *
352352
call {
353-
return 1 union
353+
return 1 as result_1 union
354354
with var_1
355-
with * where 1=1 and exists($model.user.hasCar.car.id)
355+
with * where 1=1 and $model.user.hasCar.car.id is not null
356356
merge(var_2:Car {id:$model.user.hasCar.car.id})
357357
merge(var_1)-[hasCar:HAS_CAR]->(var_2)
358358
set hasCar.since = coalesce($model.user.hasCar.since, hasCar.since)
359359
with *
360-
return 1
360+
return 1 as result_1
361361
}
362362
return 'done'
363363
""";
@@ -457,14 +457,14 @@ public void testMergeMultiRelationBetweenNodesWithPrimaryKeys() throws IOExcepti
457457
on match set domain.lines = domain.lines + [x in $model.lines where not x in domain.lines | x]
458458
with *
459459
call {
460-
return 1 union
460+
return 1 as result_1 union
461461
with var_1
462462
unwind $model.user.hasCar as var_2
463463
merge(var_3:Car {id:var_2.car.id})
464464
merge(var_1)-[hasCar:HAS_CAR]->(var_3)
465465
set hasCar.since = coalesce(var_2.since, hasCar.since)
466466
with *
467-
return 1
467+
return 1 as result_1
468468
}
469469
return 'done'
470470
""";
@@ -565,13 +565,13 @@ public void testMergeCollectionByRelationWithKeyAndNodeWithoutPrimaryKeys() thro
565565
on match set domain.lines = domain.lines + [x in $model.lines where not x in domain.lines | x]
566566
with *
567567
call {
568-
return 1 union
568+
return 1 as result_1 union
569569
with var_1
570570
unwind $model.user.hasCar as var_2
571571
merge(var_3:Car {id:var_2.car.id})
572572
merge(var_1)-[hasCar:HAS_CAR {since:var_2.since}]->(var_3)
573573
with *
574-
return 1
574+
return 1 as result_1
575575
}
576576
return 'done'
577577
""";

deployment-sample/mifune-local/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3"
22
services:
33
neo4j:
4-
image: neo4j:4.4.3-community
4+
image: "neo4j:5.1.0-community"
55
ports:
66
- "7474:7474"
77
- "7687:7687"

deployment-sample/mifune-server/docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
volumes:
1212
- "../keycloak/realm-export.json:/tmp/realm-export.json:z"
1313
neo4j:
14-
image: "neo4j:4.4.5-community"
14+
image: "neo4j:5.1.0-community"
1515
environment:
1616
NEO4J_AUTH: "neo4j/password"
1717
ports:

docker_build_local.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ cd .. || exit
77
cd ./backend || exit
88
./mvnw -f pom.xml clean install -DskipTests
99
cd .. || exit
10-
docker build -t prodyna/capt-mifune:latest .
10+
docker build -t ghcr.io/prodyna/capt-mifune:latest .
1111

0 commit comments

Comments
 (0)