Skip to content

Commit

Permalink
Upgrade dependencies ⬆️
Browse files Browse the repository at this point in the history
- Upgrade FHIR Gateway
- Upgrade 3rd party dependencies
- Update workflow configuration JDK version
  • Loading branch information
ndegwamartin committed Oct 16, 2024
1 parent d7326b0 commit 3338745
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 70 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
- uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
java-version: '17'

- name: Run Unit tests and generate report
run: mvn -B clean test jacoco:report --file pom.xml --file README.md --file LICENSE
Expand Down
8 changes: 4 additions & 4 deletions exec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<properties>
<root.basedir>${project.parent.basedir}</root.basedir>
<spring-boot.version>2.7.5</spring-boot.version>
<spring-boot.version>3.3.4</spring-boot.version>
<!-- We do not want to deploy the `exec` uber jar. -->
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
Expand Down Expand Up @@ -46,13 +46,13 @@
<dependency>
<groupId>com.google.fhir.gateway</groupId>
<artifactId>server</artifactId>
<version>0.3.1</version>
<version>${fhir.gateway.version}</version>
</dependency>

<dependency>
<groupId>com.google.fhir.gateway</groupId>
<artifactId>plugins</artifactId>
<version>0.3.1</version>
<version>${fhir.gateway.version}</version>
</dependency>

<!-- For Spring -->
Expand Down Expand Up @@ -98,7 +98,7 @@
</goals>
<configuration>
<mainClass>org.smartregister.fhir.gateway.MainApp</mainClass>
<!-- We use ZIP layout such that PropertiesLauncher is used and we
<!-- We use ZIP layout such that PropertiesLauncher is used, and we
can add extra jars through `loader.path` property:
https://docs.spring.io/spring-boot/docs/current/reference/html/executable-jar.html#appendix.executable-jar.property-launcher
This is useful for when people want to inject other plugins into
Expand Down
26 changes: 13 additions & 13 deletions plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.basedir>${project.basedir}</project.basedir>
<hapifhir.version>6.8.3</hapifhir.version>
<hapifhir.version>7.4.3</hapifhir.version>
<fhir.proxy-plugin.version>0.2.0</fhir.proxy-plugin.version>
<sentry.version>7.15.0</sentry.version>
<jakarta-servlet.version>6.0.0</jakarta-servlet.version>
</properties>

<dependencies>

<dependency>
<groupId>com.google.fhir.gateway</groupId>
<artifactId>server</artifactId>
<version>0.3.2</version>
<version>${fhir.gateway.version}</version>
</dependency>
<dependency>
<groupId>com.google.fhir.gateway</groupId>
<artifactId>plugins</artifactId>
<version>0.3.1</version>
<version>${fhir.gateway.version}</version>
</dependency>
<!-- Needed for JEE/Servlet support -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${jakarta-servlet.version}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
Expand All @@ -51,12 +51,12 @@
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-logback</artifactId>
<version>7.6.0</version>
<version>${sentry.version}</version>
</dependency>
<dependency>
<groupId>io.sentry</groupId>
<artifactId>sentry-spring-boot-starter</artifactId>
<version>7.6.0</version>
<artifactId>sentry-spring-boot-starter-jakarta</artifactId>
<version>${sentry.version}</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
import java.util.Map;
import java.util.stream.Collectors;

import javax.annotation.Nullable;
import javax.servlet.http.HttpServletRequest;

import org.hl7.fhir.instance.model.api.IBaseBundle;
import org.hl7.fhir.r4.model.Binary;
import org.hl7.fhir.r4.model.Bundle;
Expand All @@ -37,6 +34,8 @@
import ca.uhn.fhir.rest.gclient.TokenClientParam;
import ca.uhn.fhir.rest.server.exceptions.ForbiddenOperationException;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import jakarta.annotation.Nullable;
import jakarta.servlet.http.HttpServletRequest;

public class LocationHierarchyEndpointHelper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.hl7.fhir.r4.model.CareTeam;
import org.hl7.fhir.r4.model.Composition;
import org.hl7.fhir.r4.model.Organization;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smartregister.fhir.gateway.plugins.interfaces.ResourceFinder;
Expand All @@ -40,6 +39,7 @@
import ca.uhn.fhir.rest.api.SearchStyleEnum;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.server.exceptions.AuthenticationException;
import jakarta.annotation.Nonnull;

public class PermissionAccessChecker implements AccessChecker {
private static final Logger logger = LoggerFactory.getLogger(PermissionAccessChecker.class);
Expand Down Expand Up @@ -282,7 +282,7 @@ private List<String> getLocationUuids(String[] syncLocations) {
return locationUuids;
}

@NotNull
@Nonnull
private Map<String, List<String>> collateSyncStrategyIds(
String syncStrategy,
PractitionerDetails practitionerDetails,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.hl7.fhir.r4.model.OrganizationAffiliation;
import org.hl7.fhir.r4.model.Practitioner;
import org.hl7.fhir.r4.model.PractitionerRole;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smartregister.model.location.LocationHierarchy;
Expand All @@ -37,6 +36,7 @@
import ca.uhn.fhir.rest.api.SearchStyleEnum;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.gclient.ReferenceClientParam;
import jakarta.annotation.Nonnull;

public class PractitionerDetailsEndpointHelper {
private static final Logger logger =
Expand Down Expand Up @@ -160,7 +160,7 @@ protected Bundle getAttributedPractitionerDetailsByPractitioner(Practitioner pra
return responseBundle;
}

@NotNull
@Nonnull
public static Set<String> getAttributedLocations(List<LocationHierarchy> locationHierarchies) {
List<ParentChildrenMap> parentChildrenList =
locationHierarchies.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

import static org.smartregister.fhir.gateway.plugins.Constants.AUTHORIZATION;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.fhir.gateway.ExceptionUtil;
import com.google.fhir.gateway.TokenVerifier;

import ca.uhn.fhir.rest.server.exceptions.AuthenticationException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class RestUtils {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import java.util.Map;
import java.util.stream.Collectors;

import javax.annotation.Nullable;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
Expand All @@ -25,7 +23,6 @@
import org.hl7.fhir.r4.model.ListResource;
import org.hl7.fhir.r4.model.OperationOutcome;
import org.hl7.fhir.r4.model.Resource;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -42,6 +39,8 @@
import ca.uhn.fhir.rest.api.RequestTypeEnum;
import ca.uhn.fhir.rest.client.api.IGenericClient;
import ca.uhn.fhir.rest.server.exceptions.ForbiddenOperationException;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;
import lombok.Getter;

public class SyncAccessDecision implements AccessDecision {
Expand Down Expand Up @@ -152,7 +151,7 @@ public RequestMutation getRequestMutation(RequestDetailsReader requestDetailsRea

requestMutation =
RequestMutation.builder()
.queryParams(
.additionalQueryParams(
Map.of(
Constants.TAG_SEARCH_PARAM,
List.of(
Expand Down Expand Up @@ -359,7 +358,7 @@ private boolean includeAttributedPractitioners(String requestPath) {
&& SyncAccessDecisionConstants.ENDPOINT_PRACTITIONER_DETAILS.equals(requestPath);
}

@NotNull
@Nonnull
private static OperationOutcome createOperationOutcome(String exception) {
OperationOutcome operationOutcome = new OperationOutcome();
OperationOutcome.OperationOutcomeIssueComponent operationOutcomeIssueComponent =
Expand All @@ -371,7 +370,7 @@ private static OperationOutcome createOperationOutcome(String exception) {
return operationOutcome;
}

@NotNull
@Nonnull
private static Bundle processListEntriesGatewayModeByListResource(
ListResource responseListResource, int start, int count) {
Bundle requestBundle = new Bundle();
Expand Down Expand Up @@ -418,7 +417,7 @@ private Bundle processListEntriesGatewayModeByBundle(
return requestBundle.setEntry(bundleEntryComponentList);
}

@NotNull
@Nonnull
static Bundle.BundleEntryComponent createBundleEntryComponent(
Bundle.HTTPVerb method, String requestPath, @Nullable String condition) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smartregister.fhir.gateway.plugins.RestUtils;
Expand All @@ -18,6 +14,9 @@

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IParser;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public abstract class BaseEndpoint extends HttpServlet {
private static final Logger logger = LoggerFactory.getLogger(BaseEndpoint.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

import java.io.IOException;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.http.HttpStatus;
import org.hl7.fhir.r4.model.Bundle;
import org.smartregister.fhir.gateway.plugins.Constants;
Expand All @@ -18,6 +14,9 @@
import com.auth0.jwt.interfaces.DecodedJWT;

import ca.uhn.fhir.rest.server.exceptions.AuthenticationException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet("/LocationHierarchy")
public class LocationHierarchyEndpoint extends BaseEndpoint {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
import java.io.IOException;
import java.util.Collections;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.http.HttpStatus;
import org.smartregister.fhir.gateway.plugins.Constants;
import org.smartregister.fhir.gateway.plugins.PractitionerDetailsEndpointHelper;
Expand All @@ -17,6 +13,9 @@
import org.smartregister.model.practitioner.PractitionerDetails;

import ca.uhn.fhir.rest.server.exceptions.AuthenticationException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

@WebServlet("/PractitionerDetail")
public class PractitionerDetailEndpoint extends BaseEndpoint {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.hl7.fhir.instance.model.api.IBaseBundle;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.CodeableConcept;
Expand All @@ -37,6 +35,7 @@
import ca.uhn.fhir.rest.gclient.IQuery;
import ca.uhn.fhir.rest.gclient.IUntypedQuery;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import jakarta.servlet.http.HttpServletRequest;

public class LocationHierarchyEndpointHelperTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.junit.Test;
import org.mockito.Mockito;

import com.google.fhir.gateway.TokenVerifier;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

public class RestUtilTest {

@Test(expected = RuntimeException.class)
Expand Down
Loading

0 comments on commit 3338745

Please sign in to comment.