-
Notifications
You must be signed in to change notification settings - Fork 28
Add add-reviewer safe output for automated PR reviewer management #4564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…implementation for add-reviewer safe output Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…d-reviewer safe output Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ix nil checks, optimize reviewer processing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
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 a new add-reviewer safe output type to GitHub Agentic Workflows, enabling AI agents to programmatically add reviewers to pull requests with filtering and targeting controls.
Key Changes
- Implemented complete
add-reviewersafe output with schema validation, JavaScript execution, and Go integration - Added support for reviewer filtering via allowlist, configurable max count (default: 3), and target modes (triggering/any PR/explicit number)
- Special handling for "copilot" reviewer which maps to
copilot-pull-request-reviewer[bot]
Reviewed changes
Copilot reviewed 93 out of 95 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
schemas/agent-output.json |
Added AddReviewerOutput schema definition with reviewers array and optional pull_request_number |
pkg/workflow/js/add_reviewer.cjs |
Main JavaScript implementation with filtering, deduplication, and GitHub API integration |
pkg/workflow/js/add_reviewer.test.cjs |
Comprehensive unit tests covering filtering, limits, staging, and error scenarios |
pkg/workflow/add_reviewer.go |
Go job builder and configuration parser following established safe output patterns |
pkg/workflow/safe_outputs.go |
Integration of add-reviewer into safe outputs configuration and MCP tools |
pkg/workflow/compiler_jobs.go |
Wiring of add-reviewer job into compilation pipeline |
pkg/workflow/js/collect_ndjson_output.cjs |
Validation logic for add_reviewer output with username length enforcement |
pkg/workflow/js/safe_outputs_tools.json |
MCP tool signature for add_reviewer |
pkg/parser/schemas/main_workflow_schema.json |
Frontmatter schema for add-reviewer configuration |
docs/src/content/docs/reference/frontmatter-full.md |
Documentation for add-reviewer configuration options |
.github/workflows/*.lock.yml |
Updated compiled workflows with new validation constant |
pkg/workflow/scripts.go |
Script bundling setup for add_reviewer.cjs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add documentation for three new safe output types merged in the last 24 hours: - close-issue: Close GitHub issues with comment and state reason filtering - add-reviewer: Add reviewers to pull requests with allowlist support - close-pull-request: Close PRs without merging with label/title filtering Changes made: - Added entries to safe outputs table in reference documentation - Added detailed configuration sections for each new safe output type - Included examples with all configuration options - Documented target modes, filtering options, and cross-repo support Features documented from: - PR #4568: close-pull-request safe output - PR #4564: add-reviewer safe output - PR #4554: close-issue safe output 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Adds
add-reviewersafe output type enabling AI agents to programmatically add reviewers to pull requests with filtering and targeting controls.Changes
Schema & Types
AddReviewerOutputschema withreviewersarray and optionalpull_request_numberAddReviewerItemandAddReviewerConfigadd_reviewertool signature to MCP server toolsJavaScript Implementation (
pkg/workflow/js/add_reviewer.cjs)"triggering"(default),"*"(any PR), or explicit PR number"copilot"reviewer →copilot-pull-request-reviewer[bot]Go Implementation
pkg/workflow/add_reviewer.gousing sharedbuildSafeOutputJob()patternsafe_outputs.gowith schema integrationConfiguration Example
Testing
pkg/cli/workflows/test-copilot-add-reviewer.mdImplementation Notes
Reuses reviewer addition patterns from
create-pull-requestjob builder. Follows established safe output architecture with validation pipeline: JSON Schema → TypeScript types → JSONL collection → Go job generation.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/user/usr/bin/gh gh api user --jq .login(http block)/usr/bin/gh gh api user --jq .login t.go go integration_test.go test.go on_test.go _test.go always_declared_test.go(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.