feat(spring-oracle-example): initialize Spring Boot project with Orac…#67
feat(spring-oracle-example): initialize Spring Boot project with Orac…#67igorcampos-dev wants to merge 2 commits intomasterfrom
Conversation
WalkthroughAdds 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
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.
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 26
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 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-scriptis a valid Maven WrapperdistributionType.
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 tobinis unnecessary.Likely an incorrect or invalid review comment.
spring-oracle-example/.dockerignore (1)
25-33: Don’t ignore Dockerfile/compose files in .dockerignoreExcluding 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 verifyNo 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 entrypointStandard 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 verifiedspring-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.
| on: | ||
| pull_request: | ||
| branches: [master] | ||
| paths: | ||
| - "spring-oracle-example/**" | ||
| types: | ||
| - opened | ||
| - synchronize | ||
| - reopened |
There was a problem hiding this comment.
🧹 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.
| 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.
| distribution: [ 'temurin' ] | ||
| java: [ '21' ] |
There was a problem hiding this comment.
🧹 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.
| 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']".
| - 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 |
There was a problem hiding this comment.
🛠️ 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.
| - 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.
| LICENSE | ||
| README.md |
There was a problem hiding this comment.
🧹 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.
| 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.
| 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} | ||
|
|
There was a problem hiding this comment.
🧹 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.
| 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} |
There was a problem hiding this comment.
🧹 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.
| datasource: | ||
| url: ${SPRING_DATASOURCE_URL} | ||
| username: ${SPRING_DATASOURCE_USERNAME} | ||
| password: ${SPRING_DATASOURCE_PASSWORD} | ||
| driver-class-name: ${SPRING_DATASOURCE_DRIVER} | ||
|
|
There was a problem hiding this comment.
🧹 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.
| 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.
| 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 |
There was a problem hiding this comment.
🧹 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.
| 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.
|
|
||
| ,---. ,------. ,------. ,--.,--. ,--. ,----. ,-----. ,------. ,---. ,-----.,--. ,------. | ||
| ' .-'| .--. '| .--. '| || ,'.| |' .-./ ,-----.' .-. '| .--. ' / O \ ' .--./| | | .---' | ||
| `. `-.| '--' || '--'.'| || |' ' || | .---.'-----'| | | || '--'.'| .-. || | | | | `--, | ||
| .-' | | --' | |\ \ | || | ` |' '--' | ' '-' '| |\ \ | | | |' '--'\| '--.| `---. | ||
| `-----'`--' `--' '--'`--'`--' `--' `------' `-----' `--' '--'`--' `--' `-----'`-----'`------' | ||
| SPRING-ORACLE-EXAMPLE No newline at end of file |
There was a problem hiding this comment.
🧹 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.
| ,---. ,------. ,------. ,--.,--. ,--. ,----. ,-----. ,------. ,---. ,-----.,--. ,------. | |
| ' .-'| .--. '| .--. '| || ,'.| |' .-./ ,-----.' .-. '| .--. ' / 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.
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (5)
.github/workflows/spring-oracle-example.yml (5)
69-69: Add a trailing newlineSilences 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 loopAvoids 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 runsImproves 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
📒 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 directoryKeeps steps concise and avoids path repetition.
26-28: Keep actions/checkout@v5 — no downgrade neededv5.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 requiredConfirmed 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.
| - 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 | ||
|
|
There was a problem hiding this comment.
🛠️ 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.
| - 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.
| - 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' | ||
|
|
There was a problem hiding this comment.
🛠️ 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.
| - 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.
…leDB example
Summary by CodeRabbit
New Features
Chores