This document describes the CI/CD pipeline implementation for MetaDetect, including automated checks, manual testing procedures, and how to access CI reports.
- Automated CI Pipeline
- Manual Testing Procedures
- Accessing CI Reports
- Running CI Checks Locally
- CI Pipeline Architecture
The CI pipeline runs automatically on:
- Every push to any branch
- Every pull request to
mainbranch - Manual workflow dispatch (optional)
- What it does: Compiles the Java source code
- Command:
./mvnw -B clean compile - Fails on: Compilation errors
- Output: Compiled
.classfiles intarget/classes/
- What it does: Runs all JUnit unit tests
- Command:
./mvnw -B test - Fails on: Test failures or errors
- Coverage: Automatically tracked by JaCoCo
- Output:
- Test results in
target/surefire-reports/ - JaCoCo coverage data in
target/jacoco.exec
- Test results in
- Tool: JaCoCo (Java Code Coverage)
- Command:
./mvnw -B jacoco:report - Metrics tracked:
- Line coverage
- Branch coverage
- Method coverage
- Class coverage
- Output: HTML reports in
target/site/jacoco/index.html
- Tool: Checkstyle
- Standard: Google Java Style Guide
- Command:
./mvnw -B checkstyle:checkstyle - Checks:
- Code formatting
- Naming conventions
- Javadoc requirements
- Import organization
- Output:
- XML:
target/checkstyle-result.xml - HTML:
target/site/checkstyle.html
- XML:
- Tool: PMD (Programming Mistake Detector)
- Command:
./mvnw -B pmd:pmd - Detects:
- Potential bugs
- Dead code
- Suboptimal code
- Overcomplicated expressions
- Duplicate code
- Output:
- XML:
target/pmd.xml - HTML:
target/site/pmd.html
- XML:
- Command:
./mvnw -B site - Includes:
- Project information
- Dependencies report
- All plugin reports (JaCoCo, Checkstyle, PMD)
- Aggregated documentation
- Output: Complete site in
target/site/index.html
- Checkstyle Gate:
./mvnw -B checkstyle:check- Fails build if style violations exceed threshold
- Set to
continue-on-error: truefor reports
- PMD Gate:
./mvnw -B pmd:check- Warns on code quality issues
- Non-blocking for report generation
- HTML/XML Reports - Raw report files
- PNG Screenshots - Visual report summaries
- Test Results - JUnit XML format
- Build JAR - Packaged application
.github/workflows/
├── ci-reports.yml # Comprehensive CI with reports
└── maven-main.yml # Fast build and test pipeline
- End-to-End Tests require live external services with sensitive credentials
- API Integration Tests need interactive token management and file uploads
- Client UI Tests require visual validation and browser interaction
# Required environment variables
export SPRING_DATASOURCE_URL="jdbc:postgresql://..."
export SPRING_DATASOURCE_USERNAME="..."
export SPRING_DATASOURCE_PASSWORD="..."
export SUPABASE_URL="https://..."
export SUPABASE_ANON_KEY="..."
export SUPABASE_JWT_SECRET="..."
export SUPABASE_STORAGE_BUCKET="..."
export LIVE_E2E=true# Option 1: Run specific E2E test
mvn -Dtest=dev.coms4156.project.metadetect.e2e.ClientServiceLiveE2eTest test
# Option 2: Run all tests including E2E
mvn test- ✅ User signup via Supabase Auth
- ✅ User login and token generation
- ✅ Image upload to S3 storage
- ✅ Database persistence verification
- ✅ Image retrieval with signed URLs
- ✅ Image deletion and cleanup
# 1. Sign up a new user
curl -X POST http://localhost:8080/auth/signup \
-H "Content-Type: application/json" \
-d '{"email": "testuser@example.com", "password": "SecurePass123"}'
# 2. Log in and save token
TOKEN=$(curl -s -X POST http://localhost:8080/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "testuser@example.com", "password": "SecurePass123"}' \
| jq -r '.access_token')
# 3. Upload an image
IMAGE_ID=$(curl -s -X POST http://localhost:8080/api/images/upload \
-H "Authorization: Bearer $TOKEN" \
-F "file=@src/test/resources/mock-images/Spaghetti.png" \
| jq -r '.id')
# 4. Analyze the image
ANALYSIS_ID=$(curl -s -X POST "http://localhost:8080/api/analyze/$IMAGE_ID" \
-H "Authorization: Bearer $TOKEN" \
| jq -r '.analysisId')
# 5. Get analysis status
curl -X GET "http://localhost:8080/api/analyze/$ANALYSIS_ID" \
-H "Authorization: Bearer $TOKEN"
# 6. Get manifest (if available)
curl -X GET "http://localhost:8080/api/analyze/$ANALYSIS_ID/manifest" \
-H "Authorization: Bearer $TOKEN"
# 7. Delete the image
curl -X DELETE "http://localhost:8080/api/images/$IMAGE_ID" \
-H "Authorization: Bearer $TOKEN"-
Import Collection:
- Create a new Postman collection named "MetaDetect API"
- Add the base URL:
http://localhost:8080
-
Set up environment variables:
baseUrl:http://localhost:8080accessToken: (will be set after login)
-
Test sequence:
- POST
/auth/signup→ Save email/password - POST
/auth/login→ Copy access_token to environment - POST
/api/images/upload→ Upload test image - POST
/api/analyze/{imageId}→ Start analysis - GET
/api/analyze/{analysisId}→ Check status - GET
/api/images→ List all images - DELETE
/api/images/{id}→ Clean up
- POST
-
Verify in Supabase Dashboard:
- Check user table for new accounts
- Verify images bucket for uploaded files
- Confirm database records for metadata
# Terminal 1: Start backend
mvn spring-boot:run
# Terminal 2: Start client server
python3 -m http.server 4173 --directory client-
Landing Page (http://localhost:4173)
- Page loads correctly
- API URL badge shows correct backend
- Both forms render properly
-
Sign Up Flow
- Enter email and password
- Submit form
- Response panel shows Supabase JSON
- User object contains email
- Copy button works
-
Login Flow
- Enter credentials
- Submit form
- Response includes access_token
- Auto-redirect to Pulse Studio
-
Pulse Studio (http://localhost:4173/compose.html)
- Token automatically loaded from previous login
- Upload form accepts images
- Caption and labels can be added
- Post appears in feed after upload
- Signed URL loads image preview
- Delete button removes post
- AI badge updates when analysis completes
-
Error Handling
- Invalid credentials show error
- Expired token redirects to login
- Upload failures show message
- Network errors display properly
-
Navigate to Actions tab:
https://github.com/Jalen-Stephens/AdvanceJavaStudentEngineers/actions -
Select a workflow run:
- Click on the most recent run at the top
- Green checkmark = success
- Red X = failure
- Yellow circle = in progress
-
View CI Summary:
- Scroll to bottom of workflow run page
- See test counts and available reports
- Links to download artifacts
-
Download Artifacts:
ci-reports-html-xml(200-500 KB)- Contains all HTML and XML reports
- Extract and open
target/site/index.html
ci-reports-screenshots(50-100 KB)- PNG images of key reports
- Quick visual reference
test-results(10-50 KB)- JUnit XML files
- Can be imported into test management tools
application-jar(30-50 MB)- Packaged application
- Ready to deploy
- File:
target/site/jacoco/index.html - Shows:
- Overall coverage percentages
- Per-package breakdown
- Per-class details
- Uncovered line highlights
- File:
target/site/checkstyle.html - Shows:
- Violations by severity (error, warning, info)
- Violations by file
- Specific rule violations with line numbers
- File:
target/site/pmd.html - Shows:
- Code quality issues by priority
- Detailed violation descriptions
- Suggestions for improvement
- Affected files with line numbers
- File:
target/site/surefire-report.html - Shows:
- Test execution summary
- Pass/fail status per test
- Execution time
- Failure stack traces
Pre-generated report screenshots in reports/ directory:
checkstyle-report.png- Latest style check resultsbranch-report.png- Coverage visualizationpmd-report.png- Static analysis findingsapi-testing.png- Manual API test evidence
# Run the complete CI pipeline locally
./scripts/run-ci-locally.sh# Check style (fails on violations)
mvn checkstyle:check
# Generate style report
mvn checkstyle:checkstyle
# View report
open target/site/checkstyle.html # macOS
xdg-open target/site/checkstyle.html # Linux
start target/site/checkstyle.html # Windows# Run PMD analysis
mvn pmd:pmd
# Check against rules (may fail build)
mvn pmd:check
# View report
open target/site/pmd.html# Run tests with coverage
mvn clean test
# Generate coverage report
mvn jacoco:report
# View report
open target/site/jacoco/index.html# Generate complete Maven site
mvn clean test site
# Open main site page
open target/site/index.html# Fast: compile and test
mvn clean test
# Medium: compile, test, and package
mvn clean package
# Full: all checks and reports
mvn clean verify site┌─────────────────┐
│ Git Push │
│ Pull Request │
└────────┬────────┘
│
▼
┌─────────────────────────────────────────┐
│ GitHub Actions Trigger │
└────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Environment Setup │
│ - Checkout code │
│ - Setup JDK 17 │
│ - Cache Maven dependencies │
└────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Build & Compile │
│ ./mvnw clean compile │
└────────┬────────────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Unit Tests │
│ ./mvnw test │
└────────┬────────────────────────────────┘
│
├──────────────────────┐
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ Code Coverage │ │ Style Checking │
│ jacoco:report │ │ checkstyle │
└────────┬─────────┘ └────────┬─────────┘
│ │
└──────────┬───────────┘
▼
┌──────────────────────┐
│ Static Analysis │
│ pmd:pmd │
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ Maven Site │
│ Aggregate Reports │
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ Quality Gates │
│ checkstyle:check │
│ pmd:check │
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ Generate PNGs │
│ wkhtmltoimage │
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ Upload Artifacts │
│ - HTML/XML Reports │
│ - PNG Screenshots │
│ - Test Results │
│ - JAR Files │
└──────────┬───────────┘
│
▼
┌──────────────────────┐
│ Generate Summary │
│ GitHub UI │
└──────────────────────┘
Some stages run in parallel for speed:
- Coverage, Style, and Static Analysis (independent)
- Report generation happens after all analysis complete
-
Hard failures (block pipeline):
- Compilation errors
- Test failures
- Build packaging errors
-
Soft failures (continue, report issues):
- Style violations (in report mode)
- PMD warnings
- PNG generation failures
- 30 days: CI reports (HTML/XML/PNG)
- 7 days: Build artifacts (JAR files)
- Forever: Latest reports committed to
reports/directory
- Build success rate
- Test execution time
- Code coverage trends
- Style violation counts
- PMD issue trends
- Automated E2E tests with test database
- Performance testing integration
- Security scanning (OWASP Dependency Check)
- Automated deployment to staging
- Slack/Discord notifications
- PR comment reports
Issue: Tests pass locally but fail in CI
- Cause: Environment differences, missing dependencies
- Solution: Check CI logs and verify pom.xml
Issue: PMD report not generated
- Cause: Analysis errors, missing source files
- Solution: Run
mvn pmd:pmdlocally, check target/pmd folder
Issue: Coverage report empty
- Cause: Tests not run, JaCoCo agent not attached
- Solution: Ensure
mvn testruns beforejacoco:report
Issue: Artifacts not available
- Cause: Workflow failed before artifact upload
- Solution: Check step that failed, fix and re-run
- CI/CD Issues: Open issue with
ci-pipelinelabel - Test Failures: Check logs, open issue with
testinglabel - Report Questions: Review this document, contact team