Migrate self-development to webhook-based TaskSpawners#883
Migrate self-development to webhook-based TaskSpawners#883
Conversation
There was a problem hiding this comment.
5 issues found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="self-development/kelos-pr-responder.yaml">
<violation number="1" location="self-development/kelos-pr-responder.yaml:94">
P2: Remove manual `git checkout` from the task prompt; Kelos should rely on its automatic PR branch checkout instead.
(Based on your team's feedback about avoiding manual git checkout steps in Kelos prompts/tasks.) [FEEDBACK_USED]</violation>
</file>
<file name="self-development/kelos-reviewer.yaml">
<violation number="1" location="self-development/kelos-reviewer.yaml:109">
P2: Remove the manual `git checkout` step from the reviewer prompt. Kelos already checks out the PR branch automatically, so this extra checkout is unnecessary and can make the workflow more brittle.
(Based on your team's feedback about avoiding manual git checkout steps in Kelos agent prompts/tasks.) [FEEDBACK_USED]</violation>
</file>
<file name="self-development/kelos-workers.yaml">
<violation number="1" location="self-development/kelos-workers.yaml:134">
P1: The prompt uses the issue number as the PR selector in `gh pr edit`, which can edit/fail against the wrong PR in the issue workflow.</violation>
</file>
<file name="self-development/kelos-squash-commits.yaml">
<violation number="1" location="self-development/kelos-squash-commits.yaml:76">
P2: Remove the manual `git checkout` step; Kelos already checks out the PR branch for these tasks.
(Based on your team's feedback about not including manual git checkout steps in Kelos prompts.) [FEEDBACK_USED]</violation>
<violation number="2" location="self-development/kelos-squash-commits.yaml:110">
P1: The completion comment command matches the webhook trigger substring, so the bot can retrigger itself in a loop.
(Based on your team's feedback about ensuring automation does not loop or over-consume tokens.) [FEEDBACK_USED]</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| - 5a. Make only the incremental changes needed to address review feedback or remaining issues. Preserve existing work. | ||
| - 6a. Commit and push your changes to origin kelos-task-{{.Number}}. | ||
| - 7a. /review the PR to verify your changes address the feedback. If changes are needed, make them, run `make verify` and `make test`, commit and push, then /review again. Repeat until the review passes. | ||
| - 8a. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #{{.Number}}` or `Closes #{{.Number}}`). Do not embed the issue number in natural language. Ensure the PR has labels "generated-by-kelos" and "ok-to-test" (use `gh pr edit {{.Number}} --add-label generated-by-kelos --add-label ok-to-test` if missing). |
There was a problem hiding this comment.
P1: The prompt uses the issue number as the PR selector in gh pr edit, which can edit/fail against the wrong PR in the issue workflow.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At self-development/kelos-workers.yaml, line 134:
<comment>The prompt uses the issue number as the PR selector in `gh pr edit`, which can edit/fail against the wrong PR in the issue workflow.</comment>
<file context>
@@ -93,34 +105,46 @@ spec:
+ - 5a. Make only the incremental changes needed to address review feedback or remaining issues. Preserve existing work.
+ - 6a. Commit and push your changes to origin kelos-task-{{.Number}}.
+ - 7a. /review the PR to verify your changes address the feedback. If changes are needed, make them, run `make verify` and `make test`, commit and push, then /review again. Repeat until the review passes.
+ - 8a. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #{{.Number}}` or `Closes #{{.Number}}`). Do not embed the issue number in natural language. Ensure the PR has labels "generated-by-kelos" and "ok-to-test" (use `gh pr edit {{.Number}} --add-label generated-by-kelos --add-label ok-to-test` if missing).
+ - 9a. After pushing, actively check CI status with `gh pr checks`. If any checks fail, investigate the failures, fix them, commit and push, then check again. Do not request review until CI passes.
</file context>
| - 8a. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #{{.Number}}` or `Closes #{{.Number}}`). Do not embed the issue number in natural language. Ensure the PR has labels "generated-by-kelos" and "ok-to-test" (use `gh pr edit {{.Number}} --add-label generated-by-kelos --add-label ok-to-test` if missing). | |
| - 8a. Update the PR title and description to reflect the final diff. The PR body MUST contain a standard closing keyword reference on its own line (e.g., `Fixes #{{.Number}}` or `Closes #{{.Number}}`). Do not embed the issue number in natural language. Ensure the PR has labels "generated-by-kelos" and "ok-to-test" (use `gh pr edit --add-label generated-by-kelos --add-label ok-to-test` if missing). |
| - Run: `gh issue edit <issue-number> --add-label kelos/needs-input` | ||
|
|
||
| 8. Post a comment on PR #{{.Number}} whose first line is `/kelos squash-commits-done` to signal completion. | ||
| 9. Post a comment on PR #{{.Number}} whose first line is `/kelos squash-commits-done` to signal completion. |
There was a problem hiding this comment.
P1: The completion comment command matches the webhook trigger substring, so the bot can retrigger itself in a loop.
(Based on your team's feedback about ensuring automation does not loop or over-consume tokens.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At self-development/kelos-squash-commits.yaml, line 110:
<comment>The completion comment command matches the webhook trigger substring, so the bot can retrigger itself in a loop.
(Based on your team's feedback about ensuring automation does not loop or over-consume tokens.) </comment>
<file context>
@@ -44,56 +47,67 @@ spec:
- Run: `gh issue edit <issue-number> --add-label kelos/needs-input`
- 8. Post a comment on PR #{{.Number}} whose first line is `/kelos squash-commits-done` to signal completion.
+ 9. Post a comment on PR #{{.Number}} whose first line is `/kelos squash-commits-done` to signal completion.
Important:
</file context>
| 9. Post a comment on PR #{{.Number}} whose first line is `/kelos squash-commits-done` to signal completion. | |
| 9. Post a comment on PR #{{.Number}} whose first line is `/kelos squash-done` to signal completion. |
| if git remote get-url upstream >/dev/null 2>&1; then | ||
| git fetch upstream main | ||
| git fetch origin "$BRANCH":"$BRANCH" 2>/dev/null || true | ||
| git checkout "$BRANCH" |
There was a problem hiding this comment.
P2: Remove manual git checkout from the task prompt; Kelos should rely on its automatic PR branch checkout instead.
(Based on your team's feedback about avoiding manual git checkout steps in Kelos prompts/tasks.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At self-development/kelos-pr-responder.yaml, line 94:
<comment>Remove manual `git checkout` from the task prompt; Kelos should rely on its automatic PR branch checkout instead.
(Based on your team's feedback about avoiding manual git checkout steps in Kelos prompts/tasks.) </comment>
<file context>
@@ -49,47 +60,54 @@ spec:
if git remote get-url upstream >/dev/null 2>&1; then
git fetch upstream main
+ git fetch origin "$BRANCH":"$BRANCH" 2>/dev/null || true
+ git checkout "$BRANCH"
git rebase upstream/main
else
</file context>
| git fetch --unshallow || true | ||
| git fetch origin main | ||
| git fetch origin "$BRANCH":"$BRANCH" 2>/dev/null || true | ||
| git checkout "$BRANCH" |
There was a problem hiding this comment.
P2: Remove the manual git checkout step from the reviewer prompt. Kelos already checks out the PR branch automatically, so this extra checkout is unnecessary and can make the workflow more brittle.
(Based on your team's feedback about avoiding manual git checkout steps in Kelos agent prompts/tasks.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At self-development/kelos-reviewer.yaml, line 109:
<comment>Remove the manual `git checkout` step from the reviewer prompt. Kelos already checks out the PR branch automatically, so this extra checkout is unnecessary and can make the workflow more brittle.
(Based on your team's feedback about avoiding manual git checkout steps in Kelos agent prompts/tasks.) </comment>
<file context>
@@ -79,39 +81,47 @@ spec:
git fetch --unshallow || true
git fetch origin main
+ git fetch origin "$BRANCH":"$BRANCH" 2>/dev/null || true
+ git checkout "$BRANCH"
```
</file context>
| git fetch origin main | ||
| git checkout {{.Branch}} | ||
| git fetch origin "$BRANCH":"$BRANCH" 2>/dev/null || true | ||
| git checkout "$BRANCH" |
There was a problem hiding this comment.
P2: Remove the manual git checkout step; Kelos already checks out the PR branch for these tasks.
(Based on your team's feedback about not including manual git checkout steps in Kelos prompts.)
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At self-development/kelos-squash-commits.yaml, line 76:
<comment>Remove the manual `git checkout` step; Kelos already checks out the PR branch for these tasks.
(Based on your team's feedback about not including manual git checkout steps in Kelos prompts.) </comment>
<file context>
@@ -44,56 +47,67 @@ spec:
git fetch origin main
- git checkout {{.Branch}}
+ git fetch origin "$BRANCH":"$BRANCH" 2>/dev/null || true
+ git checkout "$BRANCH"
```
</file context>
/kind feature
What type of PR is this?
What this PR does / why we need it:
githubWebhookself-development/README.mdWhich issue(s) this PR is related to:
N/A
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Summary by cubic
Migrates self-development TaskSpawners from polling (
githubIssues/githubPullRequests) to webhook-basedgithubWebhookfor faster, event-driven execution and more accurate context. Updates prompts to re-check live GitHub state and adds a regression test and docs for webhook setup.New Features
githubWebhookwith filters onissues,issue_comment, andpull_request_review(stop usinggithubIssues/githubPullRequests)gh, include webhook metadata, and use predictable branch names for review/respond/squash flowsinternal/examples/self_development_test.go) enforces webhook usage and expected events/filtersMigration
/webhook/github; creategithub-webhook-secretwithWEBHOOK_SECRETissues,issue_comment, andpull_request_reviewspec.when.githubWebhook.repositoryand any author filtersWritten for commit 777e419. Summary will update on new commits.