Skip to content

feat(review): run on non-PR issue targets (#142 slice 3, ADR-0033)#160

Merged
stephane-segning merged 1 commit into
mainfrom
claude/142-slice3-issue-targets
Jun 22, 2026
Merged

feat(review): run on non-PR issue targets (#142 slice 3, ADR-0033)#160
stephane-segning merged 1 commit into
mainfrom
claude/142-slice3-issue-targets

Conversation

@stephane-segning

Copy link
Copy Markdown
Contributor

1. Summary

Completes #142 (ADR-0033): an @mention on a plain issue (not just a PR thread) now launches a task. handle_issue_comment branches on whether the issue carries a pull_request object:

  • PR thread → fetch base/head SHAs, target_type=pull_request, diff-scoped review (unchanged).
  • Plain issuetarget_type=issue, no SHAs.

The rest of the chain already supports it: no diff ⇒ the agent omits add_review_comment and answers via add_commentfinalize posts a single issue comment (emergent kind ask). The idempotency key includes target_type, so an issue and a PR with the same number are distinct tasks.

Source of truth: #142 / ADR-0033.


2. Intent

ADR-0033 said run kinds carry a target beyond PRs. The engine already answers diff-less runs (since #140's no-diff tool gating); this just lets the webhook point the agent at an issue, so you can @mention it on a bug report or question and get a grounded reply.


3. Scope

In Scope

  • Webhook accepts issue_comment on a non-PR issue → issue task (no SHAs).

Out of Scope

  • Commit/repo targets (ADR-0033 mentions them; not requested).
  • Runner changes — none needed (no-diff path already handles it).

4. Verification

  • Running automated tests
DATABASE_URL=postgres://lightbridge:lightbridge@localhost:5432/lightbridge cargo test -p control-plane --locked
cargo fmt --check && cargo clippy -p control-plane --all-targets
control-plane: 57 passed (1 new issue-target round-trip test); webhook unit tests green; fmt + clippy clean

New test: an issue task (no SHAs) round-trips via get_task_context, and a PR with the same number is a distinct task (target_type discriminates the idempotency key).


5. Screenshots / Evidence

N/A (backend). pr_diff returns None without SHAs (verified) → the diff-less agent path + issue-comment finalize sink (both already in main) carry the rest.


6. Risk Assessment

  • Low — additive webhook branch; PR path unchanged; approval gate still applies to issues.

7. AI Usage Declaration

AI was used for:

  • Understanding existing code
  • Generating code
  • Generating tests

Human verification:

  • I understand every meaningful change in this PR
  • I traced the diff-less → add_comment → finalize chain for issues
  • I accept responsibility for this PR

8. Reviewer Focus

  • Correctness (PR vs issue branch; approval gate; idempotency key)
  • Edge cases (no SHAs, same number PR vs issue)

🤖 Generated with Claude Code

An @mention on a plain issue (not just a PR thread) now launches a task.
The webhook branches on whether the issue carries a pull_request object:
a PR thread fetches base/head SHAs for a diff-scoped review (unchanged); a
plain issue creates an `issue` task with no SHAs. The rest of the chain
already supports it — no diff ⇒ the agent omits add_review_comment and
answers via add_comment ⇒ finalize posts a single issue comment (the
emergent kind is `ask`). The idempotency key includes target_type, so an
issue and a PR with the same number are distinct tasks.

Webhook-only + a DB round-trip test; runner unchanged. control-plane 57
(pg17) + webhook unit tests green; fmt + clippy clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown

✅ AI Governance check passed

This PR declares AI usage, references a source of truth, and provides verification evidence. Thank you.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request implements support for handling issue comments on plain GitHub issues (ADR-0033 slice 3) in addition to pull requests. It updates the webhook handler to distinguish between PRs and plain issues, conditionally fetching SHAs only for PRs, and updates the database task creation and logging to use the correct target type. Additionally, a new test has been added to verify that issue tasks round-trip correctly and remain distinct from PR tasks with the same ID. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@stephane-segning stephane-segning merged commit 0280a95 into main Jun 22, 2026
7 checks passed
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.

1 participant