Skip to content

Commit ce54987

Browse files
committed
Streamline ppl-bugfix workflow: fix 5 cross-cutting issues
- Add fork remote discovery step to both harness and followup (replace <your_fork_remote> placeholder with concrete instructions) - Remove redundant follow-up type from command dispatch — subagent discovers it from PR state via followup harness categorization table - Fix Phase 0.1: remove fake REST API call, use integration test only - Add no-coauthor rule to followup harness (was only in harness) - Add --repo flag to gh pr checkout in followup for worktree context Signed-off-by: Heng Qian <qianheng@amazon.com>
1 parent 6b29b60 commit ce54987

3 files changed

Lines changed: 23 additions & 13 deletions

File tree

.claude/commands/ppl-bugfix.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ Agent(
8686
name: "bugfix-<issue_number>",
8787
description: "PPL bugfix #<issue_number> followup",
8888
prompt: "Read .claude/harness/ppl-bugfix-followup.md and follow it.
89-
PR: <pr_number> (<pr_url>), Issue: #<issue_number>
90-
Follow-up type: <CI failure / review feedback / merge conflict>"
89+
PR: <pr_number> (<pr_url>), Issue: #<issue_number>"
9190
)
9291
```
9392

.claude/harness/ppl-bugfix-followup.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# PPL Bugfix Follow-up
22

3+
## Rules
4+
5+
- Do NOT add `Co-Authored-By` lines in commits — only DCO `Signed-off-by`
6+
37
---
48

59
## Reconstruct Context
@@ -10,6 +14,11 @@ The follow-up agent runs in a fresh worktree. First checkout the PR branch, then
1014
# Checkout the PR branch in this worktree
1115
gh pr checkout <pr_number>
1216

17+
# Resolve fork remote — the worktree may only have origin (upstream)
18+
git remote -v
19+
# If no fork remote exists, add it:
20+
git remote add fork https://github.com/<fork_owner>/sql.git
21+
1322
# Load PR state — reviews, CI, mergeability
1423
gh pr view <pr_number> --json title,body,state,reviews,statusCheckRollup,mergeable
1524
gh pr checks <pr_number>
@@ -41,7 +50,7 @@ For each comment (human OR bot), **cross-check against the Decision Log first**:
4150

4251
```bash
4352
git add <files> && git commit -s -m "Address review feedback: <description>"
44-
git push -u <your_fork_remote> <branch_name>
53+
git push -u fork <branch_name>
4554
```
4655

4756
## Clean Up Commit History
@@ -52,7 +61,7 @@ When you need to amend a commit (e.g. remove Co-Authored-By, reword message) and
5261
git checkout -B clean-branch origin/main
5362
git cherry-pick <fix_commit_sha>
5463
git commit --amend -s -m "<updated message>"
55-
git push <your_fork_remote> clean-branch:<pr_branch> --force-with-lease
64+
git push fork clean-branch:<pr_branch> --force-with-lease
5665
```
5766

5867
## Handle CI Failures
@@ -71,7 +80,7 @@ gh run view <run_id> --log-failed # Read logs
7180
git fetch origin && git merge origin/main # Resolve conflicts
7281
./gradlew spotlessApply && ./gradlew test && ./gradlew :integ-test:integTest # Re-verify
7382
git commit -s -m "Resolve merge conflicts with main"
74-
git push -u <your_fork_remote> <branch_name>
83+
git push -u fork <branch_name>
7584
```
7685

7786
## Mark Ready

.claude/harness/ppl-bugfix-harness.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ Read the issue title, description, and any reproduction steps before proceeding.
1515
### 0.1 Reproduce the Bug
1616

1717
```bash
18-
# Minimal PPL query
19-
POST /_plugins/_ppl/_query
20-
{ "query": "<your PPL query here>" }
21-
22-
# Or via integration test
18+
# Write a failing integration test, or run an existing one
2319
./gradlew :integ-test:integTest -Dtests.class="*<TestClass>" -Dtests.method="<testMethod>"
2420
```
2521

@@ -237,9 +233,15 @@ git fetch origin && git merge origin/main
237233
# Always re-run tests after merge — even a trivial merge can introduce regressions
238234
./gradlew test && ./gradlew :integ-test:integTest -Dtests.class="*<YourIT>"
239235
240-
# Push to personal fork (NOT origin if it points to upstream)
241-
git remote -v # confirm your fork remote
242-
git push -u <your_fork_remote> <branch_name>
236+
# Resolve fork remote — find or add it
237+
# 1. Check if a fork remote already exists (not opensearch-project/sql)
238+
git remote -v
239+
# 2. If only origin (upstream) exists, add the fork:
240+
git remote add fork https://github.com/<fork_owner>/sql.git
241+
# Use the git user name to infer the fork owner, or fall back to "qianheng-aws"
242+
243+
# Push
244+
git push -u fork <branch_name>
243245
```
244246

245247
### 3.3 Create Draft PR

0 commit comments

Comments
 (0)