agent-reviews 1.0.0 → 1.0.2

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agent-reviews",
3
3
  "description": "Manage GitHub PR review comments. Automatically triage, fix, and respond to review findings.",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "author": {
6
6
  "name": "Paul Bakaus",
7
7
  "url": "https://github.com/pbakaus"
package/README.md CHANGED
@@ -53,6 +53,20 @@ For cloud/remote environments or HTTPS proxy setups, set `GITHUB_TOKEN` or `GH_T
53
53
  3. `.env.local` in the repo root
54
54
  4. `gh auth token` (GitHub CLI)
55
55
 
56
+ ### Custom API host
57
+
58
+ Set `GITHUB_API_URL` to point agent-reviews at a GitHub Enterprise host or any API-compatible server (useful for testing, recording, or routing through a local mediator). Defaults to `https://api.github.com`.
59
+
60
+ ```bash
61
+ # GitHub Enterprise Server
62
+ GITHUB_API_URL=https://github.example.com/api/v3 agent-reviews
63
+
64
+ # Local API-compatible server
65
+ GITHUB_API_URL=http://127.0.0.1:8080 agent-reviews
66
+ ```
67
+
68
+ GraphQL endpoint resolution: agent-reviews uses `${GITHUB_API_URL}/graphql` by default. For GitHub Enterprise Server, where REST lives under `/api/v3` and GraphQL under `/api/graphql` on the same origin, the trailing `/api/v3` is rewritten to `/api/graphql` automatically. Set `GITHUB_GRAPHQL_URL` directly if you need full control over the GraphQL endpoint.
69
+
56
70
  ## CLI Usage
57
71
 
58
72
  ```bash
@@ -145,6 +159,7 @@ Bot review bodies (`REVIEW` type) are always filtered out since actionable findi
145
159
  | Sourcery | Reviewer's guide and PR summary |
146
160
  | Codacy | Analysis summary and coverage summary |
147
161
  | SonarCloud | Quality Gate pass/fail summary |
162
+ | Gemini Code Assist | "Summary of Changes" issue comment |
148
163
 
149
164
  ### Reply status
150
165
 
@@ -162,6 +177,11 @@ Polls the GitHub API at a configurable interval and reports new comments as they
162
177
 
163
178
  ## Changelog
164
179
 
180
+ ### 1.0.2
181
+
182
+ - GitHub Enterprise Server support via `GITHUB_API_URL` env var (also works for local API-compatible servers used in testing). REST and GraphQL endpoints both honor it, with GHES `/api/v3` automatically rewritten to `/api/graphql`. Optional `GITHUB_GRAPHQL_URL` for unusual setups.
183
+ - Gemini Code Assist meta-comment filtering: the bot's `## Summary of Changes` issue comment is now dropped, while inline severity-badged findings are preserved.
184
+
165
185
  ### 1.0.0
166
186
 
167
187
  **Three skills instead of one.** The single `agent-reviews` skill has been split into three, each tailored for different workflows:
package/lib/comments.js CHANGED
@@ -8,13 +8,32 @@
8
8
 
9
9
  const USER_AGENT = "agent-reviews";
10
10
 
11
+ // Base URL for the GitHub REST API. Defaults to api.github.com.
12
+ // Set GITHUB_API_URL to point at a GitHub Enterprise host or a local
13
+ // API-compatible server (e.g., for testing or recording). Trailing
14
+ // whitespace and slashes are stripped so callers can pass either
15
+ // "https://host/api/v3" or "https://host/api/v3/".
16
+ const API_BASE = (process.env.GITHUB_API_URL || "https://api.github.com")
17
+ .trim()
18
+ .replace(/\/+$/, "");
19
+
20
+ // GitHub Enterprise Server splits REST (/api/v3) and GraphQL (/api/graphql)
21
+ // onto sibling paths under the same origin, so we can't just append /graphql
22
+ // to the REST base. Detect the GHES shape and rewrite; otherwise append.
23
+ // GITHUB_GRAPHQL_URL fully overrides the derivation for unusual setups.
24
+ const GRAPHQL_URL =
25
+ process.env.GITHUB_GRAPHQL_URL?.trim().replace(/\/+$/, "") ||
26
+ (API_BASE.endsWith("/api/v3")
27
+ ? API_BASE.replace(/\/api\/v3$/, "/api/graphql")
28
+ : API_BASE + "/graphql");
29
+
11
30
  // ---------------------------------------------------------------------------
12
31
  // GitHub API helpers
13
32
  // ---------------------------------------------------------------------------
14
33
 
15
34
  async function findPRForBranch(owner, repo, branch, token, proxyFetch) {
16
35
  const response = await proxyFetch(
17
- `https://api.github.com/repos/${owner}/${repo}/pulls?head=${owner}:${branch}&state=open`,
36
+ `${API_BASE}/repos/${owner}/${repo}/pulls?head=${owner}:${branch}&state=open`,
18
37
  {
19
38
  headers: {
20
39
  Authorization: `Bearer ${token}`,
@@ -71,7 +90,7 @@ async function fetchAllPages(url, token, proxyFetch) {
71
90
  }
72
91
 
73
92
  async function fetchPRComments(owner, repo, prNumber, token, proxyFetch) {
74
- const baseUrl = `https://api.github.com/repos/${owner}/${repo}`;
93
+ const baseUrl = `${API_BASE}/repos/${owner}/${repo}`;
75
94
 
76
95
  // Fetch all comment types in parallel
77
96
  const [reviewComments, issueComments, reviews] = await Promise.all([
@@ -145,6 +164,10 @@ const DEFAULT_META_FILTERS = [
145
164
  user === "sonarqube-cloud-us[bot]" ||
146
165
  user === "sonarqube-cloud-us") &&
147
166
  body.includes("Quality Gate"),
167
+ // Gemini Code Assist "Summary of Changes" issue comment (not inline findings)
168
+ (user, body) =>
169
+ (user === "gemini-code-assist[bot]" || user === "gemini-code-assist") &&
170
+ body.startsWith("## Summary of Changes"),
148
171
  ];
149
172
 
150
173
  function isMetaComment(user, body, metaFilters = DEFAULT_META_FILTERS) {
@@ -168,6 +191,7 @@ const KNOWN_BOT_LOGINS = new Set([
168
191
  "sonarcloud",
169
192
  "sonarqubecloud",
170
193
  "sonarqube-cloud-us",
194
+ "gemini-code-assist",
171
195
  ]);
172
196
 
173
197
  function isBot(username) {
@@ -364,7 +388,7 @@ async function replyToComment(
364
388
  ) {
365
389
  // Try review comment reply endpoint first
366
390
  const response = await proxyFetch(
367
- `https://api.github.com/repos/${owner}/${repo}/pulls/${prNumber}/comments/${commentId}/replies`,
391
+ `${API_BASE}/repos/${owner}/${repo}/pulls/${prNumber}/comments/${commentId}/replies`,
368
392
  {
369
393
  method: "POST",
370
394
  headers: {
@@ -380,7 +404,7 @@ async function replyToComment(
380
404
  if (!response.ok) {
381
405
  // Fallback to issue comment endpoint
382
406
  const issueResponse = await proxyFetch(
383
- `https://api.github.com/repos/${owner}/${repo}/issues/${prNumber}/comments`,
407
+ `${API_BASE}/repos/${owner}/${repo}/issues/${prNumber}/comments`,
384
408
  {
385
409
  method: "POST",
386
410
  headers: {
@@ -437,7 +461,7 @@ async function resolveThread(owner, repo, prNumber, commentId, token, proxyFetch
437
461
  let thread = null;
438
462
 
439
463
  while (!thread) {
440
- const response = await proxyFetch("https://api.github.com/graphql", {
464
+ const response = await proxyFetch(GRAPHQL_URL, {
441
465
  method: "POST",
442
466
  headers: {
443
467
  Authorization: `Bearer ${token}`,
@@ -490,7 +514,7 @@ async function resolveThread(owner, repo, prNumber, commentId, token, proxyFetch
490
514
  }
491
515
  `;
492
516
 
493
- const resolveResponse = await proxyFetch("https://api.github.com/graphql", {
517
+ const resolveResponse = await proxyFetch(GRAPHQL_URL, {
494
518
  method: "POST",
495
519
  headers: {
496
520
  Authorization: `Bearer ${token}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-reviews",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "CLI and agent skills for managing GitHub PR review comments. List, filter, reply, and watch for bot findings.",
5
5
  "license": "MIT",
6
6
  "author": "Paul Bakaus",
@@ -3,10 +3,10 @@ name: resolve-agent-reviews
3
3
  description: Resolve PR review bot findings on current PR. Fetches unanswered bot comments, evaluates each finding, fixes real bugs, dismisses false positives, replies to every comment, and watches for new findings until bots go quiet.
4
4
  license: MIT
5
5
  compatibility: Requires git, gh (GitHub CLI), and Node.js installed.
6
- allowed-tools: Bash(npx agent-reviews *) Bash(pnpm exec agent-reviews *) Bash(yarn exec agent-reviews *) Bash(bunx agent-reviews *) Bash(git config *) Bash(git add *) Bash(git commit *) Bash(git push *)
6
+ allowed-tools: Bash(npx agent-reviews *) Bash(pnpm dlx agent-reviews *) Bash(yarn dlx agent-reviews *) Bash(bunx agent-reviews *) Bash(git config *) Bash(git add *) Bash(git commit *) Bash(git push *)
7
7
  metadata:
8
8
  author: pbakaus
9
- version: "1.0.0"
9
+ version: "1.0.2"
10
10
  homepage: https://github.com/pbakaus/agent-reviews
11
11
  ---
12
12
 
@@ -14,7 +14,7 @@ Automatically resolve findings from PR review bots (Copilot, Cursor Bugbot, Code
14
14
 
15
15
  ## Prerequisites
16
16
 
17
- All commands below use `npx agent-reviews`. If the project uses a different package manager, substitute the appropriate runner (e.g., `pnpm exec agent-reviews` for pnpm, `yarn exec agent-reviews` for Yarn, `bunx agent-reviews` for Bun). Honor the user's package manager preference throughout.
17
+ All commands below use `npx agent-reviews`. If the project uses a different package manager, substitute the appropriate runner (e.g., `pnpm dlx agent-reviews` for pnpm, `yarn dlx agent-reviews` for Yarn, `bunx agent-reviews` for Bun). Honor the user's package manager preference throughout.
18
18
 
19
19
  **Cloud environments only** (e.g., Codespaces, remote agents): verify git author identity so CI checks can map commits to the user. Run `git config --global --get user.email` and if empty or a placeholder, set it manually. Skip this check in local environments.
20
20
 
@@ -3,10 +3,10 @@ name: resolve-human-reviews
3
3
  description: Resolve human PR review comments on current PR. Fetches unanswered human comments, evaluates each piece of feedback, applies fixes, and replies to every comment with the outcome.
4
4
  license: MIT
5
5
  compatibility: Requires git, gh (GitHub CLI), and Node.js installed.
6
- allowed-tools: Bash(npx agent-reviews *) Bash(pnpm exec agent-reviews *) Bash(yarn exec agent-reviews *) Bash(bunx agent-reviews *) Bash(git config *) Bash(git add *) Bash(git commit *) Bash(git push *)
6
+ allowed-tools: Bash(npx agent-reviews *) Bash(pnpm dlx agent-reviews *) Bash(yarn dlx agent-reviews *) Bash(bunx agent-reviews *) Bash(git config *) Bash(git add *) Bash(git commit *) Bash(git push *)
7
7
  metadata:
8
8
  author: pbakaus
9
- version: "1.0.0"
9
+ version: "1.0.2"
10
10
  homepage: https://github.com/pbakaus/agent-reviews
11
11
  ---
12
12
 
@@ -14,7 +14,7 @@ Automatically resolve human review comments on the current PR. Fetches unanswere
14
14
 
15
15
  ## Prerequisites
16
16
 
17
- All commands below use `npx agent-reviews`. If the project uses a different package manager, substitute the appropriate runner (e.g., `pnpm exec agent-reviews` for pnpm, `yarn exec agent-reviews` for Yarn, `bunx agent-reviews` for Bun). Honor the user's package manager preference throughout.
17
+ All commands below use `npx agent-reviews`. If the project uses a different package manager, substitute the appropriate runner (e.g., `pnpm dlx agent-reviews` for pnpm, `yarn dlx agent-reviews` for Yarn, `bunx agent-reviews` for Bun). Honor the user's package manager preference throughout.
18
18
 
19
19
  **Cloud environments only** (e.g., Codespaces, remote agents): verify git author identity so CI checks can map commits to the user. Run `git config --global --get user.email` and if empty or a placeholder, set it manually. Skip this check in local environments.
20
20
 
@@ -3,10 +3,10 @@ name: resolve-reviews
3
3
  description: Resolve all PR review comments (human and bot) on current PR. Fetches unanswered comments, evaluates each one, fixes real issues, dismisses false positives, and replies to every comment with the outcome.
4
4
  license: MIT
5
5
  compatibility: Requires git, gh (GitHub CLI), and Node.js installed.
6
- allowed-tools: Bash(npx agent-reviews *) Bash(pnpm exec agent-reviews *) Bash(yarn exec agent-reviews *) Bash(bunx agent-reviews *) Bash(git config *) Bash(git add *) Bash(git commit *) Bash(git push *)
6
+ allowed-tools: Bash(npx agent-reviews *) Bash(pnpm dlx agent-reviews *) Bash(yarn dlx agent-reviews *) Bash(bunx agent-reviews *) Bash(git config *) Bash(git add *) Bash(git commit *) Bash(git push *)
7
7
  metadata:
8
8
  author: pbakaus
9
- version: "1.0.0"
9
+ version: "1.0.2"
10
10
  homepage: https://github.com/pbakaus/agent-reviews
11
11
  ---
12
12
 
@@ -14,7 +14,7 @@ Automatically resolve all review comments (both human and bot) on the current PR
14
14
 
15
15
  ## Prerequisites
16
16
 
17
- All commands below use `npx agent-reviews`. If the project uses a different package manager, substitute the appropriate runner (e.g., `pnpm exec agent-reviews` for pnpm, `yarn exec agent-reviews` for Yarn, `bunx agent-reviews` for Bun). Honor the user's package manager preference throughout.
17
+ All commands below use `npx agent-reviews`. If the project uses a different package manager, substitute the appropriate runner (e.g., `pnpm dlx agent-reviews` for pnpm, `yarn dlx agent-reviews` for Yarn, `bunx agent-reviews` for Bun). Honor the user's package manager preference throughout.
18
18
 
19
19
  **Cloud environments only** (e.g., Codespaces, remote agents): verify git author identity so CI checks can map commits to the user. Run `git config --global --get user.email` and if empty or a placeholder, set it manually. Skip this check in local environments.
20
20