Compare commits
4 Commits
fix/issue-
...
v0.2.32
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24dd91d0e1 | ||
| c8b2ab6b12 | |||
|
|
87434d1bca | ||
| ae8f1433a7 |
@@ -272,29 +272,39 @@ build_dev_agent_message() {
|
|||||||
|
|
||||||
if [ -n "$user_message" ]; then
|
if [ -n "$user_message" ]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
You are continuing work on $issue_ref. A PR likely already exists.
|
You are assigned to work on $issue_ref.
|
||||||
|
|
||||||
IMPORTANT - Review workflow:
|
IMPORTANT: Follow the workflow below as your guideline, but prioritize the delegator's message.
|
||||||
1. First, check if PR exists: curl -s "https://$instance/api/v1/repos/$owner/$repo/pulls?state=open" -H "Authorization: Bearer \$GITEA_TOKEN" | grep -i "$number"
|
|
||||||
2. Get PR comments: curl -s "https://$instance/api/v1/repos/$owner/$repo/issues/$number/comments" -H "Authorization: Bearer \$GITEA_TOKEN"
|
|
||||||
3. Get PR reviews: curl -s "https://$instance/api/v1/repos/$owner/$repo/pulls/$number/reviews" -H "Authorization: Bearer \$GITEA_TOKEN"
|
|
||||||
|
|
||||||
You may need to:
|
Workflow:
|
||||||
- Make code changes and push to the same branch
|
1. Read the issue at $instance/$owner/$repo/issues/$number AND all comments on that issue
|
||||||
- Reply to PR comments using: curl -X POST "https://$instance/api/v1/repos/$owner/$repo/issues/$number/comments" -H "Authorization: Bearer \$GITEA_TOKEN" -H "Content-Type: application/json" -d '{"body":"Your reply here"}'
|
2. Check if a PR already exists for this issue
|
||||||
- Or do both
|
- If PR exists and is open, review it and learn from it
|
||||||
|
- If PR makes sense to continue, work on it instead
|
||||||
|
- If PR is not worth continuing, create a new branch/PR but explain in PR description why you're creating a new one instead of continuing the existing PR
|
||||||
|
3. Read README.md (if exists) to understand the general concept of this repository
|
||||||
|
4. Read CONTRIBUTING.md (if exists) to understand how to contribute
|
||||||
|
- If CONTRIBUTING.md doesn't exist, follow steps 5-9 as your guideline
|
||||||
|
5. Explore the repository to understand the codebase
|
||||||
|
6. If anything is unclear, post a comment on the issue asking for clarification before implementing
|
||||||
|
7. Implement the solution
|
||||||
|
8. Create a branch named fix/issue-$number and implement the fix
|
||||||
|
9. Create a PR when the implementation is complete using: tea pr create --repo $owner/$repo --title "Your PR title" --body "PR description"
|
||||||
|
- Make sure you are logged in with: tea login add --name gitea --token \$GITEA_TOKEN --url https://$instance
|
||||||
|
- If tea is not available, use: curl -X POST "https://$instance/api/v1/repos/$owner/$repo/pulls" -H "Authorization: Bearer \$GITEA_TOKEN" -H "Content-Type: application/json" -d '{"title":"PR Title","head":"branch-name","base":"main","body":"PR description"}'
|
||||||
|
|
||||||
MERGING: If instructed to merge, you MUST confirm approval first before merging:
|
Tools for PR interaction:
|
||||||
- Check for PR approval via: curl -s "https://$instance/api/v1/repos/$owner/$repo/pulls/$number/reviews" -H "Authorization: Bearer \$GITEA_TOKEN"
|
- Post issue/PR comment: curl -X POST "https://$instance/api/v1/repos/$owner/$repo/issues/$number/comments" -H "Authorization: Bearer \$GITEA_TOKEN" -H "Content-Type: application/json" -d '{"body":"Your comment"}'
|
||||||
- Check for "lgtm" or "approved" in comments: curl -s "https://$instance/api/v1/repos/$owner/$repo/issues/$number/comments" -H "Authorization: Bearer \$GITEA_TOKEN"
|
- List PR comments: curl -s "https://$instance/api/v1/repos/$owner/$repo/issues/$number/comments" -H "Authorization: Bearer \$GITEA_TOKEN"
|
||||||
- Only merge if you see approval OR the instruction explicitly says to merge (e.g., "merge the PR", "please merge", "go ahead and merge")
|
- List PR reviews: curl -s "https://$instance/api/v1/repos/$owner/$repo/pulls/$number/reviews" -H "Authorization: Bearer \$GITEA_TOKEN"
|
||||||
- To merge: tea pr merge --repo $owner/$repo $number --style merge
|
- Merge PR (only with approval): tea pr merge --repo $owner/$repo $number --style merge
|
||||||
- If no approval yet, reply asking for review/approval first
|
- MERGING requires approval first! Check for: approval in reviews, OR "lgtm"/"approved" in comments
|
||||||
|
- If no approval, ask reviewer to approve first before merging
|
||||||
|
|
||||||
Delegator's message:
|
Delegator's message:
|
||||||
$user_message
|
$user_message
|
||||||
|
|
||||||
Work directory: $worktree_path (already on the fix branch)
|
Work directory: $worktree_path
|
||||||
EOF
|
EOF
|
||||||
else
|
else
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
@@ -475,6 +485,8 @@ cmd_continue() {
|
|||||||
|
|
||||||
if [ -z "$message" ]; then
|
if [ -z "$message" ]; then
|
||||||
message=$(build_dev_agent_message "$issue_ref" "")
|
message=$(build_dev_agent_message "$issue_ref" "")
|
||||||
|
else
|
||||||
|
message=$(build_dev_agent_message "$issue_ref" "$message")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local worktree_status=$(ensure_worktree "$issue_ref")
|
local worktree_status=$(ensure_worktree "$issue_ref")
|
||||||
|
|||||||
Reference in New Issue
Block a user