Skip to content

Commit fddf603

Browse files
committed
Release v0.6.1
1 parent 9309ba0 commit fddf603

4 files changed

Lines changed: 64 additions & 3 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.6.0
1+
0.6.1

npx/python/cli/expert_prompts.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@
3838
3939
1. First, understand the PR: read the diff, description, and any related files
4040
2. Decide which categories are relevant based on the changes
41-
3. Fetch checklists for relevant categories using `FETCH_FILE:checklists/<name>.md`
41+
3. Fetch the relevant checklist(s) for your analysis:
42+
- `FETCH_FILE:checklists/solid-checklist.md` for SOLID & Architecture
43+
- `FETCH_FILE:checklists/security-checklist.md` for Security & Reliability
44+
- `FETCH_FILE:checklists/code-quality-checklist.md` for Code Quality
45+
- `FETCH_FILE:checklists/removal-plan.md` for Removal Candidates
4246
4. Apply the checklists to find issues
4347
5. Classify each finding by severity (P0, P1, P2, P3)
4448
6. Provide fix suggestions for P0 and P1 issues

npx/python/cli/github_fetcher.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,41 @@ async def fetch_issue(owner: str, repo: str, number: int) -> dict:
202202
}
203203

204204

205+
async def post_comment(owner: str, repo: str, number: int, body: str) -> dict:
206+
"""Post a comment to a GitHub PR or Issue.
207+
208+
Uses the Issues API which works for both PRs and Issues.
209+
210+
Args:
211+
owner: Repository owner
212+
repo: Repository name
213+
number: PR or Issue number
214+
body: Comment body (markdown supported)
215+
216+
Returns:
217+
dict with comment metadata (id, html_url, etc.)
218+
219+
Raises:
220+
ValueError: If GITHUB_TOKEN is not set
221+
httpx.HTTPStatusError: If API call fails
222+
"""
223+
if not GITHUB_TOKEN:
224+
raise ValueError(
225+
"GITHUB_TOKEN is required to post comments.\n"
226+
"Set it via environment variable or .env file."
227+
)
228+
229+
async with httpx.AsyncClient() as client:
230+
resp = await client.post(
231+
f"{GITHUB_API_BASE}/repos/{owner}/{repo}/issues/{number}/comments",
232+
headers=_get_headers(),
233+
json={"body": body},
234+
timeout=30.0,
235+
)
236+
resp.raise_for_status()
237+
return resp.json()
238+
239+
205240
def build_pr_context(data: dict) -> str:
206241
"""Build a structured text representation of a PR for RLM input.
207242

npx/python/cli/main.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from rich.markdown import Markdown
2424

2525
from . import __version__
26-
from .github_fetcher import parse_github_url
26+
from .github_fetcher import parse_github_url, post_comment
2727
from .output_formatter import format_output
2828
from .virtual_runner import VirtualReviewRunner
2929
from .expert_prompts import get_expert_prompt
@@ -73,6 +73,7 @@ async def run_review(
7373
quiet: bool = False,
7474
model: str | None = None,
7575
expert: bool = False,
76+
submit: bool = False,
7677
):
7778
"""Run a review on a GitHub URL."""
7879
# Parse URL first to validate
@@ -135,6 +136,21 @@ async def run_review(
135136
console.print(Panel(Markdown(output), title="Review", border_style="green"))
136137
else:
137138
console.print(Panel(output, title="Review", border_style="green"))
139+
140+
# Submit as GitHub comment if requested
141+
if submit:
142+
try:
143+
# Format review as markdown for GitHub comment
144+
comment_body = f"## 🔍 AsyncReview Analysis\n\n{answer}\n\n---\n*Generated by [AsyncReview](https://github.com/AsyncFuncAI/AsyncReview) using {model_name}*"
145+
result = await post_comment(owner, repo, number, comment_body)
146+
if not quiet:
147+
console.print(f"\n[green]✓ Comment posted:[/green] {result.get('html_url', 'success')}")
148+
except ValueError as e:
149+
print_error(str(e))
150+
sys.exit(1)
151+
except Exception as e:
152+
print_error(f"Failed to post comment: {e}")
153+
sys.exit(1)
138154

139155

140156
def main():
@@ -199,6 +215,11 @@ def main():
199215
default=None,
200216
help="Model to use (e.g. gemini-3.0-pro-preview)",
201217
)
218+
review_parser.add_argument(
219+
"--submit",
220+
action="store_true",
221+
help="Post review as a comment on the PR/Issue (requires GITHUB_TOKEN)",
222+
)
202223

203224
args = parser.parse_args()
204225

@@ -210,6 +231,7 @@ def main():
210231
quiet=args.quiet,
211232
model=args.model,
212233
expert=args.expert,
234+
submit=args.submit,
213235
))
214236
else:
215237
parser.print_help()

0 commit comments

Comments
 (0)