Skip to content

Commit

Permalink
Merge branch 'release/v2.11.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bot committed May 27, 2024
2 parents 7bcbaa1 + 81b5600 commit d0d27cd
Show file tree
Hide file tree
Showing 26 changed files with 146 additions and 157 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:

- name: Sonar - Analyze
# Dependabot has no access to the SONAR_TOKEN secret, so we need to skip sonar.
if: ${{ github.actor != 'dependabot[bot]' }}
if: ${{ github.actor != 'dependabot[bot]' && github.repository_owner == 'ehrbase' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/report-sonar-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "Report Sonar Results"

# we have multiple workflows - this helps to distinguish for them
run-name: "${{ github.event.pull_request.title && github.event.pull_request.title || github.ref_name }} - Report Sonar Results"

on:
workflow_run:
workflows: ["Build & Test"] # runs after build and test workflow
types:
- completed

jobs:
#
# Collect Junit reports generated by build_and_test
#
collect-junit-reports:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup - Java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'

# Download jacoco overall coverage from build & test output
- name: Download - Jacoco Overall Coverage
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run-id: ${{ github.event.workflow_run.id }} # download artifacts from build and test workflow
pattern: jacoco-coverage-overall # uses artifact of build and test workflow
merge-multiple: true
path: ./

- name: Sonar - Analyze
# Dependabot has no access to the SONAR_TOKEN secret, so we need to skip sonar.
# if: ${{ github.actor != 'dependabot[bot]' && github.repository_owner == 'ehrbase' }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn --batch-mode -DskipTests compile sonar:sonar \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=ehrbase \
-Dsonar.projectKey=ehrbase_openEHR_SDK \
-Dsonar.exclusions=test/** \
-Dsonar.coverage.exclusions=test/**,test-data/**/*,opt-14/**/*,response-dto/**/* \
-Dsonar.coverage.jacoco.xmlReportPaths=${{ github.workspace }}/test-coverage/target/site/jacoco-overall-coverage/jacoco.xml
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Note: version releases in the 0.x.y range may introduce breaking changes.

## [2.11.0]
### Added
- Make AqlObjectPath serializable ([606](https://github.com/ehrbase/openEHR_SDK/pull/606))

## [2.10.0]
### Added
- Added EHRbase AQL `MeataData` debug execution data ([594](https://github.com/ehrbase/openEHR_SDK/pull/594))
Expand Down Expand Up @@ -402,3 +406,4 @@ Note: version releases in the 0.x.y range may introduce breaking changes.
[2.9.0]: https://github.com/ehrbase/openEHR_SDK/compare/v2.8.0...v2.9.0
[2.9.1]: https://github.com/ehrbase/openEHR_SDK/compare/v2.9.0...v2.9.1
[2.10.0]: https://github.com/ehrbase/openEHR_SDK/compare/v2.9.1...v2.10.0
[2.11.0]: https://github.com/ehrbase/openEHR_SDK/compare/v2.10.0...v2.11.0
2 changes: 1 addition & 1 deletion aql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
</parent>

<artifactId>aql</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*/
package org.ehrbase.openehr.sdk.aql.dto.path;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
Expand All @@ -28,9 +30,13 @@
import org.ehrbase.openehr.sdk.aql.dto.operand.PathPredicateOperand;
import org.ehrbase.openehr.sdk.aql.parser.AqlQueryParser;
import org.ehrbase.openehr.sdk.aql.render.AqlRenderer;
import org.ehrbase.openehr.sdk.aql.serializer.ObjectPathDeserializer;
import org.ehrbase.openehr.sdk.aql.serializer.ObjectPathSerializer;
import org.ehrbase.openehr.sdk.aql.webtemplatepath.AqlPath;
import org.ehrbase.openehr.sdk.util.Freezable;

@JsonSerialize(using = ObjectPathSerializer.class)
@JsonDeserialize(using = ObjectPathDeserializer.class)
public final class AqlObjectPath implements PathPredicateOperand<AqlObjectPath> {

public static class PathNode implements Freezable<PathNode> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.ehrbase.openehr.sdk.aql.dto.path.AqlObjectPath;

/**
* @author Stefan Spiska
Expand All @@ -39,14 +37,7 @@ public static ObjectMapper getObjectMapper() {
}

private static ObjectMapper init() {

ObjectMapper aqlobjectMapper = new ObjectMapper();

SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(AqlObjectPath.class, new ObjectPathSerializer());
simpleModule.addDeserializer(AqlObjectPath.class, new ObjectPathDeserializer());

aqlobjectMapper.registerModule(simpleModule);
aqlobjectMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
return aqlobjectMapper;
}
Expand Down
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<artifactId>bom</artifactId>
<groupId>org.ehrbase.openehr.sdk</groupId>
<version>2.10.0</version>
<version>2.11.0</version>
<packaging>pom</packaging>

<name>openEHR SDK</name>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
</parent>

<artifactId>client</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion example-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sdk-parent</artifactId>
<groupId>org.ehrbase.openehr.sdk</groupId>
<version>2.10.0</version>
<version>2.11.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion generator-commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
</parent>

<artifactId>generator-commons</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion generator-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>sdk-parent</artifactId>
<groupId>org.ehrbase.openehr.sdk</groupId>
<version>2.10.0</version>
<version>2.11.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
</parent>

<artifactId>generator</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion opt-1.4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
</parent>

<artifactId>opt-1.4</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>bom</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
<relativePath>./bom/pom.xml</relativePath>
</parent>

<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
<packaging>pom</packaging>
<name>openEHR SDK</name>

Expand Down
2 changes: 1 addition & 1 deletion response-dto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<parent>
<groupId>org.ehrbase.openehr.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>2.10.0</version>
<version>2.11.0</version>
</parent>

<artifactId>response-dto</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class MetaData {
* @see MetaData#setAdditionalProperty(String, Object)
* @param <T> of the additional property.
*/
@SuppressWarnings("unused")
@Deprecated(forRemoval = true)
public interface AdditionalProperty<T> extends Function<Object, T> {

/**
Expand Down Expand Up @@ -145,11 +147,13 @@ default Map<String, Object> apply(Object o) {

/**
* Meta additional property of type <code>any</code>.
* The entries are ordered by key.
*/
private final Map<String, Object> additionalProperties = new TreeMap<>();

public MetaData() {}

@Deprecated(forRemoval = true)
public MetaData(QueryResultDto queryResultDto) {

// initialize basic response meta data
Expand All @@ -159,7 +163,7 @@ public MetaData(QueryResultDto queryResultDto) {

// we always add the response set size - also in case it is empty
setAdditionalProperty(
AdditionalProperty.resultSize,
"resultsize",
Optional.ofNullable(queryResultDto.getResultSet())
.map(List::size)
.orElse(0));
Expand All @@ -168,8 +172,8 @@ public MetaData(QueryResultDto queryResultDto) {
Integer resultLimit = queryResultDto.getLimit();
Integer resultOffset = queryResultDto.getOffset();
if (resultLimit != null) {
setAdditionalProperty(AdditionalProperty.fetch, resultLimit);
setAdditionalProperty(AdditionalProperty.offset, resultOffset != null ? resultOffset : 0);
setAdditionalProperty("fetch", resultLimit);
setAdditionalProperty("offset", resultOffset != null ? resultOffset : 0);
}
// the following properties needs to be specified by the application
this.href = null;
Expand Down Expand Up @@ -240,6 +244,7 @@ public void setExecutedAql(String executedAql) {
* @param value to use
* @param <T> of the {@link AdditionalProperty}
*/
@Deprecated(forRemoval = true)
public <T> void setAdditionalProperty(AdditionalProperty<T> property, @Nullable T value) {
setAdditionalProperty(property.getName(), value);
}
Expand All @@ -249,15 +254,22 @@ public <T> void setAdditionalProperty(AdditionalProperty<T> property, @Nullable
*
* @see #setAdditionalProperty(AdditionalProperty, Object)
*/
@Deprecated(forRemoval = true)
public <T> @Nullable T getAdditionalProperty(AdditionalProperty<T> property) {
Object prop = additionalProperties().get(property.getName());
return prop != null ? (T) property.apply(prop) : null;
return prop != null ? property.apply(prop) : null;
}

// Internal access to additional properties
public <T> T getAdditionalProperty(String name, Class<T> type) {
return type.cast(getAdditionalProperty(name));
}

public Object getAdditionalProperty(String name) {
return additionalProperties.get(name);
}

@JsonAnySetter
private void setAdditionalProperty(String name, Object value) {
public void setAdditionalProperty(String name, Object value) {
additionalProperties.put(name, value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class QueryResponseData {

// the initial query without substitution (!)
@JsonProperty(value = "q")
@JsonInclude(JsonInclude.Include.NON_NULL)
private String query;

@JsonProperty(value = "name")
Expand Down
Loading

0 comments on commit d0d27cd

Please sign in to comment.