Skip to content

Commit

Permalink
Merge 1c2a1c6 into 541a03c
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Wiedemann authored Feb 2, 2024
2 parents 541a03c + 1c2a1c6 commit db928df
Show file tree
Hide file tree
Showing 98 changed files with 63,101 additions and 638 deletions.
45 changes: 45 additions & 0 deletions .github/actions/get-spec/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Get OpenAPI Specs
description: Try to download the OpenAPI Specs for TMForum API.

inputs:
github-token:
description: Github token to be used for creating PR-Comments
required: true

runs:
using: composite

steps:

- id: setup-jq
uses: dcarbone/[email protected]

- id: get-specs
name: Download Specifications
shell: bash
run: |
cd .github/
./get-spec.sh
- id: check-results
name: Check results of the spec download
shell: bash
run: |
failed=$(jq length ./.github/not-available.json)
echo "failed="$failed >> "$GITHUB_OUTPUT"
- id: generate-message
if: steps.check-results.outputs.failed != 0
shell: bash
run: |
echo "Failed " ${{ steps.check-results.outputs.failed }}
cd .github/
./generate-message.sh
- name: Comment PR
if: steps.check-results.outputs.failed != 0
uses: thollander/[email protected]
with:
filePath: ./.github/message.md
GITHUB_TOKEN: ${{ inputs.github-token }}

12 changes: 12 additions & 0 deletions .github/generate-message.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

echo "The following api specs are unavailable, please check if there are updates required." > message.md
echo "" >> message.md
echo "| Module | Url |" >> message.md
echo "|--------|-----|" >> message.md

while read -r i; do
module=$(echo $i | jq -c -r '.module');
url=$(echo $i | jq -c -r '.url');
echo "| $module | $url |" >> message.md
done <<< $(jq -c -r '.[]' ./not-available.json)
28 changes: 28 additions & 0 deletions .github/get-spec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

elements=""
while read -r i; do
module=$(echo $i | jq -c -r '.module');
url=$(echo $i | jq -c -r '.url');
mkdir -p ../api/tm-forum/$module
echo "Module: $module Url: $url"
result=$(curl -s -o /dev/null -w "%{http_code}" $url)
if [ $result != 200 ]; then
elements="${elements} ${i}"
else
echo "Download" $module
wget -O api.json $url
mv api.json ../api/tm-forum/$module
fi
echo $elements
done <<< $(jq -c -r '.[]' ./spec.json)

json='[]'
for e in $elements
do
module=$(echo $e | jq -c -r '.module');
url=$(echo $e | jq -c -r '.url');
json=$(jq --arg modVar "$module" --arg urlVar "$url" '. |= . + [{"module":$modVar, "url":$urlVar}]' <<< $json)
done

echo $json > not-available.json
58 changes: 58 additions & 0 deletions .github/spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[
{
"module": "account",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF666_Account_Management_API_v4.0.0_swagger.json"
},
{
"module": "agreement",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF651_Agreement_Management_API_v4.0.0_swagger.json"
},
{
"module": "customer-bill-management",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF678_Customer_Bill_Management_API_v4.0.0_swagger.json"
},
{
"module": "customer-management",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF629_Customer_Management_API_v4.0.0_swagger.json"
},
{
"module": "party-catalog",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF632_Party_Management_API_v4.0.0_swagger.json"
},
{
"module": "party-role",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF669_Party_Role_Management_API_v4.0.0_swagger.json"
},
{
"module": "product-catalog",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.1.0/swagger/TMF620_Product_Catalog_Management_API_v4.1.0_swagger.json"
},
{
"module": "product-inventory",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF637_Product_Inventory_Management_API_v4.0.0_swagger.json"
},
{
"module": "product-ordering-management",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF622_Product_Ordering_Management_API_v4.0.0_swagger.json"
},
{
"module": "resource-catalog",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.1.0/swagger/TMF634_Resource_Catalog_Management_API_v4.1.0_swagger.json"
},
{
"module": "resource-function-activation",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF664_Resource_Function_Activation_Management_API_v4.0.0_swagger.json"
},
{
"module": "resource-inventory",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF639_Resource_Inventory_Management_API_v4.0.0_swagger.json"
},
{
"module": "service-catalog",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF633_Service_Catalog_Management_API_v4.0.0_swagger.json"
},
{
"module": "usage-management",
"url": "https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF635_Usage_Management_API_v4.0.0_swagger.json"
}
]
2 changes: 1 addition & 1 deletion .github/workflows/conformance-test.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Conformance Test

on:
push
workflow_dispatch:

jobs:
conformance:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/parallel-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Parallel Tests
on:
push


jobs:
test:
runs-on: ubuntu-latest
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ env:
REGISTRY: quay.io
REPOSITORY: fiware

concurrency:
# Only cancel jobs for PR updates
group: pre-${{ github.ref }}
cancel-in-progress: true

jobs:

generate-version:
Expand Down Expand Up @@ -48,7 +53,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Checkout
uses: actions/checkout@v3

- name: Update Specs
uses: ./.github/actions/get-spec
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-java@v1
with:
Expand Down
70 changes: 67 additions & 3 deletions .github/workflows/test-brokers.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test different brokers
name: Test

on:
pull_request:
Expand All @@ -12,13 +12,21 @@ on:
branches:
- tests

concurrency:
# Only cancel jobs for PR updates
group: test-it-${{ github.ref }}
cancel-in-progress: true

jobs:
it:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
broker: [orion-ld, scorpio]
module: [ customer-bill-management, customer-management, party-catalog, party-role, product-catalog, product-inventory, product-ordering-management, resource-catalog, resource-function-activation, resource-inventory, service-catalog ]
# only test scorpio for speed up, orion is currently not really used with the tmforum
broker: [ scorpio ]
cache: [ in-memory, redis ]

steps:
- uses: actions/checkout@v2
Expand All @@ -31,4 +39,60 @@ jobs:
- name: Execute tests
id: test
run: |
mvn clean test integration-test verify -Dbroker=${{matrix.broker}}
mvn clean test integration-test verify --projects common,resource-shared-models,customer-shared-models,service-shared-models,product-shared-models,${{matrix.module}} -Dbroker=${{matrix.broker}} -Dcache=${{matrix.cache}}
- name: Archive coverage
if: matrix.broker == 'scorpio' && matrix.cache == 'in-memory'
uses: actions/upload-artifact@v4
with:
name: ${{matrix.module}}
path: |
${{matrix.module}}/target/site/jacoco/jacoco.xml
unit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
module: [ common, resource-shared-models, customer-shared-models, service-shared-models, product-shared-models ]
steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v1
with:
java-version: '17'
java-package: jdk

- name: Execute tests
id: test
run: |
mvn clean test --projects common,resource-shared-models,customer-shared-models,service-shared-models,product-shared-models,${{matrix.module}}
- name: Archive coverage
uses: actions/upload-artifact@v4
with:
name: ${{matrix.module}}
path: |
${{matrix.module}}/target/site/jacoco/jacoco.xml
upload-report:
needs: [ "it","unit" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v1
with:
java-version: '17'
java-package: jdk

- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
with:
path: jacoco-merge-dir


- name: Merge and Submit report
run: |
ls -R jacoco-merge-dir
mvn jacoco:merge jacoco:report coveralls:report -Dcoveralls.token=${{ secrets.COVERALLS_TOKEN }} -Djacoco.mergeDir=jacoco-merge-dir -Preport-coveralls
34 changes: 0 additions & 34 deletions .github/workflows/test-caches.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/test.yaml

This file was deleted.

4 changes: 1 addition & 3 deletions account/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
</parent>

<properties>
<tmforum.api.url>
https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/swagger/TMF666_Account_Management_API_swagger_v4.0.0.json
</tmforum.api.url>
<tmforum.api.url>${project.parent.basedir}/api/tm-forum/${project.artifactId}/api.json</tmforum.api.url>
<!-- seems to be unavailable right now -->
<module.ctk.url>
https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/4.0.0/ctk/TMF666-Account-v4.0.0.zip
Expand Down
2 changes: 1 addition & 1 deletion account/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ endpoints:
---
loggers:
levels:
ROOT: TRACE
ROOT: WARN

---
general:
Expand Down
2 changes: 1 addition & 1 deletion account/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</encoder>
</appender>

<root level="TRACE">
<root level="WARN">
<appender-ref ref="STDOUT" />
</root>

Expand Down
2 changes: 1 addition & 1 deletion account/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ endpoints:
---
loggers:
levels:
ROOT: TRACE
ROOT: WARN

---
general:
Expand Down
Loading

0 comments on commit db928df

Please sign in to comment.