Conversation
…ltiple review comments
There was a problem hiding this comment.
Pull request overview
Adds a new safe-output tool (submit_pull_request_review) to submit a single consolidated GitHub PR review with an overall decision (APPROVE / REQUEST_CHANGES / COMMENT), and updates the safe-outputs pipeline to buffer inline review comments and submit them together at the end of processing.
Changes:
- Introduces
submit_pull_request_reviewin agent-output schema, workflow schema, safe-output validation config, and tool manifests. - Implements JS buffering + finalization flow so multiple
create_pull_request_review_commentmessages become onepulls.createReview()submission. - Extends Go safe-outputs configuration parsing/generation, tool filtering, and permissions to support the new tool.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| schemas/agent-output.json | Adds new output type schema for submit_pull_request_review. |
| pkg/workflow/tool_description_enhancer.go | Adds constraint messaging for submit_pull_request_review safe-output config. |
| pkg/workflow/submit_pr_review.go | Adds Go config parsing for submit-pull-request-review safe-outputs frontmatter. |
| pkg/workflow/safe_outputs_tools_test.go | Updates tool filtering tests to include submit_pull_request_review. |
| pkg/workflow/safe_outputs_test.go | Updates enabled-tool detection/sorting tests to include the new tool. |
| pkg/workflow/safe_outputs_config_helpers_reflection.go | Maps config field name to tool name for reflection-based helpers. |
| pkg/workflow/safe_outputs_config_generation.go | Emits config and enables the tool when configured. |
| pkg/workflow/safe_outputs_config.go | Extracts submit-pull-request-review from frontmatter into SafeOutputsConfig. |
| pkg/workflow/safe_output_validation_config_test.go | Updates validation config test list to include the new type. |
| pkg/workflow/safe_output_validation_config.go | Adds field validation rules for submit_pull_request_review. |
| pkg/workflow/js/safe_outputs_tools.json | Adds tool definition for submit_pull_request_review to the JS tool list. |
| pkg/workflow/imports.go | Enables import/merge behavior for submit-pull-request-review safe-outputs. |
| pkg/workflow/compiler_types.go | Adds SubmitPullRequestReview to SafeOutputsConfig. |
| pkg/workflow/compiler_safe_outputs_job.go | Expands consolidated safe-outputs job permissions/requirements for PR review submission. |
| pkg/workflow/compiler_safe_outputs_config.go | Adds handler config generation for submit_pull_request_review. |
| pkg/parser/schemas/main_workflow_schema.json | Adds safe-outputs frontmatter schema for submit-pull-request-review. |
| actions/setup/js/submit_pr_review.test.cjs | Adds unit tests for the submit-review handler. |
| actions/setup/js/submit_pr_review.cjs | Implements handler that stores review metadata (body/event) for final submission. |
| actions/setup/js/safe_outputs_type_validation.test.cjs | Updates type/schema/toolname normalization checks to include the new tool. |
| actions/setup/js/safe_output_unified_handler_manager.cjs | Finalizes and submits buffered PR review at end of unified handler processing. |
| actions/setup/js/safe_output_type_validator.test.cjs | Updates sample validation config to include submit_pull_request_review. |
| actions/setup/js/safe_output_handler_manager.cjs | Finalizes and submits buffered PR review at end of handler processing. |
| actions/setup/js/pr_review_buffer.test.cjs | Adds tests for buffering comments and submitting a single PR review. |
| actions/setup/js/pr_review_buffer.cjs | Introduces shared buffer for review comments + metadata + final pulls.createReview() call. |
| actions/setup/js/create_pr_review_comment.cjs | Changes review-comment handling to validate + buffer instead of posting immediately. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
pretty cool. added a few nits about the global state and 'default imports'. |
|
updated PR, testing out here: elastic/ai-github-actions#9 (review) |
|
see elastic/ai-github-actions#9 (review) for pr review, with status and comments :) |
|
Very cool. |
|
Could you update smoke-copilot to do a submit pull review on the current pr? |
|
done (i think), not sure how to run the smoke tests locally |
PR Reviews should have a status (approve, request changes, comment), and pr review comments should be done inline and attached to the review.
Closes #15292