Skip to content

Commit deff4b9

Browse files
committed
Merge branch 'main' into feat/download_data
# Conflicts: # src/main/java/eu/europa/ec/dgc/businessrule/DgcBusinessRuleServiceApplication.java # src/main/java/eu/europa/ec/dgc/businessrule/config/DgcConfigProperties.java # src/main/java/eu/europa/ec/dgc/businessrule/config/ErrorHandler.java # src/main/java/eu/europa/ec/dgc/businessrule/config/OpenApiConfig.java # src/main/java/eu/europa/ec/dgc/businessrule/config/SchedulerConfig.java # src/main/java/eu/europa/ec/dgc/businessrule/config/ShedLockConfig.java # src/main/java/eu/europa/ec/dgc/businessrule/entity/BusinessRuleEntity.java # src/main/java/eu/europa/ec/dgc/businessrule/entity/CountryListEntity.java # src/main/java/eu/europa/ec/dgc/businessrule/entity/ShedlockEntity.java # src/main/java/eu/europa/ec/dgc/businessrule/entity/ValueSetEntity.java # src/main/java/eu/europa/ec/dgc/businessrule/exception/DgcaBusinessRulesResponseException.java # src/main/java/eu/europa/ec/dgc/businessrule/repository/BusinessRuleRepository.java # src/main/java/eu/europa/ec/dgc/businessrule/repository/CountryListRepository.java # src/main/java/eu/europa/ec/dgc/businessrule/repository/ValueSetRepository.java # src/main/java/eu/europa/ec/dgc/businessrule/restapi/controller/BusinessRuleController.java # src/main/java/eu/europa/ec/dgc/businessrule/restapi/controller/CountryListController.java # src/main/java/eu/europa/ec/dgc/businessrule/restapi/controller/ValueSetController.java # src/main/java/eu/europa/ec/dgc/businessrule/restapi/dto/BusinessRuleListItemDto.java # src/main/java/eu/europa/ec/dgc/businessrule/restapi/dto/ProblemReportDto.java # src/main/java/eu/europa/ec/dgc/businessrule/restapi/dto/ValueSetListItemDto.java # src/main/java/eu/europa/ec/dgc/businessrule/service/BusinessRuleService.java # src/main/java/eu/europa/ec/dgc/businessrule/service/CountryListService.java # src/main/java/eu/europa/ec/dgc/businessrule/service/ValueSetService.java # src/main/java/eu/europa/ec/dgc/businessrule/utils/BusinessRulesUtils.java # src/main/resources/application.yml # src/main/resources/db/changelog/init_tables.xml # src/test/java/eu/europa/ec/dgc/businessrule/OpenApiTest.java # src/test/java/eu/europa/ec/dgc/businessrule/restapi/controller/CountryListControllerIntegrationTest.java # templates/file-header.txt
2 parents a3b0762 + 85f900b commit deff4b9

17 files changed

Lines changed: 563 additions & 7 deletions

File tree

.github/ISSUE_TEMPLATE/01_bug.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: "\U0001F6A8 Bug"
3+
about: Did you come across a bug or unexpected behaviour differing from the docs?
4+
labels: bug
5+
---
6+
7+
<!--
8+
Thanks for reporting a bug!
9+
Before opening a new issue, please make sure that we do not have any duplicates already open.
10+
You can ensure this by searching the issue list for this repository.
11+
If there is a duplicate, please close your issue and add a comment to the existing issue instead.
12+
-->
13+
14+
## Describe the bug
15+
16+
<!-- Describe your issue, but please be descriptive! Thanks again -->
17+
18+
## Expected behaviour
19+
20+
<!-- A clear and concise description of what you expected to happen. -->
21+
22+
## Steps to reproduce the issue
23+
24+
<!-- include screenshots, logs, code or other info to help explain your problem -->
25+
26+
<!--
27+
1. Go to '...'
28+
2. Click on '....'
29+
3. Scroll down to '....'
30+
4. See error
31+
-->
32+
33+
## Technical details
34+
35+
- Host Machine OS (Windows/Linux/Mac):
36+
37+
## Possible Fix
38+
39+
<!-- Not obligatory, but suggest a fix or reason for the bug -->
40+
41+
## Additional context
42+
43+
<!-- Add any other context about the problem here. -->
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: "\U0001F381 Feature Request"
3+
about: Do you have an idea for a new feature?
4+
labels: feature request
5+
---
6+
7+
<!--
8+
Thanks for requesting a feature!
9+
Before opening a new issue, please make sure that we do not have any duplicates already open.
10+
You can ensure this by searching the issue list for this repository.
11+
If there is a duplicate, please close your issue and add a comment to the existing issue instead.
12+
-->
13+
14+
## Feature description
15+
16+
<!--
17+
Provide a detailed description of the feature or improvement you are proposing.
18+
What specific solution would you like? What is the expected behaviour?
19+
Add any other context, screenshots, or code snippets about the feature request here as well.
20+
-->
21+
22+
## Problem and motivation
23+
24+
<!--
25+
Why is this change important to you? What is the problem this feature would solve?
26+
How would you use it? How can it benefit other users?
27+
-->
28+
29+
## Is this something you're interested in working on
30+
31+
<!-- Yes or No -->
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: "\u23F1\uFE0F Enhancement"
3+
about: Do you have an idea for an enhancement?
4+
labels: enhancement
5+
---
6+
7+
<!--
8+
Thanks for proposing an enhancement!
9+
Before opening a new issue, please make sure that we do not have any duplicates already open.
10+
You can ensure this by searching the issue list for this repository.
11+
If there is a duplicate, please close your issue and add a comment to the existing issue instead.
12+
-->
13+
14+
## Current Implementation
15+
16+
<!-- Describe or point to the current implementation that you would like to see improved -->
17+
18+
## Suggested Enhancement
19+
20+
<!--
21+
Outline the idea of your enhancement, by e.g., describing the algorithm you propose.
22+
You can also create a Pull Request to outline your idea
23+
-->
24+
25+
## Expected Benefits
26+
27+
<!--
28+
Summarize how your enhancement could aid the implementation (performance, readability, memory consumption, battery consumption, etc.).
29+
Please also back up with measurements or give detailed explanations for reduced runtime, memory consumption, etc.
30+
-->
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: "\U00002753 Question"
3+
about: If you have questions about pieces of the code or documentation for this component, please post them here.
4+
labels: question
5+
---
6+
7+
<!--
8+
Thanks for submitting your question!
9+
Before opening a new issue, please make sure that we do not have any duplicates already open.
10+
You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.
11+
Also, please, have a look at our FAQs and existing questions before opening a new question.
12+
-->
13+
14+
## Your Question
15+
16+
<!-- Include details about your question. -->
17+
18+
* Source File:
19+
* Line(s):
20+
* Question:
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ci-dependency-check
2+
on:
3+
schedule:
4+
- cron: '0 1 * * 0' # Each Sunday at 01:00 UTC
5+
push:
6+
branches:
7+
- main
8+
jobs:
9+
build:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/setup-java@v2
13+
with:
14+
java-version: 11
15+
distribution: adopt
16+
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
- uses: actions/cache@v2
20+
with:
21+
path: |
22+
~/.m2/repository
23+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
24+
- name: version
25+
run: |-
26+
APP_SHA=$(git rev-parse --short ${GITHUB_SHA})
27+
APP_LATEST_REV=$(git rev-list --tags --max-count=1)
28+
APP_LATEST_TAG=$(git describe --tags ${APP_LATEST_REV} 2> /dev/null || echo 0.0.0)
29+
echo "APP_VERSION=${APP_LATEST_TAG}-${APP_SHA}" >> ${GITHUB_ENV}
30+
- name: mvn
31+
run: |-
32+
mvn dependency-check:check \
33+
--batch-mode \
34+
--file ./pom.xml \
35+
--settings ./settings.xml \
36+
--define app.packages.username="${APP_PACKAGES_USERNAME}" \
37+
--define app.packages.password="${APP_PACKAGES_PASSWORD}" \
38+
env:
39+
APP_PACKAGES_USERNAME: ${{ github.actor }}
40+
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci-deploy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: ci-deploy
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
required: true
7+
description: Version to deploy
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-20.04
11+
environment: dev
12+
env:
13+
APP_VERSION: ${{ github.event.inputs.version }}
14+
steps:
15+
- name: cf setup
16+
run: |-
17+
curl -sL "https://packages.cloudfoundry.org/stable?release=${CF_RELEASE}&version=${CF_VERSION}" | \
18+
sudo tar -zx -C /usr/local/bin
19+
env:
20+
CF_VERSION: 7.2.0
21+
CF_RELEASE: linux64-binary
22+
- name: cf push
23+
run: |-
24+
cf api ${CF_API}
25+
cf auth
26+
cf target -o ${CF_ORG} -s ${CF_SPACE}
27+
cf push ${APP_NAME} --docker-image ${APP_IMAGE}:${APP_VERSION} --docker-username ${CF_DOCKER_USERNAME}
28+
env:
29+
APP_NAME: dgca-businessrule-service
30+
APP_IMAGE: docker.pkg.github.com/${{ github.repository }}/dgca-businessrule-service
31+
CF_API: ${{ secrets.CF_API }}
32+
CF_ORG: ${{ secrets.CF_ORG }}
33+
CF_SPACE: ${{ secrets.CF_SPACE }}
34+
CF_USERNAME: ${{ secrets.CF_USERNAME }}
35+
CF_PASSWORD: ${{ secrets.CF_PASSWORD }}
36+
CF_DOCKER_USERNAME: ${{ secrets.CF_DOCKER_USERNAME }}
37+
CF_DOCKER_PASSWORD: ${{ secrets.CF_DOCKER_PASSWORD }}

.github/workflows/ci-main.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: ci-main
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
build:
8+
runs-on: ubuntu-20.04
9+
steps:
10+
- uses: actions/setup-java@v2
11+
with:
12+
java-version: 11
13+
distribution: adopt
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- uses: actions/cache@v2
18+
with:
19+
path: |
20+
~/.m2/repository
21+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
22+
- name: version
23+
run: |-
24+
APP_SHA=$(git rev-parse --short ${GITHUB_SHA})
25+
APP_LATEST_REV=$(git rev-list --tags --max-count=1)
26+
APP_LATEST_TAG=$(git describe --tags ${APP_LATEST_REV} 2> /dev/null || echo 0.0.0)
27+
echo "APP_VERSION=${APP_LATEST_TAG}-${APP_SHA}" >> ${GITHUB_ENV}
28+
- name: mvn
29+
run: |-
30+
mvn versions:set \
31+
--batch-mode \
32+
--file ./pom.xml \
33+
--settings ./settings.xml \
34+
--define newVersion="${APP_VERSION}"
35+
mvn clean verify \
36+
--batch-mode \
37+
--file ./pom.xml \
38+
--settings ./settings.xml \
39+
--define app.packages.username="${APP_PACKAGES_USERNAME}" \
40+
--define app.packages.password="${APP_PACKAGES_PASSWORD}"
41+
env:
42+
APP_PACKAGES_USERNAME: ${{ github.actor }}
43+
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
44+
- name: docker
45+
run: |-
46+
echo "${APP_PACKAGES_PASSWORD}" | docker login "${APP_PACKAGES_URL}" \
47+
--username "${APP_PACKAGES_USERNAME}" \
48+
--password-stdin
49+
docker build . \
50+
--file ./Dockerfile \
51+
--tag "${APP_PACKAGES_URL}:${APP_VERSION}"
52+
docker push "${APP_PACKAGES_URL}:${APP_VERSION}"
53+
env:
54+
APP_PACKAGES_URL: docker.pkg.github.com/${{ github.repository }}/dgca-businessrule-service
55+
APP_PACKAGES_USERNAME: ${{ github.actor }}
56+
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci-openapi.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: ci-openapi
2+
on:
3+
workflow_dispatch:
4+
release:
5+
types:
6+
- created
7+
jobs:
8+
release:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- uses: actions/setup-java@v2
12+
with:
13+
java-version: 11
14+
distribution: adopt
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
- uses: actions/cache@v2
19+
with:
20+
path: |
21+
~/.m2/repository
22+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
23+
- name: version
24+
run: >-
25+
APP_SHA=$(git rev-parse --short ${GITHUB_SHA});
26+
APP_TAG=${GITHUB_REF/refs\/tags\/}
27+
APP_VERSION=${APP_TAG};
28+
echo "APP_SHA=${APP_SHA}" >> ${GITHUB_ENV};
29+
echo "APP_TAG=${APP_TAG}" >> ${GITHUB_ENV};
30+
echo "APP_VERSION=${APP_VERSION}" >> ${GITHUB_ENV};
31+
- name: mvn
32+
run: >-
33+
mvn versions:set
34+
--batch-mode
35+
--file ./pom.xml
36+
--settings ./settings.xml
37+
--define newVersion="${APP_VERSION}";
38+
mvn clean verify
39+
--batch-mode
40+
--file ./pom.xml
41+
--settings ./settings.xml
42+
--define app.packages.username="${APP_PACKAGES_USERNAME}"
43+
--define app.packages.password="${APP_PACKAGES_PASSWORD}";
44+
env:
45+
APP_PACKAGES_USERNAME: ${{ github.actor }}
46+
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
47+
- name: Upload Artifact
48+
uses: actions/upload-artifact@v2
49+
with:
50+
name: openapi.json
51+
path: target/openapi.json
52+
- name: Checkout OpenApi Doc Branch
53+
uses: actions/checkout@v2
54+
with:
55+
ref: openapi-doc
56+
- name: Delete existing openapi.json
57+
run: rm -f openapi.json
58+
- name: Download openapi.json
59+
uses: actions/download-artifact@v2
60+
with:
61+
name: openapi.json
62+
- name: Commit and Push changes
63+
run: |
64+
git config user.name github-actions
65+
git config user.email [email protected]
66+
git commit -a --allow-empty -m "Update OpenAPI JSON"
67+
git push
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: ci-pull-request
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- synchronize
7+
- reopened
8+
jobs:
9+
build:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/setup-java@v2
13+
with:
14+
java-version: 11
15+
distribution: adopt
16+
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
- uses: actions/cache@v2
20+
with:
21+
path: |
22+
~/.m2/repository
23+
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
24+
- name: mvn
25+
run: |-
26+
mvn clean package \
27+
--batch-mode \
28+
--file ./pom.xml \
29+
--settings ./settings.xml \
30+
--define app.packages.username="${APP_PACKAGES_USERNAME}" \
31+
--define app.packages.password="${APP_PACKAGES_PASSWORD}"
32+
env:
33+
APP_PACKAGES_USERNAME: ${{ github.actor }}
34+
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
35+
- name: docker
36+
run: |-
37+
docker build . \
38+
--file ./Dockerfile
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: ci-release-notes
2+
on:
3+
release:
4+
types:
5+
- created
6+
jobs:
7+
release-notes:
8+
runs-on: ubuntu-20.04
9+
env:
10+
APP_VERSION: ${{ github.event.release.tag_name }}
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: release-notes
16+
run: npx github-release-notes release --override --tags ${APP_VERSION}
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
GREN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)