From de880aab682223ef1a7ab2bb5452b9ac3b7378cd Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Fri, 13 Sep 2024 19:52:17 -0400 Subject: [PATCH 1/4] JDK 22 --- .github/dependabot.yml | 25 +++++++++++++++++ .github/workflows/dependabot-merge.yml | 27 +++++++++++++++++++ .github/workflows/main.yml | 2 +- Dockerfile | 2 +- pom.xml | 2 +- .../security/ServerSecurityConfig.java | 1 + 6 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/dependabot-merge.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..71d2069 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,25 @@ +version: 2 +updates: + - package-ecosystem: "maven" + directory: "/" + schedule: + interval: weekly + open-pull-requests-limit: 10 + groups: + dependencies: + patterns: + - "*" + labels: + - "dependencies" + target-branch: "master" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + commit-message: + prefix: "[workflow]" + labels: + - "dependencies" + target-branch: "master" \ No newline at end of file diff --git a/.github/workflows/dependabot-merge.yml b/.github/workflows/dependabot-merge.yml new file mode 100644 index 0000000..0328be6 --- /dev/null +++ b/.github/workflows/dependabot-merge.yml @@ -0,0 +1,27 @@ +name: Dependabot auto-merge +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Approve a PR + run: gh pr review --approve "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8617340..dbe1fa3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: - name: Setup Java uses: actions/setup-java@v1 with: - java-version: "21" + java-version: "22" java-package: jdk architecture: x64 diff --git a/Dockerfile b/Dockerfile index 6913f27..ab84ae1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM amazoncorretto:21-alpine-jdk as jreBuilder +FROM amazoncorretto:22-alpine-jdk as jreBuilder RUN apk add binutils RUN jlink \ diff --git a/pom.xml b/pom.xml index 475aadb..92fc0bd 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ MangaBackend RSocket API for Manga-Spring Site - 21 + 22 9.10 com.mangasite.MangaBackendApplication com.mangasite.MangaBackendApplication diff --git a/src/main/java/com/mangasite/security/ServerSecurityConfig.java b/src/main/java/com/mangasite/security/ServerSecurityConfig.java index ab847d2..3cef75b 100644 --- a/src/main/java/com/mangasite/security/ServerSecurityConfig.java +++ b/src/main/java/com/mangasite/security/ServerSecurityConfig.java @@ -30,6 +30,7 @@ public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) .httpBasic(); return http.build(); } + // RSocket JWT Security Config @Bean public PayloadSocketAcceptorInterceptor rsocketTokenAcceptor(RSocketSecurity security) { From eb93836372f759bb4bdd2c0804adbe44589116b4 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Fri, 13 Sep 2024 19:54:24 -0400 Subject: [PATCH 2/4] update workflow --- .github/workflows/build.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 3 +-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..83769a8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: Build + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + runs-on: ${{ matrix.os }} + permissions: + contents: read + packages: write + strategy: + fail-fast: false + matrix: + java_version: [22] + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v4 + - name: Set up Java + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java_version }} + distribution: 'corretto' + - name: Maven cache + uses: actions/cache@v4 + env: + cache-name: maven-cache + with: + path: + ~/.m2 + key: build-${{ env.cache-name }} + - name: Build with Maven + run: mvn clean test \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dbe1fa3..e7221fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,8 +3,7 @@ name: Compile/Deploy Native Image To Fly.io env: FLY_API_TOKEN: ${{ secrets.FLY_AUTH }} on: - # Triggers the workflow on push or pull request events but only for the main branch - pull_request: + push: branches: [main] # Your workflows jobs. From 0afc7dbe1aa679e0cf6415bd212abc259ea61838 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Thu, 26 Sep 2024 23:47:53 -0400 Subject: [PATCH 3/4] java23 --- .github/workflows/build.yml | 6 +++--- .github/workflows/main.yml | 7 +++---- Dockerfile | 2 +- pom.xml | 3 ++- .../java/com/mangasite/rsocket/RSocketMangaController.java | 3 ++- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83769a8..87e1261 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,10 +17,10 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Java - uses: actions/setup-java@v4 + uses: oracle-actions/setup-java@v1 with: - java-version: ${{ matrix.java_version }} - distribution: 'corretto' + website: jdk.java.net + release: GA - name: Maven cache uses: actions/cache@v4 env: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7221fe..e50a49d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,11 +19,10 @@ jobs: uses: actions/checkout@v2 - name: Setup Java - uses: actions/setup-java@v1 + uses: oracle-actions/setup-java@v1 with: - java-version: "22" - java-package: jdk - architecture: x64 + website: jdk.java.net + release: GA - name: Setup Docker Buildx uses: docker/setup-buildx-action@v1 diff --git a/Dockerfile b/Dockerfile index ab84ae1..0fd86c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM amazoncorretto:22-alpine-jdk as jreBuilder +FROM amazoncorretto:23-alpine-jdk as jreBuilder RUN apk add binutils RUN jlink \ diff --git a/pom.xml b/pom.xml index 92fc0bd..8fed098 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,8 @@ MangaBackend RSocket API for Manga-Spring Site - 22 + 23 + full 9.10 com.mangasite.MangaBackendApplication com.mangasite.MangaBackendApplication diff --git a/src/main/java/com/mangasite/rsocket/RSocketMangaController.java b/src/main/java/com/mangasite/rsocket/RSocketMangaController.java index b3494cb..8922563 100644 --- a/src/main/java/com/mangasite/rsocket/RSocketMangaController.java +++ b/src/main/java/com/mangasite/rsocket/RSocketMangaController.java @@ -6,6 +6,7 @@ import com.mangasite.domain.Manga; import com.mangasite.services.MangaService; +import com.mongodb.MongoTimeoutException; import io.rsocket.exceptions.CustomRSocketException; import jakarta.inject.Singleton; @@ -24,7 +25,7 @@ public RSocketMangaController(MangaService service) { @MessageMapping("get-mangas") public Flux getAll() { - return service.findAll(); + return service.findAll().doOnError(MongoTimeoutException.class, e -> System.exit(0)); } @MessageMapping("get-manga-{id}") From 4d71bdb0b5637939509d3b6ded1ba1c3ebe75449 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Thu, 26 Sep 2024 23:54:08 -0400 Subject: [PATCH 4/4] Update pom.xml --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 8fed098..66a25ca 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.springframework.boot spring-boot-starter-parent - 3.1.5 + 3.3.4 com.mangasite @@ -36,12 +36,12 @@ io.avaje avaje-config - 3.10 + 4.0 com.auth0 java-jwt - 4.2.0 + 4.4.0 @@ -93,7 +93,7 @@ com.google.errorprone error_prone_core - 2.15.0 + 2.32.0 provided