Skip to content

feat: crawl --pr に --repo を必須化し対象リポのみ処理する#268

Merged
coji merged 1 commit intomainfrom
feat/crawl-pr-repo-filter
Mar 31, 2026
Merged

feat: crawl --pr に --repo を必須化し対象リポのみ処理する#268
coji merged 1 commit intomainfrom
feat/crawl-pr-repo-filter

Conversation

@coji
Copy link
Copy Markdown
Owner

@coji coji commented Mar 31, 2026

Summary

  • --pr 使用時に --repo を必須化し、指定リポのみ処理するように変更
  • 全リポを巡回して 404 になる無駄な API コールを排除
# Before: 全3リポで PR#8945 を試みて 2リポで 404
crawl <org-id> --pr 8945

# After: falcon9 だけ処理
crawl <org-id> --repo falcon9 --pr 8945

Closes #267

Test plan

  • pnpm validate が通る
  • --repo falcon9 --pr 8945 で 1 repos, 1 PRs と表示される
  • --pr 8945 のみ(--repo なし)でエラーメッセージが出る

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • 新機能
    • クローリング対象を特定のリポジトリに限定できるようになりました。
    • プルリクエスト番号を指定する際は、リポジトリの指定が必須となります。

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Warning

Rate limit exceeded

@coji has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 19 minutes and 35 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 19 minutes and 35 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 37e00124-78ab-4bb4-a452-2c8a57b05fe9

📥 Commits

Reviewing files that changed from the base of the PR and between e538b7d and 8cb77ce.

📒 Files selected for processing (3)
  • app/services/jobs/crawl.server.ts
  • batch/cli.ts
  • batch/commands/crawl.ts
📝 Walkthrough

Walkthrough

クローリングジョブの入力スキーマに repoName パラメータを追加し、CLI/コマンド層を通じて Job サービスに伝播させることで、単一リポジトリへのスコープ化機能を実装しました。--pr フラグ使用時に --repo の指定を必須とする検証ロジックも追加されています。

Changes

Cohort / File(s) Summary
Job Service Layer
app/services/jobs/crawl.server.ts
入力スキーマに repoName?: string フィールドを追加。提供時には対象リポジトリを単一リポに絞り込み、targetRepos に基づいてカウントと処理対象を制御。
CLI Layer
batch/cli.ts
--repo フラグを追加し、--pr 指定時に --repo が必須となる検証を実装。prNumbers の計算ロジックを導入し、crawlCommandrepoName パラメータを渡す。
Command Layer
batch/commands/crawl.ts
CrawlCommandPropsrepoName?: string を追加。スタートアップログを labels 配列ベースにリファクタリングしてレポ/PR/フルリフレッシュを表示。ジョブペイロードに repoName を含める。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 リポを指定して API 節約
--repo フラグが四番街に降り立つ
PR 探しに迷わず、ただ一つの道
クォータ守りて、効率の花咲く ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: making --repo required when using --pr and processing only the specified repository.
Linked Issues check ✅ Passed The code changes fully implement option A from issue #267: adding --repo flag requirement for --pr usage and filtering repositories accordingly.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the --repo requirement and repository filtering feature described in issue #267.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/crawl-pr-repo-filter

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

Comment @coderabbitai help to get the list of available commands and usage tips.

--pr 指定時は --repo でリポジトリ名を指定必須にし、
そのリポだけ処理するようにした。
全リポを巡回して 404 を出す無駄な API コールを排除。

例: crawl <org-id> --repo falcon9 --pr 8945

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coji coji force-pushed the feat/crawl-pr-repo-filter branch from e538b7d to 8cb77ce Compare March 31, 2026 07:24
@coji coji merged commit 9ba26b2 into main Mar 31, 2026
6 checks passed
@coji coji deleted the feat/crawl-pr-repo-filter branch March 31, 2026 07:25
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.

crawl --pr でリポジトリ指定または早期打ち切りを追加する

1 participant