Skip to content

Assign repo owner as reviewer on Claude-opened PRs#109

Merged
d-morrison merged 3 commits into
mainfrom
claude/issue-105-assign-reviewer
Jun 9, 2026
Merged

Assign repo owner as reviewer on Claude-opened PRs#109
d-morrison merged 3 commits into
mainfrom
claude/issue-105-assign-reviewer

Conversation

@d-morrison

Copy link
Copy Markdown
Owner

What

When the claude.yml workflow opens a draft PR for an issue trigger, it now requests the repository owner as a reviewer, so Claude's draft attempts land in the maintainer's review queue instead of sitting unnoticed.

Why

Issue #105: "when claude creates a PR, assign me as a reviewer." Previously a Claude-opened PR had no reviewer assigned, so there was nothing to surface it in a review queue.

How

In the "Push branch and open draft PR for issue trigger" step, after a PR is freshly opened, run:

gh pr edit "$PR_URL" --add-reviewer "${{ github.repository_owner }}"
  • Uses github.repository_owner rather than a hard-coded username so the behavior follows the repo into downstream books created from this template.
  • Implemented as a separate gh pr edit (rather than a --reviewer flag on gh pr create) and made non-fatal (|| echo "::warning::..."), so a reviewer-request error — e.g. the owner is an org rather than a user, or happens to be the PR author — degrades to a warning instead of failing the run.
  • Only applies on the freshly-opened path; the "PR already exists" path leaves the existing reviewer assignment untouched.

Addresses #105.

https://claude.ai/code/session_01S2Cvpp3iGd7KSC9jWnDKxs


Generated by Claude Code

When the claude.yml workflow opens a draft PR for an issue trigger, it
now requests the repository owner as a reviewer via `gh pr edit
--add-reviewer`, so Claude's draft attempts land in the maintainer's
review queue instead of sitting unnoticed.

Uses `github.repository_owner` so the behavior follows the repo into
downstream books created from this template, and runs as a non-fatal
follow-up to PR creation so a reviewer-request error degrades to a
warning rather than failing the run.

Addresses #105.
@d-morrison d-morrison marked this pull request as ready for review June 9, 2026 03:13
Copilot AI review requested due to automatic review settings June 9, 2026 03:13
@claude

claude Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 1m 18s —— View job


Code Review: PR #109 — Assign reviewer on Claude-opened PRs

  • Read changed file and diff
  • Review for correctness, security, and CI/template impact
  • Post inline comments
  • Post final summary

Summary

The change is correct and clean. The core choices are sound:

  • Using gh pr edit separately (not --reviewer on gh pr create) correctly isolates the reviewer-request failure mode from PR creation. Non-fatal degradation is the right call.
  • github.repository_owner is the right token for template portability — it follows the repo into downstream books.
  • Scoping this to the freshly-opened path only is correct; the idempotent re-run path should leave existing reviewer assignments alone.
  • No security concern: github.repository_owner is a trusted, alphanumeric-plus-hyphen value so interpolating it into shell is safe here.

One minor comment posted inline: the 8-line comment block outlining the rationale exceeds the project's "comment only the non-obvious WHY" convention, especially since the PR description already covers all of it. A one-liner covering the non-obvious structural choice (separate gh pr edit vs. --reviewer flag) would be enough. See the inline suggestion.

Otherwise, this is ready to merge.


@claude address review comments in [this review](https://github.com/d-morrison/qwt/pull/109)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the claude.yml workflow so that when it opens a draft PR in response to an issue trigger, it also requests the repository owner as a reviewer—making these Claude-created drafts appear in the maintainer’s review queue (per Issue #105).

Changes:

  • After creating a new draft PR, run gh pr edit ... --add-reviewer ${{ github.repository_owner }} and downgrade failures to a workflow warning (non-fatal).

Comment thread .github/workflows/claude.yml Outdated
Per review on #109: the 8-line comment block restated context already
covered by the PR description. Collapse it to the one non-obvious point —
why a separate `gh pr edit` (not a `--reviewer` flag on `gh pr create`):
so a reviewer-request failure degrades to a warning instead of failing PR
creation.
@claude

claude Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 1m 8s —— View job


Review comment addressed

  • Read changed file and review current state
  • Verify review comment was addressed
  • Post final status

The inline review comment has been addressed in commit 38f5750. The 8-line comment block was trimmed to 3 lines:

Before (8 lines):

# Issue #105: request the repository owner as a reviewer on the
# freshly-opened PR so Claude's drafts land in their review queue.
# Done as a separate `gh pr edit` (not a `--reviewer` flag on
# `gh pr create`) so a reviewer-request failure — e.g. the owner
# is an org rather than a user, or happens to be the PR author —
# degrades to a warning instead of failing PR creation. Uses
# `github.repository_owner` so the request follows the repo into
# downstream books created from this template.

After (3 lines):

# Issue #105: request the repo owner as a reviewer. Separate from
# `gh pr create` so a failure (e.g. owner is an org) degrades to a
# warning rather than failing PR creation.

The result is one line longer than the suggestion (which dropped the issue-reference line), but the same spirit: only the non-obvious structural WHY remains. The PR is ready to merge.

@claude

claude Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 1m 42s —— View job


Code Review: PR #109 — Assign reviewer on Claude-opened PRs

  • Read the changed file and diff
  • Review for correctness, security, and CI/template impact
  • Post inline comments if needed
  • Post final summary

Summary

This is a re-review after the branch was synced with main (92ee3d2). The actual feature change is the same 5-line addition that was reviewed in the previous cycle; nothing substantive changed.

The change is correct and ready to merge. Specific checks:

  • Correctness: gh pr edit "$PR_URL" --add-reviewer ... is correctly scoped to the freshly-opened else branch only (line 665–669). $PR_URL is set on line 657 by gh pr create, so it's always valid when the reviewer request runs.
  • Security: github.repository_owner is an alphanumeric+hyphen value — safe to interpolate into shell. No injection vector.
  • Non-fatal degradation: The || echo "::warning::..." pattern is correct. Cases where this would fail (owner is an org, owner is the PR author, insufficient token scope) are all handled gracefully without breaking the run.
  • Template portability: github.repository_owner follows the repo into downstream books — the right choice over a hardcoded username.
  • Allowedtools: gh pr edit:* is already in the Claude agent's --allowedTools allowlist (line 359), so no allowlist update needed.
  • Comment length: Previously flagged (8-line block → 3 lines in 38f5750). The remaining # Issue #105: prefix is a minor CLAUDE.md style point (issue references belong in the PR description, not in comments), but it's a cosmetic nit that doesn't warrant blocking.

No new inline comments needed — the one substantive finding from the prior cycle has been addressed.

@d-morrison d-morrison merged commit 31d8b96 into main Jun 9, 2026
8 checks passed
@d-morrison d-morrison deleted the claude/issue-105-assign-reviewer branch June 9, 2026 04:02
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-08 21:05 PDT

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