Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/1.0.1.0'
Browse files Browse the repository at this point in the history
* origin/release/1.0.1.0:
  release v1.0.1.0
  upgrade dependencies, fix publish github actions, use List.of instead of Arrays.asList
  use commit hash instead of version tag for third-party actions, only build on pull_request
  upgrade dependencies
  fix wrong boundary error event path
  foramt-and-sort
  add reporting and fix reported code improvements where possible
  delete all versions of process from test setup
  run workflows only once on pull-request, update actions
  start development cycle 1.0.1.0
  • Loading branch information
wetret committed Jun 11, 2024
2 parents 6fa8b34 + 22029c1 commit e32181e
Show file tree
Hide file tree
Showing 11 changed files with 163 additions and 131 deletions.
34 changes: 16 additions & 18 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI Build with Maven

on: [push, pull_request]
on: [pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- uses: s4u/[email protected]
with:
servers: |
[ {"id": "github-mii", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}"}]
- name: Build with Maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -B verify -fae --file pom.xml
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
cache: 'maven'
- uses: s4u/maven-settings-action@7802f6aec16c9098b4798ad1f1d8ac75198194bd #3.0.0
with:
servers: |
[ {"id": "github-mii", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}"}]
- name: Build with Maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn --batch-mode --fail-at-end clean verify
19 changes: 8 additions & 11 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will publish a Java project with Maven
# For more information see: https://docs.github.com/en/free-pro-team@latest/actions/guides/publishing-java-packages-with-maven

name: Java CI Publish with Maven

on:
Expand All @@ -13,24 +10,24 @@ on:
jobs:
publish:

# Only run if releases are published or pull requests are merged,
# omit running if pull requests are closed without merging
if: github.event.pull_request.merged || github.event.action == 'published'
# Only run if pull requests are merged, omit running if pull requests are closed without merging
if: github.event.pull_request.merged

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
distribution: 'zulu'
java-version: 17
- uses: s4u/[email protected]
cache: 'maven'
- uses: s4u/maven-settings-action@7802f6aec16c9098b4798ad1f1d8ac75198194bd #3.0.0
with:
servers: |
[ {"id": "github-mii", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}"}]
- name: Publish with Maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -B deploy --file pom.xml
run: mvn --batch-mode --fail-at-end clean deploy
69 changes: 57 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchemamvn-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>de.medizininformatik-initiative</groupId>
<artifactId>mii-process-data-transfer</artifactId>
<version>1.0.0.0</version>
<version>1.0.1.0</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<compileSource>17</compileSource>
<compileTarget>17</compileTarget>

<dsf.version>1.3.1</dsf.version>
<dsf.version>1.5.1</dsf.version>
<testSetup.location>../mii-processes-test-setup</testSetup.location>
</properties>

Expand Down Expand Up @@ -45,13 +45,13 @@
<dependency>
<groupId>de.medizininformatik-initiative</groupId>
<artifactId>mii-processes-common</artifactId>
<version>1.0.0.0</version>
<version>1.0.1.0</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.9</version>
<version>2.0.13</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -82,7 +82,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>${compileSource}</source>
<target>${compileTarget}</target>
Expand All @@ -91,12 +91,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.1</version>
<version>3.2.5</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<version>3.4.1</version>
<configuration>
<archive>
<manifest>
Expand All @@ -113,7 +113,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<version>3.5.3</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -201,6 +201,26 @@
</workingPackages>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.8.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.22.0</version>
</plugin>
</plugins>
</build>

Expand All @@ -213,6 +233,9 @@
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/medizininformatik-initiative/mii-process-data-transfer</url>
</repository>
<site>
<id>${project.artifactId}-site</id>
</site>
</distributionManagement>

<repositories>
Expand Down Expand Up @@ -363,21 +386,21 @@
<fileset>
<directory>${testSetup.location}/docker/dic1/bpe/process</directory>
<includes>
<include>${project.artifactId}-${project.version}.jar</include>
<include>${project.artifactId}-*.jar</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${testSetup.location}/docker/dic2/bpe/process</directory>
<includes>
<include>${project.artifactId}-${project.version}.jar</include>
<include>${project.artifactId}-*.jar</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
<fileset>
<directory>${testSetup.location}/docker/dms/bpe/process</directory>
<includes>
<include>${project.artifactId}-${project.version}.jar</include>
<include>${project.artifactId}-*.jar</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
Expand All @@ -388,4 +411,26 @@
</build>
</profile>
</profiles>

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<configuration>
<plugins>
<plugin>
<groupId>jp.skypencil.findbugs.slf4j</groupId>
<artifactId>bug-pattern</artifactId>
<version>1.5.0</version>
</plugin>
</plugins>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.medizininformatik_initiative.process.data_transfer;

import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

Expand All @@ -12,8 +11,8 @@

public class DataTransferProcessPluginDefinition implements ProcessPluginDefinition
{
public static final String VERSION = "1.0.0.0";
public static final LocalDate RELEASE_DATE = LocalDate.of(2023, 12, 14);
public static final String VERSION = "1.0.1.0";
public static final LocalDate RELEASE_DATE = LocalDate.of(2024, 6, 11);

@Override
public String getName()
Expand Down Expand Up @@ -72,9 +71,8 @@ public Map<String, List<String>> getFhirResourcesByProcessId()

return Map.of( //
ConstantsDataTransfer.PROCESS_NAME_FULL_DATA_RECEIVE, //
Arrays.asList(aReceive, cCrypto, cDaSeSt, cDaTr, eDaSeStEr, nPrId, sSend, vCrypto, vDaSeStRe, vDaTr), //
List.of(aReceive, cCrypto, cDaSeSt, cDaTr, eDaSeStEr, nPrId, sSend, vCrypto, vDaSeStRe, vDaTr), //
ConstantsDataTransfer.PROCESS_NAME_FULL_DATA_SEND, //
Arrays.asList(aSend, cDaSeSt, cDaTr, eDaSeStEr, nPrId, sStatus, sSendStart, tSendStart, vDaSeStSe,
vDaTr));
List.of(aSend, cDaSeSt, cDaTr, eDaSeStEr, nPrId, sStatus, sSendStart, tSendStart, vDaSeStSe, vDaTr));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,11 @@ protected void handleSendTaskError(DelegateExecution execution, Variables variab
Task task = variables.getStartTask();

String statusCode = ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_NOT_REACHABLE;
if (exception instanceof WebApplicationException webApplicationException)
if (exception instanceof WebApplicationException webApplicationException
&& webApplicationException.getResponse() != null
&& webApplicationException.getResponse().getStatus() == Response.Status.FORBIDDEN.getStatusCode())
{
if (webApplicationException.getResponse() != null
&& webApplicationException.getResponse().getStatus() == Response.Status.FORBIDDEN.getStatusCode())
{
statusCode = ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_NOT_ALLOWED;
}
statusCode = ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_NOT_ALLOWED;
}

task.setStatus(Task.TaskStatus.FAILED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@ private Stream<Task.ParameterComponent> createReceiptError(Variables variables)
private Task.ParameterComponent receiveToReceiptStatus(Task.ParameterComponent parameterComponent)
{
Type value = parameterComponent.getValue();
if (value instanceof Coding coding)
if (value instanceof Coding coding
&& ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR.equals(coding.getCode()))
{
if (ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIVE_ERROR.equals(coding.getCode()))
{
coding.setCode(ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_ERROR);
}
coding.setCode(ConstantsBase.CODESYSTEM_DATA_SET_STATUS_VALUE_RECEIPT_ERROR);
}

return parameterComponent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private DocumentReference getDocumentReference(Bundle bundle)
{
List<DocumentReference> documentReferences = bundle.getEntry().stream()
.map(Bundle.BundleEntryComponent::getResource).filter(r -> r instanceof DocumentReference)
.map(r -> ((DocumentReference) r)).toList();
.map(r -> (DocumentReference) r).toList();

if (documentReferences.size() < 1)
throw new IllegalArgumentException("Could not find any DocumentReference in PublicKey Bundle");
Expand All @@ -132,7 +132,7 @@ private DocumentReference getDocumentReference(Bundle bundle)
private Binary getBinary(Bundle bundle)
{
List<Binary> binaries = bundle.getEntry().stream().map(Bundle.BundleEntryComponent::getResource)
.filter(r -> r instanceof Binary).map(b -> ((Binary) b)).toList();
.filter(r -> r instanceof Binary).map(b -> (Binary) b).toList();

if (binaries.size() < 1)
throw new IllegalArgumentException("Could not find any Binary in PublicKey Bundle");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private DocumentReference readDocumentReference(FhirClient fhirClient, String pr
List<DocumentReference> documentReferences = fhirClient
.searchDocumentReferences(ConstantsBase.NAMINGSYSTEM_MII_PROJECT_IDENTIFIER, projectIdentifier)
.getEntry().stream().map(Bundle.BundleEntryComponent::getResource)
.filter(r -> r instanceof DocumentReference).map(r -> ((DocumentReference) r)).toList();
.filter(r -> r instanceof DocumentReference).map(r -> (DocumentReference) r).toList();

if (documentReferences.size() < 1)
throw new IllegalArgumentException("Could not find any DocumentReference for project-identifier '"
Expand Down
Loading

0 comments on commit e32181e

Please sign in to comment.