Skip to content

Commit b3c49b9

Browse files
committed
Merge remote-tracking branch 'origin/main' into wpfleger/socket-support
* origin/main: fix: use pnpm when publishing (#8092) Alexhancock/publish npm file format fix (#8091) fix: iteration on the publish-npm workflow (#8087) chore: ignore unmaintained warning for proc-macro-error (#8084) chore: clean up stray recipe.yaml (#8086) chore(release): bump version to 1.29.0 (minor) (#8088) Update lockfile references (#8085) Fix version bump (#8083) Add a code review step which uses a short-lived provider token (#7932)
2 parents 403b39b + 18bc030 commit b3c49b9

26 files changed

Lines changed: 4748 additions & 1649 deletions

.github/recipes/code-review.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: "1.0.0"
2+
title: GitHub PR Code Review
3+
description: Perform a code review of a GitHub pull request.
4+
5+
parameters:
6+
- key: pr_directory
7+
input_type: string
8+
requirement: required
9+
description: Path to the directory with pr.md and pr.diff
10+
- key: instructions
11+
input_type: string
12+
requirement: required
13+
description: Specific instructions for the code review.
14+
15+
extensions:
16+
- type: builtin
17+
name: developer
18+
- type: stdio
19+
name: code_review
20+
cmd: uv
21+
args:
22+
- run
23+
- '{{ recipe_dir }}/../scripts/pr-review-mcp.py'
24+
25+
prompt: |
26+
Review the code changes downloaded from a GitHub pull request.
27+
The PR metadata is located at {{ pr_directory }}/pr.md.
28+
The proposed diff you are to review is located at {{ pr_directory }}/pr.diff.
29+
The base branch is checked out in the working directory.
30+
Use the tools you have to review the diff and examine the code changes and context.
31+
Use the code review tools to add feedback on specific parts of the diff.
32+
There is no need to call the finish_review tool unless absolutely necessary to add
33+
summary content not covered by inline comments.
34+
35+
Be concise with your comments. Just a few sentences per comment at most, with no
36+
extra formatting. Just the gist of the problem is enough.
37+
38+
** Important **
39+
Don't add nit-pick comments and avoid matters of opinion.
40+
Adhere closely to the code review instructions below.
41+
Don't add add feedback outside the scope of the instructions below.
42+
43+
# Code review instructions
44+
{{ instructions }}

.github/scripts/pr-review-mcp.py

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#!/usr/bin/env -S uv run --script
2+
# /// script
3+
# requires-python = ">=3.11"
4+
# dependencies = ["mcp"]
5+
# ///
6+
"""MCP server for collecting PR review comments and conclusion."""
7+
8+
import json
9+
import os
10+
from pathlib import Path
11+
12+
from mcp.server.fastmcp import FastMCP
13+
14+
server = FastMCP("pr-review")
15+
16+
output_dir = Path(os.environ.get("REVIEW_OUTPUT_DIR", "/tmp"))
17+
18+
19+
def _append_comment(comment: dict) -> int:
20+
"""Append a comment to the comments file and return the new total."""
21+
comments_file = output_dir / "comments.json"
22+
comments = json.loads(comments_file.read_text()) if comments_file.exists() else []
23+
comments.append(comment)
24+
comments_file.write_text(json.dumps(comments, indent=2))
25+
return len(comments)
26+
27+
28+
@server.tool()
29+
def add_comment(
30+
path: str,
31+
line: int,
32+
body: str,
33+
suggestion: str | None = None,
34+
side: str = "RIGHT",
35+
start_line: int | None = None,
36+
) -> str:
37+
"""Add a review comment on a specific line in the PR diff.
38+
39+
Args:
40+
path: The relative file path in the repository (e.g. "src/main.rs").
41+
line: The line number in the file that the comment applies to.
42+
For added or modified lines, use the line number in the new version of the file (side=RIGHT).
43+
For deleted lines, use the line number in the old version of the file (side=LEFT).
44+
body: The review comment text (Markdown supported).
45+
suggestion: Optional replacement code for the line(s). When provided, GitHub renders an
46+
"Apply suggestion" button the author can click. The suggestion replaces the
47+
entire line (or range if start_line is set).
48+
side: Which version of the file the line number refers to.
49+
"RIGHT" for the new/modified version (default), "LEFT" for the old/deleted version.
50+
start_line: For multi-line comments, the first line of the range. When set, `line` is the last line.
51+
"""
52+
if suggestion is not None:
53+
body = (
54+
f"{body}\n\n```suggestion\n{suggestion}\n```"
55+
if body
56+
else f"```suggestion\n{suggestion}\n```"
57+
)
58+
59+
comment = {"path": path, "line": line, "side": side, "body": body}
60+
if start_line is not None:
61+
comment["start_line"] = start_line
62+
comment["start_side"] = side
63+
64+
total = _append_comment(comment)
65+
return f"Comment added on {path}:{line} ({total} total)."
66+
67+
68+
@server.tool()
69+
def finish_review(body: str = "") -> str:
70+
"""Finish the review.
71+
72+
Args:
73+
body: Optional top-level review body (Markdown supported). Only include if it
74+
contains information not already covered by inline comments. Most reviews
75+
should leave this empty.
76+
"""
77+
conclusion = {"body": body, "event": "COMMENT"}
78+
conclusion_file = output_dir / "conclusion.json"
79+
conclusion_file.write_text(json.dumps(conclusion, indent=2))
80+
return "Review finished."
81+
82+
83+
if __name__ == "__main__":
84+
server.run(transport="stdio")

.github/workflows/build-native-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
9090
with:
9191
name: goose-acp-server-${{ matrix.platform }}
92-
path: artifact/bin/
92+
path: artifact/
9393
if-no-files-found: error
9494
retention-days: 7
9595

.github/workflows/bundle-desktop-intel.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
# Update version in package.json
6363
source ./bin/activate-hermit
6464
cd ui/desktop
65-
pnpm version ${{ inputs.version }} --no-git-tag-version --allow-same-version
65+
npm pkg set "version=${{ inputs.version }}"
6666
6767
- name: Cache Rust dependencies
6868
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
@@ -102,7 +102,7 @@ jobs:
102102
path: |
103103
ui/desktop/node_modules
104104
.hermit/node/cache
105-
key: intel-pnpm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/desktop/pnpm-lock.yaml') }}
105+
key: intel-pnpm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/pnpm-lock.yaml') }}
106106
restore-keys: |
107107
intel-pnpm-cache-v1-${{ runner.os }}-
108108

.github/workflows/bundle-desktop-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
# Update version in package.json
4040
source ./bin/activate-hermit
4141
cd ui/desktop
42-
pnpm version ${{ inputs.version }} --no-git-tag-version --allow-same-version
42+
npm pkg set "version=${{ inputs.version }}"
4343
4444
- name: Debug workflow info
4545
env:
@@ -127,7 +127,7 @@ jobs:
127127
path: |
128128
ui/desktop/node_modules
129129
.hermit/node/cache
130-
key: linux-pnpm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/desktop/pnpm-lock.yaml') }}
130+
key: linux-pnpm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/pnpm-lock.yaml') }}
131131
restore-keys: |
132132
linux-pnpm-cache-v1-${{ runner.os }}-
133133

.github/workflows/bundle-desktop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
source ./bin/activate-hermit
108108
# Update version in package.json
109109
cd ui/desktop
110-
pnpm version "${VERSION}" --no-git-tag-version --allow-same-version
110+
npm pkg set "version=${VERSION}"
111111
112112
- name: Cache Rust dependencies
113113
uses: Swatinem/rust-cache@v2
@@ -141,7 +141,7 @@ jobs:
141141
path: |
142142
ui/desktop/node_modules
143143
.hermit/node/cache
144-
key: macos-pnpm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/desktop/pnpm-lock.yaml') }}
144+
key: macos-pnpm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/pnpm-lock.yaml') }}
145145
restore-keys: |
146146
macos-pnpm-cache-v1-${{ runner.os }}-
147147

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
# path: |
148148
# ui/desktop/node_modules
149149
# .hermit/node/cache
150-
# key: ci-pnpm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/desktop/pnpm-lock.yaml') }}
150+
# key: ci-pnpm-cache-v1-${{ runner.os }}-${{ hashFiles('ui/pnpm-lock.yaml') }}
151151
# restore-keys: |
152152
# ci-pnpm-cache-v1-${{ runner.os }}-
153153

0 commit comments

Comments
 (0)