aws-samples / aws-samples/sample-autonomous-cloud-coding-agents

feat(github): support @bgagent comment-triggered PR iteration

Đang mở
#587 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
adapters enhancement orchestration
Ngôn ngữ chính
TypeScript
Star
143
Fork
46
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
24

Mô tả

## Component

CDK GitHub adapter, orchestration, agent workflows

## Describe the feature

GitHub Issues should support reviewer follow-up comments that trigger ABCA to iterate on an existing PR, matching the Linear and Jira parity `@bgagent ` flow.

When a human comments on a GitHub issue with `@bgagent `, ABCA should find the active or most recent PR-producing task for that issue and run `coding/pr-iteration-v1` against that PR.

## Use case

After ABCA opens a PR from a GitHub issue, reviewers may add follow-up instructions on the originating issue. They should not need to leave the issue and manually submit a new task or comment on the PR.

## Proposed solution

Add a GitHub issue-comment trigger path:

- Subscribe the GitHub webhook setup to `issue_comment` events in addition to `issues`.
- Parse comment bodies for an `@bgagent` mention and extract the remaining instruction.
- Ignore comments authored by ABCA/the app user to prevent self-trigger loops.
- Resolve the GitHub issue to an existing ABCA task/PR using `channel_source === "github"` and GitHub issue metadata.
- Create a new task with `workflow_ref: "coding/pr-iteration-v1"`, the resolved repo, PR number, and reviewer instruction.
- Attribute the iteration to the linked GitHub user when available; otherwise use the original task owner rather than dropping the request.
- Post an immediate GitHub acknowledgement comment, then rely on platform-side final-status fanout for the terminal cost/outcome comment.
- For orchestrated GitHub child issues, route the iteration to the child task/PR and let orchestration re-integration restack dependents when available.

## Acceptance criteria

- A GitHub issue comment `@bgagent update the README too` on an issue with an ABCA PR creates a `coding/pr-iteration-v1` task for that PR.
- The GitHub issue receives an acknowledgement comment quickly after the trigger is accepted.
- The terminal GitHub final-status comment includes the iteration outcome and cost once the run finishes.
- Comments without `@bgagent`, comments from the ABCA app/bot, and unsupported comment events are no-ops.
- If no PR-producing ABCA task can be found for the issue, ABCA posts a clear GitHub comment instead of creating a task.
- Webhook redelivery does not create duplicate iteration tasks.
- Existing label-trigger behavior remains unchanged.

## Tests

- GitHub webhook tests cover comment parsing, bot/self-comment skip, no-PR fallback, idempotent redelivery, and successful iteration task creation.
- Task lookup tests cover resolving a GitHub issue to the correct prior PR task.
- Orchestration tests cover GitHub child-issue iteration metadata where applicable.
- Docs update the GitHub Issues setup guide with the required `issue_comment` event and usage examples.

## Out of scope

- Arbitrary comments as task triggers without an `@bgagent` mention.
- PR review comments or PR-native triggers; tracked separately.
- Natural-language routing from a parent issue to one of several child issues.
- GitHub Projects automation.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với việc thiết lập GitHub webhook và đường dẫn trigger issue-comment, sau đó lần theo các entry point hiện có cho việc tra cứu task và orchestration. Chạy các bài kiểm thử GitHub webhook, tra cứu task và orchestration được mô tả trong issue; hoàn tất nghĩa là các mention được chấp nhận tạo một task PR-iteration, acknowledgements và trạng thái cuối cùng được đăng, các trường hợp no-op vẫn an toàn, và hướng dẫn thiết lập có ghi lại issue_comment.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
github, typescript
Lĩnh vực
backend, devops
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
65/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.