Skip to content

Commit fe75c80

Browse files
committed
Merge branch refactor/period:
- refactor measurement handling to properly implement and fix issues related heterogenous periods within a single push - always ignore timestamp duplicates within station/datatype/period, even if within the same push (previously only if the value was a duplicate, too) - fix old unit tests and enable them again - make unit tests use an internal postgres container instead of relying on a live DB outside of ci/cd - add unit tests for new period handling - only unit test client and dto modules on client release - update postgres version to 16 to reflect recent migration due to 12 EOL - eliminate obsolete persistence configurations
1 parent 0b9e107 commit fe75c80

File tree

19 files changed

+561
-492
lines changed

19 files changed

+561
-492
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
uses: actions/checkout@v2
3131
- name: REUSE Compliance Check
3232
uses: fsfe/reuse-action@v1
33+
3334
- name: Test code
3435
uses: noi-techpark/github-actions/maven-test@v2
3536
with:

.github/workflows/sdk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
uses: noi-techpark/github-actions/maven-test@v2
3434
with:
3535
java-version: ${{ env.JAVA_VERSION }}
36-
test-command: 'mvn -B test'
36+
test-command: 'mvn -pl dto,client -B test'
3737

3838
# Release Test Snapshot SDK
3939
release-sdk-snapshot:

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ services:
4141
# stop the containers and execute 'docker-compose rm -fv db' to get rid
4242
# of cached databases...
4343
db:
44-
image: postgis/postgis:12-3.2-alpine
44+
image: postgis/postgis:16-3.5-alpine
4545
environment:
4646
POSTGRES_DB: bdp
4747
POSTGRES_USER: bdp
4848
POSTGRES_PASSWORD: password
49-
# Uncomment this lines, if you want to keep Postgres data on your local machine
50-
#volumes:
51-
# - ./tmp/postgres/data:/var/lib/postgresql/data
5249
ports:
5350
- "5555:5432"
51+
# uncomment to use local data persistence
52+
# volumes:
53+
# - ./tmp/postgres/data:/var/lib/postgresql/data
5454

5555
# To start a local ninja instance along with the core, use `docker compose --profile full up`.
5656
# It's then accessible on port 8991

writer/pom.xml

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it>
44
55
SPDX-License-Identifier: CC0-1.0
66
-->
7-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
7+
<project xmlns="http://maven.apache.org/POM/4.0.0"
8+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
810
<modelVersion>4.0.0</modelVersion>
911

1012
<parent>
11-
<groupId>com.opendatahub.timeseries.bdp</groupId>
12-
<artifactId>core</artifactId>
13+
<groupId>com.opendatahub.timeseries.bdp</groupId>
14+
<artifactId>core</artifactId>
1315
<version>9.0.0</version>
14-
<relativePath>../pom.xml</relativePath>
15-
</parent>
16+
<relativePath>../pom.xml</relativePath>
17+
</parent>
1618

1719
<packaging>jar</packaging> <!-- jar packaging needed by infrastructure/utils/schema-generator -->
1820
<groupId>com.opendatahub.timeseries.bdp</groupId>
@@ -22,7 +24,7 @@ SPDX-License-Identifier: CC0-1.0
2224
<properties>
2325
<finalName>writer</finalName>
2426
<geotools.version>30.0</geotools.version>
25-
<hibernate.version>6.3.1.Final</hibernate.version>
27+
<hibernate.version>6.6.4.Final</hibernate.version>
2628
</properties>
2729

2830
<dependencyManagement>
@@ -57,10 +59,10 @@ SPDX-License-Identifier: CC0-1.0
5759
<artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
5860
</dependency>
5961
<dependency>
60-
<groupId>org.springframework.boot</groupId>
61-
<artifactId>spring-boot-starter-data-jpa</artifactId>
62-
</dependency>
63-
62+
<groupId>org.springframework.boot</groupId>
63+
<artifactId>spring-boot-starter-data-jpa</artifactId>
64+
</dependency>
65+
6466
<dependency>
6567
<groupId>org.springframework.boot</groupId>
6668
<artifactId>spring-boot-starter-actuator</artifactId>
@@ -70,18 +72,18 @@ SPDX-License-Identifier: CC0-1.0
7072
<artifactId>spring-boot-starter-test</artifactId>
7173
<scope>test</scope>
7274
</dependency>
73-
75+
7476
<!-- Keycloak UMA To request Resource level authorization -->
75-
<dependency>
76-
<groupId>org.keycloak</groupId>
77-
<artifactId>keycloak-core</artifactId>
77+
<dependency>
78+
<groupId>org.keycloak</groupId>
79+
<artifactId>keycloak-core</artifactId>
7880
<version>26.0.6</version>
79-
</dependency>
81+
</dependency>
8082
<dependency>
81-
<groupId>org.keycloak</groupId>
82-
<artifactId>keycloak-authz-client</artifactId>
83+
<groupId>org.keycloak</groupId>
84+
<artifactId>keycloak-authz-client</artifactId>
8385
<version>26.0.3</version>
84-
</dependency>
86+
</dependency>
8587

8688
<!-- To create JSON schema descriptions out of classes -->
8789
<dependency>
@@ -98,10 +100,10 @@ SPDX-License-Identifier: CC0-1.0
98100
</dependency>
99101

100102
<!-- DB migration - Flyway -->
101-
<dependency>
102-
<groupId>org.flywaydb</groupId>
103-
<artifactId>flyway-core</artifactId>
104-
</dependency>
103+
<dependency>
104+
<groupId>org.flywaydb</groupId>
105+
<artifactId>flyway-core</artifactId>
106+
</dependency>
105107

106108
<!-- Hibernate: ORM with spatial entity support (Postgis, Geometry, ...) -->
107109
<dependency>
@@ -114,13 +116,13 @@ SPDX-License-Identifier: CC0-1.0
114116
<artifactId>hibernate-spatial</artifactId>
115117
<version>${hibernate.version}</version>
116118
</dependency>
117-
118-
<dependency>
119-
<groupId>org.postgresql</groupId>
120-
<artifactId>postgresql</artifactId>
119+
120+
<dependency>
121+
<groupId>org.postgresql</groupId>
122+
<artifactId>postgresql</artifactId>
121123
<scope>runtime</scope>
122-
</dependency>
123-
124+
</dependency>
125+
124126
<!--
125127
Second level cache, to store entities that never change as
126128
for example provenance records.
@@ -183,6 +185,18 @@ SPDX-License-Identifier: CC0-1.0
183185
<artifactId>commons-text</artifactId>
184186
<version>1.10.0</version>
185187
</dependency>
188+
<!-- Container support for testing -->
189+
<dependency>
190+
<groupId>org.testcontainers</groupId>
191+
<artifactId>junit-jupiter</artifactId>
192+
<scope>test</scope>
193+
</dependency>
194+
<dependency>
195+
<groupId>org.testcontainers</groupId>
196+
<artifactId>postgresql</artifactId>
197+
<version>1.20.0</version>
198+
<scope>test</scope>
199+
</dependency>
186200
</dependencies>
187201

188202
<repositories>
@@ -215,4 +229,4 @@ SPDX-License-Identifier: CC0-1.0
215229
<id>generator</id>
216230
</profile>
217231
</profiles>
218-
</project>
232+
</project>

writer/src/main/java/com/opendatahub/timeseries/bdp/writer/dal/MeasurementAbstract.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public abstract class MeasurementAbstract implements Serializable {
5555
public abstract MeasurementAbstract findLatestEntry(EntityManager em, Station station, DataType type, Integer period);
5656
public abstract Date getDateOfLastRecord(EntityManager em, Station station, DataType type, Integer period);
5757
public abstract void setValue(Object value);
58+
public abstract Object getValue();
5859

5960
protected MeasurementAbstract() {
6061
this.created_on = new Date();

0 commit comments

Comments
 (0)