fix(ci): Claude生成PRをリポジトリ担当者へ自動アサイン - #1049
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
📝 WalkthroughWalkthroughThe Claude workflows now support an optional ChangesClaude pull-request assignee
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
test/claude-workflow-contract.test.jsOops! Something went wrong! :( ESLint: 10.8.0 ReferenceError: describe is not defined 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/claude-workflow-contract.test.js`:
- Around line 66-68: Add assertions in the workflow contract test alongside the
existing PR_ASSIGNEE checks for the empty array initialization
`ASSIGNEE_ARGS=()` and the `if [ -n "$PR_ASSIGNEE" ]; then` guard, ensuring the
unset-assignee branch remains covered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 10724d4b-5c65-47b4-92f8-b7cd5dc4accf
📒 Files selected for processing (3)
.github/workflows/claude.ymltemplates/workflows/claude.ymltest/claude-workflow-contract.test.js
| expect(workflow).toContain('PR_ASSIGNEE: ${{ vars.CLAUDE_PR_ASSIGNEE }}'); | ||
| expect(workflow).toContain('ASSIGNEE_ARGS=(--assignee "$PR_ASSIGNEE")'); | ||
| expect(workflow).toContain('"${ASSIGNEE_ARGS[@]}"'); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
for file in \
.github/workflows/claude.yml \
templates/workflows/claude.yml \
test/claude-workflow-contract.test.js
do
echo "== $file =="
rg -n -C 8 'PR_ASSIGNEE|ASSIGNEE_ARGS|if \[ -n' "$file" || true
doneRepository: keito4/config
Length of output: 7147
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "== test/claude-workflow-contract.test.js lines 1-90 =="
cat -n test/claude-workflow-conflow.test.js 2>/dev/null || sed -n '1,120p' test/claude-workflow-contract.test.js
echo
echo "== exact guard patterns =="
python3 - <<'PY'
from pathlib import Path
for path in ["test/claude-workflow-contract.test.js", "templates/workflows/claude.yml", ".github/workflows/claude.yml"]:
p = Path(path)
print(f"-- {path} --")
if p.exists():
s = p.read_text()
for pat in [
'ASSIGNEE_ARGS=()',
'if [ -n "$PR_ASSIGNEE" ]; then',
'ASSIGNEE_ARGS=(--assignee "$PR_ASSIGNEE")',
'{"ASSIGNEE_ARGS[@]}"',
'if [ -z "$PR_ASSIGNEE" ]; then',
'PR_ASSIGNEE=""',
]:
print(f"{pat!r}: {pat in s}")
PYRepository: keito4/config
Length of output: 7003
Add coverage for the unset PR_ASSIGNEE branch.
The contract asserts that the non-empty ASSIGNEE_ARGS construction and expansion are present, but it does not assert ASSIGNEE_ARGS=() or if [ -n "$PR_ASSIGNEE" ]; then. Add those assertions so the test fails if the conditional guard is accidentally removed.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@test/claude-workflow-contract.test.js` around lines 66 - 68, Add assertions
in the workflow contract test alongside the existing PR_ASSIGNEE checks for the
empty array initialization `ASSIGNEE_ARGS=()` and the `if [ -n "$PR_ASSIGNEE" ];
then` guard, ensuring the unset-assignee branch remains covered.
|
🎉 This PR is included in version 1.132.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
変更内容
CLAUDE_PR_ASSIGNEEリポジトリ変数をClaude生成PRへ自動設定背景
OYKOT-jp配下でClaude生成PRがassigneeなしのまま滞留していました。リポジトリごとの担当者は変数で管理し、担当変更時にワークフローを書き換えず差し替えられるようにします。
確認
CLAUDE_PR_ASSIGNEEを設定済みSummary by CodeRabbit
New Features
Tests