Skip to content

Commit

Permalink
Merge pull request #3 from medizininformatik-initiative/general-overhaul
Browse files Browse the repository at this point in the history
General Overhaul
  • Loading branch information
bastianschaffer authored Dec 15, 2023
2 parents 7c3a4e3 + 33a3b12 commit efffa78
Show file tree
Hide file tree
Showing 25 changed files with 1,060 additions and 1,289 deletions.
16 changes: 13 additions & 3 deletions .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@ BACKEND_CLIENT_ID="feasibility-gui"
BACKEND_CLIENT_SECRET="test"
KEYCLOAK_TOKEN_URL="https://localhost/auth/realms/feasibility/protocol/openid-connect/token"
CONFLUENCE_API_BASE_URL="https://myconfluence-rest-api-url"
CONFLUENCE_PAGE_ID="123"
CONF_USER="username"
CONF_PW="password"
WAIT_RESULT_SECS=60
SEND_TO_CONFLUENCE=false
WAIT_RESULT_SECS_FEAS=60
WAIT_RESULT_SECS_PING=600
SEND_TO_CONFLUENCE=false
DSF_BASE_URL="https://dsf.base-url-here"
EXECUTE_HISTORY_TEST=false
CONFLUENCE_PAGE_ID_HIST=""
HISTORY_TABLE_LEN=14
EXECUTE_FEAS_TEST=false
CONFLUENCE_PAGE_ID_FEAS=""
EXECUTE_DSF_PING_TEST=false
CONFLUENCE_PAGE_ID_PING=""
DSF_CERT_PATH=
DSF_KEY_PATH=
46 changes: 46 additions & 0 deletions .github/workflows/buid.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare Version Info
id: prep
run: |
echo "mii=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ steps.prep.outputs.mii }}/feasibility-monitoring:test
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.env
test.py
feasibility-results.json
dev-call.sh
reports/*.json
reports/*.json
certs/
temp/
__pycache__/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog
13 changes: 13 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Development

## Release Checklist

* create a release branch called `release-v<version>` like `release-v0.1.1`
* update the CHANGELOG based on the milestone
* create a commit with the title `Release v<version>`
* create a PR from the release branch into main
* merge that PR
* create and push a tag called `v<version>` like `v0.1.1` on main at the merge commit
* create a new branch called `next-dev` on top of the release branch
* merge the `next-dev` branch back into develop
* create release notes on GitHub
17 changes: 0 additions & 17 deletions Dockerfile

This file was deleted.

69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,70 @@
# automatic-connection-test-feasibility

## Goal

The goal of this repository is to test the overall connectedness and what data the sites offer.
The results of the test are saved on disk and can optionally be uploaded to a Confluence page.

* The Feasibility test sends SQ's to the Backend and cheks which sites have enough data fitting the SQ's
* The History test sends one SQ to the Backend and saves multiple results over time on disk
* The Ping test sends a ping to the DSF and checks which sites answer with a pong (see [ping-task.xml](src/resources/ping-task.xml))

## Setup

For the Feasibility test, the SQ's of the [input-queries.json](config/input-queries.json) are used. This JSON has one field "queries", which contains a list where each element must have the following fields:

| Name | Description |
|:-----------------|:---------------------------------------------------------------------------------------------|
| query-name | A custom name for the query, which is used in the table on Confluence to identify the query. |
| Module | The module of the query (e.g. Procedure). |
| optional | Boolean: whether or not the sites must have data fitting this SQ - used to calculate the percentage of required modules a site fulfills in the confluence table. |
| sq | The Structured Query. |

For the History test, the [history-query.json](config/history-query.json) must contain one single SQ.

### Config

Additionally, the following fields in the [config.yml](config/config.yml) can be configured:

| Name | Description |
|:------------------------------|:---------------------------------------------------------------------------|
| feas-page-title | The title of the Confluence page for the Feasibility test. |
| feas-page-content-html | The HTML content of the Confluence page for the Feasibility test. |
| hist-page-title | The title of the Confluence page for the Feasibility history test. |
| hist-page-content-html | The HTML content of the Confluence page for the Feasibility history test. |
| ping-page-title | The title of the Confluence page for the Feasibility history test. |
| ping-page-content-html | The HTML content of the Confluence page for the ping test. |
| dsf-site-ids | A list of all sites that are expected to respont to the test. |


## Run

```sh
docker-compose -f docker/docker-compose.yml up
```


## Environment Variables

| Name | Default | Description |
|:------------------------------|:--------------------------------------|:-------------------------------------------------------------------------------------------------|
| LOCAL_DSF_CERT_PATH | ./cert/dsf-cert.cer | The local path of the DSF certificate. |
| LOCAL_DSF_KEY_PATH | ./cert/dsf-key.key | The local path of the DSF key. |
| BACKEND_BASE_URL | https://localhost/api/v1 | The URL of the Feasibility Backend. |
| BACKEND_CLIENT_ID | | The client ID for the Feasibility Backend. |
| BACKEND_CLIENT_SECRET | | The client secret for the Feasibility Backend. |
| KEYCLOAK_TOKEN_URL | | The token URL for Keycloak. |
| CONFLUENCE_API_BASE_URL | https://myconfluence-rest-api-url | The base URL of the Confluence API, where the results will be uploaded. |
| CONF_USER | | The username of the account that is used to upload the result to Confluence. |
| CONF_PW | | The password of the account that is used to upload the result to Confluence. |
| WAIT_RESULT_SECS_FEAS | 60 | The seconds to wait for the response of the Feasibility Backend for the feasibility test. |
| WAIT_RESULT_SECS_PING | 60 | The seconds to wait for the response of the DSF for the ping test. |
| SEND_TO_CONFLUENCE | false | Boolean: Whether to send the results to confluence. |
| DSF_BASE_URL | | The Base URL of the DSF - used to execute the ping test against. |
| EXECUTE_FEAS_TEST | false | Boolean: Whether to execute the Feasibility test. |
| CONFLUENCE_PAGE_ID_FEAS | | The Confluence page ID where the Feasibility test result will be uploaded. |
| EXECUTE_HISTORY_TEST | false | Boolean: Whether to execute the Feasibility history test. |
| CONFLUENCE_PAGE_ID_HIST | | The Confluence page ID where the Feasibility history test result will be uploaded. |
| HISTORY_TABLE_LEN | 14 | The maximum amount of history repots displayed in the Confluence table. |
| EXECUTE_DSF_PING_TEST | false | Boolean: Whether to execute the DSF ping test. |
| CONFLUENCE_PAGE_ID_PING | | The Confluence page ID where the ping test result will be uploaded. |
Loading

0 comments on commit efffa78

Please sign in to comment.