chore(swagger): automate swagger sync to amrit-docs#113
chore(swagger): automate swagger sync to amrit-docs#113DurgaPrasad-54 wants to merge 5 commits intoPSMRI:mainfrom
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 Walkthrough📝 Walkthrough🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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: 1
🤖 Fix all issues with AI agents
In `@src/main/resources/application-swagger.properties`:
- Around line 6-9: The swagger profile currently sets
spring.data.redis.host/port but does not disable Redis auto-configuration;
update the application-swagger properties to explicitly exclude Redis
auto-configuration by adding the spring.autoconfigure.exclude property
referencing
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration (and
optionally
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration)
so Spring Boot won't attempt to connect to Redis during the swagger profile.
🧹 Nitpick comments (2)
src/main/resources/application-swagger.properties (1)
15-16: Avoid committing a default JWT secret.The fallback secret can be reused accidentally in shared environments. Prefer requiring
JWT_SECRET_KEY(and set it in the workflow) or generate a per-run secret.🔐 Suggested update
-jwt.secret=${JWT_SECRET_KEY:default-swagger-secret-change-me} +jwt.secret=${JWT_SECRET_KEY}.github/workflows/swagger-json.yml (1)
69-74: Prefer graceful shutdown before SIGKILL.SIGKILL skips cleanup; a brief SIGTERM attempt is safer and still deterministic.
🛠️ Suggested change
- if [ -f api_pid.txt ]; then - kill -9 $(cat api_pid.txt) || true - fi + if [ -f api_pid.txt ]; then + PID=$(cat api_pid.txt) + kill "$PID" || true + sleep 5 + kill -9 "$PID" || true + fi
| # Disable Redis if not needed for docs (optional) | ||
| spring.data.redis.host=localhost | ||
| spring.data.redis.port=6379 | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, find and examine the swagger properties file
find . -name "application-swagger.properties" -type fRepository: PSMRI/Inventory-API
Length of output: 114
🏁 Script executed:
# Also check for other application properties files to understand the context
find . -name "application*.properties" -type f | head -20Repository: PSMRI/Inventory-API
Length of output: 158
🏁 Script executed:
# Read the full swagger properties file to see the complete configuration
cat -n ./src/main/resources/application-swagger.propertiesRepository: PSMRI/Inventory-API
Length of output: 992
🏁 Script executed:
# Also check the main application.properties to understand the full context
cat -n ./src/main/resources/application.propertiesRepository: PSMRI/Inventory-API
Length of output: 1454
🌐 Web query:
Spring Boot 3.2 Redis auto-configuration disable spring.autoconfigure.exclude
💡 Result:
To disable Spring Boot 3.2 Redis auto-configuration via spring.autoconfigure.exclude, exclude the Redis auto-config classes by fully-qualified name (FQCN): RedisAutoConfiguration (core), plus reactive and repositories if you use those starters. [1]
application.properties
spring.autoconfigure.exclude=\
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration,\
org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration,\
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfigurationapplication.yml
spring:
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
- org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration
- org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfigurationClass names used above come from Spring Boot’s Redis auto-configurations:
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration[2]org.springframework.boot.autoconfigure.data.redis.RedisReactiveAutoConfiguration[3]org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration[4]
(Alternative: you can also exclude via @SpringBootApplication(exclude = …); Spring Boot documents both approaches, including spring.autoconfigure.exclude.) [1]
If you only want to disable Redis repositories (not the connection factory/templates):
spring.data.redis.repositories.enabled=false(RedisRepositoriesAutoConfiguration is conditional on that property.) [4]
Note: If you’re excluding Redis just to remove the Actuator Redis health indicator, that’s a different auto-config (RedisHealthContributorAutoConfiguration / RedisReactiveHealthContributorAutoConfiguration). [5]
References:
[1] Spring Boot Reference: Disabling specific auto-configuration classes (spring.autoconfigure.exclude)
[2] Spring Boot 3.2.x API: RedisAutoConfiguration
[3] Spring Boot 3.2.x API: RedisReactiveAutoConfiguration
[4] Spring Boot API: RedisRepositoriesAutoConfiguration (same FQCN in 3.x)
[5] Spring Boot Actuator API: Redis health contributor auto-configurations
🌐 Web query:
Spring Boot RedisAutoConfiguration RedisRepositoriesAutoConfiguration property exclusion
💡 Result:
To exclude those Redis auto-configurations via properties, use spring.autoconfigure.exclude with the fully-qualified auto-config class names:
application.properties
spring.autoconfigure.exclude=\
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration,\
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfigurationSpring Boot explicitly supports excluding auto-configurations via the spring.autoconfigure.exclude property (same effect as @SpringBootApplication(exclude=...)). (docs.spring.io)
application.yml
spring:
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
- org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfigurationIf your goal is only to stop Spring Data Redis repositories (but keep Redis connectivity/templates), you can instead disable repositories with:
spring.data.redis.repositories.enabled=falseRedisRepositoriesAutoConfiguration is conditional on spring.data.redis.repositories.enabled (defaults to enabled if missing). (docs.enterprise.spring.io)
Citations:
- 1: https://docs.spring.io/spring-boot/reference/using/auto-configuration.html?utm_source=openai
- 2: https://docs.spring.io/spring-boot/reference/using/auto-configuration.html?utm_source=openai
- 3: https://docs.enterprise.spring.io/spring-boot/docs/2.7.28.1/api/org/springframework/boot/autoconfigure/data/redis/RedisRepositoriesAutoConfiguration.html
Swagger profile still enables Redis; explicitly disable auto-configuration to avoid CI failures.
Setting spring.data.redis.host and spring.data.redis.port configures the Redis connection but does not disable Redis auto-configuration. With spring-boot-starter-data-redis on the classpath, Spring Boot's RedisAutoConfiguration will still trigger and attempt to connect, which breaks CI if Redis isn't running. Since the swagger profile uses an in-memory H2 database and is intended for documentation only, explicitly disable Redis auto-configuration.
💡 Suggested update
-# Disable Redis if not needed for docs (optional)
-spring.data.redis.host=localhost
-spring.data.redis.port=6379
+# Explicitly disable Redis for swagger profile to avoid external dependency in CI
+spring.session.store-type=none
+spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration,org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration🤖 Prompt for AI Agents
In `@src/main/resources/application-swagger.properties` around lines 6 - 9, The
swagger profile currently sets spring.data.redis.host/port but does not disable
Redis auto-configuration; update the application-swagger properties to
explicitly exclude Redis auto-configuration by adding the
spring.autoconfigure.exclude property referencing
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration (and
optionally
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration)
so Spring Boot won't attempt to connect to Redis during the swagger profile.
|



Add Swagger Json Automation file swagger-json.yml and application-swagger.properties
Summary by CodeRabbit
New Features
Chores