Skip to content
Merged
Changes from 8 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
4ad21d9
add github action to check bean instantiations on startup
tobias-lippert Jun 28, 2025
4dfc909
always run on pull request for easier testing
tobias-lippert Jun 28, 2025
6950b79
improve naming
tobias-lippert Jun 28, 2025
74bde6d
avoid webapp build
tobias-lippert Jun 28, 2025
27492e2
avoid webapp build
tobias-lippert Jun 28, 2025
8664c06
dump complete log
tobias-lippert Jun 28, 2025
dc00e85
dump complete log
tobias-lippert Jun 28, 2025
c7276d2
fix boot run command
tobias-lippert Jun 28, 2025
73511b1
fix boot run command
tobias-lippert Jun 28, 2025
6e1297e
extend bean instantiation tracer
tobias-lippert Jun 28, 2025
da9b8da
try to fix different issues
tobias-lippert Jun 28, 2025
3cae3fa
fix build command
tobias-lippert Jun 28, 2025
67d1208
fix disabling liquibase
tobias-lippert Jun 28, 2025
f68210a
fix disabling liquibase
tobias-lippert Jun 28, 2025
32d7721
fix health check
tobias-lippert Jun 28, 2025
a3456f6
fix health check
tobias-lippert Jun 28, 2025
1cd6cc8
do not suppress curl output
tobias-lippert Jun 29, 2025
90aeb68
fix health check
tobias-lippert Jun 29, 2025
b1c4e33
allow access to health/liveness and health/readiness
tobias-lippert Jun 29, 2025
4533ce1
revert SecurityConfiguration change
tobias-lippert Jun 29, 2025
47fa1db
fix application started check
tobias-lippert Jun 29, 2025
8180608
fix application started check
tobias-lippert Jun 29, 2025
87ceafc
improve metrics validation
tobias-lippert Jun 29, 2025
2b26406
improve metrics validation
tobias-lippert Jun 29, 2025
802535d
Merge branch 'develop' into chore/test-instantiations-on-startup
tobias-lippert Jul 19, 2025
a1c21b8
Merge branch 'develop' into chore/test-instantiations-on-startup
tobias-lippert Jul 29, 2025
4c7c12a
improve gh action
tobias-lippert Jul 29, 2025
03e4ab7
simplify liquibase handling
tobias-lippert Jul 29, 2025
c4ccc21
improve bean instantiations check
tobias-lippert Jul 29, 2025
03244ae
fix check and log message
tobias-lippert Aug 1, 2025
e1ac1e4
fix gh action
tobias-lippert Aug 1, 2025
33e6985
fix message
tobias-lippert Aug 1, 2025
29c6ed5
debug print entire log
tobias-lippert Aug 1, 2025
ddb972d
increase timeout
tobias-lippert Aug 1, 2025
1724156
debug log
tobias-lippert Aug 1, 2025
533b9f4
debug log
tobias-lippert Aug 1, 2025
bd285ba
fix liquibase for h2
tobias-lippert Aug 1, 2025
3c58f8a
always enable liquibase
tobias-lippert Aug 1, 2025
e9c7324
reduce thresholds
tobias-lippert Aug 1, 2025
e4068b6
cleanup
tobias-lippert Aug 1, 2025
995a34f
cleanup
tobias-lippert Aug 1, 2025
a8b1b22
improve naming
tobias-lippert Aug 1, 2025
47ab84a
adapt threshold
tobias-lippert Aug 1, 2025
757d8e6
add threshold consistency check
tobias-lippert Aug 1, 2025
05da9d4
test threshold violation
tobias-lippert Aug 1, 2025
1149c8e
do not exit immediately
tobias-lippert Aug 1, 2025
8d1f1d0
fix threshold
tobias-lippert Aug 1, 2025
9750fa7
test deferred violation
tobias-lippert Aug 1, 2025
62dfa1a
fix gh action
tobias-lippert Aug 1, 2025
3c3385d
use correct thresholds again
tobias-lippert Aug 2, 2025
6311084
use correct condition again
tobias-lippert Aug 2, 2025
01963d2
Merge branch 'develop' into chore/test-instantiations-on-startup
tobias-lippert Aug 2, 2025
153e4c0
better naming in DatabaseMigration
tobias-lippert Aug 4, 2025
4ace040
be more helpful
tobias-lippert Aug 4, 2025
4d100d6
code rabbit
tobias-lippert Aug 4, 2025
17ebc29
fix gh action
tobias-lippert Aug 6, 2025
bbe7edb
Merge branch 'develop' into chore/test-instantiations-on-startup
tobias-lippert Aug 6, 2025
a7df261
better error message
tobias-lippert Aug 6, 2025
c9dfdc4
Merge branch 'develop' into chore/test-instantiations-on-startup
tobias-lippert Aug 12, 2025
c351bbb
fix gh action
tobias-lippert Aug 12, 2025
e01e1cf
upload artifacts
tobias-lippert Aug 12, 2025
f077a70
reset data before deferred init
tobias-lippert Aug 12, 2025
de2f70b
Merge branch 'develop' into chore/test-instantiations-on-startup
tobias-lippert Aug 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/bean-instantiations-startup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Check Bean Instantiations on Startup

on:
pull_request:
# paths:
# - 'src/main/java/**'

jobs:
build:
name: Check Bean Instantiations on Startup
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '21'

- name: Build application
run: ./gradlew clean assemble -x test -x webapp

- name: Start Spring Boot app
run: |
PROFILES=dev,localci,lti,aeolus,theia,iris,localvc,artemis,scheduling,buildagent,core,ldap
nohup ./gradlew bootRun -x webapp --args="--spring.profiles.active=$PROFILES --artemis.user-management.passkey.enabled=true --artemis.user-management.use-external=false --artemis.iris.url=http://iris.fake \
--artemis.iris.secret-token=token --spring.jpa.database=h2 --spring.datasource.url=jdbc:h2:mem:mydb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE --spring.datasource.username=sa --spring.datasource.password= --aeolus.url=http://aeolus.fake" > app.log 2>&1 &
echo $! > app.pid

- name: Wait for health endpoint
run: |
URL=http://localhost:8080/management/health/liveness
echo "Waiting for $URL → UP"
for i in {1..30}; do
if curl -s $URL | grep -q '"status":"UP"'; then
echo "✅ Actuator is UP (after $i attempts)"
break
fi
sleep 2
done
if ! curl -s $URL | grep -q '"status":"UP"'; then
echo "❌ Health check failed; dumping last 50 lines:"
cat app.log
exit 1
fi

- name: Extract and validate metrics
run: |
LINE=$(grep 'Bean instantiation graph exported' app.log) \
|| { echo "❌ No metrics line"; cat app.log; exit 1; }
echo "✅ Metrics line: $LINE"
if [[ "$LINE" =~ \(([0-9]+)\ edges,\ max\ call\ stack\ size:\ ([0-9]+)\) ]]; then
EDGES=${BASH_REMATCH[1]}
MAXSTACK=${BASH_REMATCH[2]}
else
echo "❌ Failed to parse numbers"; exit 1
fi
echo "• Number of edges = $EDGES"
echo "• Max call stack size = $MAXSTACK"
MIN_EDGES=20
MAX_EDGES=86
MAX_STACK_SIZE_THRESHOLD=10
(( EDGES < MIN_EDGES )) && { echo "❌ < $MIN_EDGES edges"; exit 1; }
(( EDGES > MAX_EDGES )) && { echo "❌ > $MAX_EDGES edges"; exit 1; }
(( MAXSTACK > MAX_STACK_SIZE_THRESHOLD )) && { echo "❌ stack > $MAX_STACK_SIZE_THRESHOLD"; exit 1; }
echo "✅ Final values → Edges: $EDGES; Max call stack size: $MAXSTACK"
echo "🎉 Bean metrics within expected ranges"

- name: Stop application
if: always()
run: kill $(<app.pid) || true