Skip to content

Commit

Permalink
Merge branch 'main' into feat/518-policy-store-api-test-step-definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmf authored May 7, 2024
2 parents 0415437 + 2c9a529 commit 69bb1f5
Show file tree
Hide file tree
Showing 149 changed files with 65,399 additions and 72,493 deletions.
2 changes: 1 addition & 1 deletion .config/pmd-rules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<rule ref="category/java/documentation.xml/CommentSize">
<properties>
<property name="maxLines" value="23"/>
<property name="maxLineLength" value="100"/>
<property name="maxLineLength" value="120"/>
</properties>
</rule>
<rule ref="category/java/documentation.xml/CommentRequired">
Expand Down
75 changes: 0 additions & 75 deletions .github/workflows/jira-publish-release.yaml

This file was deleted.

23 changes: 17 additions & 6 deletions .github/workflows/publish-documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build API documentation with Maven
run: |
mvn clean package -pl irs-common,irs-models,irs-policy-store,irs-testing,irs-edc-client,irs-registry-client,irs-api -DskipTests --batch-mode
cp irs-api/target/generated-sources/openapi/index.html docs/src/docs/api-specification/index.html
- name: Build with Maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand Down Expand Up @@ -112,10 +107,26 @@ jobs:
run: |
mv docs/src/diagram-replacer/assets/ docs/target/generated-docs/assets/
- name: Generate Swagger UI
uses: Legion2/swagger-ui-action@v1
with:
output: swagger-ui
spec-file: docs/src/api/irs-api.yaml

- name: Update documentation on GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3.9.3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: "./docs/target/generated-docs"
destination_dir: "docs"

- name: Deploy Swagger UI to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: "swagger-ui"
destination_dir: "docs/swagger-ui"


49 changes: 23 additions & 26 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,67 +1,64 @@
name: Release IRS

on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_call:
inputs:
new-irs-version:
description: 'New IRS version'
required: true
type: string
previous-irs-version:
description: 'Previous IRS version'
required: true
type: string
helm-chart-version:
description: 'New Helm Chart version'
required: true
type: string

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Calculate Helm release version from CHANGELOG
run: echo HELM_VERSION=$(cat charts/item-relationship-service/CHANGELOG.md | sed -n 's/.*\[\([0-9]\+\.[0-9]\+\.[0-9]\+\)\].*/\1/p' | head -n 1) >> $GITHUB_ENV

- name: Update Chart.yaml appVersion
uses: mikefarah/[email protected]
with:
cmd: yq -i eval '.appVersion = "${{ github.ref_name }}"' charts/item-relationship-service/Chart.yaml
cmd: yq -i eval '.appVersion = "${{ inputs.new-irs-version }}"' charts/item-relationship-service/Chart.yaml

- name: Update Chart.yaml version
uses: mikefarah/[email protected]
with:
cmd: yq -i eval '.version = "${{ env.HELM_VERSION }}"' charts/item-relationship-service/Chart.yaml
cmd: yq -i eval '.version = "${{ inputs.helm-chart-version }}"' charts/item-relationship-service/Chart.yaml

- name: Prepare Helm release
uses: peter-evans/create-pull-request@v5
with:
commit-message: "chore(release): Prepare release for Helm version ${{ env.HELM_VERSION }}"
branch: chore/prepare-helm-release-${{ env.HELM_VERSION }}
commit-message: "chore(release): Prepare release for Helm version ${{ inputs.helm-chart-version }}"
branch: chore/prepare-helm-release-${{ inputs.helm-chart-version }}
base: main
delete-branch: true
title: Prepare Helm release for next version
body: |
This PR prepares the Helm chart release for version ${{ env.HELM_VERSION }}.
This PR prepares the Helm chart release for version ${{ inputs.helm-chart-version }}.
Please check whether the Chart was updated correctly and that the CHANGELOG contains the relevant information
for this release. Also, make sure that the values.yaml is correct before merging this PR.
- name: Get previous version
run: echo PREVIOUS_VERSION=$(git tag | grep -E ^[0-9]+\\.[0-9]+\\.[0-9]+ | tail -2 | head -n +1) >> $GITHUB_ENV

- name: Extract changelog text
# See: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "CHANGELOG<<$EOF" >> $GITHUB_ENV
sed -n -e '/## \[${{ github.ref_name }}\]/,/## \[/ p' CHANGELOG.md | head -n -1 | tail -n +2 >> $GITHUB_ENV
echo **Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${{ env.PREVIOUS_VERSION }}...${{ github.ref_name }} >> $GITHUB_ENV
sed -n -e '/## \[${{ inputs.new-irs-version }}\]/,/## \[/ p' CHANGELOG.md | head -n -1 | tail -n +2 >> $GITHUB_ENV
echo **Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${{ inputs.previous-irs-version }}...${{ inputs.new-irs-version }} >> $GITHUB_ENV
echo "$EOF" >> "$GITHUB_ENV"
- name: Create IRS release
uses: softprops/action-gh-release@v1
with:
body: ${{ env.CHANGELOG }}

trigger-jira:
needs:
- release
uses: ./.github/workflows/jira-publish-release.yaml
with:
version: ${{ github.ref_name }}
secrets: inherit
tag_name: ${{ inputs.new-irs-version }}

publish-to-swaggerhub:
name: "Publish OpenAPI spec to Swaggerhub"
Expand All @@ -71,5 +68,5 @@ jobs:
- release
uses: ./.github/workflows/publish-swagger-hub.yml
with:
version: ${{ github.ref_name }}
version: ${{ inputs.new-irs-version }}
secrets: inherit
20 changes: 19 additions & 1 deletion .github/workflows/tavern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,28 @@ on:
global-asset-id-asBuilt:
type: string
description: Global-asset-id to use for the asBuilt tests.
default: 'urn:uuid:6d505432-8b31-4966-9514-4b753372683f'
default: 'urn:uuid:8724338c-5c85-4c34-91eb-e2735d58fb0d'
required: true
bpn-asBuilt:
type: string
description: BPN to use for the asBuilt global-asset-id.
default: 'BPNL00000003AVTH'
required: true
global-asset-id-ess-asBuilt:
type: string
description: Global-asset-id to use for the asBuilt tests.
default: 'urn:uuid:2c57b0e9-a653-411d-bdcd-64787e9fd3a7'
required: true
bpn-ess-asBuilt:
type: string
description: BPN to use for the asBuilt global-asset-id.
default: 'BPNL00000003CRHK'
required: true
bpn-ess-incident:
type: string
description: Incident BPN to search for which violates against environmental and social standards.
default: 'BPNS00000003B6LU'
required: true
execution-ticket:
type: string
description: JIRA execution ticket to safe results in.
Expand Down Expand Up @@ -68,6 +83,9 @@ jobs:
REGULAR_USER_API_KEY_ESS: ${{ secrets.INT_REGULAR_USER_API_KEY }}
ADMIN_USER_API_KEY_ESS: ${{ secrets.INT_ADMIN_USER_API_KEY }}
GLOBAL_ASSET_ID_AS_PLANNED: ${{ github.event.inputs.global-asset-id-asPlanned || 'urn:uuid:0733946c-59c6-41ae-9570-cb43a6e4c79e' }}
GLOBAL_ASSET_ID_ESS_AS_BUILT: ${{ github.event.inputs.global-asset-id-ess-asBuilt || 'urn:uuid:2c57b0e9-a653-411d-bdcd-64787e9fd3a7' }}
BPN_ESS_AS_BUILT: ${{ github.event.inputs.bpn-ess-asBuilt || 'BPNL00000003CRHK' }}
BPN_ESS_INCIDENT: ${{ github.event.inputs.bpn-ess-incident || 'BPNS00000003B6LU' }}
BPN_AS_PLANNED: ${{ github.event.inputs.bpn-asPlanned || 'BPNL00000003AYRE' }}
GLOBAL_ASSET_ID_AS_BUILT: ${{ github.event.inputs.global-asset-id-asBuilt || 'urn:uuid:6d505432-8b31-4966-9514-4b753372683f' }}
BPN_AS_BUILT: ${{ github.event.inputs.bpn-asBuilt || 'BPNL00000003AVTH' }}
Expand Down
Loading

0 comments on commit 69bb1f5

Please sign in to comment.