Skip to content

Commit 64d1354

Browse files
committed
docs: clarify pr_review does not push; print git push hint and branch warning
Made-with: Cursor
1 parent c1f79f7 commit 64d1354

3 files changed

Lines changed: 27 additions & 11 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Use **`IYNX_PR_LABEL`** when running the agent so new PRs get the same label and
157157

158158
### PR review follow-up (GitHub)
159159

160-
After maintainers comment on an open PR, dump review threads into a **local markdown file** for an agent (or you) to implement fixes. Uses **`gh` only** (no direct GitHub REST in this tool). Install and authenticate [GitHub CLI](https://cli.github.com/) on the host.
160+
After maintainers comment on an open PR, dump review threads into a **local markdown file** for an agent (or you) to implement fixes. Uses **`gh` only** (no direct GitHub REST in this tool). **It does not run `git commit` or `git push`** — you (or the agent) must commit fixes and `git push origin <pr-head-branch>` so the PR updates. Install and authenticate [GitHub CLI](https://cli.github.com/) on the host.
161161

162162
**Default output:** `<contribution-repo>/.iynx/pr-review-feedback.md` — only if that path is **gitignored** in the target repo; otherwise pass **`--output`** or set **`IYNX_PR_REVIEW_FEEDBACK_PATH`**. **Do not commit** that file.
163163

skills/issue-fix-workflow.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ gh pr checkout <PR_NUMBER>
130130

131131
### Phase 2 — Fetch review text into markdown
132132

133+
`python pr_review.py` **only writes the markdown file** — it does **not** commit or push. Pushing updated commits is **Phase 3**.
134+
133135
From the **Iynx** project root (or any cwd if you use `--output` / env):
134136

135137
```bash

src/pr_review_followup.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ def build_markdown(
192192
)
193193
has_inline = bool(pull_comments)
194194
has_issue = any(
195-
isinstance(c.get("body"), str) and (c.get("body") or "").strip()
196-
for c in issue_comments
195+
isinstance(c.get("body"), str) and (c.get("body") or "").strip() for c in issue_comments
197196
)
198197

199198
if reviews:
@@ -263,8 +262,7 @@ def build_markdown(
263262
def fetch_pr_json(view_arg: str, owner: str, repo: str) -> dict[str, Any]:
264263
"""Call `gh pr view`. Use a full GitHub PR URL as `view_arg` OR pass number + owner/repo."""
265264
fields = (
266-
"title,url,number,headRefName,baseRefName,baseRepository,headRepository,"
267-
"body,author,state"
265+
"title,url,number,headRefName,baseRefName,baseRepository,headRepository,body,author,state"
268266
)
269267
va = view_arg.strip()
270268
if _PR_URL_RE.match(va):
@@ -290,9 +288,7 @@ def fetch_json_list(endpoint: str) -> list[dict[str, Any]]:
290288
]
291289
)
292290
if proc.returncode != 0:
293-
raise GhError(
294-
proc.stderr.strip() or proc.stdout.strip() or f"gh api {endpoint} failed"
295-
)
291+
raise GhError(proc.stderr.strip() or proc.stdout.strip() or f"gh api {endpoint} failed")
296292
chunk = json.loads(proc.stdout)
297293
if not isinstance(chunk, list):
298294
raise GhError(f"expected list from gh api {endpoint}")
@@ -320,7 +316,7 @@ def resolve_output_path(
320316
321317
Raises ValueError for exit-1 cases (stderr to be printed by caller).
322318
"""
323-
override = (output_cli or (env_path or "").strip() or None)
319+
override = output_cli or (env_path or "").strip() or None
324320
if override:
325321
p = Path(override).expanduser().resolve()
326322
p.parent.mkdir(parents=True, exist_ok=True)
@@ -425,7 +421,9 @@ def main(argv: list[str] | None = None) -> int:
425421

426422
md = build_markdown(pr_data, reviews, pull_comments, issue_comments)
427423
except FileNotFoundError:
428-
print("gh executable not found; install GitHub CLI and ensure it is on PATH.", file=sys.stderr)
424+
print(
425+
"gh executable not found; install GitHub CLI and ensure it is on PATH.", file=sys.stderr
426+
)
429427
return 2
430428
except GhError as e:
431429
print(str(e), file=sys.stderr)
@@ -442,11 +440,27 @@ def main(argv: list[str] | None = None) -> int:
442440

443441
print(f"Wrote review feedback: {out_path}")
444442
print(f"PR: {pr_data.get('url', '—')}")
443+
head_ref = pr_data.get("headRefName")
444+
if isinstance(head_ref, str) and head_ref:
445+
print(
446+
f"This tool does not commit or push. After you fix and commit, push the PR branch:\n"
447+
f" git push origin {head_ref}"
448+
)
449+
else:
450+
print(
451+
"This tool does not commit or push. After you fix and commit, push your PR branch "
452+
"(same ref as the PR head on GitHub)."
453+
)
445454
if repo_root_path and out_path.is_relative_to(repo_root_path):
446455
br = current_branch(repo_root_path)
447456
if br:
448457
print(f"Current branch (in {repo_root_path}): {br}")
449-
print("Next: address feedback, run tests, commit, push to the PR branch.")
458+
if isinstance(head_ref, str) and head_ref and br != head_ref:
459+
print(
460+
f"Warning: branch '{br}' differs from PR head '{head_ref}'. "
461+
"Checkout the PR head before pushing or the PR will not update.",
462+
file=sys.stderr,
463+
)
450464

451465
return 0
452466

0 commit comments

Comments
 (0)