Skip to content

Hotfix/user repo#178

Merged
gassara-kys merged 5 commits intomasterfrom
hotfix/user-repo
Jul 15, 2025
Merged

Hotfix/user repo#178
gassara-kys merged 5 commits intomasterfrom
hotfix/user-repo

Conversation

@gassara-kys
Copy link
Copy Markdown
Collaborator

@gassara-kys gassara-kys commented Jul 14, 2025

バグ

現在は、パブリックリポジトリのみを取得する実装になっていますが、認証ユーザのリポジトリも取得する必要があります。
認証ユーザー自身を検索する場合とその他のユーザーを検索する場合で、異なるAPIエンドポイントを使い分ける:

  • 認証ユーザー自身: /user/repos → プライベートリポジトリも含む
  • 他のユーザー: /users/{username}/repos →パブリックリポジトリのみ(現在の動作)

変更箇所

  • CLAUDE.md追加します(AIで自動生成したもの)
  • 認証ユーザのリポジトリ取得方法を変更

テスト

  • 認証ユーザのリポジトリでpublic/privateのスキャン
  • 認証ユーザ以外のUserリポジトリでpublicのスキャン

@gassara-kys gassara-kys requested a review from Copilot July 14, 2025 08:21
@github-actions
Copy link
Copy Markdown

セキュリティレビューを実施しました。
特に問題は見つかりませんでした👏

By RISKEN review

Copy link
Copy Markdown

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

This PR updates the GitHub client to fetch private repositories for the authenticated user and adjusts related tests; it also adds a generated CLAUDE.md guide.

  • Switch listRepositoryForUserWithOption to use /user/repos for the authenticated user and /users/{login}/repos for others.
  • Include the underlying github.Client in GitHubV3Client and propagate it from newV3Client.
  • Update Test_listRepositoryForUserWithOption to initialize and use the new client shape.
  • Add CLAUDE.md documentation for AI code assistance.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pkg/github/github.go Include Client in GitHubV3Client, add auth-user check and endpoint switch
pkg/github/github_test.go Update test setup to construct a GitHubV3Client instead of raw service and fix typo
CLAUDE.md Add generated guidance file for Claude Code
Comments suppressed due to low confidence (4)

pkg/github/github_test.go:76

  • The 'OK empty' test case no longer sets 'want' or 'wantError', so it doesn't verify behavior. Add 'want: []*github.Repository{}' and 'wantError: false' to ensure the empty-repos path is asserted.
			name:  "OK empty",

pkg/github/github_test.go:77

  • The failure-path ('NG List Error') test was removed when refactoring. Reintroduce a case that mocks an API error and asserts 'wantError: true' to cover error propagation.
			login: "owner",

pkg/github/github_test.go:88

  • [nitpick] This 'client' variable shadows the earlier 'githubClient'. Rename it (e.g., 'v3Client') to avoid confusion between the API client and the risken client.
			client := &GitHubV3Client{

CLAUDE.md:1

  • [nitpick] This auto-generated guidance file lives at the repo root. Consider moving it under a 'docs/' directory or marking it as generated to keep root clutter minimal.
# CLAUDE.md

Copy link
Copy Markdown
Contributor

@han-ekiken han-ekiken left a comment

Choose a reason for hiding this comment

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

LGTM

@gassara-kys gassara-kys merged commit 8b6a5c0 into master Jul 15, 2025
2 checks passed
@gassara-kys gassara-kys deleted the hotfix/user-repo branch July 15, 2025 08:27
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.

3 participants