From 3187eceb2214390fb26c9795ec644b4ea3ad226d Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Mon, 13 Jun 2022 14:47:51 -0500 Subject: [PATCH 01/19] Real-development-mode ready versions of pom and CI scripts --- .circleci/config.yml | 77 +++++++++++++++++++++++++++++++++++++ .circleci/mvn-settings.xml | 9 +++++ .github/workflows/maven.yml | 35 ----------------- pom.xml | 35 +++++++++++++---- 4 files changed, 113 insertions(+), 43 deletions(-) create mode 100644 .circleci/config.yml create mode 100644 .circleci/mvn-settings.xml delete mode 100644 .github/workflows/maven.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..7c158891 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,77 @@ +version: 2.1 + +executors: + java17: + docker: + - image: 'cimg/openjdk:17.0' + resource_class: small + +orbs: + slack: circleci/slack@4.10.1 + +commands: + run_maven: + parameters: + maven_subcommand: + default: test + type: string + steps: + - checkout + - restore_cache: + keys: + - v1-dependencies-{{ checksum "pom.xml" }} + - run: + name: Run Maven + command: | + mvn -s .circleci/mvn-settings.xml << parameters.maven_subcommand >> + - run: + name: Save test results + command: | + mkdir -p ~/test-results/junit/ + find . -type f -regex ".*/target/surefire-reports/.*xml" -exec cp {} ~/test-results/junit/ \; + when: always + - store_test_results: + path: ~/test-results + - save_cache: + paths: + - ~/.m2 + key: v1-dependencies-{{ checksum "pom.xml" }} + +jobs: + mvn_test: + executor: java17 + steps: + - run_maven: + maven_subcommand: test + - slack/notify: + event: fail + + mvn_deploy: + executor: java17 + steps: + - run_maven: + maven_subcommand: deploy + - slack/notify: + event: always + +workflows: + test_only: + jobs: + - mvn_test: + context: [ qqq-maven-registry-credentials, kingsrook-slack ] + filters: + branches: + ignore: /dev/ + tags: + ignore: /version-.*/ + + deploy: + jobs: + - mvn_deploy: + context: [ qqq-maven-registry-credentials, kingsrook-slack ] + filters: + branches: + only: /dev/ + tags: + only: /version-.*/ + diff --git a/.circleci/mvn-settings.xml b/.circleci/mvn-settings.xml new file mode 100644 index 00000000..b2a345f0 --- /dev/null +++ b/.circleci/mvn-settings.xml @@ -0,0 +1,9 @@ + + + + github-qqq-maven-registry + ${env.QQQ_MAVEN_REGISTRY_USERNAME} + ${env.QQQ_MAVEN_REGISTRY_PASSWORD} + + + diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index 80d00dfd..00000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'adopt' - cache: maven - - name: maven-settings-xml-action - uses: whelk-io/maven-settings-xml-action@v20 - with: - servers: '[{ "id": "github-qqq-maven-registry", "username": "${{ secrets.QQQ_MAVEN_REGISTRY_USERNAME }}", "password": "${{ secrets.QQQ_MAVEN_REGISTRY_PASSWORD }}" }]' - repositories: '[{ "id": "github-qqq-maven-registry", "url": "https://maven.pkg.github.com/Kingsrook/qqq-maven-registry", "snapshots": { "enabled": "true" }}]' - - name: Build with Maven - run: mvn -B package --file pom.xml - - name: Publish to GitHub Packages Apache Maven - run: mvn deploy - env: - GITHUB_TOKEN: ${{ github.token }} diff --git a/pom.xml b/pom.xml index 50839179..6cc2d8ac 100644 --- a/pom.xml +++ b/pom.xml @@ -20,14 +20,18 @@ ~ along with this program. If not, see . --> - + 4.0.0 com.kingsrook.qqq qqq-middleware-javalin - 0.0-SNAPSHOT + 0.0.0-SNAPSHOT + + + scm:git:git@github.com:Kingsrook/qqq-middleware-javalin.git + scm:git:git@github.com:Kingsrook/qqq-middleware-javalin.git + HEAD + @@ -47,12 +51,12 @@ com.kingsrook.qqq qqq-backend-core - 0.0-SNAPSHOT + 0.0.0-SNAPSHOT com.kingsrook.qqq qqq-backend-module-rdbms - 0.0-SNAPSHOT + 0.0.0-SNAPSHOT test @@ -165,13 +169,28 @@ + + com.amashchenko.maven.plugin + gitflow-maven-plugin + 1.18.0 + + + main + dev + version- + + true + install + true + 1 + + - - github + github-qqq-maven-registry GitHub QQQ Maven Registry https://maven.pkg.github.com/Kingsrook/qqq-maven-registry From 0c18c377e6decea0b33ebe8a79cf19bf67ad8388 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Mon, 13 Jun 2022 14:50:01 -0500 Subject: [PATCH 02/19] Update to strip away comment lines (e.g., copyright) and use -- comments --- .../qqq/backend/javalin/TestUtils.java | 1 + src/test/resources/prime-test-database.sql | 40 +++++++++---------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/test/java/com/kingsrook/qqq/backend/javalin/TestUtils.java b/src/test/java/com/kingsrook/qqq/backend/javalin/TestUtils.java index 6d3c4e8f..7b2e36ae 100644 --- a/src/test/java/com/kingsrook/qqq/backend/javalin/TestUtils.java +++ b/src/test/java/com/kingsrook/qqq/backend/javalin/TestUtils.java @@ -57,6 +57,7 @@ public class TestUtils InputStream primeTestDatabaseSqlStream = TestUtils.class.getResourceAsStream("/prime-test-database.sql"); assertNotNull(primeTestDatabaseSqlStream); List lines = (List) IOUtils.readLines(primeTestDatabaseSqlStream); + lines = lines.stream().filter(line -> !line.startsWith("-- ")).toList(); String joinedSQL = String.join("\n", lines); for(String sql : joinedSQL.split(";")) { diff --git a/src/test/resources/prime-test-database.sql b/src/test/resources/prime-test-database.sql index 6227f249..0780239c 100644 --- a/src/test/resources/prime-test-database.sql +++ b/src/test/resources/prime-test-database.sql @@ -1,23 +1,23 @@ -/* - * QQQ - Low-code Application Framework for Engineers. - * Copyright (C) 2021-2022. Kingsrook, LLC - * 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States - * contact@kingsrook.com - * https://github.com/Kingsrook/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ +-- +-- QQQ - Low-code Application Framework for Engineers. +-- Copyright (C) 2021-2022. Kingsrook, LLC +-- 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States +-- contact@kingsrook.com +-- https://github.com/Kingsrook/ +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Affero General Public License as +-- published by the Free Software Foundation, either version 3 of the +-- License, or (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Affero General Public License for more details. +-- +-- You should have received a copy of the GNU Affero General Public License +-- along with this program. If not, see . +-- DROP TABLE IF EXISTS person; CREATE TABLE person From 3069003083d010f76b7bb4380b80dec51c4b43ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 20:04:08 +0000 Subject: [PATCH 03/19] Bump log4j-core from 2.15.0 to 2.17.1 Bumps log4j-core from 2.15.0 to 2.17.1. --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-core dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6cc2d8ac..6c3e7db1 100644 --- a/pom.xml +++ b/pom.xml @@ -108,7 +108,7 @@ org.apache.logging.log4j log4j-core - 2.15.0 + 2.17.1 org.junit.jupiter From f6fff7ca2517a08101306616ee4921702a7f47cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 20:25:19 +0000 Subject: [PATCH 04/19] Bump h2 from 1.4.197 to 2.1.210 Bumps [h2](https://github.com/h2database/h2database) from 1.4.197 to 2.1.210. - [Release notes](https://github.com/h2database/h2database/releases) - [Commits](https://github.com/h2database/h2database/compare/version-1.4.197...version-2.1.210) --- updated-dependencies: - dependency-name: com.h2database:h2 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6c3e7db1..da3cd77e 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ com.h2database h2 - 1.4.197 + 2.1.210 test From e3a7105b9960dd4f2fac81d086afb4ce5495e72a Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Mon, 13 Jun 2022 15:27:01 -0500 Subject: [PATCH 05/19] Fixing test for updated version of h2 --- .../qqq/backend/javalin/QJavalinImplementationTest.java | 1 + src/test/resources/prime-test-database.sql | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/kingsrook/qqq/backend/javalin/QJavalinImplementationTest.java b/src/test/java/com/kingsrook/qqq/backend/javalin/QJavalinImplementationTest.java index 5f17251a..06189301 100644 --- a/src/test/java/com/kingsrook/qqq/backend/javalin/QJavalinImplementationTest.java +++ b/src/test/java/com/kingsrook/qqq/backend/javalin/QJavalinImplementationTest.java @@ -203,6 +203,7 @@ class QJavalinImplementationTest Map body = new HashMap<>(); body.put("firstName", "Bobby"); body.put("lastName", "Hull"); + body.put("email", "bobby@hull.com"); HttpResponse response = Unirest.post(BASE_URL + "/data/person") .header("Content-Type", "application/json") diff --git a/src/test/resources/prime-test-database.sql b/src/test/resources/prime-test-database.sql index 0780239c..be858987 100644 --- a/src/test/resources/prime-test-database.sql +++ b/src/test/resources/prime-test-database.sql @@ -22,7 +22,7 @@ DROP TABLE IF EXISTS person; CREATE TABLE person ( - id SERIAL, + id INT AUTO_INCREMENT, create_date TIMESTAMP DEFAULT now(), modify_date TIMESTAMP DEFAULT now(), From 826455f79ec47a9ea760b865501cb48778b45310 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 20:30:58 +0000 Subject: [PATCH 06/19] Bump log4j-api from 2.15.0 to 2.17.1 Bumps log4j-api from 2.15.0 to 2.17.1. --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-api dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index da3cd77e..05c9b813 100644 --- a/pom.xml +++ b/pom.xml @@ -103,7 +103,7 @@ org.apache.logging.log4j log4j-api - 2.15.0 + 2.17.1 org.apache.logging.log4j From b453ab85dbbd470cc4a034318e411f2f9b718eed Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Mon, 13 Jun 2022 15:50:56 -0500 Subject: [PATCH 07/19] Fixed github link in License --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index cffb2382..3920b9a6 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,7 @@ This is a qqq middleware module, providing [javalin](https://javalin.io) access QQQ - Low-code Application Framework for Engineers. \ Copyright (C) 2022. Kingsrook, LLC \ 651 N Broad St Ste 205 # 6917 | Middletown DE 19709 | United States \ -contact@kingsrook.com -https://github.com/Kingsrook/intellij-commentator-plugin +contact@kingsrook.com | https://github.com/Kingsrook/ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as From 399733a2b0c56a6dc9295fad6eaf04d6c963eaf5 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Tue, 14 Jun 2022 12:19:47 -0500 Subject: [PATCH 08/19] Removing slf4j-api and redundant slf4j-simple; bumping log4j to 2.17.2 and junit to 5.8.2 --- pom.xml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 05c9b813..ebb1132b 100644 --- a/pom.xml +++ b/pom.xml @@ -81,17 +81,7 @@ org.slf4j slf4j-simple - 1.7.30 - - - org.slf4j - slf4j-api - 1.7.30 - - - org.slf4j - slf4j-simple - 1.7.30 + 1.7.36 @@ -103,17 +93,17 @@ org.apache.logging.log4j log4j-api - 2.17.1 + 2.17.2 org.apache.logging.log4j log4j-core - 2.17.1 + 2.17.2 org.junit.jupiter junit-jupiter-engine - 5.8.1 + 5.8.2 test From 9460a2133e599e7419a1799dca2eb80996c18972 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Tue, 28 Jun 2022 12:20:23 -0500 Subject: [PATCH 09/19] Update to build on snapshot tags --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c158891..0ef02745 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ workflows: branches: ignore: /dev/ tags: - ignore: /version-.*/ + ignore: /(version|snapshot)-.*/ deploy: jobs: @@ -73,5 +73,5 @@ workflows: branches: only: /dev/ tags: - only: /version-.*/ + only: /(version|snapshot)-.*/ From 5c9a12bf5f7a2600a1e800fcdb4222b7e3fafdb5 Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Tue, 28 Jun 2022 12:20:29 -0500 Subject: [PATCH 10/19] Update to sync with other modules --- checkstyle.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/checkstyle.xml b/checkstyle.xml index dbaa3479..76f872ed 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -46,6 +46,7 @@ --> + @@ -171,7 +172,7 @@ - +