Skip to content

chore: setup CI pipeline with Spotless check#7

Merged
eeebbaandersson merged 5 commits into
mainfrom
infrastructure/ci-pipeline
Apr 7, 2026
Merged

chore: setup CI pipeline with Spotless check#7
eeebbaandersson merged 5 commits into
mainfrom
infrastructure/ci-pipeline

Conversation

@eeebbaandersson

@eeebbaandersson eeebbaandersson commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

This PR adds a GitHub Actions CI pipeline to ensure the project builds and follows style guidelines using Spotless.

Changes:

  • Added .github/workflows/build-and-test.yml for automated builds.
  • Configured spotless-maven-plugin in pom.xml.
  • Merged latest main changes to ensure compatibility.

Note:
After this is merged, please run ./mvnw spotless: check and ./mvnw spotless: apply in your local branch to stay in sync with the new formatting rules.

Summary by CodeRabbit

  • Chores

    • Added an automated build-and-test pipeline that runs on pushes and pull requests and enforces formatting checks during CI.
    • Cleaned up imports and standardized annotation/formatting across the codebase.
    • Adjusted build tooling to include formatting and annotation processing checks.
  • Configuration

    • Changed JPA schema handling to allow automatic schema updates at runtime.
    • Disabled Flyway-related migration dependencies in the build configuration.

@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dd1ac8d6-42a5-41fb-aed8-9c6a4003d622

📥 Commits

Reviewing files that changed from the base of the PR and between d88a300 and 6bec691.

📒 Files selected for processing (2)
  • pom.xml
  • src/main/resources/application.properties
✅ Files skipped from review due to trivial changes (1)
  • src/main/resources/application.properties
🚧 Files skipped from review as they are similar to previous changes (1)
  • pom.xml

📝 Walkthrough

Walkthrough

Adds a GitHub Actions workflow to run Maven tests and Spotless checks on pushes/PRs to main, updates Maven build (Spotless + Lombok annotationProcessor), comments out Flyway dependencies, changes JPA ddl-auto to update, collapses annotation formatting across entities, and removes an unused import.

Changes

Cohort / File(s) Summary
CI/CD Workflow
/.github/workflows/build-and-test.yml
New GitHub Actions workflow triggered on push and pull_request to main; checks out code, sets up Temurin JDK 25, caches Maven, makes mvnw executable, runs ./mvnw -B test and ./mvnw -B spotless:check.
Maven Build & Dependencies
pom.xml
Added spotless-maven-plugin configured to run spotless:check during verify; added Lombok to maven-compiler-plugin annotationProcessorPaths; commented out Flyway-related dependencies.
Application Config
src/main/resources/application.properties
Changed spring.jpa.hibernate.ddl-auto from validate to update.
Entity Annotation Formatting
src/main/java/org/example/visacasemanagementsystem/audit/entity/AuditLog.java, src/main/java/org/example/visacasemanagementsystem/comment/entity/Comment.java, src/main/java/org/example/visacasemanagementsystem/user/entity/User.java, src/main/java/org/example/visacasemanagementsystem/visa/entity/Visa.java
Collapsed multi-line annotation blocks into single-line declarations for various fields; no behavioral or signature changes.
Import Cleanup
src/main/java/org/example/visacasemanagementsystem/audit/mapper/AuditMapper.java
Removed an unused java.time.LocalDateTime import.

Sequence Diagram(s)

sequenceDiagram
  rect rgba(99,102,241,0.5)
    participant Dev as Developer (push/PR)
    participant GH as GitHub
  end
  rect rgba(16,185,129,0.5)
    participant Runner as Actions Runner (ubuntu-latest)
    participant Maven as Maven Wrapper (`./mvnw`)
  end

  Dev->>GH: push / open pull_request to main
  GH->>Runner: trigger `build-and-test` job
  Runner->>Runner: actions/checkout@v4
  Runner->>Runner: setup-java (Temurin JDK 25), cache Maven
  Runner->>Maven: make `mvnw` executable
  Runner->>Maven: run `./mvnw -B test`
  Maven-->>Runner: test results
  Runner->>Maven: run `./mvnw -B spotless:check`
  Maven-->>Runner: formatting report / exit status
  Runner-->>GH: job status (success/fail)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Infrastructure/update base #1 — Adds(org.projectlombok:lombok) dependency/configuration in Maven; related to the pom.xml annotationProcessorPaths change.

Poem

🐇 I hopped through lines with gentle cheer,
Spotless checks and tests appear.
Annotations snug in a single row,
CI hums on each push and flow.
Carrots for green builds — nibble near!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately reflects the primary changes: adding a CI pipeline workflow and configuring Spotless formatting checks.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch infrastructure/ci-pipeline

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/main/java/org/example/visacasemanagementsystem/visa/entity/Visa.java`:
- Line 12: The file contains a duplicate import of the VisaType class which will
break compilation; remove the redundant import statement for
org.example.visacasemanagementsystem.visa.VisaType so only a single import
remains (update the import block in the Visa entity class where VisaType is
referenced).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cd95ec51-90a7-4ebd-baec-592dacd8f754

📥 Commits

Reviewing files that changed from the base of the PR and between 0ad7be9 and ca43e60.

📒 Files selected for processing (7)
  • .github/workflows/build-and-test.yml
  • pom.xml
  • src/main/java/org/example/visacasemanagementsystem/audit/entity/AuditLog.java
  • src/main/java/org/example/visacasemanagementsystem/audit/mapper/AuditMapper.java
  • src/main/java/org/example/visacasemanagementsystem/comment/entity/Comment.java
  • src/main/java/org/example/visacasemanagementsystem/user/entity/User.java
  • src/main/java/org/example/visacasemanagementsystem/visa/entity/Visa.java
💤 Files with no reviewable changes (1)
  • src/main/java/org/example/visacasemanagementsystem/audit/mapper/AuditMapper.java

Comment thread src/main/java/org/example/visacasemanagementsystem/visa/entity/Visa.java Outdated
@eeebbaandersson eeebbaandersson linked an issue Apr 7, 2026 that may be closed by this pull request
@eeebbaandersson
eeebbaandersson merged commit 84e7222 into main Apr 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement CI Pipeline

1 participant