Skip to content

Conversation

@igorcampos-dev
Copy link
Owner

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

Summary by CodeRabbit

  • New Features

    • Adds a Spring Boot example app demonstrating Oracle DB connectivity with env-driven configs, profile support, and a startup banner; includes Dockerized build/runtime and Docker Compose with Oracle XE, exposing port 8080.
  • CI

    • Adds CI workflows for Maven builds and matrix tests on Java 21, plus a containerized health-check job for the compose setup.
  • Documentation

    • Adds README with run and connectivity instructions.
  • Chores

    • Adds Maven module and wrapper, plus updated ignore/attribute files for consistent workflows.

@coderabbitai
Copy link

coderabbitai bot commented Sep 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a new module "spring-oracle-example" with a Spring Boot app, Maven wrapper, Dockerfile/Compose for Oracle XE, module and repo GitHub Actions for build and health checks, and supporting git/docker ignore and resource files. Root POM updated to register the module.

Changes

Cohort / File(s) Summary of changes
Root build config
pom.xml
Registers new spring-oracle-example Maven module in root modules.
Repo CI workflow
.github/workflows/spring-oracle-example.yml
New PR-triggered workflow: matrix build (Temurin Java 21) running ./mvnw clean verify in spring-oracle-example and a docker-compose-based health-check job that extracts services and runs a health script.
Module CI workflow
spring-oracle-example/.github/workflows/maven.yml
Adds module-scoped CI on push: Temurin Java 21 matrix running Maven wrapper with caching.
Maven wrapper
spring-oracle-example/mvnw, spring-oracle-example/mvnw.cmd, spring-oracle-example/.mvn/wrapper/maven-wrapper.properties
Adds Unix/Windows Maven Wrapper and wrapper properties (distributionUrl → Maven 3.9.11, distributionType=only-script).
Git & Docker hygiene
spring-oracle-example/.gitignore, spring-oracle-example/.gitattributes, spring-oracle-example/.dockerignore
Adds ignore rules and line-ending attributes; extensive Docker build context excludes.
Docker artifacts
spring-oracle-example/Dockerfile, spring-oracle-example/compose.yaml, spring-oracle-example/docker/java/entrypoint.sh, spring-oracle-example/docker/oracle/init.sql
Adds multi-stage Dockerfile, compose with app and oracle-db, entrypoint script, and Oracle init SQL creating TEST_SCHEMA.
Application code
spring-oracle-example/pom.xml, spring-oracle-example/src/main/java/com/io/example/SpringOracleExampleApplication.java, spring-oracle-example/src/main/java/com/io/example/entity/TestEntity.java
Adds Spring Boot project POM (Spring Boot 3.5.5, Oracle JDBC, Lombok), app entry point, and a JPA entity TestEntity mapped to TEST_SCHEMA.TEST_ENTITY.
Resources & docs
spring-oracle-example/src/main/resources/application.yml, .../application-dev.yml, .../banner.txt, spring-oracle-example/README.md
Adds environment-driven config files (prod/dev), ASCII banner, and README for the module.
Build support
spring-oracle-example/mvnw, spring-oracle-example/mvnw.cmd, spring-oracle-example/.mvn/wrapper/maven-wrapper.properties
(Also listed above) Adds full Maven Wrapper scripts with download/caching/unpack logic and properties.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Feat/oracle example #73 — Adds an equivalent spring-oracle-example module, matching CI workflows, Maven wrapper, Docker/compose, and source files.
  • Feature/geral #6 — Adds Maven Wrapper scripts and a similar CI workflow; overlaps with the wrapper files and CI configuration here.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Feat/oracle example" concisely indicates the PR introduces an Oracle example feature and directly relates to the main changeset (adding the spring-oracle-example module and supporting files), so it is focused and descriptive enough for a quick scan.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1cd7aed and c53d665.

📒 Files selected for processing (1)
  • spring-oracle-example/compose.yaml (1 hunks)

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

@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: 22

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9846250 and 1cd7aed.

📒 Files selected for processing (20)
  • .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/README.md (1 hunks)
  • spring-oracle-example/compose.yaml (1 hunks)
  • spring-oracle-example/docker/java/entrypoint.sh (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.
🪛 Checkov (3.2.334)
spring-oracle-example/Dockerfile

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

(CKV_DOCKER_2)


[low] 1-41: Ensure that a user for the container has been created

(CKV_DOCKER_3)

spring-oracle-example/compose.yaml

[low] 13-14: Base64 High Entropy String

(CKV_SECRET_6)

🪛 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] 30-30: 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)

🪛 markdownlint-cli2 (0.17.2)
spring-oracle-example/README.md

8-8: Files should end with a single newline character

(MD047, single-trailing-newline)

🪛 OSV Scanner (2.1.0)
spring-oracle-example/pom.xml

[HIGH] 1-1: org.springframework:spring-core 6.2.10: Spring Framework annotation detection mechanism may result in improper authorization

(GHSA-jmp9-x22r-554x)

🪛 actionlint (1.7.7)
.github/workflows/spring-oracle-example.yml

50-50: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


50-50: shellcheck reported issue in this script: SC2086:info:1:25: Double quote to prevent globbing and word splitting

(shellcheck)


50-50: shellcheck reported issue in this script: SC2086:info:2:77: Double quote to prevent globbing and word splitting

(shellcheck)


50-50: shellcheck reported issue in this script: SC2086:info:3:15: Double quote to prevent globbing and word splitting

(shellcheck)

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

14-20: Module inclusion looks good.

The new module is properly added to the aggregator POM.

spring-oracle-example/.gitattributes (1)

1-2: Good cross‑platform EOL settings for wrapper scripts.

Anchored patterns are correct relative to this directory.

spring-oracle-example/src/main/resources/banner.txt (1)

2-7: Banner resource OK.

No functional concerns.

spring-oracle-example/.gitignore (1)

1-33: LGTM! Comprehensive gitignore configuration

The gitignore file properly covers all essential patterns for a Spring Boot Maven project, including IDE files, build artifacts, and Docker-related files. The use of negated patterns to preserve source directories is correctly implemented.

spring-oracle-example/src/main/java/com/io/example/SpringOracleExampleApplication.java (1)

1-13: LGTM! Standard Spring Boot application setup

The main application class follows Spring Boot best practices with proper package structure and minimal boilerplate.

spring-oracle-example/.dockerignore (1)

1-62: LGTM! Well-structured Docker ignore patterns

The .dockerignore file comprehensively excludes unnecessary files from the Docker build context, which will improve build performance and reduce image size. The patterns properly cover IDE files, build artifacts, version control, and various backup files.

spring-oracle-example/mvnw (1)

1-296: LGTM! Standard Maven Wrapper script

This is the standard Apache Maven Wrapper script (v3.3.3) with proper error handling, cross-platform support, and secure download mechanisms. The script correctly handles various environments including Cygwin/MinGW and supports both Maven and mvnd distributions.

spring-oracle-example/src/main/java/com/io/example/entity/TestEntity.java (1)

19-21: No change required — repo uses Oracle XE 21 so IDENTITY is supported

spring-oracle-example/compose.yaml declares oracle-db image gvenzl/oracle-xe:21-slim, which supports IDENTITY columns; GenerationType.IDENTITY is acceptable here. If you need compatibility with older Oracle versions (e.g., 11g), switch to GenerationType.SEQUENCE with @SequenceGenerator as in the original suggestion.

spring-oracle-example/mvnw.cmd (2)

1-189: LGTM! Well-implemented Maven Wrapper for Windows.

The Windows batch/PowerShell hybrid script is comprehensive and handles all the necessary aspects:

  • Proper distribution URL resolution
  • MVND support detection
  • SHA-256 validation for security
  • Authenticated downloads support
  • Robust error handling and cleanup
  • Cross-platform compatibility with the Unix wrapper

The implementation follows the official Apache Maven Wrapper pattern.


154-175: Good handling of snapshot distributions.

The logic correctly handles both regular releases and snapshot distributions where the extracted directory name might differ from the archive name. This is a common issue that many wrapper implementations miss.

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

66-68: Health check script verified — no action required.
.github/scripts/check-container-health.sh is present and executable (mode -rwxr-xr-x) and performs Docker health checks that exit non-zero on failure.


3-3: Use boolean type for workflow trigger.

Similar to the other workflow, use proper boolean values for consistency.

-on:
+on: true
   pull_request:

Or keep the current valid structure as-is.

Likely an incorrect or invalid review comment.

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

26-30: Verify Maven wrapper path consistency.

mvnw exists at ./mvnw and ./spring-oracle-example/mvnw. The workflow spring-oracle-example/.github/workflows/maven.yml runs chmod +x mvnw and ./mvnw — GitHub Actions runs jobs from the repository root by default, so that invokes the root wrapper. Actionable options:

  • If the job should build only the module: set working-directory: spring-oracle-example (on the job/step) or call ./spring-oracle-example/mvnw.
  • If the job should build the whole repo: keep ./mvnw and document that intent.
spring-oracle-example/pom.xml (1)

1-100: Action: verify transitive Spring Data REST (CVE-2021-22047) and upgrade if present

Spring Boot 3.5.5 is the latest stable (as of Sep 19, 2025) and has no core advisories; however Spring Data REST 3.5.0–3.5.5 is affected by CVE-2021-22047 — upgrade Spring Data REST to 3.5.6+ if it is used.

  • Repo check: no direct occurrences of spring-data-rest / spring-boot-starter-data-rest found; spring-oracle-example/pom.xml sets <spring.boot.version>3.5.5.
  • Action: run ./mvnw dependency:tree (or mvn dependency:tree) and search for "spring-data-rest" / "org.springframework.data"; if any spring-data-rest 3.5.0–3.5.5 is present, update that dependency (or bump the Spring Boot BOM) to a release that contains spring-data-rest 3.5.6+.

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

Choose a reason for hiding this comment

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

🧹 Nitpick

Fix formatting: remove excessive spaces inside brackets.

Consistent with the other workflow, fix the bracket spacing.

-        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 around lines 23 to 24: the YAML
lists use spaces inside square brackets ("[ 'temurin' ]" and "[ '21' ]") which
is inconsistent with other workflows; remove the excessive spaces so they read
"['temurin']" and "['21']" to match formatting conventions and maintain
consistency across workflows.

Comment on lines +50 to +53
run: |
echo "services<<EOF" >> $GITHUB_OUTPUT
docker compose -f ./spring-oracle-example/compose.yaml config --services >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix shell script quoting issues in GitHub output.

The shell script has several quoting issues that could cause problems with service names containing spaces or special characters.

       - 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
+          echo "services<<EOF" >> "$GITHUB_OUTPUT"
+          docker compose -f ./spring-oracle-example/compose.yaml config --services >> "$GITHUB_OUTPUT"
+          echo "EOF" >> "$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
run: |
echo "services<<EOF" >> $GITHUB_OUTPUT
docker compose -f ./spring-oracle-example/compose.yaml config --services >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
run: |
echo "services<<EOF" >> "$GITHUB_OUTPUT"
docker compose -f ./spring-oracle-example/compose.yaml config --services >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
🧰 Tools
🪛 actionlint (1.7.7)

50-50: shellcheck reported issue in this script: SC2129:style:1:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects

(shellcheck)


50-50: shellcheck reported issue in this script: SC2086:info:1:25: Double quote to prevent globbing and word splitting

(shellcheck)


50-50: shellcheck reported issue in this script: SC2086:info:2:77: Double quote to prevent globbing and word splitting

(shellcheck)


50-50: shellcheck reported issue in this script: SC2086:info:3:15: Double quote to prevent globbing and word splitting

(shellcheck)

Comment on lines +63 to +64
- name: Wait for containers to initialize
run: sleep 30
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Replace fixed sleep with proper health checks.

Using a fixed 30-second sleep is fragile and may fail if services take longer to start or waste time if they start quickly.

Replace the sleep with a proper wait strategy:

-      - name: Wait for containers to initialize
-        run: sleep 30
+      - name: Wait for services to be healthy
+        run: |
+          timeout 120 bash -c 'until docker compose -f ./spring-oracle-example/compose.yaml ps --format json | jq -e ".[].Health == \"healthy\"" > /dev/null 2>&1; do sleep 5; echo "Waiting for services..."; done'
+          echo "All services are healthy"

Note: This requires healthchecks to be defined in the compose file as suggested earlier. Would you like me to create a more robust health check script?

📝 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 30
- name: Wait for services to be healthy
run: |
timeout 120 bash -c 'until docker compose -f ./spring-oracle-example/compose.yaml ps --format json | jq -e ".[].Health == \"healthy\"" > /dev/null 2>&1; do sleep 5; echo "Waiting for services..."; done'
echo "All services are healthy"
🤖 Prompt for AI Agents
.github/workflows/spring-oracle-example.yml around lines 63-64: the job
currently uses a fixed 30s sleep to wait for containers; replace it with a loop
that polls container health states (requires healthcheck entries in
docker-compose) and proceeds only when all required services report "healthy" or
a configured timeout elapses. Implement the wait by iterating over the target
service names, querying each container's health via docker inspect (or docker
compose ps/inspect) until .State.Health.Status == "healthy", include a short
backoff between polls, fail the step with logs if timeout is reached, and remove
the hardcoded sleep.

Comment on lines +3 to +6
on:
push:
branches:
- "**"
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick

Use boolean type for workflow trigger.

The YAML specification recommends using proper boolean values (true/false) instead of strings for boolean fields.

 on:
-  push:
+  push: true
     branches:
       - "**"

Or alternatively, keep the current structure which is also valid:

on:
  push:
    branches:
      - "**"
🧰 Tools
🪛 YAMLlint (1.37.1)

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

(truthy)

🤖 Prompt for AI Agents
In spring-oracle-example/.github/workflows/maven.yml around lines 3–6 the
workflow trigger uses a string pattern for the push configuration; change the
trigger to use a boolean if you intend to enable push for all branches (replace
the push mapping with a boolean true) or keep the existing branches pattern
as-is if you meant to match branch patterns—update the YAML so the push key is a
proper boolean when enabling the trigger universally, or retain the branch list
format for pattern matching.

Comment on lines +14 to +15
distribution: [ 'temurin' ]
java: [ '21' ]
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick

Fix formatting: remove excessive spaces inside brackets.

The matrix definition has excessive spacing inside the brackets which violates YAML linting rules.

-        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] 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)

🤖 Prompt for AI Agents
In spring-oracle-example/.github/workflows/maven.yml around lines 14 to 15, the
matrix entries use brackets with extra spaces causing YAML lint failures; remove
the spaces inside the square brackets so entries are written as distribution:
['temurin'] and java: ['21'] (no spaces directly inside the brackets) and re-run
the linter to ensure formatting passes.

Comment on lines +23 to +24
private String name;
private Integer age;
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick

Consider adding JPA column annotations for better control

While the default column mappings work, explicitly defining column properties provides better control over the database schema and prevents issues with naming conventions.

Consider adding column annotations:

+    @Column(name = "NAME", length = 255)
     private String name;
+    @Column(name = "AGE")
     private Integer age;
📝 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
private String name;
private Integer age;
@Column(name = "NAME", length = 255)
private String name;
@Column(name = "AGE")
private Integer age;
🤖 Prompt for AI Agents
In spring-oracle-example/src/main/java/com/io/example/entity/TestEntity.java
around lines 23-24, the fields lack explicit JPA @Column annotations; add
@Column to each field (importing javax.persistence.Column) to declare the DB
column name and constraints — e.g. annotate the name field with @Column(name =
"name", nullable = false, length = 100) (or adjust nullable/length to your
domain rules) and annotate the age field with @Column(name = "age", nullable =
true) (or set nullable = false if required); ensure the imports are added and
rebuild to apply schema/ORM mapping changes.

Comment on lines +5 to +9
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

Choose a reason for hiding this comment

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

⚠️ Potential issue

Avoid committing usable default DB password; prefer required env or obvious placeholder.

Keep dev friendly, but prevent accidental usage in other envs.

-    username: ${SPRING_DATASOURCE_USERNAME:TEST_SCHEMA}
-    password: ${SPRING_DATASOURCE_PASSWORD:Ag101Pwd123}
+    username: ${SPRING_DATASOURCE_USERNAME:TEST_SCHEMA}
+    # Use a non-working placeholder; require override via env
+    password: ${SPRING_DATASOURCE_PASSWORD:__CHANGE_ME__}
📝 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: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}
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:oracle:thin:@localhost:1521/XEPDB1}
username: ${SPRING_DATASOURCE_USERNAME:TEST_SCHEMA}
# Use a non-working placeholder; require override via env
password: ${SPRING_DATASOURCE_PASSWORD:__CHANGE_ME__}
driver-class-name: ${SPRING_DATASOURCE_DRIVER:oracle.jdbc.OracleDriver}
🤖 Prompt for AI Agents
In spring-oracle-example/src/main/resources/application-dev.yml around lines 5
to 9, the datasource.password is set to a usable default ("Ag101Pwd123");
replace that hardcoded secret with a non-functional placeholder or remove the
inline default so the value must come from SPRING_DATASOURCE_PASSWORD at runtime
(e.g., use an obvious placeholder like CHANGE_ME or leave empty), and update any
README/.env.example to document that the env var is required for local dev;
ensure no real credentials remain in the repo.

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

Choose a reason for hiding this comment

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

🧹 Nitpick

Hibernate/driver settings are fine; consider relying on auto‑detection.

Hibernate 6/Spring Boot 3 auto‑detect Oracle dialect and driver; you can drop explicit values unless you need overrides.

-    driver-class-name: ${SPRING_DATASOURCE_DRIVER:oracle.jdbc.OracleDriver}
+    # driver-class-name can be omitted (auto-detected)
@@
-    properties:
-      hibernate:
-        dialect: ${SPRING_HIBERNATE_DIALECT:org.hibernate.dialect.OracleDialect}
+    # dialect can be omitted (auto-detected)

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 11
to 17, the file sets an explicit Hibernate dialect property (hibernate.dialect)
which you can remove to let Spring Boot/Hibernate auto-detect Oracle; delete the
hibernate.dialect entry (and any explicit driver config elsewhere) from this
profile, leaving the other jpa properties intact, and only reintroduce the
explicit settings via environment vars or profile-specific overrides if you
actually need to force a non‑default.

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

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

Choose a reason for hiding this comment

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

🧹 Nitpick

Consider adding defaults or validation for environment variables

The configuration relies entirely on environment variables without defaults, which could cause startup failures if any are missing. Consider adding validation or documentation for required environment variables.

To improve resilience, you could:

  1. Add a configuration validator bean to check required environment variables at startup
  2. Document the required environment variables in a README or .env.example file
  3. Consider providing sensible defaults for non-sensitive properties (e.g., show-sql: false)

Would you like me to help create a configuration validator or documentation for the required environment variables?

🧰 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
In spring-oracle-example/src/main/resources/application.yml around lines 5 to
17, the YAML uses only environment variables with no defaults or startup
validation which can cause crashes if any are missing; add sensible defaults for
non-sensitive settings (e.g., show-sql: false, ddl-auto: none or validate) in
the YAML using ${VAR:default} syntax, and remove defaults for sensitive values
if you want them required; add a Spring @Configuration bean that runs on startup
to validate required env properties (throw a clear exception listing missing
vars) and register it so the app fails fast with a helpful message; and create a
README or .env.example documenting all required environment variables and their
purpose.

show-sql: ${SPRING_JPA_SHOW_SQL}
properties:
hibernate:
dialect: ${SPRING_HIBERNATE_DIALECT} No newline at end of file
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick

Add newline at end of file

YAML files should end with a newline character for proper POSIX compliance and to avoid potential issues with text processing tools.

Apply this diff:

       hibernate:
-        dialect: ${SPRING_HIBERNATE_DIALECT}
+        dialect: ${SPRING_HIBERNATE_DIALECT}
+
📝 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
dialect: ${SPRING_HIBERNATE_DIALECT}
dialect: ${SPRING_HIBERNATE_DIALECT}
🧰 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
In spring-oracle-example/src/main/resources/application.yml around line 17, the
file is missing a trailing newline; update the file by adding a single newline
character at the end of the file (ensure the last line "dialect:
${SPRING_HIBERNATE_DIALECT}" is followed by a newline) and save so the file ends
with a POSIX-compliant newline.

@igorcampos-dev igorcampos-dev merged commit 9b44417 into master Sep 19, 2025
4 checks passed
@igorcampos-dev igorcampos-dev deleted the feat/oracle-example branch September 19, 2025 01:34
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.

2 participants