-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: 레포지토리 조회 메서드가 레포지토리 링크를 받도록 수정 #750
Conversation
Walkthrough변경 사항은 Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Job Summary for GradleCheck Style and Test to Develop :: build-test
|
There was a problem hiding this 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
Outside diff range, codebase verification and nitpick comments (1)
src/main/java/com/gdschongik/gdsc/infra/github/client/GithubClient.java (1)
113-116
: 새로운getOwnerRepo
메서드는 코드의 가독성과 유지 관리성을 향상시킵니다.
getOwnerRepo
메서드는 전체 리포지토리 링크에서 소유자와 리포지토리 이름을 추출하는 로직을 캡슐화하여 코드의 가독성과 유지 관리성을 개선합니다.개선 제안: 매직 넘버 대신 상수를 사용하세요.
GITHUB_DOMAIN.length()
는 매직 넘버로 간주될 수 있습니다. 대신GITHUB_DOMAIN
의 길이를 나타내는 상수를 도입하는 것이 좋습니다.+private static final int GITHUB_DOMAIN_LENGTH = GITHUB_DOMAIN.length(); private String getOwnerRepo(String repositoryLink) { - int startIndex = repositoryLink.indexOf(GITHUB_DOMAIN) + GITHUB_DOMAIN.length(); + int startIndex = repositoryLink.indexOf(GITHUB_DOMAIN) + GITHUB_DOMAIN_LENGTH; return repositoryLink.substring(startIndex); }
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyHistoryService.java (3 hunks)
- src/main/java/com/gdschongik/gdsc/infra/github/client/GithubClient.java (3 hunks)
Additional comments not posted (3)
src/main/java/com/gdschongik/gdsc/infra/github/client/GithubClient.java (2)
33-35
: LGTM!
getRepository
메서드의 시그니처 변경과getOwnerRepo
메서드 호출을 통한 리팩토링은 코드의 명확성과 관심사 분리를 개선합니다.
63-64
: LGTM!
getLatestAssignmentSubmission
메서드에서getOwnerRepo
메서드를 호출하여 리포지토리 이름을 추출하는 것은getRepository
메서드의 변경 사항과 일관되며, 입력 링크에서 리포지토리 이름을 일관되게 포맷하고 추출합니다.src/main/java/com/gdschongik/gdsc/domain/study/application/StudentStudyHistoryService.java (1)
58-58
: 리포지토리 링크 처리 로직 개선
getOwnerRepo
메서드를 제거하고request.repositoryLink()
를 직접 사용하여GHRepository
객체를 얻는 것은 코드를 간결하게 만들고 가독성과 유지 관리성을 향상시킵니다. 이는 리포지토리 링크 처리에 대한 보다 직접적인 접근 방식으로의 전환을 나타내며, 향후 수정이나 테스트 작업을 단순화할 수 있습니다.
Job Summary for GradleCheck Style and Test to Develop :: build-test
|
There was a problem hiding this 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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/main/java/com/gdschongik/gdsc/infra/github/client/GithubClient.java (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/main/java/com/gdschongik/gdsc/infra/github/client/GithubClient.java
🌱 관련 이슈
📌 작업 내용 및 특이사항
GithubClient
의getRepository
메서드는 'owner/repo'의 형식으로 값을 받아야 하는데, repo링크가 통째로 들어가서 발생한 이슈입니다.getRepository
메서드 내부에서 변환하도록 수정했습니다.getOwnerRepo
메서드를 GithubUtil로 분리할까도 생각해봤지만, api 호출을 위해 적절한 형식으로 변환하는 것도 GithubClient의 역할이라고 볼 수 있고, 결정적으로 사용하는 곳이 여기밖에 없어서 분리하지 않았습니다.📝 참고사항
📚 기타
Summary by CodeRabbit
getOwnerRepo
메서드를 추가하여 전체 리포지토리 링크에서 소유자 및 리포지토리 이름을 추출하는 로직을 중앙 집중화했습니다.getRepository
메서드의 매개변수를 명확하게 변경하여 리포지토리 정보를 보다 간결하게 처리합니다.getCommitDate
메서드를 업데이트했습니다.