From 9ca89a2a9cdd6fb167cd8a1af8d93457f3b99323 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Mon, 30 Jun 2025 16:10:14 -0400 Subject: [PATCH 01/55] Updated file --- CICD.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 CICD.txt diff --git a/CICD.txt b/CICD.txt new file mode 100644 index 00000000..ad2647a7 --- /dev/null +++ b/CICD.txt @@ -0,0 +1,18 @@ +CI/CD Plan + +Validations +- Run codegen unit tests +- Run codegen integration tests +- Run usage unit tests +- Run spotless check +- Run PMD check + +PRs +- Build the codegen artifact +- Perform Validations + +Main Build +- Build the codegen artifact +- Perform Validations +- Build docker image, with pom version. +- Push docker image \ No newline at end of file From e4265ab0ba658b1077448ba97ce49d0790abdcfd Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Mon, 30 Jun 2025 16:10:33 -0400 Subject: [PATCH 02/55] Progress --- CICD.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CICD.txt b/CICD.txt index ad2647a7..b870a128 100644 --- a/CICD.txt +++ b/CICD.txt @@ -15,4 +15,6 @@ Main Build - Build the codegen artifact - Perform Validations - Build docker image, with pom version. -- Push docker image \ No newline at end of file +- Push docker image + +DO GITHUB ACTIONS CONTAIN INPUTS FOR RELEASE VERSIONING LIKE GITLAB? \ No newline at end of file From 26cae91f057eed029d4b7186c9a0f4dcdc033225 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 09:44:49 -0400 Subject: [PATCH 03/55] Doing my first github action --- .github/workflows/hello-world.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/workflows/hello-world.yml diff --git a/.github/workflows/hello-world.yml b/.github/workflows/hello-world.yml new file mode 100644 index 00000000..bb3b96c2 --- /dev/null +++ b/.github/workflows/hello-world.yml @@ -0,0 +1,11 @@ +name: Hello World Workflow +on: + push: + branches: ['*'] + +jobs: + say-helllo: + runs-on: ubuntu-latest + steps: + - name: Print Hello World + run: echo "Hello World" \ No newline at end of file From 7e44793e39e7121cf2af4326df473edbd92e1847 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 15:42:03 -0400 Subject: [PATCH 04/55] Deleted actions --- .github/workflows/hello-world.yml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .github/workflows/hello-world.yml diff --git a/.github/workflows/hello-world.yml b/.github/workflows/hello-world.yml deleted file mode 100644 index bb3b96c2..00000000 --- a/.github/workflows/hello-world.yml +++ /dev/null @@ -1,11 +0,0 @@ -name: Hello World Workflow -on: - push: - branches: ['*'] - -jobs: - say-helllo: - runs-on: ubuntu-latest - steps: - - name: Print Hello World - run: echo "Hello World" \ No newline at end of file From 1a535f50d7700ab35567affb2d3dcea4604ff0c4 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 15:42:16 -0400 Subject: [PATCH 05/55] Added actions --- .github/actions/git-commit-changed/action.yml | 26 +++++ .github/actions/git-config/action.yml | 10 ++ .github/actions/git-tag/action.yml | 15 +++ .../action.yml | 28 ++++++ .../increment-snapshot.sh | 19 ++++ .github/actions/maven-project-info/action.yml | 17 ++++ .../maven-project-info/get-project-info.sh | 6 ++ .github/actions/maven-set-version/action.yml | 19 ++++ .../actions/parse-release-version/action.yml | 32 ++++++ .../parse-release-version/parse-version.sh | 29 ++++++ .github/actions/setup-java/action.yml | 26 +++++ .github/workflows/core-docker-build.yml | 41 ++++++++ .github/workflows/core-maven-build.yml | 85 ++++++++++++++++ .github/workflows/main.yml | 25 +++++ .github/workflows/pr.yml | 15 +++ .github/workflows/release.yml | 99 +++++++++++++++++++ 16 files changed, 492 insertions(+) create mode 100644 .github/actions/git-commit-changed/action.yml create mode 100644 .github/actions/git-config/action.yml create mode 100644 .github/actions/git-tag/action.yml create mode 100644 .github/actions/increment-version-next-snapshot/action.yml create mode 100755 .github/actions/increment-version-next-snapshot/increment-snapshot.sh create mode 100644 .github/actions/maven-project-info/action.yml create mode 100755 .github/actions/maven-project-info/get-project-info.sh create mode 100644 .github/actions/maven-set-version/action.yml create mode 100644 .github/actions/parse-release-version/action.yml create mode 100755 .github/actions/parse-release-version/parse-version.sh create mode 100644 .github/actions/setup-java/action.yml create mode 100644 .github/workflows/core-docker-build.yml create mode 100644 .github/workflows/core-maven-build.yml create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/pr.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/actions/git-commit-changed/action.yml b/.github/actions/git-commit-changed/action.yml new file mode 100644 index 00000000..85ee7990 --- /dev/null +++ b/.github/actions/git-commit-changed/action.yml @@ -0,0 +1,26 @@ +name: Git Commit Changed Files + +inputs: + message: + required: true + description: The commit message + push: + required: false + default: false + description: If the commit should be pushed + +runs: + using: composite + steps: + - name: print_status + shell: bash + run: git status --porcelain + - name: commit_changed_files + shell: bash + run: | + git add -u + git commit -m "${{ inputs.message }}" + - name: push + if: ${{ inputs.push == 'true' }} + shell: bash + run: git push diff --git a/.github/actions/git-config/action.yml b/.github/actions/git-config/action.yml new file mode 100644 index 00000000..11355bf8 --- /dev/null +++ b/.github/actions/git-config/action.yml @@ -0,0 +1,10 @@ +name: Git Config + +runs: + using: composite + steps: + - name: configure_git + shell: bash + run: | + git config --global user.email github-actions@radiantlogic.com + git config --global user.name github-actions \ No newline at end of file diff --git a/.github/actions/git-tag/action.yml b/.github/actions/git-tag/action.yml new file mode 100644 index 00000000..cedcd8c0 --- /dev/null +++ b/.github/actions/git-tag/action.yml @@ -0,0 +1,15 @@ +name: Git Apply Tag + +inputs: + tag: + required: true + description: The git tag to apply + +runs: + using: composite + steps: + - name: apply_tag + shell: bash + run: | + git tag "${{ inputs.tag }}" + git push --tags \ No newline at end of file diff --git a/.github/actions/increment-version-next-snapshot/action.yml b/.github/actions/increment-version-next-snapshot/action.yml new file mode 100644 index 00000000..8a616a45 --- /dev/null +++ b/.github/actions/increment-version-next-snapshot/action.yml @@ -0,0 +1,28 @@ +name: Increment Version to Next Snapshot + +inputs: + major_version: + description: The major version number + required: true + minor_version: + description: The minor version number + required: true + patch_version: + description: The patch version number + required: true +outputs: + next_snapshot_version: + description: The next snapshot version calculated by this action + value: ${{ steps.increment_snapshot_version.outputs.next_snapshot_version }} + +runs: + using: composite + steps: + - name: increment_snapshot_version + id: increment_snapshot_version + shell: bash + run: | + ${{ github.action_path }}/increment-snapshot.sh \ + "${{ inputs.major_version }}" \ + "${{ inputs.minor_version }}" \ + "${{ inputs.patch_version }}" \ No newline at end of file diff --git a/.github/actions/increment-version-next-snapshot/increment-snapshot.sh b/.github/actions/increment-version-next-snapshot/increment-snapshot.sh new file mode 100755 index 00000000..fa0d3b1f --- /dev/null +++ b/.github/actions/increment-version-next-snapshot/increment-snapshot.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -euo pipefail + +major_version="$1" +minor_version="$2" +patch_version="$3" + +if [ -z "$major_version" ] || [ -z "$minor_version" ] || [ -z "$patch_version" ]; then + echo "Missing required input values" >&2 + echo "major_version=$major_version" >&2 + echo "minor_version=$minor_version" >&2 + echo "patch_version=$patch_version" >&2 + exit 1 +fi + +echo "Incrementing to new snapshot version" +next_snapshot_version="${major_version}.${minor_version}.$(( "$patch_version" + 1 ))-SNAPSHOT" +echo "next_snapshot_version=$next_snapshot_version" | tee -a $GITHUB_OUTPUT \ No newline at end of file diff --git a/.github/actions/maven-project-info/action.yml b/.github/actions/maven-project-info/action.yml new file mode 100644 index 00000000..4c74ced3 --- /dev/null +++ b/.github/actions/maven-project-info/action.yml @@ -0,0 +1,17 @@ +name: Maven Project Info + +outputs: + project_name: + description: The name of the project + value: openapi-java-client-codegen + project_version: + description: The version of the project + value: ${{ steps.get_project_info.outputs.version }} + +runs: + using: composite + steps: + - name: Get Project Info + id: get_project_info + shell: bash + run: ${{ github.action_path }}/get-project-info.sh \ No newline at end of file diff --git a/.github/actions/maven-project-info/get-project-info.sh b/.github/actions/maven-project-info/get-project-info.sh new file mode 100755 index 00000000..ddb80c1d --- /dev/null +++ b/.github/actions/maven-project-info/get-project-info.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -euo pipefail + +version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) +echo "version=$version" | tee -a $GITHUB_OUTPUT \ No newline at end of file diff --git a/.github/actions/maven-set-version/action.yml b/.github/actions/maven-set-version/action.yml new file mode 100644 index 00000000..2028d38d --- /dev/null +++ b/.github/actions/maven-set-version/action.yml @@ -0,0 +1,19 @@ +name: Maven Set Version + +inputs: + version: + required: true + description: The version to set + +runs: + using: composite + steps: + - name: Set Project Version + shell: bash + run: | + version="${{ inputs.version }}" + if [ -z "$version" ]; then + echo "No version input provided, cannot proceed" >&2 + exit 1 + fi + mvn versions:set-property -Dproperty=revision -DnewVersion="$version" -DgenerateBackupPoms=false \ No newline at end of file diff --git a/.github/actions/parse-release-version/action.yml b/.github/actions/parse-release-version/action.yml new file mode 100644 index 00000000..5972289c --- /dev/null +++ b/.github/actions/parse-release-version/action.yml @@ -0,0 +1,32 @@ +name: Parse Release Version +inputs: + release_version: + required: true + description: The version number for the release. Must be a valid semver number. +outputs: + major_version: + description: The major version number. + value: ${{ steps.parse_version.outputs.major_version }} + minor_version: + description: The minor version number. + value: ${{ steps.parse_version.outputs.minor_version }} + patch_version: + description: The patch version number. + value: ${{ steps.parse_version.outputs.patch_version }} + qualifier_name: + description: The qualifier name, if present. + value: ${{ steps.parse_version.outputs.qualifier_name }} + qualifier_version: + description: The qualifier version, if present. + value: ${{ steps.parse_version.outputs.qualifier_version }} + +runs: + using: composite + steps: + - name: Print Version + shell: bash + run: echo "${{ inputs.release_version }}" + - name: Parse Version + id: parse_version + shell: bash + run: ${{ github.action_path }}/parse-version.sh "${{ inputs.release_version }}" \ No newline at end of file diff --git a/.github/actions/parse-release-version/parse-version.sh b/.github/actions/parse-release-version/parse-version.sh new file mode 100755 index 00000000..c004526d --- /dev/null +++ b/.github/actions/parse-release-version/parse-version.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +set -euo pipefail + +version="$1" + +pattern='^([0-9]+)\.([0-9]+)\.([0-9]+)(-(alpha|beta|rc)\.([0-9]+))?$' +echo "Comparing $version to regex $pattern" +if [[ ! "$version" =~ $pattern ]]; then + echo "Release version '$version' does not match semver pattern, aborting" >&2 + exit 1 +fi + +major_version="${BASH_REMATCH[1]}" +minor_version="${BASH_REMATCH[2]}" +patch_version="${BASH_REMATCH[3]}" +qualifier_name="${BASH_REMATCH[5]-$""}" +qualifier_version="${BASH_REMATCH[6]-$""}" + +echo "major_version=$major_version" | tee -a $GITHUB_OUTPUT +echo "minor_version=$minor_version" | tee -a $GITHUB_OUTPUT +echo "patch_version=$patch_version" | tee -a $GITHUB_OUTPUT +echo "qualifier_name=$qualifier_name" | tee -a $GITHUB_OUTPUT +echo "qualifier_version=$qualifier_version" | tee -a $GITHUB_OUTPUT + +if [ -n "$qualifier_name" ] || [ -n "$qualifier_version" ]; then + echo "This pipeline does not currently support releasing with semver qualifiers. Auto-versioning will not work. Please stick to major/minor/patch versions or upgrade the pipeline." >&2 + exit 1 +fi \ No newline at end of file diff --git a/.github/actions/setup-java/action.yml b/.github/actions/setup-java/action.yml new file mode 100644 index 00000000..87804362 --- /dev/null +++ b/.github/actions/setup-java/action.yml @@ -0,0 +1,26 @@ +name: Setup Java + +inputs: + pom_artifact_name: + required: false + description: >- + If this is being called as part of a workflow where the pom.xml has been + modified (ie, releases), the name of the artifact should be defined here + and it will be downloaded. + default: "" + +runs: + using: composite + steps: + - name: Download Pom Artifact + if: ${{ inputs.pom_artifact_name != '' }} + uses: actions/download-artifact@v4 + with: + name: ${{ inputs.pom_artifact_name }} + path: . + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: 24 + distribution: temurin + cache: maven \ No newline at end of file diff --git a/.github/workflows/core-docker-build.yml b/.github/workflows/core-docker-build.yml new file mode 100644 index 00000000..7d7b09d5 --- /dev/null +++ b/.github/workflows/core-docker-build.yml @@ -0,0 +1,41 @@ +name: Docker Build + +on: + workflow_call: + inputs: + image_name: + type: string + required: true + image_tag: + type: string + required: true + secrets: + DOCKERHUB_PASSWORD: + required: true + +jobs: + build_docker_image: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: project_artifacts + path: . + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + # TODO document these in the readme + username: ${{ vars.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build and Push + uses: docker/build-push-action@v6 + with: + push: false # TODO make this true in the real thing + tags: rlidev/${{ inputs.image_name }}:${{ inputs.image_tag }} # TODO make this the real repo/tag + context: . + platforms: linux/amd64,linux/arm64 \ No newline at end of file diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml new file mode 100644 index 00000000..9d74e315 --- /dev/null +++ b/.github/workflows/core-maven-build.yml @@ -0,0 +1,85 @@ +name: Maven Build + +on: + workflow_call: + inputs: + is_release: + required: false + type: boolean + default: false + description: If this is being called as part of a release + outputs: + project_name: + description: The name of the project + value: ${{ jobs.project_info.outputs.project_name }} + project_version: + description: The version of the project + value: ${{ jobs.project_info.outputs.project_version }} + +jobs: + project_info: + runs-on: ubuntu-latest + outputs: + project_version: ${{ steps.maven_project_info.outputs.project_version }} + project_name: ${{ steps.maven_project_info.outputs.project_name }} + steps: + - uses: actions/checkout@v4 + - name: Setup Java + uses: ./.github/actions/setup-java + with: + pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - id: maven_project_info + name: Get Project Info + uses: ./.github/actions/maven-project-info + + build_artifact: + runs-on: ubuntu-latest + needs: ['project_info'] + steps: + - uses: actions/checkout@v4 + - name: Setup Java + uses: ./.github/actions/setup-java + with: + pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - name: Build Artifact + run: mvn package -DskipTests + - uses: actions/upload-artifact@v4 + with: + name: project_artifacts + path: ./target/*.jar + + run_unit_tests: + runs-on: ubuntu-latest + needs: ['build_artifact'] + steps: + - uses: actions/checkout@v4 + - name: Setup Java + uses: ./.github/actions/setup-java + with: + pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - name: Run Tests + run: mvn test + + run_pmd: + runs-on: ubuntu-latest + needs: ['build_artifact'] + steps: + - uses: actions/checkout@v4 + - name: Setup Java + uses: ./.github/actions/setup-java + with: + pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - name: Run PMD + run: mvn pmd:check + + run_spotless: + runs-on: ubuntu-latest + needs: ['build_artifact'] + steps: + - uses: actions/checkout@v4 + - name: Setup Java + uses: ./.github/actions/setup-java + with: + pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - name: Run Spotless + run: mvn spotless:check \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..edbecec5 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,25 @@ +name: Main Branch + +on: + push: + branches: ['main'] + workflow_dispatch: + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + +jobs: + run_maven_build: + uses: ./.github/workflows/core-maven-build.yml + with: + is_release: false + + run_docker_build: + uses: ./.github/workflows/core-docker-build.yml + needs: ['run_maven_build'] + with: + image_name: ${{ needs.run_maven_build.outputs.project_name }} + image_tag: ${{ needs.run_maven_build.outputs.project_version }} + secrets: + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..914ffeaa --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,15 @@ +name: Pull Request + +on: + pull_request: + branches: [ 'main' ] + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + +jobs: + run_maven_build: + uses: ./.github/workflows/core-maven-build.yml + with: + is_release: false \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ec0c9704 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,99 @@ +name: Release +on: + workflow_dispatch: + inputs: + release_version: + type: string + required: true + description: The version number for the release. Must be a valid semver number. + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }} + +permissions: + contents: write + +jobs: + parse_release_version: + runs-on: ubuntu-latest + outputs: + major_version: ${{ steps.parse_version.outputs.major_version }} + minor_version: ${{ steps.parse_version.outputs.minor_version }} + patch_version: ${{ steps.parse_version.outputs.patch_version }} + steps: + - uses: actions/checkout@v4 + - name: parse_version + id: parse_version + uses: ./.github/actions/parse-release-version + with: + release_version: ${{ inputs.release_version }} + + set_project_release_version: + runs-on: ubuntu-latest + needs: ['parse_release_version'] + steps: + - uses: actions/checkout@v4 + - name: Setup Java + uses: ./.github/actions/setup-java + - uses: ./.github/actions/maven-set-version + with: + version: ${{ inputs.release_version }} + - uses: actions/upload-artifact@v4 + with: + name: release_pom_xml + path: pom.xml + + run_maven_build: + uses: ./.github/workflows/core-maven-build.yml + with: + is_release: true + needs: ['set_project_release_version'] + + run_docker_build: + uses: ./.github/workflows/core-docker-build.yml + needs: [ 'run_maven_build' ] + with: + image_name: ${{ needs.run_maven_build.outputs.project_name }} + image_tag: ${{ inputs.release_version }} + secrets: + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + + apply_git_tag: + runs-on: ubuntu-latest + needs: ['run_docker_build'] + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: release_pom_xml + path: . + - uses: ./.github/actions/git-config + - uses: ./.github/actions/git-commit-changed + with: + message: Updating project version to ${{ inputs.release_version }} + push: false + - uses: ./.github/actions/git-tag + with: + tag: v${{ inputs.release_version }} + + increment_project_snapshot_version: + runs-on: ubuntu-latest + needs: ['run_docker_build', 'parse_release_version'] + steps: + - uses: actions/checkout@v4 + - name: increment_version + id: increment_version + uses: ./.github/actions/increment-version-next-snapshot + with: + major_version: ${{ needs.parse_release_version.outputs.major_version }} + minor_version: ${{ needs.parse_release_version.outputs.minor_version }} + patch_version: ${{ needs.parse_release_version.outputs.patch_version }} + - uses: ./.github/actions/maven-set-version + with: + version: ${{ steps.increment_version.outputs.next_snapshot_version }} + - uses: ./.github/actions/git-config + - uses: ./.github/actions/git-commit-changed + with: + message: Updating project version to ${{ steps.increment_version.outputs.next_snapshot_version }} + push: true From 58f573f99e5aa8e0bdad6bd798753c4f06e4bd26 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 15:42:52 -0400 Subject: [PATCH 06/55] Progress with readme --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e7b8a11b..5bd22d0d 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,10 @@ The primary use for the generated code is to support building custom connectors - The quality of the generated code is directly correlated to the quality of the OpenAPI specification. - Only OpenAPI 3 is supported. +## Using the Codegen + +TBD + ## Development ### Modules @@ -77,4 +81,8 @@ A robust set of end-to-end tests have been constructed to validate the behavior First is the `integration.com.radiantlogic.openapi.codegen.javaclient.CodegenIT` class in `codegen-modules/openapi-java-client-codegen`. This test suite executes the code generation against a wide range of official OpenAPI specs from a variety of companies. It generates, compiles, and installs the maven artifacts from those specs. -Next is the full test suite in `usage-modules/openapi-java-client-usage`. Once all tests from `CodegenIT` complete successfully, all the artifacts will be available in the local `.m2` directory. At that point the test suite in this project can be run to execute a variety of java client operations against a mock server. This validates that the generated code performs as-expected. \ No newline at end of file +Next is the full test suite in `usage-modules/openapi-java-client-usage`. Once all tests from `CodegenIT` complete successfully, all the artifacts will be available in the local `.m2` directory. At that point the test suite in this project can be run to execute a variety of java client operations against a mock server. This validates that the generated code performs as-expected. + +## CI/CD + +TBD \ No newline at end of file From a8dd864e0d42c72b074d7afc5a8b22f68a6b568f Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 15:43:07 -0400 Subject: [PATCH 07/55] progress --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bd22d0d..7daf7888 100644 --- a/README.md +++ b/README.md @@ -85,4 +85,5 @@ Next is the full test suite in `usage-modules/openapi-java-client-usage`. Once a ## CI/CD -TBD \ No newline at end of file +TBD +Don't forget about the username & password variables in docs \ No newline at end of file From a45e59ba9bfa568b15f68b6c6d520f016477caca Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 15:43:20 -0400 Subject: [PATCH 08/55] Downgraded version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3d5f6867..a90db36d 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ - 1.0.0-SNAPSHOT + 0.0.1-SNAPSHOT 1.18.38 UTF-8 7.12.0 From 915dd0cb7301c6ea53bbd46e53b24bc1ee7aca14 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 15:44:14 -0400 Subject: [PATCH 09/55] Cleanup --- .github/workflows/core-docker-build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/core-docker-build.yml b/.github/workflows/core-docker-build.yml index 7d7b09d5..903fdd10 100644 --- a/.github/workflows/core-docker-build.yml +++ b/.github/workflows/core-docker-build.yml @@ -25,7 +25,6 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v3 with: - # TODO document these in the readme username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - name: Setup QEMU @@ -35,7 +34,7 @@ jobs: - name: Build and Push uses: docker/build-push-action@v6 with: - push: false # TODO make this true in the real thing - tags: rlidev/${{ inputs.image_name }}:${{ inputs.image_tag }} # TODO make this the real repo/tag + push: true + tags: rlidev/${{ inputs.image_name }}:${{ inputs.image_tag }} context: . platforms: linux/amd64,linux/arm64 \ No newline at end of file From d3b1b7eaac0928ff81476be6aa6c8e6eacc3afd6 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 15:48:40 -0400 Subject: [PATCH 10/55] Improving build with more features for this project --- .github/workflows/core-maven-build.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index 9d74e315..97bcd38e 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -42,11 +42,11 @@ jobs: with: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - name: Build Artifact - run: mvn package -DskipTests + run: mvn test-compile package -DskipTests - uses: actions/upload-artifact@v4 with: name: project_artifacts - path: ./target/*.jar + path: ./codegen-modules/openapi-java-client-codegen/target/*.jar run_unit_tests: runs-on: ubuntu-latest @@ -57,7 +57,7 @@ jobs: uses: ./.github/actions/setup-java with: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - - name: Run Tests + - name: Run Unit Tests run: mvn test run_pmd: @@ -82,4 +82,16 @@ jobs: with: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - name: Run Spotless - run: mvn spotless:check \ No newline at end of file + run: mvn spotless:check + + run_integration_tests: + runs-on: ubuntu-latest + needs: ['build_artifact'] + steps: + - uses: actions/checkout@v4 + - name: Setup Java + uses: ./.github/actions/setup-java + with: + pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - name: Run Integration Tests + run: echo "" \ No newline at end of file From 2425f165140fa49672cd6c7e9d2efdea428e81c2 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 15:53:38 -0400 Subject: [PATCH 11/55] Progress with build --- pom.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pom.xml b/pom.xml index a90db36d..017b85a3 100644 --- a/pom.xml +++ b/pom.xml @@ -43,6 +43,7 @@ 1.6.3 ./codegen-modules/openapi-java-client-codegen ./usage-modules/openapi-java-client-usage + ${skipTests} @@ -228,11 +229,21 @@ org.apache.maven.plugins maven-surefire-plugin 3.5.3 + + ${skip.surefire.tests} + org.apache.maven.plugins maven-failsafe-plugin 3.5.3 + + + + integration-test + + + From 6c63982f6181bfcf50852610e702d0c4dc67567b Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 15:55:00 -0400 Subject: [PATCH 12/55] Progress integrating usage tests --- .github/workflows/core-maven-build.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index 97bcd38e..84446f82 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -94,4 +94,16 @@ jobs: with: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - name: Run Integration Tests - run: echo "" \ No newline at end of file + run: mvn integration-test -Dskip.surefire.tests + + run_usage_tests: + runs-on: ubuntu-latest + needs: ['run_integration_tests'] + steps: + - uses: actions/checkout@v4 + - name: Setup Java + uses: ./.github/actions/setup-java + with: + pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - name: Run Usage Tests + run: mvn -P usage test \ No newline at end of file From 3a920b13762b3724790745c9b0b7fb53f3fe6d38 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 15:59:57 -0400 Subject: [PATCH 13/55] Fixed build so integration tests fail --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 017b85a3..30101ad5 100644 --- a/pom.xml +++ b/pom.xml @@ -241,9 +241,14 @@ integration-test + verify + integration-test + + false + From aa62894aa5b404dcb595252c9cc6113c6eb5a5c8 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 16:00:06 -0400 Subject: [PATCH 14/55] Fixing tests and url parsing --- .../openapi/codegen/javaclient/args/ArgsParser.java | 2 +- .../openapi/codegen/javaclient/integration/CodegenIT.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/main/java/com/radiantlogic/openapi/codegen/javaclient/args/ArgsParser.java b/codegen-modules/openapi-java-client-codegen/src/main/java/com/radiantlogic/openapi/codegen/javaclient/args/ArgsParser.java index c0d0f928..cce77a90 100644 --- a/codegen-modules/openapi-java-client-codegen/src/main/java/com/radiantlogic/openapi/codegen/javaclient/args/ArgsParser.java +++ b/codegen-modules/openapi-java-client-codegen/src/main/java/com/radiantlogic/openapi/codegen/javaclient/args/ArgsParser.java @@ -98,7 +98,7 @@ public Args parse(@NonNull final String[] args) { private URL parseOpenapiPath(@NonNull final String openapiPath) { try { return new URI(openapiPath).toURL(); - } catch (final MalformedURLException | URISyntaxException ex) { + } catch (final MalformedURLException | URISyntaxException | IllegalArgumentException ex) { try { final Path absoluteFilePath = Paths.get(openapiPath); if (Files.exists(absoluteFilePath)) { diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index ea62cda0..a93fd816 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -156,6 +156,7 @@ private void generateAndBuild( final URL url = getClass().getClassLoader().getResource("openapi/%s".formatted(yamlFilename)); final Path yamlPath = Paths.get(url.toURI()); + System.out.println("Running test for spec file %s".formatted(yamlPath)); final Runner runner = new Runner(); final String[] args = new String[] {"-p=%s".formatted(yamlPath.toString())}; runner.run(args); From d569164af019f27ae646a45d88f423971f88f7df Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 16:07:14 -0400 Subject: [PATCH 15/55] Updated jackson --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 30101ad5..89ab7aa4 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ com.fasterxml.jackson jackson-bom - 2.19.0 + 2.19.1 pom import From 0ff6ac251dd00b98edba98c9422a9375a824667e Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 16:10:53 -0400 Subject: [PATCH 16/55] Updated lib --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 89ab7aa4..fe45107f 100644 --- a/pom.xml +++ b/pom.xml @@ -107,7 +107,7 @@ org.openapitools openapi-generator - 7.13.0 + 7.14.0 org.wiremock From 0864ff91f9dce29d724161e910639c4ceaa31e97 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 16:14:53 -0400 Subject: [PATCH 17/55] Bumping lib --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index fe45107f..c1a42350 100644 --- a/pom.xml +++ b/pom.xml @@ -119,6 +119,11 @@ mapstruct ${mapstruct.version} + + com.github.ben-manes.caffeine + caffeine + 3.2.1 + From ad73569fd95ce58794d08b02a4c3578ac802e7be Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 16:25:16 -0400 Subject: [PATCH 18/55] Downgraded to java 21 --- .sdkmanrc | 2 +- codegen-modules/openapi-java-client-codegen/pom.xml | 2 +- .../openapi/codegen/javaclient/integration/CodegenIT.java | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.sdkmanrc b/.sdkmanrc index 36241e5d..388dc3ae 100644 --- a/.sdkmanrc +++ b/.sdkmanrc @@ -1,4 +1,4 @@ # Enable auto-env through the sdkman_auto_env config # Add key=value pairs of SDKs to use below -java=24.0.1-amzn +java=21.0.2-amzn maven=3.9.9 \ No newline at end of file diff --git a/codegen-modules/openapi-java-client-codegen/pom.xml b/codegen-modules/openapi-java-client-codegen/pom.xml index a71d3e5f..8d4595fa 100644 --- a/codegen-modules/openapi-java-client-codegen/pom.xml +++ b/codegen-modules/openapi-java-client-codegen/pom.xml @@ -15,7 +15,7 @@ ${revision} - 24 + 21 diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index a93fd816..18fcba6b 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -7,6 +7,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.time.Duration; +import java.util.concurrent.TimeUnit; import lombok.NonNull; import lombok.SneakyThrows; import org.apache.commons.io.FileUtils; @@ -167,7 +168,7 @@ private void generateAndBuild( .inheritIO() .start(); - final boolean waitSuccess = process.waitFor(WAIT_FOR_BUILD); + final boolean waitSuccess = process.waitFor(WAIT_FOR_BUILD.toMillis(), TimeUnit.MILLISECONDS); assertThat(waitSuccess).withFailMessage("Wait for build of generated code timed out.").isTrue(); final int exitValue = process.exitValue(); From e6458e47e43af83a5d0e7331071b1ef13235561e Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 16:30:36 -0400 Subject: [PATCH 19/55] Fixed module path --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index c1a42350..0c1eab37 100644 --- a/pom.xml +++ b/pom.xml @@ -253,6 +253,7 @@ false + false From 6a5bc0786ebb67611de190b49f809996e31ca4c6 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 16:32:26 -0400 Subject: [PATCH 20/55] Reverted to prior working state now that module issue is solved --- .sdkmanrc | 2 +- .../openapi-java-client-codegen/pom.xml | 2 +- .../javaclient/integration/CodegenIT.java | 243 +++++++++--------- pom.xml | 5 - 4 files changed, 125 insertions(+), 127 deletions(-) diff --git a/.sdkmanrc b/.sdkmanrc index 388dc3ae..36241e5d 100644 --- a/.sdkmanrc +++ b/.sdkmanrc @@ -1,4 +1,4 @@ # Enable auto-env through the sdkman_auto_env config # Add key=value pairs of SDKs to use below -java=21.0.2-amzn +java=24.0.1-amzn maven=3.9.9 \ No newline at end of file diff --git a/codegen-modules/openapi-java-client-codegen/pom.xml b/codegen-modules/openapi-java-client-codegen/pom.xml index 8d4595fa..a71d3e5f 100644 --- a/codegen-modules/openapi-java-client-codegen/pom.xml +++ b/codegen-modules/openapi-java-client-codegen/pom.xml @@ -15,7 +15,7 @@ ${revision} - 21 + 24 diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index 18fcba6b..c8c3daab 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -11,7 +11,6 @@ import lombok.NonNull; import lombok.SneakyThrows; import org.apache.commons.io.FileUtils; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** @@ -29,125 +28,129 @@ void oktaIdpMinimal() { generateAndBuild("okta-idp-minimal-2025.01.1.yaml", "MyAccount-Management/2025.01.1"); } - @Test - @Disabled( - "This spec has a lot of problems with it. It is more an example of how poorly designed specs cannot work with this tool than anything else.") - void oktaManagementMinimal() { - generateAndBuild("okta-management-minimal-2025.01.1.yaml", "Okta-Admin-Management/2025.01.1"); - } - - @Test - void oktaOauthMinimal() { - generateAndBuild( - "okta-oauth-minimal-2025.01.1.yaml", "Okta-OpenID-Connect--OAuth-2.0/2025.01.1"); - } - - @Test - void radiantone() { - generateAndBuild( - "radiantone-openapi-8.1.4-beta.2-SNAPSHOT.yaml", "RadiantOne-V8-API/8.1.4-beta.2-SNAPSHOT"); - } - - @Test - void gitlabV4() { - generateAndBuild("gitlab-v4.yaml", "GitLab-API/v4"); - } - - @Test - @Disabled("Swagger 2 is currently out of scope") - void gitlabV4Swagger2() { - generateAndBuild("gitlab-v4-swagger2.yaml", "GitLab-API---Swagger-2/v4"); - } - - @Test - void googleMaps() { - generateAndBuild("google-maps-1.22.5.json", "Google-Maps-Platform/1.22.5"); - } - - @Test - void msgraphApplication() { - generateAndBuild("msgraph-applications-1.0.yaml", "Applications/v1.0"); - } - - @Test - void msgraphCalendar() { - generateAndBuild("msgraph-calendar-1.0.yaml", "Calendar/v1.0"); - } - - @Test - void openai() { - generateAndBuild("openai-2.3.0.yaml", "OpenAI-API/2.3.0"); - } - - @Test - void anthropic() { - generateAndBuild("anthropic-0.0.0.json", "Anthropic-API/0.0.0"); - } - - @Test - void onepasswordConnect() { - generateAndBuild("1password-connect-1.7.1.yaml", "1Password-Connect/1.7.1"); - } - - @Test - void bitbucket() { - generateAndBuild("bitbucket-2.0.json", "Bitbucket-API/2.0"); - } - - @Test - void radiantlogicCloudmanager() { - generateAndBuild("radiantlogic-cloudmanager-1.3.2.json", "Radiantlogic-CloudManager/1.3.2"); - } - - @Test - void swaggerPetstore() { - generateAndBuild("swagger-petstore-1.0.26.json", "Swagger-Petstore---OpenAPI-3.0/1.0.26"); - } - - @Test - void harryPotter() { - generateAndBuild("harrypotter-1.0.0.yaml", "Harry-Potter-API/1.0.0"); - } - - @Test - void snyk() { - generateAndBuild("snyk-1.0.yaml", "Snyk-API/1.0"); - } - - @Test - void sonarqube() { - generateAndBuild("sonarqube-2025.4.0.109754.json", "SonarQube-Web-API-v2/2025.4.0.109754"); - } - - @Test - void githubActions() { - generateAndBuild("github-actions-v3-1.1.4.yaml", "GitHub-v3-REST-API---actions/1.1.4"); - } - - @Test - void githubActivity() { - generateAndBuild("github-activity-v3-1.1.4.yaml", "GitHub-v3-REST-API---activity/1.1.4"); - } - - @Test - void githubApps() { - generateAndBuild("github-apps-v3-1.1.4.yaml", "GitHub-v3-REST-API---apps/1.1.4"); - } - - @Test - void githubBilling() { - generateAndBuild("github-billing-v3-1.1.4.yaml", "GitHub-v3-REST-API---billing/1.1.4"); - } - - /** - * This generates test code to validate more scenarios involving broken discriminated unions. The - * existing real specs produce several scenarios, but to fully exercise the impact of the code - * changes this new test-only spec is required. - */ - @Test - void brokenDiscriminatorTest() { - generateAndBuild("broken-discriminator-test-1.0.0.yaml", "Broken-Discriminator-Test/1.0.0"); - } + // @Test + // @Disabled( + // "This spec has a lot of problems with it. It is more an example of how poorly designed + // specs cannot work with this tool than anything else.") + // void oktaManagementMinimal() { + // generateAndBuild("okta-management-minimal-2025.01.1.yaml", + // "Okta-Admin-Management/2025.01.1"); + // } + // + // @Test + // void oktaOauthMinimal() { + // generateAndBuild( + // "okta-oauth-minimal-2025.01.1.yaml", "Okta-OpenID-Connect--OAuth-2.0/2025.01.1"); + // } + // + // @Test + // void radiantone() { + // generateAndBuild( + // "radiantone-openapi-8.1.4-beta.2-SNAPSHOT.yaml", + // "RadiantOne-V8-API/8.1.4-beta.2-SNAPSHOT"); + // } + // + // @Test + // void gitlabV4() { + // generateAndBuild("gitlab-v4.yaml", "GitLab-API/v4"); + // } + // + // @Test + // @Disabled("Swagger 2 is currently out of scope") + // void gitlabV4Swagger2() { + // generateAndBuild("gitlab-v4-swagger2.yaml", "GitLab-API---Swagger-2/v4"); + // } + // + // @Test + // void googleMaps() { + // generateAndBuild("google-maps-1.22.5.json", "Google-Maps-Platform/1.22.5"); + // } + // + // @Test + // void msgraphApplication() { + // generateAndBuild("msgraph-applications-1.0.yaml", "Applications/v1.0"); + // } + // + // @Test + // void msgraphCalendar() { + // generateAndBuild("msgraph-calendar-1.0.yaml", "Calendar/v1.0"); + // } + // + // @Test + // void openai() { + // generateAndBuild("openai-2.3.0.yaml", "OpenAI-API/2.3.0"); + // } + // + // @Test + // void anthropic() { + // generateAndBuild("anthropic-0.0.0.json", "Anthropic-API/0.0.0"); + // } + // + // @Test + // void onepasswordConnect() { + // generateAndBuild("1password-connect-1.7.1.yaml", "1Password-Connect/1.7.1"); + // } + // + // @Test + // void bitbucket() { + // generateAndBuild("bitbucket-2.0.json", "Bitbucket-API/2.0"); + // } + // + // @Test + // void radiantlogicCloudmanager() { + // generateAndBuild("radiantlogic-cloudmanager-1.3.2.json", "Radiantlogic-CloudManager/1.3.2"); + // } + // + // @Test + // void swaggerPetstore() { + // generateAndBuild("swagger-petstore-1.0.26.json", "Swagger-Petstore---OpenAPI-3.0/1.0.26"); + // } + // + // @Test + // void harryPotter() { + // generateAndBuild("harrypotter-1.0.0.yaml", "Harry-Potter-API/1.0.0"); + // } + // + // @Test + // void snyk() { + // generateAndBuild("snyk-1.0.yaml", "Snyk-API/1.0"); + // } + // + // @Test + // void sonarqube() { + // generateAndBuild("sonarqube-2025.4.0.109754.json", "SonarQube-Web-API-v2/2025.4.0.109754"); + // } + // + // @Test + // void githubActions() { + // generateAndBuild("github-actions-v3-1.1.4.yaml", "GitHub-v3-REST-API---actions/1.1.4"); + // } + // + // @Test + // void githubActivity() { + // generateAndBuild("github-activity-v3-1.1.4.yaml", "GitHub-v3-REST-API---activity/1.1.4"); + // } + // + // @Test + // void githubApps() { + // generateAndBuild("github-apps-v3-1.1.4.yaml", "GitHub-v3-REST-API---apps/1.1.4"); + // } + // + // @Test + // void githubBilling() { + // generateAndBuild("github-billing-v3-1.1.4.yaml", "GitHub-v3-REST-API---billing/1.1.4"); + // } + // + // /** + // * This generates test code to validate more scenarios involving broken discriminated unions. + // The + // * existing real specs produce several scenarios, but to fully exercise the impact of the code + // * changes this new test-only spec is required. + // */ + // @Test + // void brokenDiscriminatorTest() { + // generateAndBuild("broken-discriminator-test-1.0.0.yaml", "Broken-Discriminator-Test/1.0.0"); + // } @SneakyThrows private void generateAndBuild( diff --git a/pom.xml b/pom.xml index 0c1eab37..7eada29a 100644 --- a/pom.xml +++ b/pom.xml @@ -119,11 +119,6 @@ mapstruct ${mapstruct.version} - - com.github.ben-manes.caffeine - caffeine - 3.2.1 - From 69609334ea95d8d3fd4ba4d3692078c8fac3d97f Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 16:42:59 -0400 Subject: [PATCH 21/55] Working on m2 --- .github/actions/setup-java/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-java/action.yml b/.github/actions/setup-java/action.yml index 87804362..2328a93e 100644 --- a/.github/actions/setup-java/action.yml +++ b/.github/actions/setup-java/action.yml @@ -23,4 +23,9 @@ runs: with: java-version: 24 distribution: temurin - cache: maven \ No newline at end of file + cache: maven + # TODO delete this + - name: Print M2 + shell: bash + run: | + ls -l ~/.m2/repository \ No newline at end of file From 09d2afa005edbe8cb6423c107dda69fde2ff48c2 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 16:44:54 -0400 Subject: [PATCH 22/55] Updated m2 printing --- .github/actions/setup-java/action.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/setup-java/action.yml b/.github/actions/setup-java/action.yml index 2328a93e..3635331f 100644 --- a/.github/actions/setup-java/action.yml +++ b/.github/actions/setup-java/action.yml @@ -27,5 +27,4 @@ runs: # TODO delete this - name: Print M2 shell: bash - run: | - ls -l ~/.m2/repository \ No newline at end of file + run: find ~/.m2/repository -type d \ No newline at end of file From c4a7c25f1e751658bf4beb7d72fd659a98039b87 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 16:58:57 -0400 Subject: [PATCH 23/55] restored remaining tests --- .../javaclient/integration/CodegenIT.java | 243 +++++++++--------- 1 file changed, 120 insertions(+), 123 deletions(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index c8c3daab..18fcba6b 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -11,6 +11,7 @@ import lombok.NonNull; import lombok.SneakyThrows; import org.apache.commons.io.FileUtils; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** @@ -28,129 +29,125 @@ void oktaIdpMinimal() { generateAndBuild("okta-idp-minimal-2025.01.1.yaml", "MyAccount-Management/2025.01.1"); } - // @Test - // @Disabled( - // "This spec has a lot of problems with it. It is more an example of how poorly designed - // specs cannot work with this tool than anything else.") - // void oktaManagementMinimal() { - // generateAndBuild("okta-management-minimal-2025.01.1.yaml", - // "Okta-Admin-Management/2025.01.1"); - // } - // - // @Test - // void oktaOauthMinimal() { - // generateAndBuild( - // "okta-oauth-minimal-2025.01.1.yaml", "Okta-OpenID-Connect--OAuth-2.0/2025.01.1"); - // } - // - // @Test - // void radiantone() { - // generateAndBuild( - // "radiantone-openapi-8.1.4-beta.2-SNAPSHOT.yaml", - // "RadiantOne-V8-API/8.1.4-beta.2-SNAPSHOT"); - // } - // - // @Test - // void gitlabV4() { - // generateAndBuild("gitlab-v4.yaml", "GitLab-API/v4"); - // } - // - // @Test - // @Disabled("Swagger 2 is currently out of scope") - // void gitlabV4Swagger2() { - // generateAndBuild("gitlab-v4-swagger2.yaml", "GitLab-API---Swagger-2/v4"); - // } - // - // @Test - // void googleMaps() { - // generateAndBuild("google-maps-1.22.5.json", "Google-Maps-Platform/1.22.5"); - // } - // - // @Test - // void msgraphApplication() { - // generateAndBuild("msgraph-applications-1.0.yaml", "Applications/v1.0"); - // } - // - // @Test - // void msgraphCalendar() { - // generateAndBuild("msgraph-calendar-1.0.yaml", "Calendar/v1.0"); - // } - // - // @Test - // void openai() { - // generateAndBuild("openai-2.3.0.yaml", "OpenAI-API/2.3.0"); - // } - // - // @Test - // void anthropic() { - // generateAndBuild("anthropic-0.0.0.json", "Anthropic-API/0.0.0"); - // } - // - // @Test - // void onepasswordConnect() { - // generateAndBuild("1password-connect-1.7.1.yaml", "1Password-Connect/1.7.1"); - // } - // - // @Test - // void bitbucket() { - // generateAndBuild("bitbucket-2.0.json", "Bitbucket-API/2.0"); - // } - // - // @Test - // void radiantlogicCloudmanager() { - // generateAndBuild("radiantlogic-cloudmanager-1.3.2.json", "Radiantlogic-CloudManager/1.3.2"); - // } - // - // @Test - // void swaggerPetstore() { - // generateAndBuild("swagger-petstore-1.0.26.json", "Swagger-Petstore---OpenAPI-3.0/1.0.26"); - // } - // - // @Test - // void harryPotter() { - // generateAndBuild("harrypotter-1.0.0.yaml", "Harry-Potter-API/1.0.0"); - // } - // - // @Test - // void snyk() { - // generateAndBuild("snyk-1.0.yaml", "Snyk-API/1.0"); - // } - // - // @Test - // void sonarqube() { - // generateAndBuild("sonarqube-2025.4.0.109754.json", "SonarQube-Web-API-v2/2025.4.0.109754"); - // } - // - // @Test - // void githubActions() { - // generateAndBuild("github-actions-v3-1.1.4.yaml", "GitHub-v3-REST-API---actions/1.1.4"); - // } - // - // @Test - // void githubActivity() { - // generateAndBuild("github-activity-v3-1.1.4.yaml", "GitHub-v3-REST-API---activity/1.1.4"); - // } - // - // @Test - // void githubApps() { - // generateAndBuild("github-apps-v3-1.1.4.yaml", "GitHub-v3-REST-API---apps/1.1.4"); - // } - // - // @Test - // void githubBilling() { - // generateAndBuild("github-billing-v3-1.1.4.yaml", "GitHub-v3-REST-API---billing/1.1.4"); - // } - // - // /** - // * This generates test code to validate more scenarios involving broken discriminated unions. - // The - // * existing real specs produce several scenarios, but to fully exercise the impact of the code - // * changes this new test-only spec is required. - // */ - // @Test - // void brokenDiscriminatorTest() { - // generateAndBuild("broken-discriminator-test-1.0.0.yaml", "Broken-Discriminator-Test/1.0.0"); - // } + @Test + @Disabled( + "This spec has a lot of problems with it. It is more an example of how poorly designed specs cannot work with this tool than anything else.") + void oktaManagementMinimal() { + generateAndBuild("okta-management-minimal-2025.01.1.yaml", "Okta-Admin-Management/2025.01.1"); + } + + @Test + void oktaOauthMinimal() { + generateAndBuild( + "okta-oauth-minimal-2025.01.1.yaml", "Okta-OpenID-Connect--OAuth-2.0/2025.01.1"); + } + + @Test + void radiantone() { + generateAndBuild( + "radiantone-openapi-8.1.4-beta.2-SNAPSHOT.yaml", "RadiantOne-V8-API/8.1.4-beta.2-SNAPSHOT"); + } + + @Test + void gitlabV4() { + generateAndBuild("gitlab-v4.yaml", "GitLab-API/v4"); + } + + @Test + @Disabled("Swagger 2 is currently out of scope") + void gitlabV4Swagger2() { + generateAndBuild("gitlab-v4-swagger2.yaml", "GitLab-API---Swagger-2/v4"); + } + + @Test + void googleMaps() { + generateAndBuild("google-maps-1.22.5.json", "Google-Maps-Platform/1.22.5"); + } + + @Test + void msgraphApplication() { + generateAndBuild("msgraph-applications-1.0.yaml", "Applications/v1.0"); + } + + @Test + void msgraphCalendar() { + generateAndBuild("msgraph-calendar-1.0.yaml", "Calendar/v1.0"); + } + + @Test + void openai() { + generateAndBuild("openai-2.3.0.yaml", "OpenAI-API/2.3.0"); + } + + @Test + void anthropic() { + generateAndBuild("anthropic-0.0.0.json", "Anthropic-API/0.0.0"); + } + + @Test + void onepasswordConnect() { + generateAndBuild("1password-connect-1.7.1.yaml", "1Password-Connect/1.7.1"); + } + + @Test + void bitbucket() { + generateAndBuild("bitbucket-2.0.json", "Bitbucket-API/2.0"); + } + + @Test + void radiantlogicCloudmanager() { + generateAndBuild("radiantlogic-cloudmanager-1.3.2.json", "Radiantlogic-CloudManager/1.3.2"); + } + + @Test + void swaggerPetstore() { + generateAndBuild("swagger-petstore-1.0.26.json", "Swagger-Petstore---OpenAPI-3.0/1.0.26"); + } + + @Test + void harryPotter() { + generateAndBuild("harrypotter-1.0.0.yaml", "Harry-Potter-API/1.0.0"); + } + + @Test + void snyk() { + generateAndBuild("snyk-1.0.yaml", "Snyk-API/1.0"); + } + + @Test + void sonarqube() { + generateAndBuild("sonarqube-2025.4.0.109754.json", "SonarQube-Web-API-v2/2025.4.0.109754"); + } + + @Test + void githubActions() { + generateAndBuild("github-actions-v3-1.1.4.yaml", "GitHub-v3-REST-API---actions/1.1.4"); + } + + @Test + void githubActivity() { + generateAndBuild("github-activity-v3-1.1.4.yaml", "GitHub-v3-REST-API---activity/1.1.4"); + } + + @Test + void githubApps() { + generateAndBuild("github-apps-v3-1.1.4.yaml", "GitHub-v3-REST-API---apps/1.1.4"); + } + + @Test + void githubBilling() { + generateAndBuild("github-billing-v3-1.1.4.yaml", "GitHub-v3-REST-API---billing/1.1.4"); + } + + /** + * This generates test code to validate more scenarios involving broken discriminated unions. The + * existing real specs produce several scenarios, but to fully exercise the impact of the code + * changes this new test-only spec is required. + */ + @Test + void brokenDiscriminatorTest() { + generateAndBuild("broken-discriminator-test-1.0.0.yaml", "Broken-Discriminator-Test/1.0.0"); + } @SneakyThrows private void generateAndBuild( From 5cc3869af7e14639de404275f3c0ca596486d013 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:00:14 -0400 Subject: [PATCH 24/55] Adjusting cache key --- .github/actions/setup-java/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-java/action.yml b/.github/actions/setup-java/action.yml index 3635331f..b0b810c4 100644 --- a/.github/actions/setup-java/action.yml +++ b/.github/actions/setup-java/action.yml @@ -18,13 +18,13 @@ runs: with: name: ${{ inputs.pom_artifact_name }} path: . + - name: Write Run ID For Cache Key + shell: bash + run: echo "run_id=${{ github.run_id }}" | tee run_id.txt - name: Setup Java uses: actions/setup-java@v4 with: java-version: 24 distribution: temurin cache: maven - # TODO delete this - - name: Print M2 - shell: bash - run: find ~/.m2/repository -type d \ No newline at end of file + cache-dependency-path: run_id.txt \ No newline at end of file From f8affab8a493167ee01b986dd40ac42822edb3d9 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:01:15 -0400 Subject: [PATCH 25/55] Updated pipeline --- .github/workflows/core-maven-build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index 84446f82..32ab45ff 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -95,6 +95,10 @@ jobs: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - name: Run Integration Tests run: mvn integration-test -Dskip.surefire.tests + - uses: actions/upload-artifact@v4 + with: + name: integration_test_artifacts + path: ~/.m2/repository/com/radiantlogic/openapi/generated run_usage_tests: runs-on: ubuntu-latest From dae2313a0e4b0017ae9b2e2accfdf85ef2405154 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:04:32 -0400 Subject: [PATCH 26/55] More work --- .github/workflows/core-maven-build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index 32ab45ff..7247f230 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -95,10 +95,11 @@ jobs: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - name: Run Integration Tests run: mvn integration-test -Dskip.surefire.tests - - uses: actions/upload-artifact@v4 + - name: Upload Integration Test Artifacts + uses: actions/upload-artifact@v4 with: name: integration_test_artifacts - path: ~/.m2/repository/com/radiantlogic/openapi/generated + path: ~/.m2/repository/com/radiantlogic/openapi/generated/**/* run_usage_tests: runs-on: ubuntu-latest @@ -109,5 +110,10 @@ jobs: uses: ./.github/actions/setup-java with: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - name: Download Integration Test Artifacts + uses: actions/download-artifact@v4 + with: + name: integration_test_artifacts + path: ~/.m2/repository/com/radiantlogic/openapi/generated - name: Run Usage Tests run: mvn -P usage test \ No newline at end of file From 89c0855ac79619aebe05727cf3e08240ed86ab73 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:06:57 -0400 Subject: [PATCH 27/55] Adding attempt to download all dependencies up front --- .github/actions/setup-java/action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-java/action.yml b/.github/actions/setup-java/action.yml index b0b810c4..ef93a8fa 100644 --- a/.github/actions/setup-java/action.yml +++ b/.github/actions/setup-java/action.yml @@ -27,4 +27,7 @@ runs: java-version: 24 distribution: temurin cache: maven - cache-dependency-path: run_id.txt \ No newline at end of file + cache-dependency-path: run_id.txt + - name: Resolve Dependencies + shell: bash + run: mvn dependency:go-offline \ No newline at end of file From f94bcb96cb2d18668e732eb283cb3291b6516f73 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:08:04 -0400 Subject: [PATCH 28/55] Trying to increase heap --- .github/workflows/core-maven-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index 7247f230..74f3a1ea 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -94,7 +94,7 @@ jobs: with: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - name: Run Integration Tests - run: mvn integration-test -Dskip.surefire.tests + run: MAVEN_OPTS="-Xmx2g" mvn integration-test -Dskip.surefire.tests - name: Upload Integration Test Artifacts uses: actions/upload-artifact@v4 with: From 449c1a347f468b25b835fc185a2822d07c9e1a27 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:11:17 -0400 Subject: [PATCH 29/55] More ram --- .github/workflows/core-maven-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index 74f3a1ea..824d8e34 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -94,7 +94,7 @@ jobs: with: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - name: Run Integration Tests - run: MAVEN_OPTS="-Xmx2g" mvn integration-test -Dskip.surefire.tests + run: MAVEN_OPTS="-Xmx6g" mvn integration-test -Dskip.surefire.tests - name: Upload Integration Test Artifacts uses: actions/upload-artifact@v4 with: From 6e7cd556b1e1d5f868b31188783e4c7876148a08 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:19:40 -0400 Subject: [PATCH 30/55] Trying to make sure as many dependencies as possible are resolved --- .github/actions/setup-java/action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-java/action.yml b/.github/actions/setup-java/action.yml index ef93a8fa..7f161008 100644 --- a/.github/actions/setup-java/action.yml +++ b/.github/actions/setup-java/action.yml @@ -28,6 +28,8 @@ runs: distribution: temurin cache: maven cache-dependency-path: run_id.txt - - name: Resolve Dependencies + - name: Resolve Dependencies To Populate Cache shell: bash - run: mvn dependency:go-offline \ No newline at end of file + run: | + mvn dependency:go-offline + mvn test-compile \ No newline at end of file From 5d7cb01f933d325a97f57c01d18f937675f822aa Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:22:15 -0400 Subject: [PATCH 31/55] Trying to increase memory --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 7eada29a..1c9765a2 100644 --- a/pom.xml +++ b/pom.xml @@ -249,6 +249,7 @@ false false + -Xmx2048m From 9f207ecfb929a3e8d91aae8b803303de25bc973e Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:27:39 -0400 Subject: [PATCH 32/55] Progress --- .github/workflows/core-maven-build.yml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index 824d8e34..7247f230 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -94,7 +94,7 @@ jobs: with: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - name: Run Integration Tests - run: MAVEN_OPTS="-Xmx6g" mvn integration-test -Dskip.surefire.tests + run: mvn integration-test -Dskip.surefire.tests - name: Upload Integration Test Artifacts uses: actions/upload-artifact@v4 with: diff --git a/pom.xml b/pom.xml index 1c9765a2..ade00591 100644 --- a/pom.xml +++ b/pom.xml @@ -249,7 +249,7 @@ false false - -Xmx2048m + -Xmx4096m From 55ea5dd227aab511be4ad922376051e0f053723b Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:28:46 -0400 Subject: [PATCH 33/55] Pushing again --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index ade00591..804c9165 100644 --- a/pom.xml +++ b/pom.xml @@ -250,6 +250,7 @@ false false -Xmx4096m + From 139b8eabeb6185aaeef7bf014ed955370265d6a2 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:35:06 -0400 Subject: [PATCH 34/55] Trying to track memory usage --- .../javaclient/integration/CodegenIT.java | 19 +++++++++++++++++++ pom.xml | 1 - 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index 18fcba6b..1a50b422 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -11,6 +11,7 @@ import lombok.NonNull; import lombok.SneakyThrows; import org.apache.commons.io.FileUtils; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -24,6 +25,24 @@ public class CodegenIT { private static final Path OUTPUT_DIR = Paths.get(System.getProperty("user.dir"), "output"); private static final Duration WAIT_FOR_BUILD = Duration.ofMinutes(2); + // TODO delete this + @BeforeAll + static void beforeAll() { + new Thread( + () -> { + while (true) { + final long amount = + Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); + System.out.println("Memory used: %,d".formatted(amount)); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + } + } + }) + .start(); + } + @Test void oktaIdpMinimal() { generateAndBuild("okta-idp-minimal-2025.01.1.yaml", "MyAccount-Management/2025.01.1"); diff --git a/pom.xml b/pom.xml index 804c9165..ade00591 100644 --- a/pom.xml +++ b/pom.xml @@ -250,7 +250,6 @@ false false -Xmx4096m - From b4049750e074dcef14b965d25d3c818806074f18 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:40:26 -0400 Subject: [PATCH 35/55] Updated xmx some more --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ade00591..9ee97077 100644 --- a/pom.xml +++ b/pom.xml @@ -249,7 +249,7 @@ false false - -Xmx4096m + -Xmx6000m From 55982691e513a5dd386ffe77ec907108421e83bc Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:43:34 -0400 Subject: [PATCH 36/55] Progress with memory printing --- .../codegen/javaclient/integration/CodegenIT.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index 1a50b422..53918da9 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -25,7 +25,12 @@ public class CodegenIT { private static final Path OUTPUT_DIR = Paths.get(System.getProperty("user.dir"), "output"); private static final Duration WAIT_FOR_BUILD = Duration.ofMinutes(2); - // TODO delete this + private static long peakMemory = 0; + + /** + * This prints the memory being used on an ongoing basis. This is useful information due to the + * sheer absurd size of some of the specs + */ @BeforeAll static void beforeAll() { new Thread( @@ -33,9 +38,12 @@ static void beforeAll() { while (true) { final long amount = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); - System.out.println("Memory used: %,d".formatted(amount)); + if (amount > peakMemory) { + peakMemory = amount; + } + System.out.printf("Memory Current: %,d Peak: %,d%n", amount, peakMemory); try { - Thread.sleep(1000); + Thread.sleep(3000); } catch (InterruptedException e) { } } From db74bd771e2e550c57e4fef19e01e858eee59012 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Tue, 1 Jul 2025 17:43:49 -0400 Subject: [PATCH 37/55] Progress --- .../openapi/codegen/javaclient/integration/CodegenIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index 53918da9..28d80849 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -29,7 +29,7 @@ public class CodegenIT { /** * This prints the memory being used on an ongoing basis. This is useful information due to the - * sheer absurd size of some of the specs + * sheer absurd size of some of the specs. */ @BeforeAll static void beforeAll() { From b0d3df4ae83ca51be14d7ab823d3c024d931dc28 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 08:50:25 -0400 Subject: [PATCH 38/55] Forcing another run --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 9ee97077..0435d8f6 100644 --- a/pom.xml +++ b/pom.xml @@ -250,6 +250,7 @@ false false -Xmx6000m + From 3943c89672ac0fdd20eaeaa97aa08c6777359b72 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:00:11 -0400 Subject: [PATCH 39/55] Another attempt at getting integration tests to pass --- .github/workflows/core-maven-build.yml | 2 ++ .../openapi/codegen/javaclient/integration/CodegenIT.java | 1 + pom.xml | 3 +-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index 7247f230..026681da 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -93,6 +93,8 @@ jobs: uses: ./.github/actions/setup-java with: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - name: Print PATH + run: echo $PATH - name: Run Integration Tests run: mvn integration-test -Dskip.surefire.tests - name: Upload Integration Test Artifacts diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index 28d80849..bb237644 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -122,6 +122,7 @@ void bitbucket() { } @Test + @Disabled // TODO don't really want to disable this, just trying to make the runner work void radiantlogicCloudmanager() { generateAndBuild("radiantlogic-cloudmanager-1.3.2.json", "Radiantlogic-CloudManager/1.3.2"); } diff --git a/pom.xml b/pom.xml index 0435d8f6..adcb0c45 100644 --- a/pom.xml +++ b/pom.xml @@ -249,8 +249,7 @@ false false - -Xmx6000m - + -Xmx8000m From ce54d20d5b705758ff3d17695f107c097038235c Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:01:13 -0400 Subject: [PATCH 40/55] Another adjustment to process writing --- .../openapi/codegen/javaclient/integration/CodegenIT.java | 1 + 1 file changed, 1 insertion(+) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index bb237644..da2c7ce1 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -193,6 +193,7 @@ private void generateAndBuild( final Process process = new ProcessBuilder("mvn", "clean", "install", "-DskipTests") .directory(outputPath.toFile()) + .redirectErrorStream(true) .inheritIO() .start(); From c1ff13e7174ea950ceb6fd842d51aedd9faf44af Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:06:16 -0400 Subject: [PATCH 41/55] Updated logging --- .../openapi/codegen/javaclient/integration/CodegenIT.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index da2c7ce1..b3ae62f2 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -181,15 +181,18 @@ void brokenDiscriminatorTest() { private void generateAndBuild( @NonNull final String yamlFilename, @NonNull final String relativeOutputPath) { final Path outputPath = OUTPUT_DIR.resolve(relativeOutputPath); + System.out.printf("Cleaning output directory %s%n", outputPath); FileUtils.deleteDirectory(outputPath.toFile()); final URL url = getClass().getClassLoader().getResource("openapi/%s".formatted(yamlFilename)); final Path yamlPath = Paths.get(url.toURI()); - System.out.println("Running test for spec file %s".formatted(yamlPath)); + System.out.printf("Running codegen for spec file %s%n", yamlPath); final Runner runner = new Runner(); final String[] args = new String[] {"-p=%s".formatted(yamlPath.toString())}; runner.run(args); + System.out.printf("Codegen complete. Building generated code at %s%n", outputPath); + final Process process = new ProcessBuilder("mvn", "clean", "install", "-DskipTests") .directory(outputPath.toFile()) @@ -202,5 +205,6 @@ private void generateAndBuild( final int exitValue = process.exitValue(); assertThat(exitValue).isEqualTo(0); + System.out.println("Build of generated code completed successfully."); } } From 9d35d50c967f65c70abc590985b52a67e4564e88 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:09:32 -0400 Subject: [PATCH 42/55] Added more logging --- .../codegen/javaclient/generate/CodeGeneratorExecutor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/codegen-modules/openapi-java-client-codegen/src/main/java/com/radiantlogic/openapi/codegen/javaclient/generate/CodeGeneratorExecutor.java b/codegen-modules/openapi-java-client-codegen/src/main/java/com/radiantlogic/openapi/codegen/javaclient/generate/CodeGeneratorExecutor.java index c8827efd..4795a865 100644 --- a/codegen-modules/openapi-java-client-codegen/src/main/java/com/radiantlogic/openapi/codegen/javaclient/generate/CodeGeneratorExecutor.java +++ b/codegen-modules/openapi-java-client-codegen/src/main/java/com/radiantlogic/openapi/codegen/javaclient/generate/CodeGeneratorExecutor.java @@ -28,6 +28,7 @@ public void generate(final OpenAPI openAPI) { generator.setGeneratorPropertyDefault(CodegenConstants.SKIP_FORM_MODEL, "false"); generator.opts(new ClientOptInput().config(codegen).openAPI(openAPI)).generate(); + log.info("Code generation complete"); } private void prepareOutputDirectory( From abe98df2bc0bfa3dbea0b37b4e38c3bb39dfce89 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:14:48 -0400 Subject: [PATCH 43/55] More upgrades and restoring one test --- .../codegen/javaclient/integration/CodegenIT.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index b3ae62f2..23323a63 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -3,6 +3,8 @@ import static org.assertj.core.api.Assertions.assertThat; import com.radiantlogic.openapi.codegen.javaclient.Runner; +import java.io.BufferedReader; +import java.io.InputStreamReader; import java.net.URL; import java.nio.file.Path; import java.nio.file.Paths; @@ -122,7 +124,6 @@ void bitbucket() { } @Test - @Disabled // TODO don't really want to disable this, just trying to make the runner work void radiantlogicCloudmanager() { generateAndBuild("radiantlogic-cloudmanager-1.3.2.json", "Radiantlogic-CloudManager/1.3.2"); } @@ -197,9 +198,13 @@ private void generateAndBuild( new ProcessBuilder("mvn", "clean", "install", "-DskipTests") .directory(outputPath.toFile()) .redirectErrorStream(true) - .inheritIO() .start(); + try (BufferedReader reader = + new BufferedReader(new InputStreamReader(process.getInputStream()))) { + reader.lines().forEach(System.out::println); + } + final boolean waitSuccess = process.waitFor(WAIT_FOR_BUILD.toMillis(), TimeUnit.MILLISECONDS); assertThat(waitSuccess).withFailMessage("Wait for build of generated code timed out.").isTrue(); From 35930c2bf5900f7d188f3452587439b5d721102c Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:22:46 -0400 Subject: [PATCH 44/55] Digging deeper into problem --- .github/workflows/core-maven-build.yml | 71 ++++++++++--------- .../javaclient/integration/CodegenIT.java | 20 ++++++ 2 files changed, 56 insertions(+), 35 deletions(-) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index 026681da..100f159c 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -48,41 +48,42 @@ jobs: name: project_artifacts path: ./codegen-modules/openapi-java-client-codegen/target/*.jar - run_unit_tests: - runs-on: ubuntu-latest - needs: ['build_artifact'] - steps: - - uses: actions/checkout@v4 - - name: Setup Java - uses: ./.github/actions/setup-java - with: - pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - - name: Run Unit Tests - run: mvn test - - run_pmd: - runs-on: ubuntu-latest - needs: ['build_artifact'] - steps: - - uses: actions/checkout@v4 - - name: Setup Java - uses: ./.github/actions/setup-java - with: - pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - - name: Run PMD - run: mvn pmd:check - - run_spotless: - runs-on: ubuntu-latest - needs: ['build_artifact'] - steps: - - uses: actions/checkout@v4 - - name: Setup Java - uses: ./.github/actions/setup-java - with: - pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - - name: Run Spotless - run: mvn spotless:check +# TODO restore below +# run_unit_tests: +# runs-on: ubuntu-latest +# needs: ['build_artifact'] +# steps: +# - uses: actions/checkout@v4 +# - name: Setup Java +# uses: ./.github/actions/setup-java +# with: +# pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} +# - name: Run Unit Tests +# run: mvn test +# +# run_pmd: +# runs-on: ubuntu-latest +# needs: ['build_artifact'] +# steps: +# - uses: actions/checkout@v4 +# - name: Setup Java +# uses: ./.github/actions/setup-java +# with: +# pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} +# - name: Run PMD +# run: mvn pmd:check +# +# run_spotless: +# runs-on: ubuntu-latest +# needs: ['build_artifact'] +# steps: +# - uses: actions/checkout@v4 +# - name: Setup Java +# uses: ./.github/actions/setup-java +# with: +# pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} +# - name: Run Spotless +# run: mvn spotless:check run_integration_tests: runs-on: ubuntu-latest diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index 23323a63..8aad2957 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -54,6 +54,7 @@ static void beforeAll() { } @Test + @Disabled // TODO delete this void oktaIdpMinimal() { generateAndBuild("okta-idp-minimal-2025.01.1.yaml", "MyAccount-Management/2025.01.1"); } @@ -66,18 +67,21 @@ void oktaManagementMinimal() { } @Test + @Disabled // TODO delete this void oktaOauthMinimal() { generateAndBuild( "okta-oauth-minimal-2025.01.1.yaml", "Okta-OpenID-Connect--OAuth-2.0/2025.01.1"); } @Test + @Disabled // TODO delete this void radiantone() { generateAndBuild( "radiantone-openapi-8.1.4-beta.2-SNAPSHOT.yaml", "RadiantOne-V8-API/8.1.4-beta.2-SNAPSHOT"); } @Test + @Disabled // TODO delete this void gitlabV4() { generateAndBuild("gitlab-v4.yaml", "GitLab-API/v4"); } @@ -89,36 +93,43 @@ void gitlabV4Swagger2() { } @Test + @Disabled // TODO delete this void googleMaps() { generateAndBuild("google-maps-1.22.5.json", "Google-Maps-Platform/1.22.5"); } @Test + @Disabled // TODO delete this void msgraphApplication() { generateAndBuild("msgraph-applications-1.0.yaml", "Applications/v1.0"); } @Test + @Disabled // TODO delete this void msgraphCalendar() { generateAndBuild("msgraph-calendar-1.0.yaml", "Calendar/v1.0"); } @Test + @Disabled // TODO delete this void openai() { generateAndBuild("openai-2.3.0.yaml", "OpenAI-API/2.3.0"); } @Test + @Disabled // TODO delete this void anthropic() { generateAndBuild("anthropic-0.0.0.json", "Anthropic-API/0.0.0"); } @Test + @Disabled // TODO delete this void onepasswordConnect() { generateAndBuild("1password-connect-1.7.1.yaml", "1Password-Connect/1.7.1"); } @Test + @Disabled // TODO delete this void bitbucket() { generateAndBuild("bitbucket-2.0.json", "Bitbucket-API/2.0"); } @@ -129,41 +140,49 @@ void radiantlogicCloudmanager() { } @Test + @Disabled // TODO delete this void swaggerPetstore() { generateAndBuild("swagger-petstore-1.0.26.json", "Swagger-Petstore---OpenAPI-3.0/1.0.26"); } @Test + @Disabled // TODO delete this void harryPotter() { generateAndBuild("harrypotter-1.0.0.yaml", "Harry-Potter-API/1.0.0"); } @Test + @Disabled // TODO delete this void snyk() { generateAndBuild("snyk-1.0.yaml", "Snyk-API/1.0"); } @Test + @Disabled // TODO delete this void sonarqube() { generateAndBuild("sonarqube-2025.4.0.109754.json", "SonarQube-Web-API-v2/2025.4.0.109754"); } @Test + @Disabled // TODO delete this void githubActions() { generateAndBuild("github-actions-v3-1.1.4.yaml", "GitHub-v3-REST-API---actions/1.1.4"); } @Test + @Disabled // TODO delete this void githubActivity() { generateAndBuild("github-activity-v3-1.1.4.yaml", "GitHub-v3-REST-API---activity/1.1.4"); } @Test + @Disabled // TODO delete this void githubApps() { generateAndBuild("github-apps-v3-1.1.4.yaml", "GitHub-v3-REST-API---apps/1.1.4"); } @Test + @Disabled // TODO delete this void githubBilling() { generateAndBuild("github-billing-v3-1.1.4.yaml", "GitHub-v3-REST-API---billing/1.1.4"); } @@ -174,6 +193,7 @@ void githubBilling() { * changes this new test-only spec is required. */ @Test + @Disabled // TODO delete this void brokenDiscriminatorTest() { generateAndBuild("broken-discriminator-test-1.0.0.yaml", "Broken-Discriminator-Test/1.0.0"); } From 1ca6f8de3b60cb793bc718c657bf4fb51f778ce2 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:26:08 -0400 Subject: [PATCH 45/55] Process refactoring --- .../codegen/javaclient/integration/CodegenIT.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index 8aad2957..b1b95b54 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -214,8 +214,16 @@ private void generateAndBuild( System.out.printf("Codegen complete. Building generated code at %s%n", outputPath); + final int exitValue = runProcess("mvn clean install -DskipTests"); + + assertThat(exitValue).isEqualTo(0); + System.out.println("Build of generated code completed successfully."); + } + + @SneakyThrows + private int runProcess(@NonNull final String command) { final Process process = - new ProcessBuilder("mvn", "clean", "install", "-DskipTests") + new ProcessBuilder(command.split(" ")) .directory(outputPath.toFile()) .redirectErrorStream(true) .start(); @@ -227,9 +235,6 @@ private void generateAndBuild( final boolean waitSuccess = process.waitFor(WAIT_FOR_BUILD.toMillis(), TimeUnit.MILLISECONDS); assertThat(waitSuccess).withFailMessage("Wait for build of generated code timed out.").isTrue(); - - final int exitValue = process.exitValue(); - assertThat(exitValue).isEqualTo(0); - System.out.println("Build of generated code completed successfully."); + return process.exitValue(); } } From 6549c94a4cc0de3fed932a4a62de90d0aff46f0f Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:27:22 -0400 Subject: [PATCH 46/55] Another attempt --- .../codegen/javaclient/integration/CodegenIT.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index b1b95b54..9e2c15fb 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -6,6 +6,7 @@ import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; +import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.time.Duration; @@ -212,19 +213,23 @@ private void generateAndBuild( final String[] args = new String[] {"-p=%s".formatted(yamlPath.toString())}; runner.run(args); + // TODO delete this block + System.out.println("OUTPUT EXISTS: " + Files.exists(outputPath)); + runProcess("echo $PATH", outputPath); + System.out.printf("Codegen complete. Building generated code at %s%n", outputPath); - final int exitValue = runProcess("mvn clean install -DskipTests"); + final int exitValue = runProcess("mvn clean install -DskipTests", outputPath); assertThat(exitValue).isEqualTo(0); System.out.println("Build of generated code completed successfully."); } @SneakyThrows - private int runProcess(@NonNull final String command) { + private int runProcess(@NonNull final String command, @NonNull final Path directory) { final Process process = new ProcessBuilder(command.split(" ")) - .directory(outputPath.toFile()) + .directory(directory.toFile()) .redirectErrorStream(true) .start(); From 8c7dae4f8c89e2cffebd8e5b92816556435cf7d4 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:31:10 -0400 Subject: [PATCH 47/55] Another attempt --- .../openapi/codegen/javaclient/integration/CodegenIT.java | 1 + 1 file changed, 1 insertion(+) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index 9e2c15fb..ad6b535c 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -215,6 +215,7 @@ private void generateAndBuild( // TODO delete this block System.out.println("OUTPUT EXISTS: " + Files.exists(outputPath)); + Files.list(OUTPUT_DIR).forEach(output -> System.out.println("OUTPUT: " + output)); runProcess("echo $PATH", outputPath); System.out.printf("Codegen complete. Building generated code at %s%n", outputPath); From e4d0db96654eebcf0aef15bf5955e2c35a91a42c Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:34:00 -0400 Subject: [PATCH 48/55] Another attempt --- .../openapi/codegen/javaclient/integration/CodegenIT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index ad6b535c..db81dced 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -215,7 +215,7 @@ private void generateAndBuild( // TODO delete this block System.out.println("OUTPUT EXISTS: " + Files.exists(outputPath)); - Files.list(OUTPUT_DIR).forEach(output -> System.out.println("OUTPUT: " + output)); + System.out.println("PARENT EXISTS: " + Files.exists(outputPath.getParent())); runProcess("echo $PATH", outputPath); System.out.printf("Codegen complete. Building generated code at %s%n", outputPath); From 0fb47c764972feb0fa98e483f8701f22fb992a24 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:34:42 -0400 Subject: [PATCH 49/55] More adjusting --- .../openapi/codegen/javaclient/integration/CodegenIT.java | 1 + 1 file changed, 1 insertion(+) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index db81dced..9c04c5e0 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -216,6 +216,7 @@ private void generateAndBuild( // TODO delete this block System.out.println("OUTPUT EXISTS: " + Files.exists(outputPath)); System.out.println("PARENT EXISTS: " + Files.exists(outputPath.getParent())); + Files.list(OUTPUT_DIR).forEach(output -> System.out.println("OUTPUT: " + output)); runProcess("echo $PATH", outputPath); System.out.printf("Codegen complete. Building generated code at %s%n", outputPath); From 8029d3061c97c606bc7bda927530134c76e00df2 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:34:56 -0400 Subject: [PATCH 50/55] More adjusting --- .../openapi/codegen/javaclient/integration/CodegenIT.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index 9c04c5e0..3cd02ab4 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -214,8 +214,9 @@ private void generateAndBuild( runner.run(args); // TODO delete this block - System.out.println("OUTPUT EXISTS: " + Files.exists(outputPath)); - System.out.println("PARENT EXISTS: " + Files.exists(outputPath.getParent())); + System.out.println("OUTPUT EXISTS: " + outputPath + " " + Files.exists(outputPath)); + System.out.println( + "PARENT EXISTS: " + outputPath.getParent() + " " + Files.exists(outputPath.getParent())); Files.list(OUTPUT_DIR).forEach(output -> System.out.println("OUTPUT: " + output)); runProcess("echo $PATH", outputPath); From 594c19a53dca2566f5edcdba35b9dd81e0ca670f Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:39:33 -0400 Subject: [PATCH 51/55] Adding more debugging --- .github/workflows/core-maven-build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index 100f159c..92644bbe 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -98,6 +98,15 @@ jobs: run: echo $PATH - name: Run Integration Tests run: mvn integration-test -Dskip.surefire.tests + # TODO delete below + - name: Debug Failure + if: failure() + run: | + whoami + ls -l + ls -l output + ls -l output/RadiantLogic-CloudManager + ls -l output/RadiantLogic-CloudManager/1.3.2 - name: Upload Integration Test Artifacts uses: actions/upload-artifact@v4 with: From 51c18d76ae7490dcb1856252fd431e84e773d06b Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:42:24 -0400 Subject: [PATCH 52/55] Progress --- .github/workflows/core-maven-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index 92644bbe..dd867c78 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -104,9 +104,9 @@ jobs: run: | whoami ls -l - ls -l output - ls -l output/RadiantLogic-CloudManager - ls -l output/RadiantLogic-CloudManager/1.3.2 + ls -l codegen-modules/openapi-java-client-codegen/output + ls -l codegen-modules/openapi-java-client-codegen/output/RadiantLogic-CloudManager + ls -l codegen-modules/openapi-java-client-codegen/output/RadiantLogic-CloudManager/1.3.2 - name: Upload Integration Test Artifacts uses: actions/upload-artifact@v4 with: From 76dc508b00e1606c7224cd5670d1047111ec5888 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:46:30 -0400 Subject: [PATCH 53/55] Another adjustment --- .github/workflows/core-maven-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index dd867c78..ac053b98 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -94,6 +94,7 @@ jobs: uses: ./.github/actions/setup-java with: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + # TODO delete below - name: Print PATH run: echo $PATH - name: Run Integration Tests @@ -103,6 +104,7 @@ jobs: if: failure() run: | whoami + pwd ls -l ls -l codegen-modules/openapi-java-client-codegen/output ls -l codegen-modules/openapi-java-client-codegen/output/RadiantLogic-CloudManager From b5ffe7fe0905625a5b20fd3c9eb20e7d220aeb0c Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:50:27 -0400 Subject: [PATCH 54/55] Cleanup --- .../javaclient/integration/CodegenIT.java | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java index 3cd02ab4..25783539 100644 --- a/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java +++ b/codegen-modules/openapi-java-client-codegen/src/test/java/com/radiantlogic/openapi/codegen/javaclient/integration/CodegenIT.java @@ -6,7 +6,6 @@ import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; -import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.time.Duration; @@ -55,7 +54,6 @@ static void beforeAll() { } @Test - @Disabled // TODO delete this void oktaIdpMinimal() { generateAndBuild("okta-idp-minimal-2025.01.1.yaml", "MyAccount-Management/2025.01.1"); } @@ -68,21 +66,18 @@ void oktaManagementMinimal() { } @Test - @Disabled // TODO delete this void oktaOauthMinimal() { generateAndBuild( "okta-oauth-minimal-2025.01.1.yaml", "Okta-OpenID-Connect--OAuth-2.0/2025.01.1"); } @Test - @Disabled // TODO delete this void radiantone() { generateAndBuild( "radiantone-openapi-8.1.4-beta.2-SNAPSHOT.yaml", "RadiantOne-V8-API/8.1.4-beta.2-SNAPSHOT"); } @Test - @Disabled // TODO delete this void gitlabV4() { generateAndBuild("gitlab-v4.yaml", "GitLab-API/v4"); } @@ -94,43 +89,36 @@ void gitlabV4Swagger2() { } @Test - @Disabled // TODO delete this void googleMaps() { generateAndBuild("google-maps-1.22.5.json", "Google-Maps-Platform/1.22.5"); } @Test - @Disabled // TODO delete this void msgraphApplication() { generateAndBuild("msgraph-applications-1.0.yaml", "Applications/v1.0"); } @Test - @Disabled // TODO delete this void msgraphCalendar() { generateAndBuild("msgraph-calendar-1.0.yaml", "Calendar/v1.0"); } @Test - @Disabled // TODO delete this void openai() { generateAndBuild("openai-2.3.0.yaml", "OpenAI-API/2.3.0"); } @Test - @Disabled // TODO delete this void anthropic() { generateAndBuild("anthropic-0.0.0.json", "Anthropic-API/0.0.0"); } @Test - @Disabled // TODO delete this void onepasswordConnect() { generateAndBuild("1password-connect-1.7.1.yaml", "1Password-Connect/1.7.1"); } @Test - @Disabled // TODO delete this void bitbucket() { generateAndBuild("bitbucket-2.0.json", "Bitbucket-API/2.0"); } @@ -141,49 +129,41 @@ void radiantlogicCloudmanager() { } @Test - @Disabled // TODO delete this void swaggerPetstore() { generateAndBuild("swagger-petstore-1.0.26.json", "Swagger-Petstore---OpenAPI-3.0/1.0.26"); } @Test - @Disabled // TODO delete this void harryPotter() { generateAndBuild("harrypotter-1.0.0.yaml", "Harry-Potter-API/1.0.0"); } @Test - @Disabled // TODO delete this void snyk() { generateAndBuild("snyk-1.0.yaml", "Snyk-API/1.0"); } @Test - @Disabled // TODO delete this void sonarqube() { generateAndBuild("sonarqube-2025.4.0.109754.json", "SonarQube-Web-API-v2/2025.4.0.109754"); } @Test - @Disabled // TODO delete this void githubActions() { generateAndBuild("github-actions-v3-1.1.4.yaml", "GitHub-v3-REST-API---actions/1.1.4"); } @Test - @Disabled // TODO delete this void githubActivity() { generateAndBuild("github-activity-v3-1.1.4.yaml", "GitHub-v3-REST-API---activity/1.1.4"); } @Test - @Disabled // TODO delete this void githubApps() { generateAndBuild("github-apps-v3-1.1.4.yaml", "GitHub-v3-REST-API---apps/1.1.4"); } @Test - @Disabled // TODO delete this void githubBilling() { generateAndBuild("github-billing-v3-1.1.4.yaml", "GitHub-v3-REST-API---billing/1.1.4"); } @@ -194,7 +174,6 @@ void githubBilling() { * changes this new test-only spec is required. */ @Test - @Disabled // TODO delete this void brokenDiscriminatorTest() { generateAndBuild("broken-discriminator-test-1.0.0.yaml", "Broken-Discriminator-Test/1.0.0"); } @@ -213,13 +192,6 @@ private void generateAndBuild( final String[] args = new String[] {"-p=%s".formatted(yamlPath.toString())}; runner.run(args); - // TODO delete this block - System.out.println("OUTPUT EXISTS: " + outputPath + " " + Files.exists(outputPath)); - System.out.println( - "PARENT EXISTS: " + outputPath.getParent() + " " + Files.exists(outputPath.getParent())); - Files.list(OUTPUT_DIR).forEach(output -> System.out.println("OUTPUT: " + output)); - runProcess("echo $PATH", outputPath); - System.out.printf("Codegen complete. Building generated code at %s%n", outputPath); final int exitValue = runProcess("mvn clean install -DskipTests", outputPath); From c5f642fb4692f2410a8b6e766ccfc8ba9ece9d57 Mon Sep 17 00:00:00 2001 From: Craig Miller Date: Wed, 2 Jul 2025 09:51:06 -0400 Subject: [PATCH 55/55] Cleanup --- .github/workflows/core-maven-build.yml | 84 +++++++++++--------------- 1 file changed, 35 insertions(+), 49 deletions(-) diff --git a/.github/workflows/core-maven-build.yml b/.github/workflows/core-maven-build.yml index ac053b98..7247f230 100644 --- a/.github/workflows/core-maven-build.yml +++ b/.github/workflows/core-maven-build.yml @@ -48,42 +48,41 @@ jobs: name: project_artifacts path: ./codegen-modules/openapi-java-client-codegen/target/*.jar -# TODO restore below -# run_unit_tests: -# runs-on: ubuntu-latest -# needs: ['build_artifact'] -# steps: -# - uses: actions/checkout@v4 -# - name: Setup Java -# uses: ./.github/actions/setup-java -# with: -# pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} -# - name: Run Unit Tests -# run: mvn test -# -# run_pmd: -# runs-on: ubuntu-latest -# needs: ['build_artifact'] -# steps: -# - uses: actions/checkout@v4 -# - name: Setup Java -# uses: ./.github/actions/setup-java -# with: -# pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} -# - name: Run PMD -# run: mvn pmd:check -# -# run_spotless: -# runs-on: ubuntu-latest -# needs: ['build_artifact'] -# steps: -# - uses: actions/checkout@v4 -# - name: Setup Java -# uses: ./.github/actions/setup-java -# with: -# pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} -# - name: Run Spotless -# run: mvn spotless:check + run_unit_tests: + runs-on: ubuntu-latest + needs: ['build_artifact'] + steps: + - uses: actions/checkout@v4 + - name: Setup Java + uses: ./.github/actions/setup-java + with: + pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - name: Run Unit Tests + run: mvn test + + run_pmd: + runs-on: ubuntu-latest + needs: ['build_artifact'] + steps: + - uses: actions/checkout@v4 + - name: Setup Java + uses: ./.github/actions/setup-java + with: + pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - name: Run PMD + run: mvn pmd:check + + run_spotless: + runs-on: ubuntu-latest + needs: ['build_artifact'] + steps: + - uses: actions/checkout@v4 + - name: Setup Java + uses: ./.github/actions/setup-java + with: + pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} + - name: Run Spotless + run: mvn spotless:check run_integration_tests: runs-on: ubuntu-latest @@ -94,21 +93,8 @@ jobs: uses: ./.github/actions/setup-java with: pom_artifact_name: ${{ inputs.is_release && 'release_pom_xml' || '' }} - # TODO delete below - - name: Print PATH - run: echo $PATH - name: Run Integration Tests run: mvn integration-test -Dskip.surefire.tests - # TODO delete below - - name: Debug Failure - if: failure() - run: | - whoami - pwd - ls -l - ls -l codegen-modules/openapi-java-client-codegen/output - ls -l codegen-modules/openapi-java-client-codegen/output/RadiantLogic-CloudManager - ls -l codegen-modules/openapi-java-client-codegen/output/RadiantLogic-CloudManager/1.3.2 - name: Upload Integration Test Artifacts uses: actions/upload-artifact@v4 with: