Skip to content

[UPLUS-125] 그라파나 링크 적용#36

Closed
arlen02-01 wants to merge 5 commits into
developfrom
feat/UPLUS-125
Closed

[UPLUS-125] 그라파나 링크 적용#36
arlen02-01 wants to merge 5 commits into
developfrom
feat/UPLUS-125

Conversation

@arlen02-01
Copy link
Copy Markdown
Contributor

@arlen02-01 arlen02-01 commented Jan 26, 2026

🎫 지라 티켓

UPLUS-125


✅ 작업 사항

그라파나 링크 적용


📋 체크리스트

  • 코드가 정상적으로 빌드됩니다.
  • 관련 테스트 코드를 작성했습니다.
  • 기존 테스트가 모두 통과합니다.
  • 코드 스타일(Spotless, Checkstyle)을 준수합니다.

⌨ 기타

@github-actions github-actions Bot requested a review from paul0755 January 26, 2026 05:08
@github-actions github-actions Bot added the size/S PR size: S label Jan 26, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @arlen02-01, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 주로 Grafana 링크를 업데이트하는 것을 목표로 하며, 이와 함께 코드베이스의 여러 영역에서 리팩토링 및 개선 작업을 포함합니다. 구독 플랜 이름 접근 방식의 변경과 템플릿 그룹 검색 로직 통합을 통해 코드의 일관성과 유지보수성을 높였습니다. 또한, 테스트 코드의 중복을 제거하여 전반적인 코드 품질을 향상시켰습니다.

Highlights

  • 그라파나 링크 업데이트: application-secret.yml 파일에서 Grafana iframe URL이 새로운 도메인 기반의 주소로 업데이트되었습니다.
  • 구독 플랜 이름 접근 방식 변경: SubscriptionService에서 구독 플랜 이름을 subPlan.getPlanName() 대신 subPlan.getPlan().getPlanName()을 통해 접근하도록 수정되었습니다. 이는 SubscriptionPlan 엔티티 내에서 Plan 객체를 통해 이름에 접근하는 구조로 변경되었음을 시사합니다.
  • 템플릿 그룹 검색 로직 통합: TemplateGroupRepository에서 searchWithoutKeyword 메서드가 제거되고, TemplateGroupService에서는 키워드가 비어있거나 null일 경우 search 메서드에 null 키워드를 전달하도록 로직이 통합되었습니다.
  • 테스트 코드 리팩토링: SubscriptionServiceTest에서 SubscriptionPlan 모의 객체 설정을 위한 헬퍼 메서드 setupMockSubscriptionPlan이 추가되어 테스트 코드의 중복이 줄어들고 가독성이 향상되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 Grafana 링크를 적용하고 관련 코드를 리팩토링하는 변경 사항을 포함합니다. 전반적으로 코드 개선을 위한 좋은 시도들이 보이지만, 몇 가지 잠재적인 성능 및 보안 문제를 발견했습니다. SubscriptionService에서 발생할 수 있는 N+1 쿼리 문제와 application-secret.yml에 저장된 Grafana URL의 보안 위험에 대한 검토가 필요합니다. 또한 테스트 코드의 가독성을 높이기 위한 제안도 포함했습니다. 자세한 내용은 각 파일의 주석을 확인해주세요.

Comment thread src/main/java/com/project/core/service/SubscriptionService.java
Comment thread src/main/resources/application-secret.yml
Comment thread src/main/java/com/project/core/service/SubscriptionService.java
Comment thread src/test/java/com/project/core/service/SubscriptionServiceTest.java
@github-actions
Copy link
Copy Markdown

SonarQube Quality Summary (Community)

Quality Gate PASSED

Branch: feat/UPLUS-125
Compared to: default branch

Issues

  • 🐞 Bugs: 0
  • 🔐 Vulnerabilities: 2
  • 📎 Code Smells: 45

Measures

  • Coverage: 0%
  • Duplication: 0%

🔗 Dashboard: https://sonarqube.swthewhite.store/dashboard?id=api-core&branch=feat/UPLUS-125

Generated automatically by GitHub Actions.

@arlen02-01
Copy link
Copy Markdown
Contributor Author

/gemini review

@arlen02-01 arlen02-01 closed this Jan 26, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 Grafana 링크를 적용하고 관련 코드를 리팩토링하는 변경 사항을 포함합니다. 전반적으로 코드베이스를 개선하려는 좋은 시도들이 보입니다. 특히 TemplateGroupService에서 중복된 리포지토리 메소드를 제거하고 로직을 단순화한 점은 훌륭합니다.

그러나 몇 가지 개선이 필요한 부분이 있습니다.
가장 중요한 점은 SubscriptionService에서 subPlan.getPlan().getPlanName()으로 변경된 부분입니다. 이 변경은 지연 로딩으로 인해 N+1 쿼리 문제를 발생시켜 성능을 저하시킬 수 있습니다. SubscriptionPlan에 이미 스냅샷으로 저장된 planName 필드를 사용하는 것이 좋습니다.
또한, 테스트 코드에서 setupMockSubscriptionPlan 헬퍼 메소드를 추가한 것은 좋은 리팩토링이지만, 가독성을 위해 정규화된 클래스 이름 대신 import를 사용하는 것이 좋겠습니다.

자세한 내용은 각 파일의 인라인 코멘트를 참고해주세요.

totalUsedBytes,
subPlan.getAllotmentAmount(),
subPlan.getPlanName(),
subPlan.getPlan().getPlanName(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

subPlan.getPlan().getPlanName() 호출은 plan 엔티티가 지연 로딩(FetchType.LAZY)으로 설정되어 있어 N+1 쿼리 문제를 유발할 수 있습니다. getAllSubscriptions 메소드는 페이지네이션된 여러 구독을 처리하므로, 각 구독에 대해 Plan을 가져오기 위한 추가 쿼리가 발생하여 성능 저하를 일으킬 수 있습니다.

SubscriptionPlan 엔티티에는 planName 필드가 이미 존재하며, 이는 구독 계획 생성 시점의 요금제 이름을 스냅샷으로 저장하는 역할을 합니다. subPlan.getPlanName()을 사용하면 추가 쿼리 없이 이 문제를 해결하고, 원래의 스냅샷 데이터를 사용하는 의도에도 부합합니다.

아마 테스트 코드에서 subPlan.getPlanName()에 대한 모의(mock) 설정이 누락되어 이 부분을 수정하신 것으로 보입니다. 프로덕션 코드를 변경하는 대신, 테스트에서 given(subPlan.getPlanName()).willReturn(...)을 추가하여 해결하는 것이 더 나은 접근 방식입니다.

Suggested change
subPlan.getPlan().getPlanName(),
subPlan.getPlanName(),

totalUsedBytes,
subPlan.getAllotmentAmount(),
subPlan.getPlanName(),
subPlan.getPlan().getPlanName(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

subPlan.getPlan().getPlanName() 호출은 plan 엔티티가 지연 로딩(FetchType.LAZY)으로 설정되어 있어 불필요한 쿼리를 유발할 수 있습니다. getSubscriptionDetailByPhone 메소드에서는 단일 항목을 조회하므로 getAllSubscriptions 만큼 심각한 성능 문제는 아니지만, 일관성을 유지하고 설계 의도에 맞게 SubscriptionPlan에 스냅샷으로 저장된 planName 필드를 사용하는 것이 좋습니다.

이렇게 하면 불필요한 데이터베이스 조회를 피하고, SubscriptionPlanplanName 필드가 가진 스냅샷의 의미를 명확히 할 수 있습니다.

Suggested change
subPlan.getPlan().getPlanName(),
subPlan.getPlanName(),

Comment on lines +153 to +154
com.project.core.infra.entity.plan.Plan plan =
org.mockito.Mockito.mock(com.project.core.infra.entity.plan.Plan.class);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

com.project.core.infra.entity.plan.Plan 클래스의 전체 경로를 사용하고 있어 코드가 길어지고 가독성이 떨어집니다. 파일 상단에 import com.project.core.infra.entity.plan.Plan;를 추가하고, 여기서는 짧은 클래스 이름 Plan을 사용하는 것이 좋습니다.

Suggested change
com.project.core.infra.entity.plan.Plan plan =
org.mockito.Mockito.mock(com.project.core.infra.entity.plan.Plan.class);
Plan plan = org.mockito.Mockito.mock(Plan.class);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant