Skip to content

Conversation

@minjee2758
Copy link
Collaborator

@minjee2758 minjee2758 commented Jul 28, 2025

작업 내용

  • 깃허브 자동 push 여부 true false 조회 api 추가
  • user 데이터베이스에서 git_push_status 를 찾아 반환합니다

참고 사항

  • 기타 공유하고 싶은 정보나 참고한 문서(링크 등)가 있다면 작성해주세요.

코드 리뷰 전 확인 체크리스트

  • 불필요한 콘솔 로그, 주석 제거
  • 커밋 메시지 컨벤션 준수 (type : )
  • 기능 정상 동작 확인

Summary by CodeRabbit

  • 신규 기능
    • 사용자의 GitHub 자동 푸시 상태를 조회할 수 있는 새로운 API 엔드포인트(/api/users/github/status)가 추가되었습니다.
    • 해당 엔드포인트를 통해 현재 자동 푸시 설정 여부를 확인할 수 있습니다.

@minjee2758 minjee2758 self-assigned this Jul 28, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 28, 2025

Walkthrough

UserGithubService 클래스에 인증된 사용자의 GitHub 자동 푸시 상태를 조회하는 새로운 public 메서드가 추가되었습니다. 이에 따라, UserGithubController/api/users/github/status GET 엔드포인트가 신설되어 해당 정보를 반환합니다. 이 엔드포인트는 인증된 사용자의 자동 푸시 설정 상태를 메시지와 함께 제공합니다.

Changes

Cohort / File(s) Change Summary
서비스 메서드 추가
src/main/java/org/ezcode/codetest/domain/user/service/UserGithubService.java
인증 사용자의 GitHub 자동 푸시 상태를 조회하는 getAutoPushStatus(AuthUser authUser) 메서드 추가
컨트롤러 엔드포인트 추가
src/main/java/org/ezcode/codetest/presentation/usermanagement/UserGithubController.java
/api/users/github/status GET 엔드포인트 추가, 서비스 메서드 호출 및 상태 반환

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller as UserGithubController
    participant Service as UserGithubService

    Client->>Controller: GET /api/users/github/status (with AuthUser)
    Controller->>Service: getAutoPushStatus(authUser)
    Service-->>Controller: UserGitubAutoPushResponse
    Controller-->>Client: 200 OK + UserGitubAutoPushResponse
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

Poem

🐇
깃허브 자동 푸시, 토끼가 묻네
"설정이 켜졌나요?" 새 엔드포인트에
서비스와 컨트롤러, 손잡고 나아가
사용자의 상태를 친절히 말해주네
오늘도 코드는 한 뼘 더 자라나!
🌱

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/githubPushTF

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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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.

Copy link

@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: 0

🧹 Nitpick comments (1)
src/main/java/org/ezcode/codetest/presentation/usermanagement/UserGithubController.java (1)

58-67: 새로운 상태 조회 엔드포인트가 잘 구현되었습니다. 메서드 명명 규칙 개선을 제안합니다.

엔드포인트 구현이 기존 패턴과 일관되고 Swagger 문서화도 잘 되어 있습니다. 다만 Java 명명 규칙에 따라 메서드명을 camelCase로 변경하는 것을 권장합니다.

다음과 같이 메서드명을 변경해보세요:

-    public ResponseEntity<UserGitubAutoPushResponse> AutoPushStatus(
+    public ResponseEntity<UserGitubAutoPushResponse> getAutoPushStatus(
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6ae605a and 3ac224a.

📒 Files selected for processing (2)
  • src/main/java/org/ezcode/codetest/domain/user/service/UserGithubService.java (1 hunks)
  • src/main/java/org/ezcode/codetest/presentation/usermanagement/UserGithubController.java (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: chat26666
PR: ezcode-my/backend#37
File: src/main/java/org/ezcode/codetest/infrastructure/elasticsearch/repository/ProblemElasticsearchRepositoryDsl.java:10-10
Timestamp: 2025-06-06T19:56:27.759Z
Learning: When user chat26666 mentions that code was implemented in a previous PR but explanation was missing, they may submit a follow-up PR just to add documentation/explanation without the actual implementation code.
Learnt from: minjee2758
PR: ezcode-my/backend#105
File: src/main/resources/application.properties:127-127
Timestamp: 2025-06-26T09:43:03.922Z
Learning: GitHub OAuth에서 자동 커밋 기능을 구현하려면 `repo` scope가 필수적이며, 이는 public/private 저장소 모두에 대한 전체 접근 권한을 제공한다. 공개 저장소만 대상으로 한다면 `public_repo` scope 사용 가능하다. 더 세밀한 권한 제어가 필요하다면 OAuth App 대신 GitHub App 사용을 권장한다.
Learnt from: minjee2758
PR: ezcode-my/backend#110
File: src/main/java/org/ezcode/codetest/domain/user/service/CustomOAuth2UserService.java:102-112
Timestamp: 2025-06-27T06:03:05.761Z
Learning: `CustomOAuth2UserService`의 `updateGithubUrl` 메서드는 새로운 유저 생성 시나 기존 유저가 새로운 AuthType을 추가할 때만 호출되므로, `UserGithubInfo` 중복 생성 가능성이 없다. 별도의 중복 체크 로직이 불필요하다.
Learnt from: minjee2758
PR: ezcode-my/backend#105
File: src/main/resources/application.properties:127-127
Timestamp: 2025-06-26T09:43:03.922Z
Learning: GitHub OAuth에서 자동 커밋 기능 구현을 위해서는 `repo` scope가 필요하며, 이는 저장소에 대한 읽기/쓰기 권한을 제공한다. `user` scope는 커밋 작성자 정보 설정을 위해 필요하다.
Learnt from: pokerbearkr
PR: ezcode-my/backend#89
File: src/main/java/org/ezcode/codetest/presentation/ranking/PointController.java:27-31
Timestamp: 2025-06-22T06:01:45.543Z
Learning: PointController의 getUserPoint 엔드포인트는 다른 사용자의 프로필에서 티어 정보를 표시하기 위한 공개 API로, 모든 사용자가 다른 사용자의 점수를 조회할 수 있도록 설계되었다.
src/main/java/org/ezcode/codetest/presentation/usermanagement/UserGithubController.java (2)

Learnt from: minjee2758
PR: #110
File: src/main/java/org/ezcode/codetest/domain/user/service/CustomOAuth2UserService.java:102-112
Timestamp: 2025-06-27T06:03:05.761Z
Learning: CustomOAuth2UserServiceupdateGithubUrl 메서드는 새로운 유저 생성 시나 기존 유저가 새로운 AuthType을 추가할 때만 호출되므로, UserGithubInfo 중복 생성 가능성이 없다. 별도의 중복 체크 로직이 불필요하다.

Learnt from: NCookies
PR: #17
File: src/main/java/org/ezcode/codetest/presentation/problemmanagement/ProblemAdminController.java:25-25
Timestamp: 2025-06-02T06:57:37.929Z
Learning: 이 프로젝트에서는 아직 Spring Security가 적용되지 않아서 @PreAuthorize 어노테이션이 주석 처리되어 있음. Spring Security 도입 전까지는 권한 검증 어노테이션들이 비활성화 상태임.

src/main/java/org/ezcode/codetest/domain/user/service/UserGithubService.java (2)

Learnt from: minjee2758
PR: #110
File: src/main/java/org/ezcode/codetest/domain/user/service/CustomOAuth2UserService.java:102-112
Timestamp: 2025-06-27T06:03:05.761Z
Learning: CustomOAuth2UserServiceupdateGithubUrl 메서드는 새로운 유저 생성 시나 기존 유저가 새로운 AuthType을 추가할 때만 호출되므로, UserGithubInfo 중복 생성 가능성이 없다. 별도의 중복 체크 로직이 불필요하다.

Learnt from: minjee2758
PR: #105
File: src/main/resources/application.properties:127-127
Timestamp: 2025-06-26T09:43:03.922Z
Learning: GitHub OAuth에서 자동 커밋 기능 구현을 위해서는 repo scope가 필요하며, 이는 저장소에 대한 읽기/쓰기 권한을 제공한다. user scope는 커밋 작성자 정보 설정을 위해 필요하다.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (1)
src/main/java/org/ezcode/codetest/domain/user/service/UserGithubService.java (1)

130-137: 새로운 상태 조회 메서드가 올바르게 구현되었습니다.

기존 changeAutoPushSetting 메서드와 일관된 패턴을 따르고 있으며, 적절한 예외 처리와 응답 객체를 사용하고 있습니다. 읽기 전용 메서드로서 상태를 변경하지 않는 것도 적절합니다.

@minjee2758 minjee2758 merged commit fc99e55 into dev Jul 28, 2025
2 checks passed
@minjee2758 minjee2758 deleted the feature/githubPushTF branch July 28, 2025 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants