pr-shepherd 2.2.0 → 2.2.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
3
  "description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
4
- "version": "2.2.0",
4
+ "version": "2.2.1",
5
5
  "author": {
6
6
  "name": "Jonathan Ong",
7
7
  "email": "jonathanrichardong@gmail.com"
@@ -5,6 +5,7 @@ import { GitHubRequestError } from "./errors.mjs";
5
5
  import { isGraphQlMutationDocument, withGraphQlInternalRetry } from "./graphql-internal-retry.mjs";
6
6
  import { githubFetch } from "./github-fetch.mjs";
7
7
  import { formatGraphQlErrors, parseGraphQlPayload } from "./graphql-response.mjs";
8
+ import { withoutToleratedErrors } from "./graphql-tolerated-errors.mjs";
8
9
  import { CCR_GRAPHQL_REFUSAL_MESSAGE, isCcrGraphqlRefusal } from "./graphql-session-refusal.mjs";
9
10
  import { isAppEligibleGraphql } from "./app-eligibility.mjs";
10
11
  import { withAppQuotaFallback } from "./app-quota.mjs";
@@ -163,20 +164,21 @@ async function graphqlAttempt(query, vars, opts) {
163
164
  authSource,
164
165
  });
165
166
  }
166
- if (payload.errors?.length && !opts.allowPartialData) {
167
- throw new GitHubRequestError(`GitHub GraphQL error: ${formatGraphQlErrors(payload.errors)}`, {
167
+ const errors = withoutToleratedErrors(payload.errors);
168
+ if (errors?.length && !opts.allowPartialData) {
169
+ throw new GitHubRequestError(`GitHub GraphQL error: ${formatGraphQlErrors(errors)}`, {
168
170
  status: res.status,
169
171
  rateLimit: rateLimit ?? undefined,
170
172
  retryAfterSeconds,
171
- graphqlErrors: payload.errors,
173
+ graphqlErrors: errors,
172
174
  authSource,
173
175
  });
174
176
  }
175
- if (payload.errors?.length) {
176
- const messages = payload.errors.map((e) => e.message).join("; ");
177
+ if (errors?.length) {
178
+ const messages = errors.map((e) => e.message).join("; ");
177
179
  process.stderr.write(`pr-shepherd: GraphQL non-fatal errors: ${messages}\n`);
178
180
  }
179
- return { data: payload.data, rateLimit, retryAfterSeconds, errors: payload.errors };
181
+ return { data: payload.data, rateLimit, retryAfterSeconds, errors };
180
182
  }
181
183
  export async function graphql(query, vars = {}, opts = {}) {
182
184
  const { data, errors } = await withGraphQlInternalRetry(query, () => graphqlInner(query, vars, opts));
@@ -0,0 +1,3 @@
1
+ import type { GitHubGraphQlError } from "./errors.mts";
2
+ /** Drops errors on fields whose null Shepherd already handles. */
3
+ export declare function withoutToleratedErrors(errors: GitHubGraphQlError[] | undefined): GitHubGraphQlError[] | undefined;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A check suite's `app` can be unreadable while the suite itself is readable:
3
+ * GitHub blocks it when the app's owner enforces an IP allow list, and returns
4
+ * the rest of the response with `app: null`. Shepherd reads `app.slug` only to
5
+ * tell GitHub Actions suites apart, and an unreadable app is never Actions, so
6
+ * the null is complete enough to keep the snapshot.
7
+ */
8
+ const TOLERATED_PATH = /(^|\.)checkSuites\.nodes\.\d+\.app$/;
9
+ function isTolerated(error) {
10
+ if (!Array.isArray(error.path))
11
+ return false;
12
+ return TOLERATED_PATH.test(error.path.map(String).join("."));
13
+ }
14
+ /** Drops errors on fields whose null Shepherd already handles. */
15
+ export function withoutToleratedErrors(errors) {
16
+ if (!errors?.length)
17
+ return errors;
18
+ const rest = errors.filter((e) => !isTolerated(e));
19
+ return rest.length ? rest : undefined;
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
5
5
  "keywords": [
6
6
  "automation",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
3
  "description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
4
- "version": "2.2.0",
4
+ "version": "2.2.1",
5
5
  "author": {
6
6
  "name": "Jonathan Ong",
7
7
  "email": "jonathanrichardong@gmail.com"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "Autonomous PR CI monitor and review-comment resolver for Codex.",
5
5
  "author": {
6
6
  "name": "Jonathan Ong",
@@ -2,7 +2,7 @@
2
2
  "mcpServers": {
3
3
  "pr-shepherd": {
4
4
  "command": "npx",
5
- "args": ["--yes", "--package", "pr-shepherd@2.2.0", "pr-shepherd-mcp"]
5
+ "args": ["--yes", "--package", "pr-shepherd@2.2.1", "pr-shepherd-mcp"]
6
6
  }
7
7
  }
8
8
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "pr-shepherd": {
3
3
  "command": "npx",
4
- "args": ["--yes", "--package", "pr-shepherd@2.2.0", "pr-shepherd-mcp"]
4
+ "args": ["--yes", "--package", "pr-shepherd@2.2.1", "pr-shepherd-mcp"]
5
5
  }
6
6
  }
@@ -7,7 +7,7 @@
7
7
  "name": "pr-shepherd-plugin",
8
8
  "license": "MIT",
9
9
  "dependencies": {
10
- "pr-shepherd": "2.1.0"
10
+ "pr-shepherd": "2.2.0"
11
11
  }
12
12
  },
13
13
  "node_modules/@hono/node-server": {
@@ -889,9 +889,9 @@
889
889
  }
890
890
  },
891
891
  "node_modules/pr-shepherd": {
892
- "version": "2.1.0",
893
- "resolved": "https://registry.npmjs.org/pr-shepherd/-/pr-shepherd-2.1.0.tgz",
894
- "integrity": "sha512-zbDws4+yvi48G+msF7bfv25fLuW4vmF/1gMSuxMtFc8wDwt18yGUhTm4dFTjslhIr/82YeVr+2XkQHZlcDyH8g==",
892
+ "version": "2.2.0",
893
+ "resolved": "https://registry.npmjs.org/pr-shepherd/-/pr-shepherd-2.2.0.tgz",
894
+ "integrity": "sha512-czQunFT1nHK4Qcn/3tAqFIi5vmCAdsoAWdd7oYdFVP1u5FGyyi82+fhrR+NJw/lmY4OGc5AWMxNI6xm+h9pr4g==",
895
895
  "license": "MIT",
896
896
  "dependencies": {
897
897
  "@modelcontextprotocol/sdk": "^1.30.0",
@@ -4,6 +4,6 @@
4
4
  "description": "Pins the pr-shepherd package that .mcp.json launches",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
- "pr-shepherd": "2.1.0"
7
+ "pr-shepherd": "2.2.0"
8
8
  }
9
9
  }