From ea87508a65ef1ea6aa9fa430ffdc28a3990b586e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 10:57:12 +0200 Subject: [PATCH 1/9] Bump org.springdoc:springdoc-openapi-ui from 1.7.0 to 1.8.0 (#144) Bumps org.springdoc:springdoc-openapi-ui from 1.7.0 to 1.8.0. --- updated-dependencies: - dependency-name: org.springdoc:springdoc-openapi-ui dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 25648a2..98b5944 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ org.springdoc springdoc-openapi-ui - 1.7.0 + 1.8.0 com.zaxxer From 0a668dca6481aa30517137c921be27eb1e8ad234 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 11:09:29 +0200 Subject: [PATCH 2/9] Bump com.squareup.okhttp3:okhttp from 4.11.0 to 4.12.0 (#145) * Bump com.squareup.okhttp3:okhttp from 4.11.0 to 4.12.0 Bumps [com.squareup.okhttp3:okhttp](https://github.com/square/okhttp) from 4.11.0 to 4.12.0. - [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/okhttp/compare/parent-4.11.0...parent-4.12.0) --- updated-dependencies: - dependency-name: com.squareup.okhttp3:okhttp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * oppdatering prometheus --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Klara M Helgemo --- pom.xml | 2 +- src/main/resources/application-local.properties | 2 +- src/main/resources/application.properties | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 98b5944..dc8c246 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ com.squareup.okhttp3 okhttp - 4.11.0 + 4.12.0 diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index b9c2a43..b030811 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -4,7 +4,7 @@ management.endpoint.metrics.enabled=true management.endpoints.web.base-path=/internal management.endpoints.web.exposure.include=* management.endpoint.prometheus.enabled=true -management.metrics.export.prometheus.enabled=true +management.prometheus.metrics.export.enabled=true # Vi migrerer databasen med flyway manuelt spring.flyway.enabled=false diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 83faa6e..257c120 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,8 +5,8 @@ management.endpoint.metrics.enabled=true management.endpoints.web.base-path=/internal management.endpoints.web.exposure.include=prometheus,health management.endpoint.prometheus.enabled=true -management.metrics.export.prometheus.enabled=true -management.health.probes.enabled=true +management.prometheus.metrics.export.enabled=true +management.endpoint.health.probes.enabled=true management.endpoint.health.group.liveness.include=livenessState # Vi migrerer databasen med flyway manuelt From 155726483a23710af62858d99f9fd7537759bbec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 11:15:42 +0200 Subject: [PATCH 3/9] Bump softprops/action-gh-release from 1 to 2 in /.github/workflows (#146) Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Klara M Helgemo --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b517ab9..3ab6aaa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -87,7 +87,7 @@ jobs: VAR: image=${{ needs.test-build-and-push.outputs.image }} - name: Create release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: name: Release to prod target_commitish: master From 283ea7134b0a42fc3dfef3d42e1b2c4856a6f6f6 Mon Sep 17 00:00:00 2001 From: Sondre Larsen Ovrid <111113539+slovrid@users.noreply.github.com> Date: Fri, 10 May 2024 14:43:49 +0200 Subject: [PATCH 4/9] Legg til generativ KI merking --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0df2a5e..32608c9 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,7 @@ Spørsmål knyttet til koden eller prosjektet kan stilles ved å opprette en iss ## For NAV-ansatte Interne henvendelser kan sendes via Slack i kanalen #po-arbeidsoppfølging. + +## Kode generert av GitHub Copilot + +Dette repoet bruker GitHub Copilot til å generere kode. From ecca9303bdfb58e4678db20969911df56728ab66 Mon Sep 17 00:00:00 2001 From: Klara M Helgemo Date: Mon, 13 May 2024 11:57:00 +0200 Subject: [PATCH 5/9] Oppgrader til Java 21 (#153) --- .github/workflows/codeql.yml | 2 +- .github/workflows/deploy-til-dev.yaml | 8 ++++---- .github/workflows/main.yml | 8 ++++---- Dockerfile | 2 +- pom.xml | 3 ++- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index cf4699e..1917d91 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -53,7 +53,7 @@ jobs: - name: Setup Java uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: temurin cache: maven diff --git a/.github/workflows/deploy-til-dev.yaml b/.github/workflows/deploy-til-dev.yaml index a471c55..c2cc341 100644 --- a/.github/workflows/deploy-til-dev.yaml +++ b/.github/workflows/deploy-til-dev.yaml @@ -19,10 +19,10 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up Java uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' - name: Run maven tests @@ -37,10 +37,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up Java uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3ab6aaa..ed8e2af 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,10 +16,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up Java uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' @@ -36,10 +36,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set up JDK 17 + - name: Set up Java uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: 'temurin' cache: 'maven' diff --git a/Dockerfile b/Dockerfile index bc5ded0..13e1154 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,2 @@ -FROM ghcr.io/navikt/poao-baseimages/java:17 +FROM ghcr.io/navikt/baseimages/temurin:21 COPY /target/veilarboppgave.jar app.jar diff --git a/pom.xml b/pom.xml index dc8c246..94034d1 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ Backend applikasjon for oppgaver - 17 + 21 3.2023.10.23_12.41-bafec3836d28 @@ -79,6 +79,7 @@ org.projectlombok lombok + 1.18.32 true From bd12c57ccce793eeec9c53f80514adeea276be51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 12:40:21 +0200 Subject: [PATCH 6/9] Bump org.testcontainers:postgresql from 1.19.7 to 1.19.8 (#155) Bumps [org.testcontainers:postgresql](https://github.com/testcontainers/testcontainers-java) from 1.19.7 to 1.19.8. - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/1.19.7...1.19.8) --- updated-dependencies: - dependency-name: org.testcontainers:postgresql dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 94034d1..45cef45 100644 --- a/pom.xml +++ b/pom.xml @@ -168,7 +168,7 @@ org.testcontainers postgresql - 1.19.7 + 1.19.8 test From 3148d057ee3b70fb93ec87f49c600d728f8cf008 Mon Sep 17 00:00:00 2001 From: Klara M Helgemo Date: Wed, 3 Jul 2024 14:47:02 +0200 Subject: [PATCH 7/9] Oppgraderer databasen til postgres 15 i dev (#159) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Oppgrader til Java 21 * Prodsette oppgradering Java 21 (#154) * Bump org.springdoc:springdoc-openapi-ui from 1.7.0 to 1.8.0 (#144) Bumps org.springdoc:springdoc-openapi-ui from 1.7.0 to 1.8.0. --- updated-dependencies: - dependency-name: org.springdoc:springdoc-openapi-ui dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump com.squareup.okhttp3:okhttp from 4.11.0 to 4.12.0 (#145) * Bump com.squareup.okhttp3:okhttp from 4.11.0 to 4.12.0 Bumps [com.squareup.okhttp3:okhttp](https://github.com/square/okhttp) from 4.11.0 to 4.12.0. - [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/okhttp/compare/parent-4.11.0...parent-4.12.0) --- updated-dependencies: - dependency-name: com.squareup.okhttp3:okhttp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * oppdatering prometheus --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Klara M Helgemo * Bump softprops/action-gh-release from 1 to 2 in /.github/workflows (#146) Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Klara M Helgemo * Legg til generativ KI merking * Oppgrader til Java 21 (#153) --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sondre Larsen Ovrid <111113539+slovrid@users.noreply.github.com> Co-authored-by: Mathias S. Müller <85442404+Mathiamu@users.noreply.github.com> * Migrerer databasen i dev til pg15 * Migrerer databasen i dev til pg15 * Migrerer databasen i dev til pg15 * Migrerer databasen i dev til pg15 --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sondre Larsen Ovrid <111113539+slovrid@users.noreply.github.com> Co-authored-by: Mathias S. Müller <85442404+Mathiamu@users.noreply.github.com> --- README.md | 4 ++++ .../no/nav/veilarboppgave/config/DatabaseMigrationConfig.java | 2 +- src/main/java/no/nav/veilarboppgave/util/DbUtils.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 32608c9..a6bec5d 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,7 @@ Interne henvendelser kan sendes via Slack i kanalen #po-arbeidsoppfølging. ## Kode generert av GitHub Copilot Dette repoet bruker GitHub Copilot til å generere kode. +## PostgreSQL +Innloggingsinformasjon til databasen: https://vault.adeo.no/ + +Dev: vault read postgresql/preprod-fss/creds/veilarboppgave-pg15-dev-admin diff --git a/src/main/java/no/nav/veilarboppgave/config/DatabaseMigrationConfig.java b/src/main/java/no/nav/veilarboppgave/config/DatabaseMigrationConfig.java index 16de92d..28afcf5 100644 --- a/src/main/java/no/nav/veilarboppgave/config/DatabaseMigrationConfig.java +++ b/src/main/java/no/nav/veilarboppgave/config/DatabaseMigrationConfig.java @@ -27,7 +27,7 @@ public void migrateDb() { Flyway.configure() .dataSource(dataSource) - .initSql(format("SET ROLE \"veilarboppgave-%s-admin\"", environment)) + .initSql(format("SET ROLE \"veilarboppgave-pg15-%s-admin\"", environment)) .load() .migrate(); } diff --git a/src/main/java/no/nav/veilarboppgave/util/DbUtils.java b/src/main/java/no/nav/veilarboppgave/util/DbUtils.java index f49fee6..24f7668 100644 --- a/src/main/java/no/nav/veilarboppgave/util/DbUtils.java +++ b/src/main/java/no/nav/veilarboppgave/util/DbUtils.java @@ -27,7 +27,7 @@ public static HikariConfig createDataSourceConfig(String dbUrl) { @SneakyThrows private static DataSource createVaultRefreshDataSource(HikariConfig config) { String environment = isProduction().orElse(false) ? "prod" : "dev"; - String role = String.join("-", APPLICATION_NAME, environment, "admin"); + String role = isProduction().orElse(false) ? String.join("-", APPLICATION_NAME, environment, "admin") : String.join("-", APPLICATION_NAME, "pg15", environment, "admin") ; return HikariCPVaultUtil.createHikariDataSourceWithVaultIntegration(config, getMountPath(), role); } From 1074378737a71b7b41d4e5996e5e88cca027717c Mon Sep 17 00:00:00 2001 From: Klara M Helgemo Date: Thu, 4 Jul 2024 10:02:57 +0200 Subject: [PATCH 8/9] Postgres 15 (#161) * Oppgrader til Java 21 * Migrerer databasen i dev til pg15 * Migrerer databasen i dev til pg15 * Migrerer databasen i dev til pg15 * Migrerer databasen i dev til pg15 * Forklarende tekst i Readme --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index a6bec5d..2f9ed7c 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,15 @@ Dette repoet bruker GitHub Copilot til å generere kode. Innloggingsinformasjon til databasen: https://vault.adeo.no/ Dev: vault read postgresql/preprod-fss/creds/veilarboppgave-pg15-dev-admin + +Ting å passe på ved oppgradering av databasen: +1. Lag PR i repo database-iac, eksempel https://github.com/navikt/database-iac/pull/592 Ny database får gjerne nytt navn, eks veilarboppgave-pg15 +I repoet database-iac finner du bla hostnavn og port +2. Lag PR i repo vault.iac, eksempel: https://github.com/navikt/vault-iac/pull/5514 +Ny database må legges inn i terraform/teams/pto/apps/veilarboppgave.yml og i terraform/teams/pto/pto.yml, både under dev og prod +3. I dev: Du kan opprette tabeller i den nye databasen ved å ta ut DDlene fra gammel db, og tilpasse skriptet med nytt navn. Kjør skriptet. +4. I dev: Bruk Import/Export og Copy table to.. (F5) Dobbeltklikk på public i ny database, og kopier. Da kopieres data med riktig user (ikke deg selv) +5. I dev: Vault: Sjekk at url til ny database stemmer med det som er satt i database-iac. Gå inn i Secrets kv/preprod/fss og velg veilarboppgave , q1. +Hvis ikke VEILARBOPPGAVE_DB_URL er riktig, velg Edit secret og sett riktige verdier. +6. Oppdater koden med riktig databasenavn, se f.eks https://github.com/navikt/veilarboppgave/pull/160/files + From 126346499837ea424b6de5d88d96d3283aaabf03 Mon Sep 17 00:00:00 2001 From: Klara M Helgemo Date: Fri, 5 Jul 2024 12:37:04 +0200 Subject: [PATCH 9/9] Migrering til Postgres 15 (#162) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Oppgrader til Java 21 * Migrerer databasen i dev til pg15 * Migrerer databasen i dev til pg15 * Migrerer databasen i dev til pg15 * Migrerer databasen i dev til pg15 * Forklarende tekst i Readme * Forbereder appen for å kopiere data fra gammel til ny db i prod --- .nais/application/application-config-prod.yaml | 4 ++-- src/main/java/no/nav/veilarboppgave/util/DbUtils.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.nais/application/application-config-prod.yaml b/.nais/application/application-config-prod.yaml index 382b336..7dc08a6 100644 --- a/.nais/application/application-config-prod.yaml +++ b/.nais/application/application-config-prod.yaml @@ -8,8 +8,8 @@ metadata: spec: image: {{image}} replicas: - min: 2 - max: 4 + min: 0 + max: 0 cpuThresholdPercentage: 75 port: 8080 webproxy: true diff --git a/src/main/java/no/nav/veilarboppgave/util/DbUtils.java b/src/main/java/no/nav/veilarboppgave/util/DbUtils.java index 24f7668..39c4b75 100644 --- a/src/main/java/no/nav/veilarboppgave/util/DbUtils.java +++ b/src/main/java/no/nav/veilarboppgave/util/DbUtils.java @@ -27,7 +27,7 @@ public static HikariConfig createDataSourceConfig(String dbUrl) { @SneakyThrows private static DataSource createVaultRefreshDataSource(HikariConfig config) { String environment = isProduction().orElse(false) ? "prod" : "dev"; - String role = isProduction().orElse(false) ? String.join("-", APPLICATION_NAME, environment, "admin") : String.join("-", APPLICATION_NAME, "pg15", environment, "admin") ; + String role = String.join("-", APPLICATION_NAME, "pg15", environment, "admin"); return HikariCPVaultUtil.createHikariDataSourceWithVaultIntegration(config, getMountPath(), role); }