Skip to content

refactor/#240 production CORS 도메인 추가 및 에러 디버깅#242

Merged
LeeHanEum merged 8 commits intodevelopfrom
refactor/#240-cors-test
Aug 10, 2025
Merged

refactor/#240 production CORS 도메인 추가 및 에러 디버깅#242
LeeHanEum merged 8 commits intodevelopfrom
refactor/#240-cors-test

Conversation

@LeeHanEum
Copy link
Copy Markdown
Member

Summary

production CORS 에러 방지를 위해 도메인 및 ip를 추가하고 에러 디버깅을 수행하였습니다

Tasks

  • production CORS 도메인 추가 및 에러 디버깅

@LeeHanEum LeeHanEum self-assigned this Aug 10, 2025
@LeeHanEum LeeHanEum added the 🔨refactor refactoring code label Aug 10, 2025
@LeeHanEum LeeHanEum linked an issue Aug 10, 2025 that may be closed by this pull request
1 task
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 10, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

이 PR에서는 여러 파일에서 코드 스타일 및 내부 로직이 소폭 수정되었습니다. 주로 파일 끝의 불필요한 개행 제거, CORS 허용 오리진 추가, 로깅 관련 메서드의 내부 처리 변경 및 일부 코드의 주석 처리 등이 이루어졌습니다.

Changes

Cohort / File(s) Change Summary
개행 문자 제거
aics-admin/src/main/java/kgu/developers/admin/aspect/ServerErrorLoggingAspect.java, aics-api/src/main/java/kgu/developers/api/aspect/ExceptionLoggingAspect.java, aics-api/src/main/java/kgu/developers/api/aspect/ServerErrorLoggingAspect.java
파일 끝의 불필요한 개행 문자 제거. 기능적 변화 없음.
CORS 허용 오리진 추가
aics-common/src/main/java/kgu/developers/common/config/SecurityConfig.java
CORS 설정에서 허용 오리진 패턴에 "http://175.45.195.63""http://203.249.22.207:8080" 추가.
로깅 인터셉터 수정
aics-common/src/main/java/kgu/developers/common/interceptor/LoggingInterceptor.java
afterCompletion 메서드 내 LoggingUtils.logDuration 호출부 주석 처리.
로깅 유틸리티 내부 로직 변경
aics-global-utils/src/main/java/kgu/developers/globalutils/logging/LoggingUtils.java
getObjectFields에 null 체크 추가(입력 객체가 null이면 "null" 반환). logDuration에서 ex가 null일 때 ex.printStackTrace() 호출 추가(논리적으로 오류 가능성 있음).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15분

Possibly related PRs

Suggested reviewers

  • LeeShinHaeng
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/#240-cors-test

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown

Test Coverage Report

Overall Project 94.32% 🍏

There is no coverage information present for the Files changed

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
aics-common/src/main/java/kgu/developers/common/interceptor/LoggingInterceptor.java (1)

31-31: logDuration 호출 주석 해제 권장 (유틸리티 버그 수정 후)

LoggingUtils.logDuration의 NPE 원인이 제거되면, 지연 시간 로깅을 복구하세요.

권장 수정(diff):

-        // LoggingUtils.logDuration(request, response, ex);
+        LoggingUtils.logDuration(request, response, ex);
aics-common/src/main/java/kgu/developers/common/config/SecurityConfig.java (2)

102-103: 신규 IP 오리진의 스킴/포트 조합 검증 요청

아래 두 오리진의 실제 접근 방식(HTTP/HTTPS, 포트 유무)을 운영 환경에서 확인해 주세요. 예를 들어 클라이언트가 HTTPS로 접속하거나 다른 포트를 사용할 경우 현재 설정으로는 CORS가 차단됩니다.

  • 현재 추가:
    • http://175.45.195.63 (기본 80 포트 가정)
    • http://203.249.22.207:8080
  • 확인 제안:
    • 실제 트래픽에 HTTPS가 필요한지 (https://175.45.195.63, https://203.249.22.207:8080 등)
    • 동일 IP에서 여러 포트를 사용할 가능성
    • 호스트명이 추가로 필요한지(IP 대신 도메인)

필요 시 동일 항목의 HTTPS 버전 또는 추가 포트 케이스를 함께 등록해 주세요.


87-107: CORS 성능·운영성 개선 제안 (maxAge/설정 외부화)

  • Preflight 감소를 위해 maxAge 설정을 권장합니다.
  • 운영 환경별 오리진 하드코딩 대신 설정 외부화로 재배포 없이 관리할 수 있게 하는 것을 권장합니다.

코드 예시:

// import 추가
import java.time.Duration;

// 설정 내부
config.setMaxAge(Duration.ofHours(1));

설정 외부화 예시:

  • application.yml
    cors:
      allowed-origin-patterns: "http://localhost:3000,http://localhost:3001,https://aics-client-dev.vercel.app,http://175.45.195.63,http://203.249.22.207:8080"
    
  • 주입하여 분리:
    @Value("${cors.allowed-origin-patterns}")
    private String allowedOriginPatterns;
    
    config.setAllowedOriginPatterns(Arrays.stream(allowedOriginPatterns.split(","))
        .map(String::trim)
        .toList());
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f26f0bf and c35ce06.

📒 Files selected for processing (6)
  • aics-admin/src/main/java/kgu/developers/admin/aspect/ServerErrorLoggingAspect.java (1 hunks)
  • aics-api/src/main/java/kgu/developers/api/aspect/ExceptionLoggingAspect.java (1 hunks)
  • aics-api/src/main/java/kgu/developers/api/aspect/ServerErrorLoggingAspect.java (1 hunks)
  • aics-common/src/main/java/kgu/developers/common/config/SecurityConfig.java (1 hunks)
  • aics-common/src/main/java/kgu/developers/common/interceptor/LoggingInterceptor.java (1 hunks)
  • aics-global-utils/src/main/java/kgu/developers/globalutils/logging/LoggingUtils.java (2 hunks)
🔇 Additional comments (4)
aics-api/src/main/java/kgu/developers/api/aspect/ExceptionLoggingAspect.java (1)

44-44: 기능 영향 없음: EOF 개행 제거만 변경

동작 변경은 없습니다.

aics-admin/src/main/java/kgu/developers/admin/aspect/ServerErrorLoggingAspect.java (1)

49-49: 기능 영향 없음: EOF 개행 제거만 변경

동작 변경은 없습니다.

aics-global-utils/src/main/java/kgu/developers/globalutils/logging/LoggingUtils.java (1)

29-31: NPE 방지용 null 처리 추가 👍

obj가 null일 때 문자열 "null"을 반환하여 불필요한 리플렉션 접근을 회피합니다. 적절한 수정입니다.

aics-api/src/main/java/kgu/developers/api/aspect/ServerErrorLoggingAspect.java (1)

49-49: 기능 영향 없음: EOF 개행 제거만 변경

동작 변경은 없습니다.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #242   +/-   ##
==========================================
  Coverage      91.42%   91.42%           
  Complexity       159      159           
==========================================
  Files             49       49           
  Lines            455      455           
  Branches           9        9           
==========================================
  Hits             416      416           
  Misses            29       29           
  Partials          10       10           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f26f0bf...3e64b5a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LeeHanEum LeeHanEum merged commit b3606e5 into develop Aug 10, 2025
5 checks passed
@LeeHanEum LeeHanEum deleted the refactor/#240-cors-test branch August 10, 2025 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨refactor refactoring code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

배포 테스트 환경 CORS 해결

2 participants