Skip to content

Commit

Permalink
Merge pull request #763 from RADAR-base/release-2.1.1
Browse files Browse the repository at this point in the history
Release 2.1.1
  • Loading branch information
Bdegraaf1234 authored Mar 22, 2024
2 parents 008ff71 + 91b0dc6 commit 6a57c48
Show file tree
Hide file tree
Showing 450 changed files with 23,371 additions and 25,892 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ jobs:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Cache
uses: actions/cache@v3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-java-${{ hashFiles('**/build.gradle', '**/gradle.properties', '**/yarn.lock', '.yarnrc.yml') }}
key: ${{ runner.os }}-node-${{ hashFiles('**/build.gradle', '**/gradle.properties', '**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
${{ runner.os }}-java-
${{ runner.os }}-node-
- name: Install Yarn dependencies
run: yarn install
Expand Down Expand Up @@ -202,6 +203,16 @@ jobs:
org.opencontainers.image.vendor=RADAR-base
org.opencontainers.image.licenses=Apache-2.0
# # placeholder for testing
# - name: End to end tests (docker image)
# id: e2e-prod-docker
# run: |
# cp src/test/resources/config/keystore.p12 src/main/docker/etc/config
# ./gradlew -Pprod buildDocker -x test -x javadocJar
# docker-compose -f src/main/docker/app.yml up -d
# yarn run e2e-prod
# docker-compose -f src/main/docker/app.yml down -v

# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
Expand Down
35 changes: 23 additions & 12 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,40 @@ jobs:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Cache
uses: actions/cache@v3
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-java-${{ hashFiles('**/build.gradle', '**/gradle.properties', '**/yarn.lock') }}
key: ${{ runner.os }}-rc-node-${{ hashFiles('**/build.gradle', '**/gradle.properties', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-java-
${{ runner.os }}-rc-node-
${{ runner.os }}-node-
- name: Install Yarn dependencies
run: yarn install

- name: Yarn build
run: yarn build:prod

- name: Yarn check
run: yarn test

# Compile the code
- name: Install dependencies
run: |
yarn install
- name: Compile java
run: ./gradlew assemble

- name: Run full end to end tests
- name: Run full production end to end tests
id: e2e
run: |
cp src/test/resources/config/keystore.p12 src/main/resources/config/keystore.p12
./gradlew bootRun &>mp.log </dev/null &
yarn run wait-for-managementportal
./gradlew generateOpenApiSpec
yarn e2e
docker-compose -f src/main/docker/postgresql.yml up -d
./gradlew bootRun -Pprod -Pe2e-prod-test &>mp.log </dev/null &
yarn run e2e-prod
docker-compose -f src/main/docker/postgresql.yml down -v
./gradlew --stop
- name: Upload screenshots of failed e2e tests
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,22 @@ jobs:
with:
node-version: 16

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=.yarn/cache" >> $GITHUB_OUTPUT

- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17

- name: Cache
uses: actions/cache@v3
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-java-${{ hashFiles('**/build.gradle', '**/gradle.properties', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-java-
cache-disabled: true

- name: Compile code
run: ./gradlew assemble

# Upload it to GitHub
- name: Upload to GitHub
uses: AButler/[email protected]
uses: AButler/[email protected].2
with:
files: '*/build/libs/*'
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @nivemaham @blootsvoets
* @nivemaham @blootsvoets @bdegraaf1234 @peyman-mohtashami
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Management Portal is an application which is used to manage clinical studies for
- [Testing](#testing)
* [Client tests](#client-tests)
* [Other tests](#other-tests)
- [Using Docker to simplify development (optional)](#using-docker-to-simplify-development--optional-)
- [Using Docker to simplify development (optional)](#using-docker-to-simplify-development-optional)
- [Documentation](#documentation)
- [Client libraries](#client-libraries)

Expand Down Expand Up @@ -49,7 +49,7 @@ docker-compose files.
3. Now, we can start the stack with `docker-compose -f src/main/docker/management-portal.yml up -d`.

This will start a Postgres database and ManagementPortal. The default password for the `admin`
account is `admin`.
account is `admin`. An angular live development server to access the managementportal can be started using the `yarn start` command (see [Development](#development)).

### Build from source

Expand All @@ -68,15 +68,14 @@ You must install and configure the following dependencies on your machine to run
main differences between the profiles. Configure the application using the property file at `src/main/resources/config/application-<profile>.yml`.Read more about configurations [here](#configuration)

5. Run ManagementPortal by running `./gradlew bootRun -Pprod` or `./gradlew bootRun -Pdev`. Development mode will start an in
memory database and ManagementPortal.
memory database and ManagementPortal. An angular live development server to access the managementportal can be started using the `yarn start` command (see [Development](#development)).
6. You can log in to the application using `admin:admin`. Please don't forgot to change the password of `admin`, if you are using the application on production environment.


| | Development | Production |
|----------------------------------|-----------------|-----------------------------------|
| Database type | In-memory | Postgres |
| Demo data loaded | Yes | No |
| Context path of the application | `/` | `/managementportal` |



Expand Down Expand Up @@ -249,6 +248,8 @@ auto-refreshes when files change on your hard drive.
Then open <http://localhost:8081/> to start the interface and sign in with admin/admin.
### Managing dependencies
[Yarn][] is also used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by
specifying a newer version in [package.json](package.json). You can also run `yarn update` and `yarn install` to manage dependencies.
Add the `help` flag on any command to see how you can use it. For example, `yarn help update`.
Expand Down Expand Up @@ -294,15 +295,15 @@ To launch your application's tests, run:
### Client tests
Unit tests are run by [Karma][] and written with [Jasmine][]. They're located in [src/test/javascript/](src/test/javascript/) and can be run with:
Unit tests are run by [Karma][] and written with [Jasmine][]. They're located in `src/test/javascript/` and can be run with:
yarn test
UI end-to-end tests are powered by [Cypress][], which is built on top of WebDriverJS. They're located in [src/test/javascript/e2e](src/test/javascript/e2e)
and can be run by starting Spring Boot in one terminal (`./gradlew bootRun`) and running the tests (`yarn run e2e`) in a second one.
### Other tests
Performance tests are run by [Gatling][] and written in Scala. They're located in [src/test/gatling](src/test/gatling) and can be run with:
Performance tests are run by [Gatling][] and written in Scala. They're located in `src/test/gatling` and can be run with:
./gradlew gatlingRunAll
Expand Down
4 changes: 1 addition & 3 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@
},
"configurations": {
"production": {
"devServerTarget": "management-portal:serve:production",
"watch": false,
"headless": true
"devServerTarget": "management-portal:serve:production"
}
}
}
Expand Down
37 changes: 25 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ plugins {
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id("com.github.ben-manes.versions") version "0.47.0"
id 'org.jetbrains.kotlin.jvm' version "1.9.10"
id "org.jetbrains.kotlin.kapt" version "1.9.10"
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.10' apply false
id 'org.jetbrains.dokka' version "1.8.20"
id "org.jetbrains.kotlin.plugin.allopen" version "1.9.10"
}

apply plugin: 'org.springframework.boot'
Expand All @@ -32,7 +34,7 @@ apply plugin: 'io.spring.dependency-management'

allprojects {
group 'org.radarbase'
version '2.1.0' // project version
version '2.1.1' // project version

// The comment on the previous line is only there to identify the project version line easily
// with a sed command, to auto-update the version number with the prepare-release-branch.sh
Expand Down Expand Up @@ -147,9 +149,10 @@ if (project.hasProperty('prod')) {
ext.findbugAnnotationVersion = '3.0.2'

dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}")
implementation("tech.jhipster:jhipster-framework:${jhipster_server_version}")
implementation("tech.jhipster:jhipster-dependencies:${jhipster_server_version}")
implementation("io.micrometer:micrometer-core")
implementation("io.micrometer:micrometer-core:${micrometer_version}")
runtimeOnly "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-hibernate5"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-csv"
Expand All @@ -169,28 +172,29 @@ dependencies {
runtimeOnly ("org.springframework.boot:spring-boot-starter-data-jpa") {
exclude group: 'org.hibernate', module: 'hibernate-entitymanager'
}
implementation "org.hibernate:hibernate-core"
implementation "org.hibernate:hibernate-envers"
implementation 'org.hibernate:hibernate-validator:8.0.0.Final'

runtimeOnly "org.postgresql:postgresql:${postgresql_version}"
runtimeOnly "org.hsqldb:hsqldb:${hsqldb_version}"

runtimeOnly "org.springframework.boot:spring-boot-starter-security"
implementation "org.springframework.security:spring-security-data"

implementation("org.springframework.boot:spring-boot-starter-web") {
exclude module: 'spring-boot-starter-tomcat'
}
runtimeOnly "org.springframework.boot:spring-boot-starter-security"
implementation ("org.springframework.boot:spring-boot-starter-undertow")

implementation "org.hibernate:hibernate-core"
implementation "org.hibernate:hibernate-envers"
implementation "org.hibernate:hibernate-validator:${hibernate_validator_version}"

runtimeOnly "org.postgresql:postgresql:${postgresql_version}"
runtimeOnly "org.hsqldb:hsqldb:${hsqldb_version}"

// Fix vulnerabilities
runtimeOnly("io.undertow:undertow-websockets-jsr:2.2.25.Final")
runtimeOnly("io.undertow:undertow-servlet:2.2.25.Final")
runtimeOnly("io.undertow:undertow-core:2.2.25.Final")

implementation "org.springframework.boot:spring-boot-starter-thymeleaf"
runtimeOnly("org.thymeleaf:thymeleaf-spring5:${thymeleaf_version}")
runtimeOnly("org.thymeleaf:thymeleaf:${thymeleaf_version}")
runtimeOnly("org.thymeleaf:thymeleaf-spring5:${thymeleaf_version}")
implementation("org.springframework:spring-context-support")
implementation("org.springframework.session:spring-session-hazelcast")

Expand All @@ -201,6 +205,9 @@ dependencies {
implementation project(':radar-auth')
implementation "org.springframework.data:spring-data-envers"

implementation "org.mockito:mockito-core:$mockito_version"
implementation "org.mockito.kotlin:mockito-kotlin:${mockito_kotlin_version}"

runtimeOnly("jakarta.xml.bind:jakarta.xml.bind-api:${javax_xml_bind_version}")
runtimeOnly("org.glassfish.jaxb:jaxb-core:${javax_jaxb_core_version}")
runtimeOnly("org.glassfish.jaxb:jaxb-runtime:${javax_jaxb_runtime_version}")
Expand All @@ -217,14 +224,20 @@ dependencies {
testImplementation "org.springframework.boot:spring-boot-test"
testImplementation "org.assertj:assertj-core:${assertj_version}"
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.mockito:mockito-core:$mockito_version"
testImplementation "org.mockito.kotlin:mockito-kotlin:${mockito_kotlin_version}"
testImplementation "com.mattbertolini:liquibase-slf4j:${liquibase_slf4j_version}"
testImplementation "org.hamcrest:hamcrest-library"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"

annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
}

allOpen {
annotation("org.springframework.stereotype.Component")
annotation("org.springframework.boot.test.context.SpringBootTest")
annotation("org.springframework.web.bind.annotation.RestController")
}

dependencyManagement {
imports {
mavenBom "com.fasterxml.jackson:jackson-bom:$jackson_version"
Expand Down
2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"screenshotsFolder": "src/test/javascript/e2e/cypress/screenshots",
"pluginsFile": false,
"fixturesFolder": false,
"baseUrl": "http://localhost:9000"
"baseUrl": "http://localhost:8081"
}
18 changes: 13 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ rootProject.name=management-portal
profile=dev
assertj_version=3.23.1
jhipster_server_version=7.9.3
hazelcast_version=5.2.4
hazelcast_version=5.2.5
hazelcast_hibernate_version=5.1.0
hikaricp_version=5.0.1
liquibase_slf4j_version=4.1.0
liquibase_version=4.22.0
postgresql_version=42.6.0
postgresql_version=42.6.1
springdoc_version=1.6.15
spring_boot_version=2.7.15
spring_framework_version=5.3.27
Expand All @@ -16,20 +16,28 @@ thymeleaf_version=3.1.2.RELEASE
spring_session_version=2021.2.0
gatling_version=3.8.4
mapstruct_version=1.5.5.Final
jackson_version=2.15.2
jackson_version=2.16.1
javax_xml_bind_version=2.3.3
javax_jaxb_core_version=2.3.0.1
javax_jaxb_runtime_version=2.3.8
javax_activation=1.1.1
mockito_version=4.8.1
mockito_kotlin_version=5.1.0
slf4j_version=2.0.7
logback_version=1.4.11
oauth_jwt_version=4.4.0
junit_version=5.10.0
okhttp_version=4.10.0
hsqldb_version=2.7.2
coroutines_version=1.7.3
ktor_version=2.3.3
coroutines_version=1.8.0
ktor_version=2.3.9
radar_commons_version=1.0.0
hamcrest_version=2.2
wiremock_version=3.0.1
kotlin_version=1.9.10
micrometer_version=1.12.3
hibernate_orm_version=6.4.4.Final
hibernate_validator_version=8.0.0.Final

kotlin.code.style=official
org.gradle.vfs.watch=true
Expand Down
6 changes: 1 addition & 5 deletions gradle/docker.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,5 @@ task buildDocker(type: Exec, dependsOn: bootWar) {
include "*.war*"
}
}
if (OperatingSystem.current().isWindows()) {
commandLine 'cmd', '/c', 'docker', 'image', 'build', '-f', 'build/docker/Dockerfile', '-t', 'managementportal', 'build/docker/'
} else {
commandLine 'docker', 'image', 'build', '-f', 'build/docker/Dockerfile', '-t', 'managementportal', 'build/docker/'
}
commandLine 'docker', 'image', 'build', '-f', 'build/docker/Dockerfile', '-t', 'managementportal', 'build/docker/'
}
2 changes: 1 addition & 1 deletion gradle/mapstruct.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

dependencies {
implementation group: 'org.mapstruct', name: 'mapstruct', version: mapstruct_version
annotationProcessor group: 'org.mapstruct', name: 'mapstruct-processor', version: mapstruct_version
kapt group: 'org.mapstruct', name: 'mapstruct-processor', version: mapstruct_version
}
4 changes: 4 additions & 0 deletions gradle/profile_dev.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ if (project.hasProperty('no-liquibase')) {
profiles += ',no-liquibase'
}

if (project.hasProperty('e2e-prod-test')) {
profiles += ',e2e-prod-test'
}

bootRun {
args = []
systemProperty "spring.profiles.active", profiles
Expand Down
Loading

0 comments on commit 6a57c48

Please sign in to comment.