Skip to content

Commit 1404e0c

Browse files
authored
Merge pull request #10 from maximilianiKIT/dev
Dev
2 parents c3ab1c9 + 322344b commit 1404e0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2905
-2208
lines changed

.github/workflows/CI.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,47 @@ name: Java CI
77

88
on:
99
push:
10-
branches: [ main , dev]
10+
branches: [main, dev]
1111
pull_request:
12-
branches: "*"
12+
branches: [main, dev]
1313

1414
jobs:
15-
build-jdk:
16-
runs-on: ubuntu-latest
15+
build:
16+
name: Build and generate coverage report with Gradle in JDK ${{ matrix.jdk }} on ${{ matrix.os }}
1717
strategy:
1818
matrix:
19-
jdk: [ 17 ]
19+
# os: [ubuntu-latest, windows-latest, macos-latest]
20+
os: [ubuntu-latest, macos-latest]
21+
jdk: [17]
22+
python-version: [3.9]
23+
runs-on: ${{ matrix.os }}
2024
steps:
2125
- name: Checkout repo
2226
uses: actions/checkout@v2
2327
- name: Set up OpenJDK
2428
uses: actions/setup-java@v1
2529
with:
2630
java-version: ${{ matrix.jdk }}
27-
- name: Install python
28-
run: sudo apt install -y python3 python3-setuptools python3-pip
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
- name: Get Python location
36+
run: python -c "import os, sys; print(sys.executable)"
2937
- name: Update pip
30-
run: pip3 install --upgrade pip
38+
run: python3 -m pip install --upgrade pip
3139
- name: Grant execute permission for gradlew
3240
run: chmod +x gradlew
33-
- name: Build with Gradle
34-
run: ./gradlew clean check jacocoTestReport
41+
- name: Clean
42+
run: ./gradlew clean
43+
# - if: matrix.os == 'windows-latest'
44+
# name: Test with Gradle on Windows
45+
# run: ./gradlew build -DapplicationProperties="src\test\resources\test-config\application-test-windows.properties"
46+
- if: matrix.os != 'windows-latest'
47+
name: Test with Gradle on ${{ matrix.os }}
48+
run: ./gradlew build -DapplicationProperties="src/test/resources/test-config/application-test.properties"
49+
- name: Generate report
50+
run: ./gradlew jacocoTestReport
3551
- name: Codecov
3652
uses: codecov/codecov-action@v1
3753
with:

.github/workflows/codeql-analysis.yml

Lines changed: 51 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "main", "dev" ]
16+
branches: [ main, dev ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
1919
branches: "*"
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
permissions:
2828
actions: read
29-
contents: read
29+
contents: write
3030
security-events: write
3131

3232
strategy:
@@ -37,20 +37,21 @@ jobs:
3737
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
3838

3939
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v3
42-
40+
- uses: actions/checkout@v3
41+
- name: Set up Python3
42+
uses: actions/setup-python@v4
43+
with:
44+
python-version: '3.10'
4345
- name: Set up OpenJDK
4446
uses: actions/setup-java@v1
4547
with:
46-
java-version: ${{ matrix.jdk }}
48+
java-version: 17
4749

4850
# Initializes the CodeQL tools for scanning.
4951
- name: Initialize CodeQL
5052
uses: github/codeql-action/init@v2
5153
with:
5254
languages: ${{ matrix.language }}
53-
java-version: 17
5455
# If you wish to specify custom queries, you can do so here or in a config file.
5556
# By default, queries listed here will override any specified in a config file.
5657
# Prefix the list here with "+" to use these queries and those in the config file.
@@ -61,22 +62,57 @@ jobs:
6162

6263
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6364
# If this step fails, then you should remove it and run the build manually (see below)
64-
- name: Autobuild
65-
uses: github/codeql-action/autobuild@v2
66-
with:
67-
java-version: 17
65+
# - name: Autobuild
66+
# uses: github/codeql-action/autobuild@v2
67+
# with:
68+
# java-version: 17
6869

6970
# ℹ️ Command-line programs to run using the OS shell.
7071
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
7172

7273
# If the Autobuild fails above, remove it and uncomment the following three lines.
7374
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
7475

75-
# # - run: |
76-
# echo "Run, Build Application using script"
77-
# ./location_of_script_within_repo/buildscript.sh
76+
- run: |
77+
echo "Run, Build Application using script"
78+
./gradlew build -DapplicationProperties="src/test/resources/test-config/application-test.properties"
7879
7980
- name: Perform CodeQL Analysis
8081
uses: github/codeql-action/analyze@v2
8182
with:
82-
category: "/language:${{matrix.language}}"
83+
category: "/language:java
84+
85+
review:
86+
name: Review Dependencies and create SBOM
87+
runs-on: ubuntu-latest
88+
permissions:
89+
actions: read
90+
contents: write
91+
security-events: write
92+
93+
strategy:
94+
fail-fast: false
95+
matrix:
96+
language: [ 'java' ]
97+
steps:
98+
- uses: actions/checkout@v3
99+
100+
- name: Set up Python3
101+
uses: actions/setup-python@v4
102+
with:
103+
python-version: '3.10'
104+
105+
- name: Set up OpenJDK
106+
uses: actions/setup-java@v1
107+
with:
108+
java-version: 17
109+
110+
- name: 'Dependency Review'
111+
uses: actions/dependency-review-action@v2
112+
113+
- name: Scan the image and upload dependency results
114+
uses: anchore/sbom-action@v0
115+
with:
116+
artifact-name: image.spdx.json
117+
dependency-snapshot: true
118+

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,4 +236,5 @@ gradle-app.setting
236236

237237
# End of https://www.toptal.com/developers/gitignore/api/intellij+all,java,macos,gradle,linux
238238
lib/gemma
239-
!/plugins/gemma-plugin-0.1.0.jar
239+
!/plugins/gemma-plugin-0.1.0-SNAPSHOT-plain.jar
240+
!/plugins/empty-plugin-0.0.0-SNAPSHOT-plain.jar

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# Mapping-Service
22

33
[![Java CI with Gradle](https://github.com/maximilianiKIT/mapping-service/actions/workflows/CI.yml/badge.svg)](https://github.com/maximilianiKIT/mapping-service/actions/workflows/CI.yml)
4-
![License](https://img.shields.io/github/license/kit-data-manager/indexing-service.svg)
4+
[![CodeQL](https://github.com/maximilianiKIT/mapping-service/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/maximilianiKIT/mapping-service/actions/workflows/codeql-analysis.yml)
55
[![codecov](https://codecov.io/gh/maximilianiKIT/mapping-service/branch/main/graph/badge.svg?token=XFhZruKFaE)](https://codecov.io/gh/maximilianiKIT/mapping-service)
6+
[![License](https://img.shields.io/github/license/kit-data-manager/indexing-service.svg)](https://github.com/maximilianiKIT/mapping-service/blob/c3ab1c96643b3409774eafd4c8f0843cb9ae2aa1/LICENSE)
67

78
:warning:
89
Not fully tested yet!
10+
The mapping-service provides a generic interface for mapping various documents.
11+
The tools required for this, such as Gemma, JOLT, XSLT, ... can be loaded into the mapping-service as plugins, regardless of the programming language in which they were developed.
12+
These tools are then made usable via the REST-API and a Web-UI.
13+
The mapping schemas are stored in a database and can be managed via the REST-API and the Web-UI.
914

10-
The mapping service allows multiple schemas to be uploaded and managed and documents to be mapped over one of them at a time accordingly.
11-
Therefore, the service is extensible to other mappers, although currently only Gemma, a service that can only map JSON files, is available.
12-
The REST API is documented at the following link: [http://localhost:8095/swagger-ui/index.html](http://localhost:8095/swagger-ui/index.html)
15+
The Web-UI is accessible via the following URL: [http://\<IP or hostname>:8095](http://localhost:8095)
16+
The REST-API is documented at the following link: [http://\<IP or hostname>:8095/swagger-ui/index.html](http://localhost:8095/swagger-ui/index.html)
1317

1418
## How to build
1519

build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ plugins {
1010

1111
description = 'Generic mapping service supporting different mapping implementations.'
1212
group = 'edu.kit.datamanager'
13+
version = '0.1.0-SNAPSHOT'
1314

1415
println "Running gradle version: $gradle.gradleVersion"
1516
println "Building ${name} version: ${version}"
@@ -30,6 +31,7 @@ repositories {
3031

3132
ext {
3233
set('snippetsDir', file('build/generated-snippets'))
34+
applicationProperties = System.getProperty('applicationProperties', 'src/main/resources/application.properties')
3335
}
3436

3537
dependencies {
@@ -58,7 +60,7 @@ dependencies {
5860
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.7.3'
5961
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:2.0.6.RELEASE'
6062
testImplementation 'org.springframework.security:spring-security-test:5.7.3'
61-
testImplementation 'org.springframework:spring-test:5.3.22'
63+
testImplementation 'org.springframework:spring-test:5.3.23'
6264
testImplementation 'org.mockito:mockito-core:4.8.0'
6365
testImplementation 'org.powermock:powermock-module-junit4:2.0.9'
6466
testImplementation 'org.powermock:powermock-api-mockito2:2.0.9'
@@ -80,6 +82,9 @@ dependencies {
8082
test {
8183
outputs.dir snippetsDir
8284
finalizedBy jacocoTestReport
85+
print("Running tests with configuration: ${applicationProperties}")
86+
environment 'spring.config.location', applicationProperties
87+
// environment 'spring.config.location', 'classpath:/test-config/'
8388
useJUnitPlatform()
8489
}
8590

@@ -91,7 +96,7 @@ jacocoTestReport{
9196
dependsOn test
9297
reports {
9398
xml.required = true
94-
html.required = false
99+
html.required = true
95100
}
96101
}
97102

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
66

output

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello World!Input file: inputMapping schema file: schema
73.4 KB
Binary file not shown.
75.1 KB
Binary file not shown.

src/main/java/edu/kit/datamanager/mappingservice/MappingServiceApplication.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
@EntityScan("edu.kit.datamanager")
1717
@Configuration
1818
public class MappingServiceApplication {
19-
2019
private static final Logger LOG = LoggerFactory.getLogger(MappingServiceApplication.class);
2120

2221
@Bean

0 commit comments

Comments
 (0)