pr-shepherd 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -39,7 +39,7 @@ Invoke `/loop <INTERVAL> --max-turns 50 --expires 8h` via the Skill tool. Use th
|
|
|
39
39
|
|
|
40
40
|
````
|
|
41
41
|
# pr-shepherd-loop:pr=<PR_NUMBER>
|
|
42
|
-
Run the following in a single Bash invocation
|
|
42
|
+
Run the following in a single Bash invocation:
|
|
43
43
|
npx pr-shepherd iterate <PR_NUMBER> --ready-delay <READY_DELAY> --no-cache --last-push-time "$(git log -1 --format=%ct HEAD)" --format=json
|
|
44
44
|
|
|
45
45
|
Exit codes 0, 1, 2, and 3 are all valid signals — always try to parse stdout as JSON first. If the command exits non-zero and stdout is not parseable JSON (e.g. a crash), log the first line of stderr and continue (do not cancel the loop).
|
|
@@ -51,7 +51,7 @@ Parse the `action` field and act:
|
|
|
51
51
|
- `rerun_ci` → log: `RERAN <N> CI checks: <reran joined by space>`
|
|
52
52
|
- `mark_ready` → log: `MARKED READY: PR <pr>`
|
|
53
53
|
- `cancel` → invoke `/loop cancel` and stop
|
|
54
|
-
- `rebase` → run
|
|
54
|
+
- `rebase` → run:
|
|
55
55
|
```bash
|
|
56
56
|
if ! git diff --quiet || ! git diff --cached --quiet; then
|
|
57
57
|
echo "SKIP rebase: dirty worktree (uncommitted changes present)"
|
|
@@ -82,13 +82,13 @@ Parse the `action` field and act:
|
|
|
82
82
|
All items in `fix.threads` are always actionable (they carry a file path and line by construction).
|
|
83
83
|
1. For each item in `fix.threads` and each **actionable** `fix.comments`: read the referenced file/line and apply the fix (Edit/Write tools).
|
|
84
84
|
2. For each item in `fix.checks`:
|
|
85
|
-
- If `runId` is non-null: fetch the failure log with `gh run view <runId> --log-failed
|
|
85
|
+
- If `runId` is non-null: fetch the failure log with `gh run view <runId> --log-failed`, scan the output to identify the failure (e.g. grep for `FAIL` for test failures, `error:` for type/compile errors, lint rule names for lint failures), then read the relevant file and apply the fix (Edit/Write tools).
|
|
86
86
|
- If `runId` is null: the failed check is an external status check that cannot be inspected via run logs. Escalate — tell the user to open `detailsUrl` in the PR checks UI, inspect the failure manually, and rerun `/pr-shepherd:monitor <PR_NUMBER>` after addressing it. Do not attempt to fix these automatically.
|
|
87
87
|
3. For each item in `fix.changesRequestedReviews`: read the review body and apply the requested changes.
|
|
88
88
|
4. If files were changed, `git add <files> && git commit -m "<appropriate commit message>"`
|
|
89
|
-
5. If files were changed: `git fetch origin && git rebase origin/<BASE_BRANCH> && git push --force-with-lease
|
|
89
|
+
5. If files were changed: `git fetch origin && git rebase origin/<BASE_BRANCH> && git push --force-with-lease`, then `HEAD_SHA=$(git rev-parse HEAD)`.
|
|
90
90
|
6. If **only noise** was found (no files changed, no threads/checks/reviews to act on): skip commit/push and omit `--require-sha` in the next step.
|
|
91
|
-
7. Resolve the items on GitHub
|
|
91
|
+
7. Resolve the items on GitHub. Build the command from the non-empty ID lists only — always start with:
|
|
92
92
|
`npx pr-shepherd resolve <PR_NUMBER>`
|
|
93
93
|
Then append:
|
|
94
94
|
- `--resolve-thread-ids <IDs>` only if `fix.threads` was non-empty.
|