Skip to content

Commit

Permalink
feat(codegen): support new linked applications model (#355)
Browse files Browse the repository at this point in the history
* feat(spec): update openapi spec
* feat(codegen): generate client sources (partial)
* feat(codegen): generate new advanced applications model
* test(bonita-client): add use case on linked applications
* tr(openapi-generator): ignore AbstractApplication generation for now
As long as OpenAPI Generator does not handle inheritance and the usage of allOf, anyOf and oneOf,
we ignore this incorrect abstraction generation to prevent its usage.
* update to 0.0.18
adapt tests to run on several Bonita versions
---------

Co-authored-by: Romain Bioteau <[email protected]>
  • Loading branch information
akantcheff and rbioteau authored Jun 25, 2024
1 parent 0b17662 commit f293517
Show file tree
Hide file tree
Showing 230 changed files with 3,446 additions and 880 deletions.
50 changes: 48 additions & 2 deletions .github/workflows/workflow-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,73 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: Keeper-Security/ksm-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
secrets: |
${{ vars.KEEPER_SONARCLOUD_RECORD_ID }}/field/password > env:SONAR_TOKEN
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/login > env:JFROG_USER
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/password > env:JFROG_TOKEN
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: maven

- uses: docker/login-action@v3
with:
registry: ${{ vars.BONITASOFT_DOCKER_REGISTRY }}
username: ${{ env.JFROG_USER }}
password: ${{ env.JFROG_TOKEN }}

- name: Build and test project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
run: ./mvnw -B -ntp clean verify sonar:sonar -Dsonar.scanner.force-deprecated-java-version=true
run: ./mvnw -B -ntp verify sonar:sonar -Dsonar.scanner.force-deprecated-java-version=true -Dbonita.image=${{ vars.BONITASOFT_DOCKER_REGISTRY }}/${{ vars.DOCKER_SNAPSHOTS_REPOSITORY }}/bonita-community:10.2-SNAPSHOT

test-supported-versions:
runs-on: ubuntu-22.04
strategy:
matrix:
bonita-version:
- '7.15.0'
- '8.0.0'
- '9.0.0'
- '10.0.0'
- '10.1.0'
steps:
- uses: actions/checkout@v4
- uses: Keeper-Security/ksm-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
secrets: |
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/login > env:JFROG_USER
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/password > env:JFROG_TOKEN
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: maven

- uses: docker/login-action@v3
with:
registry: ${{ vars.BONITASOFT_DOCKER_REGISTRY }}
username: ${{ env.JFROG_USER }}
password: ${{ env.JFROG_TOKEN }}

- name: ${{ matrix.bonita-version }} Integration tests
run: ./mvnw -B -ntp verify -Dbonita.image=${{ vars.BONITASOFT_DOCKER_REGISTRY }}/${{ vars.INTERNAL_DOCKER_REPOSITORY_RELEASE }}/bonita-community:${{ matrix.bonita-version }}
47 changes: 45 additions & 2 deletions .github/workflows/workflow-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
${{ vars.KEEPER_GPG_ARTIFACT_SIGNING_RECORD_ID }}/field/login > env:GPG_KEYNAME
${{ vars.KEEPER_GPG_ARTIFACT_SIGNING_RECORD_ID }}/custom_field/gpg-private-key > env:GPG_PRIVATE_KEY
${{ vars.KEEPER_GPG_ARTIFACT_SIGNING_RECORD_ID }}/field/password > env:MAVEN_GPG_PASSPHRASE
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/login > env:JFROG_USER
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/password > env:JFROG_TOKEN
- name: Setup Java
uses: actions/setup-java@v4
Expand All @@ -34,11 +36,52 @@ jobs:
gpg-private-key: ${{ env.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- uses: docker/login-action@v3
with:
registry: ${{ vars.BONITASOFT_DOCKER_REGISTRY }}
username: ${{ env.JFROG_USER }}
password: ${{ env.JFROG_TOKEN }}

- name: Compile and test project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
run: ./mvnw -B -ntp clean verify sonar:sonar -Dsonar.scanner.force-deprecated-java-version=true
run: ./mvnw -B -ntp clean verify sonar:sonar -Dsonar.scanner.force-deprecated-java-version=true -Dbonita.image=${{ vars.BONITASOFT_DOCKER_REGISTRY }}/${{ vars.DOCKER_SNAPSHOTS_REPOSITORY }}/bonita-community:10.2-SNAPSHOT

# Build and Push snapshots to maven central
- name: Deploy snapshots to Maven central
run: ./mvnw -B -ntp deploy -DskipTests=true -Pdeploy
run: ./mvnw -B -ntp deploy -DskipTests=true -Pdeploy

test-supported-versions:
runs-on: ubuntu-22.04
strategy:
matrix:
bonita-version:
- '7.15.0'
- '8.0.0'
- '9.0.0'
- '10.0.0'
- '10.1.0'
steps:
- uses: actions/checkout@v4
- uses: Keeper-Security/ksm-action@v1
with:
keeper-secret-config: ${{ secrets.KSM_CONFIG }}
secrets: |
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/login > env:JFROG_USER
${{ vars.KEEPER_JFROG_RECORD_ID }}/field/password > env:JFROG_TOKEN
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: maven

- uses: docker/login-action@v3
with:
registry: ${{ vars.BONITASOFT_DOCKER_REGISTRY }}
username: ${{ env.JFROG_USER }}
password: ${{ env.JFROG_TOKEN }}

- name: ${{ matrix.bonita-version }} Integration tests
run: ./mvnw -B -ntp verify -Dbonita.image=${{ vars.BONITASOFT_DOCKER_REGISTRY }}/${{ vars.INTERNAL_DOCKER_REPOSITORY_RELEASE }}/bonita-community:${{ matrix.bonita-version }}
6 changes: 5 additions & 1 deletion .openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

# Ignore below APIs to keep client iso to legacy Bonita APIs
**/org/bonitasoft/web/client/api/PortalAuthenticationApi.java
**/org/bonitasoft/web/client/api/LicenseApi.java
**/org/bonitasoft/web/client/api/SessionApi.java
**/org/bonitasoft/web/client/api/ApplicationApi.java

# As long as OpenAPI Generator does not handle inheritance and the usage of allOf, anyOf and oneOf,
# we ignore this incorrect abstraction generation to prevent its usage.
**/org/bonitasoft/web/client/model/AbstractApplication.java

**/org/bonitasoft/web/client/model/Inline*.java
**/org/bonitasoft/web/client/invoker/ServerConfiguration.java
Expand Down
3 changes: 3 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ src/main/java/org/bonitasoft/web/client/api/ActivityApi.java
src/main/java/org/bonitasoft/web/client/api/ActivityVariableApi.java
src/main/java/org/bonitasoft/web/client/api/ActorApi.java
src/main/java/org/bonitasoft/web/client/api/ActorMemberApi.java
src/main/java/org/bonitasoft/web/client/api/ApplicationApi.java
src/main/java/org/bonitasoft/web/client/api/ApplicationMenuApi.java
src/main/java/org/bonitasoft/web/client/api/ApplicationPageApi.java
src/main/java/org/bonitasoft/web/client/api/ArchivedActivityApi.java
Expand Down Expand Up @@ -92,6 +93,7 @@ src/main/java/org/bonitasoft/web/client/model/ActorMember.java
src/main/java/org/bonitasoft/web/client/model/ActorUpdateRequest.java
src/main/java/org/bonitasoft/web/client/model/ApiResponse.java
src/main/java/org/bonitasoft/web/client/model/Application.java
src/main/java/org/bonitasoft/web/client/model/ApplicationLink.java
src/main/java/org/bonitasoft/web/client/model/ApplicationMenu.java
src/main/java/org/bonitasoft/web/client/model/ApplicationMenuCreateRequest.java
src/main/java/org/bonitasoft/web/client/model/ApplicationMenuUpdateRequest.java
Expand Down Expand Up @@ -143,6 +145,7 @@ src/main/java/org/bonitasoft/web/client/model/GroupUpdateRequest.java
src/main/java/org/bonitasoft/web/client/model/HumanTask.java
src/main/java/org/bonitasoft/web/client/model/HumanTaskUpdateRequest.java
src/main/java/org/bonitasoft/web/client/model/I18nlocale.java
src/main/java/org/bonitasoft/web/client/model/LegacyApplication.java
src/main/java/org/bonitasoft/web/client/model/License.java
src/main/java/org/bonitasoft/web/client/model/MaintenanceDetails.java
src/main/java/org/bonitasoft/web/client/model/ManualTask.java
Expand Down
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.1.0
7.6.0
2 changes: 1 addition & 1 deletion .openapi-generator/openapi.yaml-default.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c4829d4b7658a0e392e19cc140d26861630f6f4543d4c744f9d51c39a4138b5d
25eaf10608f1031bd1ec198e8d19cd85333e570352112f68ec7db4890e59da55
Loading

0 comments on commit f293517

Please sign in to comment.