Skip to content

feat(pr-review): add conversation resolution to PR workflow#233

Merged
rjmurillo merged 4 commits into
mainfrom
feat/conversation-resolution
Dec 22, 2025
Merged

feat(pr-review): add conversation resolution to PR workflow#233
rjmurillo merged 4 commits into
mainfrom
feat/conversation-resolution

Conversation

@rjmurillo-bot

Copy link
Copy Markdown
Collaborator

Summary

Add capability to resolve PR review threads via GraphQL API, enabling PRs to be merged when branch protection requires all conversations to be resolved.

  • Add Resolve-PRReviewThread.ps1 script with single/bulk resolution modes
  • Add 43 Pester tests covering syntax, parameters, GraphQL, error handling
  • Update pr-comment-responder.md with Step 6.4 (resolve thread) and Step 8.2 (verify resolution)
  • Update pr-review.md error recovery for safer parallel worktree handling

Context

Previously, the /pr-review workflow would reply to comments but leave review threads unresolved. This blocked PR merges when branch protection rules require all conversations to be resolved.

The complete workflow is now: Code fix → Reply → Resolve (all three steps required)

Test Plan

  • All 43 Pester tests pass for Resolve-PRReviewThread.ps1
  • Markdownlint passes for updated documentation
  • Script uses correct PowerShell syntax (${PullRequest} not #$PullRequest)
  • Manual test: Run bulk resolution on a PR with unresolved threads

Changes

New Files

  • .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 - GraphQL-based thread resolution
  • .claude/skills/github/tests/Resolve-PRReviewThread.Tests.ps1 - 43 Pester tests

Modified Files

  • src/claude/pr-comment-responder.md - Added Step 6.4 and Step 8.2
  • .claude/commands/pr-review.md - Safer error recovery for parallel scenarios

🤖 Generated with Claude Code

Add capability to resolve PR review threads via GraphQL API, enabling
PRs to be merged when branch protection requires all conversations resolved.

Changes:
- Add Resolve-PRReviewThread.ps1 script with single/bulk resolution modes
- Add 43 Pester tests covering syntax, parameters, GraphQL, error handling
- Update pr-comment-responder.md with Step 6.4 (resolve thread) and Step 8.2
- Update pr-review.md error recovery for safer parallel worktree handling

The complete workflow is now: Code fix → Reply → Resolve (all three required)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 22, 2025 06:55
@github-actions

Copy link
Copy Markdown
Contributor

Spec-to-Implementation Validation

Warning

No spec references found

This PR does not reference any specifications (REQ-, DESIGN-, TASK-*, or linked issues).

How to add spec references

Add spec references to your PR description to enable traceability:

Method Example
Reference requirements Implements REQ-001
Link issues Closes #123
Reference spec files .agents/specs/requirements/...

Spec Requirement by PR Type:

PR Type Required?
Feature (feat:) ✅ Required
Bug fix (fix:) Optional
Refactor (refactor:) Optional
Documentation (docs:) Not required
Infrastructure (ci:, build:, chore:) Optional

See PR template for full guidance.


Powered by AI Spec Validator - Validation skipped - no specs found

@github-actions

Copy link
Copy Markdown
Contributor

AI Quality Gate Review

Warning

⚠️ Final Verdict: WARN

Walkthrough

This PR was reviewed by six AI agents in parallel, analyzing different aspects of the changes:

  • Security Agent: Scans for vulnerabilities, secrets exposure, and security anti-patterns
  • QA Agent: Evaluates test coverage, error handling, and code quality
  • Analyst Agent: Assesses code quality, impact analysis, and maintainability
  • Architect Agent: Reviews design patterns, system boundaries, and architectural concerns
  • DevOps Agent: Evaluates CI/CD, build pipelines, and infrastructure changes
  • Roadmap Agent: Assesses strategic alignment, feature scope, and user value

Review Summary

Agent Verdict Status
Security PASS
QA WARN ⚠️
Analyst PASS
Architect PASS
DevOps PASS
Roadmap PASS
Analyst Review Details

Now let me check the modified pr-review.md file and look at existing patterns in the codebase:

Let me examine existing scripts in this directory for pattern comparison:

Let me also check one of the existing scripts to compare patterns:

I have enough context. Let me compile the analysis.

Analysis: PR feat(pr-review): add conversation resolution to PR workflow

Code Quality Score

Criterion Score (1-5) Notes
Readability 4 Clear function names, good comments, proper PowerShell conventions
Maintainability 4 Two focused functions, JSON output for automation, proper error handling
Consistency 4 Follows existing script patterns (cf. Get-PRContext.ps1), uses same test structure
Simplicity 4 Straightforward GraphQL approach, no over-engineering

Overall: 4/5

Impact Assessment

  • Scope: Module-wide (affects PR review workflow)
  • Risk Level: Low
  • Affected Components: PR review workflow, pr-comment-responder agent, pr-review command

Findings

Priority Category Finding Location
Low Consistency Script does not import GitHubHelpers module unlike Get-PRContext.ps1 Resolve-PRReviewThread.ps1:36
Low Robustness No pagination for PRs with >100 review threads Resolve-PRReviewThread.ps1:82
Low Testing Tests are regex-based static analysis only, no mock-based behavior tests Resolve-PRReviewThread.Tests.ps1
Low Documentation Step 6.4 renumbers existing Step 6.4 to 6.5, potential external reference breakage pr-comment-responder.md:763

Recommendations

  1. Consider pagination: The query fetches first: 100 threads. For PRs with 100+ threads, add pagination or document the limitation.
  2. Add null checks: Lines 132-133 access $thread.comments.nodes[0] without null-safety. If a thread has no comments, this throws.
  3. Module import: Consider using GitHubHelpers module for Assert-GhAuthenticated and Resolve-RepoParams to match existing scripts.

Verdict

VERDICT: PASS
MESSAGE: Well-structured addition with comprehensive tests. Minor improvements suggested but not blocking.
Architect Review Details

Design Quality Assessment

Aspect Rating (1-5) Notes
Pattern Adherence 4 Clean separation: script handles single responsibility (thread resolution). Functions follow Single Responsibility.
Boundary Respect 5 Script stays within GitHub API integration layer. No cross-cutting concerns violated.
Coupling 4 Depends only on gh CLI. Could add interface for testing but acceptable for utility script.
Cohesion 5 All functions relate to thread resolution. No unrelated functionality.
Extensibility 4 Bulk vs single modes via parameter sets. Easy to extend with dry-run or filter options.

Overall Design Score: 4.4/5

Architectural Concerns

Severity Concern Location Recommendation
Low Hard-coded pagination limit Resolve-PRReviewThread.ps1:82 first: 100 may miss threads on large PRs. Consider pagination or configurable limit.
Low No retry logic Resolve-PRReviewThread.ps1:52-56 Transient API failures will fail immediately. Consider exponential backoff for production use.
Low Null safety on empty comments Resolve-PRReviewThread.ps1:132-133 $thread.comments.nodes[0] may be null if thread has no comments. Add null check.

Breaking Change Assessment

  • Breaking Changes: No
  • Impact Scope: None
  • Migration Required: No
  • Migration Path: N/A (new capability)

Technical Debt Analysis

  • Debt Added: Low
  • Debt Reduced: Low
  • Net Impact: Improved (closes automation gap in PR workflow)

ADR Assessment

  • ADR Required: No
  • Decisions Identified: Uses GraphQL API over REST for thread resolution (only available via GraphQL)
  • Existing ADR: ADR-005 (PowerShell-only scripting) and ADR-006 (thin workflows) apply
  • Recommendation: N/A. This is a tactical utility following established patterns.

Recommendations

  1. Add pagination support for PRs with >100 review threads (edge case but possible).
  2. Consider adding -WhatIf support for dry-run mode per PowerShell conventions.
  3. Add null check for $thread.comments.nodes[0] to handle edge case of empty comment threads.

Verdict

VERDICT: PASS
MESSAGE: Clean utility script following established patterns (ADR-005, ADR-006). Adds missing workflow capability without architectural impact. Minor improvements suggested but non-blocking.
QA Review Details

Based on my code review, I'll now provide the QA assessment.


Test Report: PR Review Thread Resolution Feature

Summary

Metric Value
Total Tests 43
Passed Unable to execute (no pwsh)
Failed N/A
Skipped N/A
Coverage Static analysis only

Status

QA: WARN


Test Coverage Assessment

Area Status Evidence Files Checked
Unit tests Adequate 43 tests in Resolve-PRReviewThread.Tests.ps1 Resolve-PRReviewThread.ps1
Edge cases Partial Tests cover syntax, params, GraphQL; missing runtime mocking Script, Tests
Error paths Tested (static) Tests verify Write-Warning, LASTEXITCODE checks exist Lines 53-55, 99-103
Assertions Present 43 Should assertions across 12 contexts Test file

Quality Concerns

Severity Issue Location Evidence Required Fix
MEDIUM Tests are static pattern-matching only Tests.ps1:17-228 All tests use Should -Match on script content, no mocked execution Add mocked integration tests
MEDIUM No null/empty thread list handling Script:121-126 .Count on null returns 0, but no explicit null check Add explicit null handling
MEDIUM No test for single-thread GraphQL failure Tests Missing mock for Resolve-SingleThread returning false Add failure path test
LOW Thread comment access assumes non-empty Script:132-133 $thread.comments.nodes[0] could fail on empty comments Add defensive null check
LOW No pagination for >100 threads Script:82 reviewThreads(first: 100) Document limitation or add pagination

Regression Risk Assessment

  • Risk Level: Low
  • Affected Components: .claude/skills/github/scripts/pr/, src/claude/pr-comment-responder.md, .claude/commands/pr-review.md
  • Breaking Changes: None. New additive functionality only.
  • Required Testing: Manual test on PR with unresolved threads (as noted in PR description)

Code Quality Checks

Check Result Evidence
Function length [PASS] Resolve-SingleThread: 19 lines, Get-UnresolvedThreads: 37 lines
Error handling [PASS] $ErrorActionPreference = 'Stop', explicit LASTEXITCODE checks
Magic numbers [PASS] Only 100 for pagination (acceptable)
PowerShell syntax [PASS] Uses ${PullRequest} not #$PullRequest (comment vs variable issue avoided)

Test Quality Analysis

Strengths:

  • Comprehensive syntax validation (43 tests)
  • Tests verify critical PowerShell syntax pitfall (${PullRequest} vs #$PullRequest)
  • Good coverage of help documentation, parameter sets, GraphQL patterns

Gaps:

  • All tests are static content matching, not behavioral tests
  • No mocked gh api graphql calls to verify actual execution paths
  • No test for malformed GraphQL responses
  • No test for partial bulk resolution failure (some succeed, some fail)

VERDICT: WARN

MESSAGE: Static tests adequate for syntax validation; missing mocked integration tests for runtime behavior.

EVIDENCE:

  • Tests found: 43 for 2 new functions (155-line script)
  • Edge cases: Syntax patterns covered; runtime edge cases (null threads, empty comments) untested
  • Error handling: Static verification present; no mocked failure path execution
  • Blocking issues: 0

Recommendations

  1. Accept PR as-is - static tests catch syntax errors which are highest risk for PowerShell scripts
  2. Follow-up: Add mocked execution tests using Pester Mock for gh command
  3. Follow-up: Add defensive null check at line 132 for empty comments array
  4. Document: Note 100-thread pagination limit in script help
Roadmap Review Details

Strategic Alignment Assessment

Criterion Rating Notes
Aligns with project goals High Enables merging PRs when branch protection requires conversation resolution (documented in AGENTS.md)
Priority appropriate High Directly supports PR workflow which is core to development process
User value clear High Solves a concrete blocker: PRs with unresolved threads cannot merge
Investment justified High 155-line script + 228-line tests for a workflow-completing feature

Feature Completeness

  • Scope Assessment: Right-sized
  • Ship Ready: Yes
  • MVP Complete: Yes
  • Enhancement Opportunities: None identified. Single + bulk modes cover all use cases.

Impact Analysis

Dimension Assessment Notes
User Value High Completes the PR review workflow: Code fix + Reply + Resolve
Business Impact High Removes a merge blocker for repositories with branch protection
Technical Leverage Medium Script is reusable across all PRs; GraphQL pattern is extensible
Competitive Position Neutral Standard workflow completion, not differentiating

Concerns

Priority Concern Recommendation
Low Manual test not yet complete Complete before merge if possible; acceptable to merge with automated coverage

Recommendations

  1. This change completes a gap in the pr-comment-responder workflow. The product roadmap documents "Conversations Resolved" as a branch protection requirement. This feature directly enables that.
  2. The change aligns with the Claude Code P0 platform priority. The new script and documentation live in .claude/ paths.
  3. Test coverage is strong (43 tests covering syntax, parameters, GraphQL, error handling).

Verdict

VERDICT: PASS
MESSAGE: Feature completes the PR review workflow and aligns with documented branch protection requirements. Scope is appropriate, tests are comprehensive, documentation is updated.
Security Review Details

Security Review: PR Review Thread Resolution Feature

Findings

Severity Category Finding Location CWE
Medium Injection GraphQL mutation constructs query string with direct variable interpolation. If $Id contained malicious GraphQL, it could alter query semantics. Resolve-PRReviewThread.ps1:43 CWE-943
Low Input Validation No validation that $ThreadId matches expected PRRT_ format before use Resolve-PRReviewThread.ps1:27 CWE-20
Low Error Disclosure Error messages include raw API responses which may contain internal details Resolve-PRReviewThread.ps1:54,74,103 CWE-209
Info Best Practice PR number $PR is interpolated directly into GraphQL query. Integer type provides implicit validation. Resolve-PRReviewThread.ps1:81 N/A

Analysis

GraphQL Injection Risk (Medium): The $Id variable is interpolated directly into the GraphQL mutation string at line 43. While GitHub's GraphQL API validates thread IDs server-side and rejects malformed IDs, the script does not validate the format client-side. The expected format is PRRT_[base64]. Risk is mitigated because:

  1. The script is invoked by trusted automation, not user input
  2. GitHub's API validates the thread ID format
  3. The mutation only resolves threads the authenticated user has permission to resolve

Input Validation (Low): Adding a regex check for ^PRRT_[A-Za-z0-9_-]+$ would provide defense-in-depth.

Error Disclosure (Low): Raw API responses in warnings could expose internal state. In a CI/CD context, logs may be publicly visible.

No Secrets Detected: No hardcoded credentials, API keys, or tokens found.

Dependency Security: Uses only gh CLI (GitHub-maintained). No external dependencies added.

Authentication: Relies on existing gh CLI authentication. No credential handling in script.

Recommendations

  1. Add ThreadId format validation (optional hardening):
if ($ThreadId -notmatch '^PRRT_[A-Za-z0-9_-]+$') {
    throw "Invalid ThreadId format. Expected PRRT_xxx"
}
  1. Sanitize error output for public logs:
Write-Warning "Failed to resolve thread ${Id}: API error"
  1. Documentation change is safe: The pr-comment-responder.md and pr-review.md changes add operational guidance without security impact.

Verdict

VERDICT: PASS
MESSAGE: No critical security vulnerabilities. GraphQL injection risk is mitigated by server-side validation and trusted invocation context. Recommended adding client-side ThreadId format validation for defense-in-depth.
DevOps Review Details

Pipeline Impact Assessment

Area Impact Notes
Build None No build script changes
Test Low New Pester tests added to existing test path .claude/skills/
Deploy None No deployment changes
Cost None Tests run on existing Windows runner

CI/CD Quality Checks

Check Status Location
YAML syntax valid No workflow changes
Actions pinned Existing pester-tests.yml uses SHA pins
Secrets secure Script uses gh api (relies on GITHUB_TOKEN from environment)
Permissions minimal No new permissions required
Shell scripts robust Resolve-PRReviewThread.ps1

Findings

Severity Category Finding Location Fix
Low Shell Script Script captures stderr with 2>&1 but could benefit from explicit error variable Resolve-PRReviewThread.ps1:52,72,101 Optional: Use -ErrorVariable for cleaner error handling
Low Robustness No null check on $thread.comments.nodes[0] before accessing .author.login Resolve-PRReviewThread.ps1:132-133 Add null coalescing: $author = $thread.comments.nodes[0]?.author?.login ?? 'unknown'
Low GraphQL Query fetches only first 100 threads; PRs with 100+ threads would miss some Resolve-PRReviewThread.ps1:82 Document limit or add pagination

Template Assessment

  • PR Template: Adequate
  • Issue Templates: Adequate (drift-alert.md exists)
  • Template Issues: None

Automation Opportunities

Opportunity Type Benefit Effort
Add thread resolution to existing PR review workflow Workflow integration Medium (reduces manual steps) Low
Extract GraphQL helper for gh api calls Composite action Low (reduces duplication) Medium

Recommendations

  1. The .claude/skills/** path is already included in pester-tests.yml testable paths, so the 43 new tests will run automatically
  2. Consider adding null-safe navigation for accessing nested thread properties to prevent runtime errors on edge cases
  3. The 100-thread limit is reasonable for most PRs but should be documented

Verdict

VERDICT: PASS
MESSAGE: CI/CD changes are safe. New PowerShell script follows conventions, tests are discoverable by existing workflow, no secrets exposure or security concerns.

Run Details
Property Value
Run ID 20424329967
Triggered by pull_request on 233/merge
Commit 631cf450355554338937253594893d056cb15043

Powered by AI Quality Gate - View Workflow

rjmurillo
rjmurillo previously approved these changes Dec 22, 2025

@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 introduces a valuable feature for resolving PR review threads, which is crucial for workflows with branch protection rules. The new PowerShell script is well-structured and accompanied by a comprehensive set of Pester tests and updated documentation. My review focuses on improving the script's robustness and adherence to the repository's PowerShell style guide. I've suggested using try/catch blocks for safer JSON parsing, adding defensive checks for handling potential edge cases during bulk operations, and refining function names to better align with PowerShell conventions.

Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 Outdated
Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 Outdated
Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 Outdated
Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 Outdated
Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 Outdated
Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 Outdated

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

This PR adds PR review thread resolution capability to enable merging PRs when branch protection requires all conversations to be resolved. The implementation uses GitHub's GraphQL API to resolve threads individually or in bulk, integrating into the existing PR comment workflow.

Key changes:

  • New PowerShell script with single/bulk thread resolution modes and comprehensive error handling
  • 43 Pester tests covering syntax validation, GraphQL operations, and error scenarios
  • Updated PR comment responder workflow with mandatory thread resolution steps

Reviewed changes

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

File Description
.claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 Implements GraphQL-based thread resolution with single thread and bulk mode support
.claude/skills/github/tests/Resolve-PRReviewThread.Tests.ps1 Comprehensive test suite with 43 tests covering syntax, parameters, GraphQL ops, and error handling
src/claude/pr-comment-responder.md Adds Step 6.4 (resolve thread after reply) and Step 8.2 (verify all threads resolved before completion)
.claude/commands/pr-review.md Enhanced error recovery for push rejections to handle parallel worktree scenarios more safely

Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 Outdated
Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 Outdated
Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1
Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 Outdated
@coderabbitai

coderabbitai Bot commented Dec 22, 2025

Copy link
Copy Markdown

Warning

Rate limit exceeded

@rjmurillo-bot has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 2 minutes and 22 seconds before requesting another review.

⌛ 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.

📥 Commits

Reviewing files that changed from the base of the PR and between b5a0db0 and 43808ee.

📒 Files selected for processing (7)
  • .claude/commands/pr-review.md
  • .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1
  • .claude/skills/github/tests/Resolve-PRReviewThread.Tests.ps1
  • src/claude/pr-comment-responder.md
  • src/copilot-cli/pr-comment-responder.agent.md
  • src/vs-code-agents/pr-comment-responder.agent.md
  • templates/agents/pr-comment-responder.shared.md

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds a PowerShell tool to resolve GitHub PR review threads via GraphQL, a comprehensive Pester test suite for that tool, updates PR responder docs to require resolving conversation threads, and refines push-rejection recovery guidance to detect concurrent updates before force-pushing.

Changes

Cohort / File(s) Summary
PR Review Error Recovery
\.claude/commands/pr-review.md
Reworked push-rejection handling to fetch and compare remote branch; if no concurrent changes, retry with --force-with-lease; if concurrent updates exist, log rejection and require manual resolution (no blind force-push).
Thread Resolution Implementation
\.claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1 , \.claude/skills/github/tests/Resolve-PRReviewThread.Tests.ps1
New PowerShell script exposing Resolve-ReviewThread([string]$Id) and Get-UnresolvedReviewThreads([int]$PR). Supports single-thread and bulk (-All) modes, uses gh api graphql to query and call resolveReviewThread mutation, returns JSON summary and exit codes. Comprehensive Pester tests added validating syntax, parameters, GraphQL usage, error handling, output, and exit behavior.
PR Comment Responder Workflow
src/claude/pr-comment-responder.md
Inserted mandatory "Resolve Conversation Thread" step (bulk and single-thread commands, PRRT_xxx ID format) and blocking verification step requiring all conversations resolved before marking PR complete; renumbered phases and updated completion/QA checks.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Script as Resolve-PRReviewThread.ps1
    participant gh as gh CLI
    participant API as GitHub GraphQL

    User->>Script: Run script (-All + PR) or (-ThreadId)
    Script->>gh: gh repo view (get owner/name)
    gh-->>Script: repo metadata
    Script->>gh: gh api graphql (query PR reviewThreads where isResolved=false)
    gh->>API: GraphQL query
    API-->>gh: unresolved threads JSON
    gh-->>Script: JSON list

    loop per unresolved thread
        Script->>gh: gh api graphql (resolveReviewThread mutation with thread ID)
        gh->>API: GraphQL mutation
        alt mutation success
            API-->>gh: success result
            gh-->>Script: success
            Script->>Script: increment Resolved
        else mutation failure
            API-->>gh: error
            gh-->>Script: failure
            Script->>Script: increment Failed
        end
    end

    Script->>User: Output JSON summary (TotalUnresolved, Resolved, Failed, Success)
    Script->>User: Exit code 0 if all resolved, 1 if any failed
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • Files/areas needing extra attention:
    • Resolve-PRReviewThread.ps1: validate GraphQL queries/mutation payloads, gh CLI error handling, exit-code logic, and concurrent execution safety.
    • Resolve-PRReviewThread.Tests.ps1: ensure mocks/expectations correctly simulate gh responses and failure modes.
    • \.claude/commands/pr-review.md: verify fetch-and-compare steps are precise and unambiguous for automation scripts and humans.
    • src/claude/pr-comment-responder.md: ensure step numbering and required commands align with the script's CLI (PRRT ID format, exit codes).

Possibly related issues

Possibly related PRs

Suggested reviewers

  • rjmurillo
  • Copilot

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed Title follows conventional commit format with 'feat' prefix and concise description of the main change: adding conversation resolution to PR workflow.
Description check ✅ Passed Description clearly relates to the changeset, detailing the new resolution script, tests, documentation updates, and the workflow context for the feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

Address all 10 review comments from gemini-code-assist and copilot:

- Rename Resolve-SingleThread to Resolve-ReviewThread (verb-noun pattern)
- Rename Get-UnresolvedThreads to Get-UnresolvedReviewThreads
- Add try/catch for JSON parsing in Resolve-ReviewThread function
- Add try/catch for GraphQL response parsing in Get-UnresolvedReviewThreads
- Add null checks for thread comment data to prevent index errors
- Remove unused isOutdated and totalCount fields from GraphQL query
- Use idiomatic empty collection check (-not $collection)
- Add documentation note about 100 thread pagination limit

All 43 Pester tests pass with the renamed functions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions Bot added enhancement New feature or request area-skills Skills documentation and patterns labels Dec 22, 2025
coderabbitai[bot]
coderabbitai Bot previously approved these changes Dec 22, 2025
Merged Phase 8 verification steps from both branches:
- Phase 8.1: Comment Status Verification
- Phase 8.2: Verify Conversation Resolution (new - thread resolution)
- Phase 8.3: Re-check for New Comments (from main)
- Phase 8.4: QA Gate Verification (from main)
- Phase 8.5: Completion Criteria Checklist (from main)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

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

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

Comment thread .claude/skills/github/tests/Resolve-PRReviewThread.Tests.ps1
Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1
Comment thread .claude/skills/github/scripts/pr/Resolve-PRReviewThread.ps1
coderabbitai[bot]
coderabbitai Bot previously approved these changes Dec 22, 2025

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Comment thread src/claude/pr-comment-responder.md
Comment thread src/claude/pr-comment-responder.md Outdated
…r exceptions

Addresses PR review comments from @rjmurillo:

- Ported Step 6.4 (Resolve Conversation Thread) to templates
- Added Exception clause: do NOT auto-resolve for human reviewers
- Added Phase 8.2 (Verify Conversation Resolution) to templates
- Added full Phase 8 sub-phases (8.1-8.5) to templates
- Ran Generate-Agents.ps1 to regenerate platform agents

Changes also include the WONTFIX status in comment counting.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
rjmurillo-bot added a commit that referenced this pull request Dec 28, 2025
Extract learnings from PR #235 (Get-PRReviewComments dual endpoint fix)
and create 5 atomic skillbook entries with 95-97% atomicity scores:

Skills Created:
- Skill-GH-API-002 (97%, 9/10) - GitHub dual comment endpoints
- Skill-Diagnosis-001 (95%, 8/10) - Evidence-based diagnosis
- Skill-PowerShell-006 (96%, 9/10) - Backward-compatible switch params
- Skill-API-Design-001 (97%, 8/10) - Type discriminator fields
- Skill-Test-Pester-006 (96%, 9/10) - Static analysis tests

Key Patterns:
1. MUST query both /pulls/{n}/comments AND /issues/{n}/comments
2. Compare API counts against real PR data to prove gaps
3. Use switch parameters with default false for backward compatibility
4. Add discriminator field when merging multiple API sources
5. Use regex-based tests to validate scripts without API calls

Evidence: PR #235, PR #233 (26 review + 3 issue = 29 total comments)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
rjmurillo-bot added a commit that referenced this pull request Dec 28, 2025
…ts (#235)

* feat(github-skills): add issue comments support to Get-PRReviewComments

Add -IncludeIssueComments switch to fetch top-level PR comments
(issue comments) in addition to code-level review comments.

Problem: The /pr-review workflow was missing issue comments like
AI Quality Gate reviews, spec validation, and CodeRabbit summaries.
These are posted via /issues/{n}/comments API, not /pulls/{n}/comments.

Solution:
- Add -IncludeIssueComments switch parameter
- Fetch from /issues/{n}/comments when switch is set
- Add CommentType field ("Review" or "Issue") to distinguish types
- Add ReviewCommentCount and IssueCommentCount to output
- Combine and sort all comments by CreatedAt

Test: 49 new tests covering syntax, parameters, API endpoints,
comment type handling, and output structure.

Example:
  Get-PRReviewComments.ps1 -PullRequest 233 -IncludeIssueComments
  # Returns 26 review + 3 issue = 29 total comments

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: update documentation for -IncludeIssueComments feature

Updates documentation to reflect new functionality in Get-PRReviewComments.ps1:
- SKILL.md: Updated structure and quick reference for issue comments
- pr-comment-responder.md: Updated scripts table, Phase 0, Steps 1.3/1.4, Phase 8.2
- pr-comment-responder.shared.md: Updated GitHub skill table

The -IncludeIssueComments switch enables fetching of issue comments
(AI Quality Gate, CodeRabbit summaries) that were previously missed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(pr-235): address PR review comments

- Fix null handling for empty issue comments (wrap foreach in @())
- Add pluralization logic for comment counts in output message
- Remove redundant @() operator on line 114

Addresses review comments from Copilot and gemini-code-assist[bot]

Comment-IDs: 2639441218, 2639441176, 2639434849

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: regenerate pr-comment-responder agent files

Update generated agent files for copilot-cli and vscode platforms after reviewing PR #235 comments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: wrap review comments foreach in @() for consistent array behavior

Addresses Copilot review comment: The foreach loop for processing review
comments now uses @() wrapper like issue comments processing, ensuring
consistent array behavior when  is null or empty.

Comment-ID: 2639613878

* feat(skills): extract 5 learnings from PR #235 into skillbook

Extract learnings from PR #235 (Get-PRReviewComments dual endpoint fix)
and create 5 atomic skillbook entries with 95-97% atomicity scores:

Skills Created:
- Skill-GH-API-002 (97%, 9/10) - GitHub dual comment endpoints
- Skill-Diagnosis-001 (95%, 8/10) - Evidence-based diagnosis
- Skill-PowerShell-006 (96%, 9/10) - Backward-compatible switch params
- Skill-API-Design-001 (97%, 8/10) - Type discriminator fields
- Skill-Test-Pester-006 (96%, 9/10) - Static analysis tests

Key Patterns:
1. MUST query both /pulls/{n}/comments AND /issues/{n}/comments
2. Compare API counts against real PR data to prove gaps
3. Use switch parameters with default false for backward compatibility
4. Add discriminator field when merging multiple API sources
5. Use regex-based tests to validate scripts without API calls

Evidence: PR #235, PR #233 (26 review + 3 issue = 29 total comments)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): record commit SHA 29fd93b in session log

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): update session log to match canonical checklist format

Update Session End checklist to match SESSION-PROTOCOL.md template
with Req|Step|Status|Evidence columns required by Validate-SessionEnd.ps1

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): exact match canonical checklist template

Fix Step column text to exactly match SESSION-PROTOCOL.md line 309:
'Commit all changes (including .serena/memories)'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): mark QA as complete (N/A for skillbook updates)

Skillbook updates only modify .serena/memories/ documentation files
and do not require QA validation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(qa): add QA report for skillbook update

Create QA report explaining that skillbook updates (documentation only)
do not require functional QA validation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): update commit SHA to 2a73216

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: commit remaining PR #235 agent artifacts and memory updates

Add PR #235 agent artifacts (critique, devops, qa) and finalize
skill memory updates for session 01.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): final commit SHA ddeba58

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs(session): record validator PASS with commit 64b31ae

Session End validation passed successfully.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Port pr-comment-responder changes and add PowerShell schema ADR

Addresses PR review comments from @rjmurillo:

1. Port changes from src/claude/pr-comment-responder.md to
   templates/agents/pr-comment-responder.shared.md to maintain
   tri-template system until consolidation

2. Document PowerShell cmdlet output schema consistency design
   decision in ADR-017

Changes:
- Sync pr-comment-responder.shared.md with src version (preserving
  tools_vscode/tools_copilot frontmatter)
- Add ADR-017 documenting why IssueCommentCount is always included
  (even when -IncludeIssueComments not used)

Comment-IDs: 2643934251, 2643938888

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(session): mark HANDOFF.md update as N/A per ADR-014

The session log was created before ADR-014 (distributed handoff architecture)
which made HANDOFF.md read-only on feature branches. Update the Session End
checklist to reflect this protocol change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: Correct template system description in PR-235 devops review

Address review comment from @rjmurillo clarifying the dual-maintenance
template system during tri-template migration period.

Changes:
- Update devops review to document dual-flow pattern
- Clarify src/claude/**/*.md is maintained independently (not generated)
- Document bidirectional porting requirement between src/claude and
  templates/agents

Comment-ID: 2643934251

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(adr): remove duplicate ADR-017-powershell-cmdlet-schema-consistency.md

Main branch already contains ADR-017-powershell-output-schema-consistency.md
from PR #302, covering the same PowerShell schema consistency decision.

The duplicate file was created before the main branch merge and
conflicted with the existing ADR-017 naming.

This commit removes the duplicate and relies on the canonical ADR-017
from main.

* fix(pr-235): port IncludeIssueComments changes to template

Apply changes from src/claude/pr-comment-responder.md to templates/agents/pr-comment-responder.shared.md:

- Update table row to show -IncludeIssueComments parameter
- Simplify Phase 0 to Session State Check
- Remove Memory Initialization steps (now handled by Serena)
- Update Step 1.3 to use -IncludeIssueComments
- Update Step 1.4 to document CommentType field
- Update session state check comment fetching

Addresses comment #2649336096

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* build: regenerate pr-comment-responder agents from template

Run build/Generate-Agents.ps1 to sync platform-specific agents with template changes.

Fixes validation check failure.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: rjmurillo-bot <rjmurillo-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
rjmurillo-bot added a commit that referenced this pull request Dec 28, 2025
Addresses review comments from gemini-code-assist[bot] and @rjmurillo:

**RFC 2119 Compliance (gemini comments 2639624178, 2639624181, 2639624184, 2639624193, 2639624194, 2639624197)**:
- Replace all instances of MANDATORY with MUST per RFC 2119 keywords
- Updated in all three pr-comment-responder files (template + copilot-cli + vs-code-agents)
- Re-applies fix from fc4db8d that was overwritten by merge from main (PR #199 reintroduced MANDATORY)

**PR References (rjmurillo comment 2644360944)**:
- Add explicit PR list to analysis methodology section (line 28)
- Lists all 8 PRs analyzed: #233, #232, #199, #206, #194, #143, #141, #202

Note: gemini comments about code example improvements (2639624180, 2639624189, 2639624196) are not applicable - the referenced code sections were removed when main merged. The current table correctly uses "Copilot" as the reviewer login (verified via GitHub API).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-skills Skills documentation and patterns enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants