Skip to content

feat: redis cache prefix version#114

Merged
dev-ant merged 3 commits intodevfrom
feat/redis-cache-prefix-version
Mar 5, 2026
Merged

feat: redis cache prefix version#114
dev-ant merged 3 commits intodevfrom
feat/redis-cache-prefix-version

Conversation

@dev-ant
Copy link
Copy Markdown
Contributor

@dev-ant dev-ant commented Mar 5, 2026

📋 상세 설명

  • app.cache.redis-prefix 설정을 도입하고, 이를 Spring Cache Redis 키 prefix에 적용
  • Redis 캐시 값(value) 직렬화 타입 설정을 수정
  • application.yml에서 P6Spy 로깅을 활성화

📊 체크리스트

  • PR 제목이 형식에 맞나요 e.g. feat: PR을 등록한다
  • 코드가 테스트 되었나요
  • 문서는 업데이트 되었나요
  • 불필요한 코드를 제거했나요
  • 이슈와 라벨이 등록되었나요

@dev-ant dev-ant requested a review from Copilot March 5, 2026 14:38
@dev-ant dev-ant self-assigned this Mar 5, 2026
@dev-ant dev-ant added the ✨feature 새로운 기능 추가 label Mar 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 5, 2026

✅ 테스트 결과 for PR

Build: success

🧪 테스트 실행 with Gradle
📈 Coverage: -0.00%

📁 테스트 결과
📁 커버리지 보고서 (HTML)

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a versioned Redis cache key prefix to allow cache invalidation via namespace changes, and updates related cache configuration.

Changes:

  • Introduces app.cache.redis-prefix configuration and applies it to Spring Cache Redis key prefixes.
  • Modifies Redis cache value serialization typing configuration.
  • Enables P6Spy logging in application.yml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/main/resources/application.yml Adds app.cache.redis-prefix default and flips P6Spy logging to enabled.
src/main/java/until/the/eternity/config/RedisConfig.java Reads app.cache.redis-prefix, applies it via computePrefixWith, and changes Jackson default typing mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 43 to 46
objectMapper.activateDefaultTyping(
LaissezFaireSubTypeValidator.instance,
DefaultTyping.NON_FINAL,
DefaultTyping.EVERYTHING,
JsonTypeInfo.As.PROPERTY);
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

activateDefaultTyping with LaissezFaireSubTypeValidator is already permissive; switching to DefaultTyping.EVERYTHING further expands polymorphic type metadata to essentially all values, increasing the risk of unsafe deserialization gadgets and unexpected payload bloat. Prefer a narrower typing mode (e.g., NON_FINAL / OBJECT_AND_NON_CONCRETE) and a restrictive PolymorphicTypeValidator allowlisting only your DTO packages, or avoid global default typing entirely for cache serialization.

Copilot uses AI. Check for mistakes.
@EnableCaching
public class RedisConfig implements CachingConfigurer {

@Value("${app.cache.redis-prefix:oab:v2}")
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

The default value for app.cache.redis-prefix is defined both here in @Value(...:oab:v2) and in application.yml. Keeping defaults in two places makes future version bumps easy to miss; consider defining the default only in configuration (and reference ${app.cache.redis-prefix} here without an inline default), or binding via @ConfigurationProperties for a single source of truth.

Suggested change
@Value("${app.cache.redis-prefix:oab:v2}")
@Value("${app.cache.redis-prefix}")

Copilot uses AI. Check for mistakes.
Comment on lines 43 to 46
objectMapper.activateDefaultTyping(
LaissezFaireSubTypeValidator.instance,
DefaultTyping.NON_FINAL,
DefaultTyping.EVERYTHING,
JsonTypeInfo.As.PROPERTY);
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

This PR is titled around Redis cache prefix versioning, but this change also modifies the cache value serialization behavior (DefaultTyping) which can affect compatibility and security posture. If this is intentional, it should be called out in the PR description (or split into a separate PR) because it’s a behavior change independent of key prefixing.

Copilot uses AI. Check for mistakes.
Comment thread src/main/resources/application.yml Outdated
datasource:
p6spy:
enable-logging: false
enable-logging: true
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

decorator.datasource.p6spy.enable-logging is now enabled by default in the main application.yml. This can significantly increase log volume and may expose SQL/parameter values in non-local environments; consider defaulting to false and controlling it via an environment variable or profile-specific config (the application-sample.yml currently defaults it to false).

Suggested change
enable-logging: true
enable-logging: ${P6SPY_ENABLE_LOGGING:false}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/main/resources/application.yml:100

  • decorator.datasource.p6spy.enable-logging is now hard-coded to true in the main application.yml. This will enable SQL logging in all environments that use this config, which can significantly increase log volume and may leak sensitive query parameters. Consider defaulting this back to false and/or wiring it to an env var (or profile-specific config) so it’s only enabled for local/dev.
decorator:
  datasource:
    p6spy:
      enable-logging: false

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 147 to 151
app:
cache:
redis-prefix: ${APP_CACHE_REDIS_PREFIX:oab:v2} # 직렬화 방식 변경 시 버전업 필요
warmup:
enabled: ${APP_CACHE_WARMUP_ENABLED:true}
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

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

A new app.cache.redis-prefix property was added here, but application-sample.yml still appears to have no corresponding entry (and still uses the old enable-logging: false value for p6spy). To avoid configuration drift for developers, please mirror this new property (and intended defaults) in application-sample.yml as well.

Copilot uses AI. Check for mistakes.
@dev-ant dev-ant merged commit 92b9fed into dev Mar 5, 2026
1 check passed
@dev-ant dev-ant deleted the feat/redis-cache-prefix-version branch March 5, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨feature 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants