Skip to content
This repository was archived by the owner on Jul 1, 2025. It is now read-only.

Commit 75df7fa

Browse files
dfcoffinclaude
andcommitted
Implement Spring Boot 3.5 migration with Entity architecture
Major architectural modernization to Spring Boot 3.5 with comprehensive infrastructure upgrades and Entity-based domain model integration. ## Framework Migration - Upgrade to Spring Boot 3.5.0 with Java 21 runtime - Modernize Spring Security 6.5 with OAuth2 Resource Server - Migrate from javax.* to jakarta.* namespace - Update all dependencies to Spring Boot 3.5 compatible versions ## Infrastructure Modernization - Add GitHub Actions CI/CD pipeline replacing CircleCI - Implement TestContainers for integration testing - Add JaCoCo code coverage and OWASP security scanning - Configure multi-profile Maven build (dev, test, prod) ## Domain Model Architecture - Migrate from legacy domain classes to Entity classes - Update imports from domain.legacy to domain.usage Entity types - Fix ResourceValidationFilter to use AuthorizationEntity/SubscriptionEntity - Update customer controllers to use Entity architecture - Resolve Entity vs Legacy type compatibility issues ## Security Configuration - Implement modern OAuth2 Resource Server for opaque tokens - Configure ESPI-compliant authorization with scope-based access - Add JWT decoder configuration for token validation - Update security rules for Entity-based architecture ## Application Structure - Create modern DataCustodianApplication with Entity scanning - Add comprehensive web configuration with CORS support - Implement modern controller architecture with Entity types - Add version endpoint with build information ## Development Experience - Add Maven wrapper for consistent builds - Configure SDKMAN for Java version management - Add comprehensive OWASP security suppressions - Include development settings and configuration examples ## Testing Infrastructure - Add TestContainers for MySQL and PostgreSQL - Configure Cucumber for behavior-driven testing - Add comprehensive test resource configuration - Enable parallel test execution with proper isolation This migration establishes the foundation for modern Spring Boot 3.5 development while maintaining ESPI standard compliance and OAuth2 security requirements. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent f3f7bd2 commit 75df7fa

File tree

333 files changed

+45982
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+45982
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(grep:*)"
5+
],
6+
"deny": []
7+
}
8+
}
Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main, develop, feature/spring-boot-3.5-architectural-modernization ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
JAVA_VERSION: '21'
11+
MAVEN_OPTS: -Xmx3200m
12+
13+
jobs:
14+
test:
15+
name: Test
16+
runs-on: ubuntu-latest
17+
18+
services:
19+
mysql:
20+
image: mysql:8.0
21+
env:
22+
MYSQL_ROOT_PASSWORD: rootpw
23+
MYSQL_DATABASE: testdb
24+
ports:
25+
- 3306:3306
26+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
34+
- name: Set up JDK ${{ env.JAVA_VERSION }}
35+
uses: actions/setup-java@v4
36+
with:
37+
java-version: ${{ env.JAVA_VERSION }}
38+
distribution: 'temurin'
39+
40+
- name: Cache Maven dependencies
41+
uses: actions/cache@v4
42+
with:
43+
path: ~/.m2/repository
44+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
45+
restore-keys: |
46+
${{ runner.os }}-maven-
47+
48+
- name: Install OpenESPI-Common dependency
49+
run: |
50+
cd ../OpenESPI-Common-java
51+
mvn clean install -DskipTests
52+
cd ../OpenESPI-DataCustodian-java
53+
54+
- name: Compile project
55+
run: mvn clean compile -P dev-mysql
56+
57+
- name: Run security scan
58+
run: mvn org.owasp:dependency-check-maven:check -DfailBuildOnCVSS=7 -P dev-mysql
59+
continue-on-error: false
60+
61+
- name: Run unit tests
62+
run: mvn test -P dev-mysql
63+
env:
64+
SPRING_PROFILES_ACTIVE: test
65+
66+
- name: Run integration tests
67+
run: mvn verify -P testcontainers-mysql
68+
env:
69+
SPRING_PROFILES_ACTIVE: testcontainers-mysql
70+
71+
- name: Upload test reports
72+
uses: actions/upload-artifact@v4
73+
if: always()
74+
with:
75+
name: test-reports
76+
path: |
77+
target/surefire-reports/
78+
target/failsafe-reports/
79+
target/cucumber-reports/
80+
target/site/jacoco/
81+
retention-days: 30
82+
83+
- name: Upload OWASP report
84+
uses: actions/upload-artifact@v4
85+
if: always()
86+
with:
87+
name: owasp-report
88+
path: target/dependency-check-report.html
89+
retention-days: 30
90+
91+
build:
92+
name: Build
93+
runs-on: ubuntu-latest
94+
needs: test
95+
96+
steps:
97+
- name: Checkout code
98+
uses: actions/checkout@v4
99+
100+
- name: Set up JDK ${{ env.JAVA_VERSION }}
101+
uses: actions/setup-java@v4
102+
with:
103+
java-version: ${{ env.JAVA_VERSION }}
104+
distribution: 'temurin'
105+
106+
- name: Cache Maven dependencies
107+
uses: actions/cache@v4
108+
with:
109+
path: ~/.m2/repository
110+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
111+
restore-keys: |
112+
${{ runner.os }}-maven-
113+
114+
- name: Install OpenESPI-Common dependency
115+
run: |
116+
cd ../OpenESPI-Common-java
117+
mvn clean install -DskipTests
118+
cd ../OpenESPI-DataCustodian-java
119+
120+
- name: Build JAR
121+
run: mvn clean package -P dev-mysql -DskipTests
122+
123+
- name: Upload JAR artifact
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: datacustodian-jar
127+
path: target/OpenESPI-DataCustodian.jar
128+
retention-days: 30
129+
130+
code-quality:
131+
name: Code Quality
132+
runs-on: ubuntu-latest
133+
needs: test
134+
if: github.ref == 'refs/heads/main'
135+
136+
steps:
137+
- name: Checkout code
138+
uses: actions/checkout@v4
139+
with:
140+
fetch-depth: 0
141+
142+
- name: Set up JDK ${{ env.JAVA_VERSION }}
143+
uses: actions/setup-java@v4
144+
with:
145+
java-version: ${{ env.JAVA_VERSION }}
146+
distribution: 'temurin'
147+
148+
- name: Cache Maven dependencies
149+
uses: actions/cache@v4
150+
with:
151+
path: ~/.m2/repository
152+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
153+
restore-keys: |
154+
${{ runner.os }}-maven-
155+
156+
- name: Install OpenESPI-Common dependency
157+
run: |
158+
cd ../OpenESPI-Common-java
159+
mvn clean install -DskipTests
160+
cd ../OpenESPI-DataCustodian-java
161+
162+
- name: Run SonarCloud analysis
163+
if: env.SONAR_TOKEN != ''
164+
env:
165+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
167+
run: |
168+
mvn clean compile test jacoco:report -P dev-mysql
169+
mvn sonar:sonar \
170+
-Dsonar.projectKey=GreenButtonAlliance_OpenESPI-DataCustodian-java \
171+
-Dsonar.organization=greenbuttonalliance \
172+
-Dsonar.host.url=https://sonarcloud.io \
173+
-Dsonar.token=$SONAR_TOKEN
174+
175+
security:
176+
name: Security Scan
177+
runs-on: ubuntu-latest
178+
needs: build
179+
180+
steps:
181+
- name: Checkout code
182+
uses: actions/checkout@v4
183+
184+
- name: Run Trivy vulnerability scanner
185+
uses: aquasecurity/trivy-action@master
186+
with:
187+
scan-type: 'fs'
188+
scan-ref: '.'
189+
format: 'sarif'
190+
output: 'trivy-results.sarif'
191+
192+
- name: Upload Trivy scan results to GitHub Security tab
193+
uses: github/codeql-action/upload-sarif@v3
194+
if: always()
195+
with:
196+
sarif_file: 'trivy-results.sarif'
197+
198+
- name: Run TruffleHog OSS
199+
uses: trufflesecurity/trufflehog@main
200+
with:
201+
path: ./
202+
base: main
203+
head: HEAD
204+
extra_args: --debug --only-verified
205+
206+
docker:
207+
name: Docker Build
208+
runs-on: ubuntu-latest
209+
needs: build
210+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
211+
212+
steps:
213+
- name: Checkout code
214+
uses: actions/checkout@v4
215+
216+
- name: Download JAR artifact
217+
uses: actions/download-artifact@v4
218+
with:
219+
name: datacustodian-jar
220+
path: target/
221+
222+
- name: Set up Docker Buildx
223+
uses: docker/setup-buildx-action@v3
224+
225+
- name: Build Docker image
226+
uses: docker/build-push-action@v5
227+
with:
228+
context: .
229+
file: ./Dockerfile
230+
platforms: linux/amd64,linux/arm64
231+
push: false
232+
tags: |
233+
greenbuttonalliance/openespi-datacustodian:latest
234+
greenbuttonalliance/openespi-datacustodian:${{ github.sha }}
235+
cache-from: type=gha
236+
cache-to: type=gha,mode=max
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
######################
2+
# Project Specific
3+
######################
4+
/build/www/**
5+
/src/test/javascript/coverage/
6+
/src/test/javascript/PhantomJS*/
7+
8+
######################
9+
# Node
10+
######################
11+
/node/
12+
node_tmp/
13+
node_modules/
14+
npm-debug.log.*
15+
16+
######################
17+
# SASS
18+
######################
19+
.sass-cache/
20+
21+
######################
22+
# Eclipse
23+
######################
24+
*.pydevproject
25+
.project
26+
.metadata
27+
tmp/
28+
tmp/**/*
29+
*.tmp
30+
*.bak
31+
*.swp
32+
*~.nib
33+
local.properties
34+
.classpath
35+
.settings/
36+
.loadpath
37+
.factorypath
38+
/src/main/resources/rebel.xml
39+
40+
# External tool builders
41+
.externalToolBuilders/**
42+
43+
# Locally stored "Eclipse launch configurations"
44+
*.launch
45+
46+
# CDT-specific
47+
.cproject
48+
49+
# PDT-specific
50+
.buildpath
51+
52+
######################
53+
# Intellij
54+
######################
55+
.idea/
56+
*.iml
57+
*.iws
58+
*.ipr
59+
*.ids
60+
*.orig
61+
62+
######################
63+
# Visual Studio Code
64+
######################
65+
.vscode/
66+
67+
######################
68+
# Maven
69+
######################
70+
/log/
71+
/target/
72+
73+
######################
74+
# Gradle
75+
######################
76+
.gradle/
77+
/build/
78+
79+
######################
80+
# Package Files
81+
######################
82+
*.jar
83+
*.war
84+
*.ear
85+
*.db
86+
87+
######################
88+
# Windows
89+
######################
90+
# Windows image file caches
91+
Thumbs.db
92+
93+
# Folder config file
94+
Desktop.ini
95+
96+
######################
97+
# Mac OSX
98+
######################
99+
.DS_Store
100+
.svn
101+
102+
# Thumbnails
103+
._*
104+
105+
# Files that might appear on external disk
106+
.Spotlight-V100
107+
.Trashes
108+
109+
######################
110+
# Directories
111+
######################
112+
/bin/
113+
/deploy/
114+
115+
######################
116+
# Logs
117+
######################
118+
*.log
119+
120+
######################
121+
# Others
122+
######################
123+
*.class
124+
*.*~
125+
*~
126+
.merge_file*
127+
128+
######################
129+
# Gradle Wrapper
130+
######################
131+
!gradle/wrapper/gradle-wrapper.jar
132+
133+
######################
134+
# Maven Wrapper
135+
######################
136+
!.mvn/wrapper/maven-wrapper.jar
137+
138+
######################
139+
# ESLint
140+
######################
141+
.eslintcache
142+
143+
######################
144+
# attach_pid
145+
######################
146+
.attach_pid*
147+

0 commit comments

Comments
 (0)