Skip to content

feat(spring-oracle-example): initialize Spring Boot project with Orac…#67

Closed
igorcampos-dev wants to merge 2 commits intomasterfrom
feat/oracle-example
Closed

feat(spring-oracle-example): initialize Spring Boot project with Orac…#67
igorcampos-dev wants to merge 2 commits intomasterfrom
feat/oracle-example

Conversation

@igorcampos-dev
Copy link
Copy Markdown
Owner

@igorcampos-dev igorcampos-dev commented Sep 13, 2025

…leDB example

Summary by CodeRabbit

  • New Features

    • Added a Spring Boot example app with Oracle DB support (JPA entity included) and app entrypoint.
    • Dev and prod profiles configurable via environment variables.
    • Local dev environment via Docker Compose (app + Oracle XE) with preseeded schema/user.
    • Multi-stage Docker image optimized for layered, non-root runtime; app exposes port 8080.
    • Included Maven Wrapper, project module, runtime configs, and startup banner.
  • Chores

    • CI workflows for Maven builds, integration tests, and container health checks on PRs.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Sep 13, 2025

Walkthrough

Adds a new Maven module "spring-oracle-example" with Spring Boot app, JPA entity, Oracle XE compose setup, Dockerfile, Maven Wrapper, CI workflows (module build + PR integration tests with health checks), and registers the module in the root POM.

Changes

Cohort / File(s) Summary
CI workflows
.github/workflows/spring-oracle-example.yml, spring-oracle-example/.github/workflows/maven.yml
New GitHub Actions: PR-triggered integration-tests + health-check workflow (docker compose, container health script) and a module-level Maven build workflow.
Root Maven modules
pom.xml
Registers new module: spring-oracle-example.
Maven wrapper
spring-oracle-example/mvnw, spring-oracle-example/mvnw.cmd, spring-oracle-example/.mvn/wrapper/maven-wrapper.properties
Adds Maven Wrapper scripts and config (distributionUrl → Maven 3.9.11, only-script).
Docker & compose
spring-oracle-example/Dockerfile, spring-oracle-example/compose.yaml
Adds multi-stage Dockerfile for the app and docker-compose with app and oracle-db services and env wiring.
Database init
spring-oracle-example/docker/oracle/init.sql
SQL init script creating TEST_SCHEMA user, grants, and quota for XEPDB1.
Application code
spring-oracle-example/src/main/java/com/io/example/SpringOracleExampleApplication.java
Spring Boot application entry point (@SpringBootApplication main class).
Domain entity
spring-oracle-example/src/main/java/com/io/example/entity/TestEntity.java
New JPA entity TestEntity (Lombok) mapped to TEST_SCHEMA.TEST_ENTITY.
App config & resources
spring-oracle-example/src/main/resources/application.yml, spring-oracle-example/src/main/resources/application-dev.yml, spring-oracle-example/src/main/resources/banner.txt
Adds prod (env-var driven) and dev (Oracle defaults) configs and ASCII banner.
Project metadata / POM
spring-oracle-example/pom.xml
Module POM: Spring Boot 3.5.5 parent, Java 21, dependencies (web, data-jpa, ojdbc11 runtime, lombok), plugins (compiler, spring-boot).
VCS / build ignores & attributes
spring-oracle-example/.gitignore, spring-oracle-example/.gitattributes, spring-oracle-example/.dockerignore
Adds ignore rules, eol normalization for mvnw/.cmd, and Docker build context exclusions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Feature/geral #6 — Adds Maven Wrapper files and CI Maven workflow, overlapping bootstrap artifacts and workflow patterns.
  • Update spring-kafka-example.yml #27 — Introduces/changes integration test workflows and a health-check job with docker-compose, closely related to the new CI jobs.
  • Feature/kafka #40 — Touches container health-check logic used by CI; likely related to the health-check script invoked by the workflow.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "feat(spring-oracle-example): initialize Spring Boot project with OracleDB example" accurately and concisely captures the primary change — adding a new spring-oracle-example module with scaffolding (POM, app code, Docker/compose, and CI workflows); it follows conventional commit style and is specific rather than vague or off-topic.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/oracle-example

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 26

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1c26c8 and f2e34fd.

📒 Files selected for processing (18)
  • .github/workflows/spring-oracle-example.yml (1 hunks)
  • pom.xml (1 hunks)
  • spring-oracle-example/.dockerignore (1 hunks)
  • spring-oracle-example/.gitattributes (1 hunks)
  • spring-oracle-example/.github/workflows/maven.yml (1 hunks)
  • spring-oracle-example/.gitignore (1 hunks)
  • spring-oracle-example/.mvn/wrapper/maven-wrapper.properties (1 hunks)
  • spring-oracle-example/Dockerfile (1 hunks)
  • spring-oracle-example/compose.yaml (1 hunks)
  • spring-oracle-example/docker/oracle/init.sql (1 hunks)
  • spring-oracle-example/mvnw (1 hunks)
  • spring-oracle-example/mvnw.cmd (1 hunks)
  • spring-oracle-example/pom.xml (1 hunks)
  • spring-oracle-example/src/main/java/com/io/example/SpringOracleExampleApplication.java (1 hunks)
  • spring-oracle-example/src/main/java/com/io/example/entity/TestEntity.java (1 hunks)
  • spring-oracle-example/src/main/resources/application-dev.yml (1 hunks)
  • spring-oracle-example/src/main/resources/application.yml (1 hunks)
  • spring-oracle-example/src/main/resources/banner.txt (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: igorcampos-dev
PR: igorcampos-dev/spring-integrations-examples#21
File: spring-kafka-example/README.md:12-17
Timestamp: 2025-07-22T01:35:41.406Z
Learning: User igorcampos-dev prefers minimal, high-level documentation in README files without detailed version specifications, choosing to keep tech stack information simple rather than adding precise version numbers.
🧬 Code graph analysis (1)
spring-oracle-example/src/main/java/com/io/example/SpringOracleExampleApplication.java (4)
spring-jasper-example/src/main/java/com/io/example/SpringJasperExampleApplication.java (2)
  • SpringBootApplication (6-13)
  • main (9-11)
spring-keycloak-example/src/main/java/com/io/example/SpringKeycloakExampleApplication.java (2)
  • SpringBootApplication (6-13)
  • main (9-11)
spring-prometheus-grafana-example/src/main/java/com/io/example/SpringPrometheusGrafanaExampleApplication.java (2)
  • SpringPrometheusGrafanaExampleApplication (6-13)
  • main (9-11)
spring-kafka-example/src/main/java/com/io/example/SpringKafkaExampleApplication.java (2)
  • SpringKafkaExampleApplication (6-13)
  • main (9-11)
🪛 YAMLlint (1.37.1)
spring-oracle-example/.github/workflows/maven.yml

[warning] 3-3: truthy value should be one of [false, true]

(truthy)


[error] 14-14: too many spaces inside brackets

(brackets)


[error] 14-14: too many spaces inside brackets

(brackets)


[error] 15-15: too many spaces inside brackets

(brackets)


[error] 15-15: too many spaces inside brackets

(brackets)


[error] 30-30: no new line character at the end of file

(new-line-at-end-of-file)

spring-oracle-example/src/main/resources/application.yml

[error] 17-17: no new line character at the end of file

(new-line-at-end-of-file)

spring-oracle-example/compose.yaml

[error] 32-32: no new line character at the end of file

(new-line-at-end-of-file)

.github/workflows/spring-oracle-example.yml

[warning] 3-3: truthy value should be one of [false, true]

(truthy)


[error] 23-23: too many spaces inside brackets

(brackets)


[error] 23-23: too many spaces inside brackets

(brackets)


[error] 24-24: too many spaces inside brackets

(brackets)


[error] 24-24: too many spaces inside brackets

(brackets)


[error] 68-68: no new line character at the end of file

(new-line-at-end-of-file)

🪛 Checkov (3.2.334)
spring-oracle-example/Dockerfile

[low] 1-47: Ensure that HEALTHCHECK instructions have been added to container images

(CKV_DOCKER_2)

spring-oracle-example/compose.yaml

[low] 14-15: Base64 High Entropy String

(CKV_SECRET_6)

🔇 Additional comments (9)
pom.xml (1)

14-20: LGTM: module aggregation wired correctly.

spring-oracle-example/.mvn/wrapper/maven-wrapper.properties (1)

1-2: Incorrect — only-script is a valid Maven Wrapper distributionType.
Valid values are script, bin, source and only-script; only-script was introduced in 3.2.0 and is supported in current Maven Wrapper distributions, so changing this to bin is unnecessary.

Likely an incorrect or invalid review comment.

spring-oracle-example/.dockerignore (1)

25-33: Don’t ignore Dockerfile/compose files in .dockerignore

Excluding Dockerfile or compose files removes them from the build context (breaking COPY/ADD and confusing docker-compose builds); keep them in the context or explicitly narrow the build context instead.

File: spring-oracle-example/.dockerignore (lines 25–33)

-**/docker-compose*
-**/compose.y*ml
-**/Dockerfile*
+# Keep compose/Dockerfile in context for clarity
+# **/docker-compose*
+# **/compose.y*ml
+# **/Dockerfile*
spring-oracle-example/.gitignore (1)

1-4: Wrapper jar ignored—ensure wrapper works without it.

If you rely on the modern wrapper (no jar), fine. If not, builds will fail. Align with the proposed distributionType=bin.

spring-oracle-example/pom.xml (1)

7-12: Verified — artifacts present on Maven Central. Both org.springframework.boot:spring-boot-starter-parent:3.5.5 and com.oracle.database.jdbc:ojdbc11:23.7.0.25.01 are available on repo1.maven.org; no action required.

spring-oracle-example/.github/workflows/maven.yml (1)

1-30: Move/add workflow to repository root (.github/workflows/maven.yml) and verify

No workflow files found at repo root or nested locations; GitHub only runs workflows from .github/workflows at the repository root.

  • Move/commit spring-oracle-example/.github/workflows/maven.yml → .github/workflows/maven.yml (repo root).
  • Apply YAML lint fixes and CI improvements: add pull_request trigger, address yamllint nits, set defaults.run.working-directory: spring-oracle-example, ensure mvnw is executable, and run ./mvnw -B -ntp clean verify.
spring-oracle-example/src/main/java/com/io/example/SpringOracleExampleApplication.java (1)

6-11: LGTM: clean Spring Boot entrypoint

Standard setup; package structure will component-scan entities under com.io.example.* as expected.

spring-oracle-example/mvnw (1)

1-1: LGTM: standard Maven Wrapper — executable bit verified

spring-oracle-example/mvnw is tracked with mode 100755 (executable); no action needed.

.github/workflows/spring-oracle-example.yml (1)

66-68: Verified: helper script exists and is executable

.github/scripts/check-container-health.sh is present and tracked with mode 100755.

Comment on lines +3 to +11
on:
pull_request:
branches: [master]
paths:
- "spring-oracle-example/**"
types:
- opened
- synchronize
- reopened
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Quote the “on” key to satisfy YAML linters

Prevents YAML 1.1 truthy parsing complaints.

Apply:

-on:
+"on":
   pull_request:
     branches: [master]
     paths:
       - "spring-oracle-example/**"
     types:
       - opened
       - synchronize
       - reopened
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
on:
pull_request:
branches: [master]
paths:
- "spring-oracle-example/**"
types:
- opened
- synchronize
- reopened
"on":
pull_request:
branches: [master]
paths:
- "spring-oracle-example/**"
types:
- opened
- synchronize
- reopened
🧰 Tools
🪛 YAMLlint (1.37.1)

[warning] 3-3: truthy value should be one of [false, true]

(truthy)

🤖 Prompt for AI Agents
.github/workflows/spring-oracle-example.yml lines 3-11: the top-level YAML key
on is unquoted which can trigger YAML 1.1 truthy parsing linters; update the
file to quote the key (e.g., change on: to "on":) so the key is treated as a
string, preserving the existing pull_request block and behavior.

Comment on lines +23 to +24
distribution: [ 'temurin' ]
java: [ '21' ]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Fix bracket spacing in matrices (YAMLlint)

Compact arrays silence lint errors.

Apply:

-        distribution: [ 'temurin' ]
-        java: [ '21' ]
+        distribution: ["temurin"]
+        java: ["21"]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
distribution: [ 'temurin' ]
java: [ '21' ]
distribution: ["temurin"]
java: ["21"]
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 23-23: too many spaces inside brackets

(brackets)


[error] 23-23: too many spaces inside brackets

(brackets)


[error] 24-24: too many spaces inside brackets

(brackets)


[error] 24-24: too many spaces inside brackets

(brackets)

🤖 Prompt for AI Agents
.github/workflows/spring-oracle-example.yml lines 23-24: the matrix arrays use
spaced bracket style which triggers YAMLlint; replace the current "distribution:
[ 'temurin' ]" and "java: [ '21' ]" with compact arrays (no spaces after '[' or
before ']'), e.g. "distribution: ['temurin']" and "java: ['21']".

Comment on lines +63 to +68
- name: Wait for containers to initialize
run: sleep 20

- name: Check container health
run: |
./.github/scripts/check-container-health.sh "${{ steps.services.outputs.services }}" No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace fixed sleep with a bounded health wait loop

Avoids flakiness on slow Oracle startup.

Apply:

-      - name: Wait for containers to initialize
-        run: sleep 20
-
-      - name: Check container health
-        run: |
-          ./.github/scripts/check-container-health.sh "${{ steps.services.outputs.services }}"
+      - name: Wait until services are healthy (max 5m)
+        run: |
+          set -e
+          for svc in ${{ steps.services.outputs.services }}; do
+            id="$(docker compose -f ./spring-oracle-example/compose.yaml ps -q "$svc")"
+            for i in {1..60}; do
+              status="$(docker inspect -f '{{if .State.Health}}{{.State.Health.Status}}{{else}}starting{{end}}' "$id" 2>/dev/null || echo starting)"
+              [ "$status" = "healthy" ] && break
+              sleep 5
+            done
+            docker inspect -f '{{.Name}} -> {{.State.Health.Status}}' "$id"
+          done
+
+      - name: Check container health
+        run: ./.github/scripts/check-container-health.sh "${{ steps.services.outputs.services }}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Wait for containers to initialize
run: sleep 20
- name: Check container health
run: |
./.github/scripts/check-container-health.sh "${{ steps.services.outputs.services }}"
- name: Wait until services are healthy (max 5m)
run: |
set -e
for svc in ${{ steps.services.outputs.services }}; do
id="$(docker compose -f ./spring-oracle-example/compose.yaml ps -q "$svc")"
for i in {1..60}; do
status="$(docker inspect -f '{{if .State.Health}}{{.State.Health.Status}}{{else}}starting{{end}}' "$id" 2>/dev/null || echo starting)"
[ "$status" = "healthy" ] && break
sleep 5
done
docker inspect -f '{{.Name}} -> {{.State.Health.Status}}' "$id"
done
- name: Check container health
run: ./.github/scripts/check-container-health.sh "${{ steps.services.outputs.services }}"
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 68-68: no new line character at the end of file

(new-line-at-end-of-file)

🤖 Prompt for AI Agents
.github/workflows/spring-oracle-example.yml lines 63-68: currently a fixed 20s
sleep precedes the container health check which can be flaky for slow Oracle
startups; replace the sleep with a bounded wait loop that repeatedly invokes
./.github/scripts/check-container-health.sh (or queries the containers' health
endpoints) with short sleeps between attempts and a configurable overall
timeout/attempt limit, failing the job if health is not achieved within the
bound; implement the loop in the workflow step (or inside the script) so it
exits immediately on success and returns non-zero after the timeout to fail the
run.

Comment thread .github/workflows/spring-oracle-example.yml Outdated
Comment on lines +32 to +33
LICENSE
README.md
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Consider keeping LICENSE/README in context.

Some multi-stage builds copy README/LICENSE into the image labels or docs; harmless to include given size.

-LICENSE
-README.md
+# LICENSE
+# README.md
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
LICENSE
README.md
# LICENSE
# README.md
🤖 Prompt for AI Agents
In spring-oracle-example/.dockerignore around lines 32 to 33, the Docker ignore
file currently excludes LICENSE and README.md which can prevent multi-stage
builds from having those files available for image labels or documentation;
remove LICENSE and README.md from .dockerignore (or comment them out) so the
files are included in build context, then re-run the build to ensure multi-stage
copy/label steps can access them.

Comment on lines +5 to +10
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:oracle:thin:@localhost:1521/XEPDB1}
username: ${SPRING_DATASOURCE_USERNAME:TEST_SCHEMA}
password: ${SPRING_DATASOURCE_PASSWORD:Ag101Pwd123}
driver-class-name: ${SPRING_DATASOURCE_DRIVER:oracle.jdbc.OracleDriver}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Consider minimal pool/timeouts for dev stability.

Add conservative Hikari settings to avoid connection storms on container restarts.

   datasource:
     url: ${SPRING_DATASOURCE_URL:jdbc:oracle:thin:@localhost:1521/XEPDB1}
     username: ${SPRING_DATASOURCE_USERNAME:TEST_SCHEMA}
-    password: ${SPRING_DATASOURCE_PASSWORD:}
+    password: ${SPRING_DATASOURCE_PASSWORD:}
+    hikari:
+      maximum-pool-size: ${SPRING_DATASOURCE_MAX_POOL_SIZE:5}
+      connection-timeout: ${SPRING_DATASOURCE_CONNECTION_TIMEOUT:30000}
+      validation-timeout: ${SPRING_DATASOURCE_VALIDATION_TIMEOUT:5000}

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In spring-oracle-example/src/main/resources/application-dev.yml around lines 5
to 10, the datasource config lacks Hikari connection pool/timeouts for
development; add conservative Hikari settings (e.g. minimumIdle: 1,
maximumPoolSize: 5, connectionTimeout: 30000, idleTimeout: 600000, maxLifetime:
1800000, validationTimeout: 5000) under spring.datasource.hikari (and optionally
a pool-name) to prevent connection storms on container restarts and improve dev
stability.

Comment on lines +11 to +17
jpa:
hibernate:
ddl-auto: ${SPRING_JPA_HIBERNATE_DDL_AUTO:update}
show-sql: ${SPRING_JPA_SHOW_SQL:true}
properties:
hibernate:
dialect: ${SPRING_HIBERNATE_DIALECT:org.hibernate.dialect.OracleDialect}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Hibernate dialect is optional on Hibernate 6+.

Boot usually auto-resolves for Oracle; keeping it is fine, but consider removing to reduce config surface.

🤖 Prompt for AI Agents
In spring-oracle-example/src/main/resources/application-dev.yml around lines 11
to 17, the file explicitly sets a Hibernate dialect which is optional with
Hibernate 6+ because Spring Boot can auto-detect Oracle dialect; remove the
explicit dialect entry (or comment it out) to reduce configuration surface, or
if you prefer to keep it for clarity, add a short comment explaining why it’s
intentionally overridden so future maintainers understand the reason.

Comment on lines +5 to +10
datasource:
url: ${SPRING_DATASOURCE_URL}
username: ${SPRING_DATASOURCE_USERNAME}
password: ${SPRING_DATASOURCE_PASSWORD}
driver-class-name: ${SPRING_DATASOURCE_DRIVER}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Optional: provide connection defaults for local/dev.

Keeps app bootable without Compose.

Apply:

   datasource:
-    url: ${SPRING_DATASOURCE_URL}
-    username: ${SPRING_DATASOURCE_USERNAME}
-    password: ${SPRING_DATASOURCE_PASSWORD}
-    driver-class-name: ${SPRING_DATASOURCE_DRIVER}
+    url: ${SPRING_DATASOURCE_URL:jdbc:oracle:thin:@localhost:1521/XEPDB1}
+    username: ${SPRING_DATASOURCE_USERNAME:TEST_SCHEMA}
+    password: ${SPRING_DATASOURCE_PASSWORD:changeMe}
+    driver-class-name: ${SPRING_DATASOURCE_DRIVER:oracle.jdbc.OracleDriver}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
datasource:
url: ${SPRING_DATASOURCE_URL}
username: ${SPRING_DATASOURCE_USERNAME}
password: ${SPRING_DATASOURCE_PASSWORD}
driver-class-name: ${SPRING_DATASOURCE_DRIVER}
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:oracle:thin:@localhost:1521/XEPDB1}
username: ${SPRING_DATASOURCE_USERNAME:TEST_SCHEMA}
password: ${SPRING_DATASOURCE_PASSWORD:changeMe}
driver-class-name: ${SPRING_DATASOURCE_DRIVER:oracle.jdbc.OracleDriver}
🤖 Prompt for AI Agents
In spring-oracle-example/src/main/resources/application.yml around lines 5-10,
the datasource properties use environment-only placeholders so the app won't
boot without Compose; add Spring-style default fallbacks using the
${VAR:default} syntax (e.g., provide a local Oracle JDBC URL, username, password
and driver fallback such as jdbc:oracle:thin:@localhost:1521:xe, system, oracle
and oracle.jdbc.OracleDriver) so the application can start in local/dev when env
vars are missing.

Comment on lines +11 to +17
jpa:
hibernate:
ddl-auto: ${SPRING_JPA_HIBERNATE_DDL_AUTO}
show-sql: ${SPRING_JPA_SHOW_SQL}
properties:
hibernate:
dialect: ${SPRING_HIBERNATE_DIALECT} No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

🛠️ Refactor suggestion

Avoid schema auto-update in prod; add safe defaults.

Prefer Flyway/Liquibase and ddl-auto=validate in production; add sensible fallbacks and keep SQL logs off by default.

Apply:

 spring:
@@
   jpa:
     hibernate:
-      ddl-auto: ${SPRING_JPA_HIBERNATE_DDL_AUTO}
-    show-sql: ${SPRING_JPA_SHOW_SQL}
+      ddl-auto: ${SPRING_JPA_HIBERNATE_DDL_AUTO:validate}
+    show-sql: ${SPRING_JPA_SHOW_SQL:false}
     properties:
       hibernate:
-        dialect: ${SPRING_HIBERNATE_DIALECT}
+        dialect: ${SPRING_HIBERNATE_DIALECT:org.hibernate.dialect.OracleDialect}
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
jpa:
hibernate:
ddl-auto: ${SPRING_JPA_HIBERNATE_DDL_AUTO}
show-sql: ${SPRING_JPA_SHOW_SQL}
properties:
hibernate:
dialect: ${SPRING_HIBERNATE_DIALECT}
jpa:
hibernate:
ddl-auto: ${SPRING_JPA_HIBERNATE_DDL_AUTO:validate}
show-sql: ${SPRING_JPA_SHOW_SQL:false}
properties:
hibernate:
dialect: ${SPRING_HIBERNATE_DIALECT:org.hibernate.dialect.OracleDialect}
🧰 Tools
🪛 YAMLlint (1.37.1)

[error] 17-17: no new line character at the end of file

(new-line-at-end-of-file)

🤖 Prompt for AI Agents
spring-oracle-example/src/main/resources/application.yml around lines 11 to 17:
currently jpa.hibernate.ddl-auto and show-sql are driven only by env vars which
can enable auto-update and SQL logging in prod; change to safer defaults and
recommend migrations: set jpa.hibernate.ddl-auto to
${SPRING_JPA_HIBERNATE_DDL_AUTO:validate} and jpa.show-sql to
${SPRING_JPA_SHOW_SQL:false}, keep hibernate.dialect as
${SPRING_HIBERNATE_DIALECT:org.hibernate.dialect.Oracle12cDialect} (or your
dialect), and add a short comment recommending using Flyway/Liquibase for schema
changes and avoiding update/create in production.

Comment on lines +1 to +7

,---. ,------. ,------. ,--.,--. ,--. ,----. ,-----. ,------. ,---. ,-----.,--. ,------.
' .-'| .--. '| .--. '| || ,'.| |' .-./ ,-----.' .-. '| .--. ' / O \ ' .--./| | | .---'
`. `-.| '--' || '--'.'| || |' ' || | .---.'-----'| | | || '--'.'| .-. || | | | | `--,
.-' | | --' | |\ \ | || | ` |' '--' | ' '-' '| |\ \ | | | |' '--'\| '--.| `---.
`-----'`--' `--' '--'`--'`--' `--' `------' `-----' `--' '--'`--' `--' `-----'`-----'`------'
SPRING-ORACLE-EXAMPLE No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Add trailing newline.

Minor POSIX convention/readability.

-                                        SPRING-ORACLE-EXAMPLE
+                                        SPRING-ORACLE-EXAMPLE
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
,---. ,------. ,------. ,--.,--. ,--. ,----. ,-----. ,------. ,---. ,-----.,--. ,------.
' .-'| .--. '| .--. '| || ,'.| |' .-./ ,-----.' .-. '| .--. ' / O \ ' .--./| | | .---'
`. `-.| '--' || '--'.'| || |' ' || | .---.'-----'| | | || '--'.'| .-. || | | | | `--,
.-' | | --' | |\ \ | || | ` |' '--' | ' '-' '| |\ \ | | | |' '--'\| '--.| `---.
`-----'`--' `--' '--'`--'`--' `--' `------' `-----' `--' '--'`--' `--' `-----'`-----'`------'
SPRING-ORACLE-EXAMPLE
,---. ,------. ,------. ,--.,--. ,--. ,----. ,-----. ,------. ,---. ,-----.,--. ,------.
' .-'| .--. '| .--. '| || ,'.| |' .-./ ,-----.' .-. '| .--. ' / O \ ' .--./| | | .---'
`. `-.| '--' || '--'.'| || |' ' || | .---.'-----'| | | || '--'.'| .-. || | | | | `--,
.-' | | --' | |\ \ | || | ` |' '--' | ' '-' '| |\ \ | | | |' '--'\| '--.| `---.
`-----'`--' `--' '--'`--'`--' `--' `------' `-----' `--' '--'`--' `--' `-----'`-----'`------'
SPRING-ORACLE-EXAMPLE
🤖 Prompt for AI Agents
In spring-oracle-example/src/main/resources/banner.txt around lines 1 to 7, the
file is missing a trailing newline; update the file so its last line is
terminated with a POSIX newline character (ensure the file ends with '\n') and
save the file, preserving all existing content and spacing.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (5)
.github/workflows/spring-oracle-example.yml (5)

69-69: Add a trailing newline

Silences EOF newline linter warning.


3-11: Quote the workflow trigger key "on"

Prevents YAML 1.1 truthy parsing lint warnings.

-on:
+"on":
   pull_request:
     branches: [master]
     paths:
       - "spring-oracle-example/**"
     types:
       - opened
       - synchronize
       - reopened

23-24: Compact the matrix arrays (YAMLlint brackets rule)

Remove inner spaces inside [ ].

-        distribution: [ 'temurin' ]
-        java: [ '21' ]
+        distribution: ["temurin"]
+        java: ["21"]

63-68: Replace fixed sleep with a bounded health wait loop

Avoids flakiness on slow Oracle startups; fail fast on timeout.

-      - name: Wait for containers to initialize
-        run: sleep 30
-
-      - name: Check container health
-        run: |
-          ./.github/scripts/check-container-health.sh "${{ steps.services.outputs.services }}"
+      - name: Wait until services are healthy (max 5m)
+        run: |
+          set -euo pipefail
+          for svc in ${{ steps.services.outputs.services }}; do
+            id="$(docker compose -f ./spring-oracle-example/compose.yaml ps -q "$svc")"
+            for i in {1..60}; do
+              status="$(docker inspect -f '{{if .State.Health}}{{.State.Health.Status}}{{else}}starting{{end}}' "$id" 2>/dev/null || echo starting)"
+              [ "$status" = "healthy" ] && break
+              sleep 5
+            done
+            docker inspect -f '{{.Name}} -> {{.State.Health.Status}}' "$id"
+          done
+
+      - name: Check container health
+        run: ./.github/scripts/check-container-health.sh ${{ steps.services.outputs.services }}

1-13: Add least-privilege permissions and cancel in-progress runs

Improves security and reduces CI waste on rapid PR updates.

 name: spring-oracle-example CI Build
+
+permissions:
+  contents: read
+
+"on":
   pull_request:
@@
 
 jobs:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2e34fd and 866b5bf.

📒 Files selected for processing (1)
  • .github/workflows/spring-oracle-example.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: igorcampos-dev
PR: igorcampos-dev/spring-integrations-examples#21
File: spring-kafka-example/README.md:12-17
Timestamp: 2025-07-22T01:35:41.406Z
Learning: User igorcampos-dev prefers minimal, high-level documentation in README files without detailed version specifications, choosing to keep tech stack information simple rather than adding precise version numbers.
🪛 YAMLlint (1.37.1)
.github/workflows/spring-oracle-example.yml

[warning] 3-3: truthy value should be one of [false, true]

(truthy)


[error] 23-23: too many spaces inside brackets

(brackets)


[error] 23-23: too many spaces inside brackets

(brackets)


[error] 24-24: too many spaces inside brackets

(brackets)


[error] 24-24: too many spaces inside brackets

(brackets)

🔇 Additional comments (3)
.github/workflows/spring-oracle-example.yml (3)

18-21: LGTM on job-scoped working directory

Keeps steps concise and avoids path repetition.


26-28: Keep actions/checkout@v5 — no downgrade needed

v5.0.0 was released Aug 11, 2025; actions/checkout@v5 is valid. For extra supply‑chain hardening, pin to the exact v5 commit SHA.

Likely an incorrect or invalid review comment.


31-35: Keep actions/setup-java@v5.0.0 — no change required

Confirmed v5.0.0 is the latest released version and cache: 'maven' is valid; do not downgrade to v4 or pin to a SHA.

Likely an incorrect or invalid review comment.

Comment on lines +48 to +54
- name: Extract service names from docker compose
id: services
run: |
echo "services<<EOF" >> $GITHUB_OUTPUT
docker compose -f ./spring-oracle-example/compose.yaml config --services >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Harden GITHUB_OUTPUT handling and normalize services list

Fail fast on errors and emit a space-delimited list to avoid quoting/newline pitfalls downstream.

-      - name: Extract service names from docker compose
+      - name: Extract service names from docker compose
         id: services
         run: |
-          echo "services<<EOF" >> $GITHUB_OUTPUT
-          docker compose -f ./spring-oracle-example/compose.yaml config --services >> $GITHUB_OUTPUT
-          echo "EOF" >> $GITHUB_OUTPUT
+          set -euo pipefail
+          services="$(docker compose -f ./spring-oracle-example/compose.yaml config --services | tr '\n' ' ' | sed -e 's/[[:space:]]\+/ /g' -e 's/[[:space:]]$//')"
+          echo "services=${services}" >> "$GITHUB_OUTPUT"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Extract service names from docker compose
id: services
run: |
echo "services<<EOF" >> $GITHUB_OUTPUT
docker compose -f ./spring-oracle-example/compose.yaml config --services >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Extract service names from docker compose
id: services
run: |
set -euo pipefail
services="$(docker compose -f ./spring-oracle-example/compose.yaml config --services | tr '\n' ' ' | sed -e 's/[[:space:]]\+/ /g' -e 's/[[:space:]]$//')"
echo "services=${services}" >> "$GITHUB_OUTPUT"
🤖 Prompt for AI Agents
In .github/workflows/spring-oracle-example.yml around lines 48-54, the step
writing services to GITHUB_OUTPUT should fail fast on errors and emit a single
space-delimited value instead of raw newlines; update the script to enable
strict shell mode (e.g., set -euo pipefail), run docker compose to capture the
service names into a variable, normalize newlines to spaces (trim
leading/trailing whitespace), verify the variable is non-empty and exit with an
error if it is, then write a single line like services=<space-delimited-list> to
$GITHUB_OUTPUT so downstream steps get a safe, quoted-free list.

Comment on lines +55 to +62
- name: Start containers with Compose Action
uses: hoverkraft-tech/compose-action@v2.3.0
with:
compose-file: './spring-oracle-example/compose.yaml'
services: ${{ steps.services.outputs.services }}
up-flags: '--build'
down-flags: '--volumes'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Pin third-party action and clean up orphans on down

Pin by commit SHA for security; remove orphaned containers on teardown to reduce cross-run interference.

-      - name: Start containers with Compose Action
-        uses: hoverkraft-tech/compose-action@v2.3.0
+      - name: Start containers with Compose Action
+        uses: hoverkraft-tech/compose-action@v2.3.0
+        # TODO: consider pinning to the action's commit SHA for supply-chain hardening
         with:
           compose-file: './spring-oracle-example/compose.yaml'
           services: ${{ steps.services.outputs.services }}
           up-flags: '--build'
-          down-flags: '--volumes'
+          down-flags: '--volumes --remove-orphans'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Start containers with Compose Action
uses: hoverkraft-tech/compose-action@v2.3.0
with:
compose-file: './spring-oracle-example/compose.yaml'
services: ${{ steps.services.outputs.services }}
up-flags: '--build'
down-flags: '--volumes'
- name: Start containers with Compose Action
uses: hoverkraft-tech/compose-action@v2.3.0
# TODO: consider pinning to the action's commit SHA for supply-chain hardening
with:
compose-file: './spring-oracle-example/compose.yaml'
services: ${{ steps.services.outputs.services }}
up-flags: '--build'
down-flags: '--volumes --remove-orphans'
🤖 Prompt for AI Agents
.github/workflows/spring-oracle-example.yml lines 55-62: the Compose Action is
using a floating tag and doesn't remove orphaned containers on teardown; update
the uses key to pin the action to a specific commit SHA (replace the tag with
hoverkraft-tech/compose-action@<commit-sha>) for security, and modify down-flags
to include --remove-orphans (e.g., '--volumes --remove-orphans') so orphaned
containers are cleaned up on down.

@igorcampos-dev igorcampos-dev deleted the feat/oracle-example branch September 13, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant