pr-shepherd 0.56.0 → 0.56.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": "0.56.0",
4
+ "version": "0.56.1",
5
5
  "author": {
6
6
  "name": "Jonathan Ong",
7
7
  "email": "jonathanrichardong@gmail.com"
@@ -0,0 +1,11 @@
1
+ import { type RepoInfo } from "./client.mts";
2
+ import type { RawSummaryPr } from "./poll-summary-raw.mts";
3
+ /**
4
+ * Overlay REST mergeability onto an open summary PR whose GraphQL snapshot is `UNKNOWN`, in place.
5
+ *
6
+ * GraphQL keeps reporting `UNKNOWN` while GitHub recomputes mergeability after the
7
+ * base moves; REST `GET /pulls/{n}` triggers that computation and usually answers
8
+ * `dirty` at once. Without this, a layer that just gained a conflict routes as
9
+ * pending until a later tick, matching `iterate`'s `refreshUnknownMergeability`.
10
+ */
11
+ export declare function refreshUnknownSummaryMergeability(raw: RawSummaryPr, repo: RepoInfo): Promise<void>;
@@ -0,0 +1,23 @@
1
+ import { getMergeableState } from "./client.mjs";
2
+ /**
3
+ * Overlay REST mergeability onto an open summary PR whose GraphQL snapshot is `UNKNOWN`, in place.
4
+ *
5
+ * GraphQL keeps reporting `UNKNOWN` while GitHub recomputes mergeability after the
6
+ * base moves; REST `GET /pulls/{n}` triggers that computation and usually answers
7
+ * `dirty` at once. Without this, a layer that just gained a conflict routes as
8
+ * pending until a later tick, matching `iterate`'s `refreshUnknownMergeability`.
9
+ */
10
+ export async function refreshUnknownSummaryMergeability(raw, repo) {
11
+ if (raw.state !== "OPEN")
12
+ return;
13
+ if (raw.mergeable !== "UNKNOWN" && raw.mergeStateStatus !== "UNKNOWN")
14
+ return;
15
+ const rest = await getMergeableState(raw.number, repo.owner, repo.name);
16
+ // REST can still be computing; keep a field GraphQL already knew rather than erase it.
17
+ if (rest.mergeable !== "UNKNOWN")
18
+ raw.mergeable = rest.mergeable;
19
+ if (rest.mergeStateStatus !== "UNKNOWN")
20
+ raw.mergeStateStatus = rest.mergeStateStatus;
21
+ if (rest.state !== undefined)
22
+ raw.state = rest.state;
23
+ }
@@ -2,6 +2,7 @@ import { EXIT, ShepherdError } from "../exit-codes.mjs";
2
2
  import { graphqlWithRateLimit } from "./client.mjs";
3
3
  import { GitHubRequestError, isRetryableGraphQlResourceLimit, missingRepositoryError, } from "./errors.mjs";
4
4
  import { hydratePollSummaryChecks } from "./poll-summary-check-hydration.mjs";
5
+ import { refreshUnknownSummaryMergeability } from "./poll-summary-mergeability.mjs";
5
6
  import { summarizePollSummaryPr } from "./poll-summary-projector.mjs";
6
7
  import { trunkRequiredContexts } from "./poll-summary-unreported.mjs";
7
8
  import { POLL_STACK_SUMMARY_QUERY, POLL_SUMMARY_FRAGMENT } from "./queries.mjs";
@@ -52,8 +53,10 @@ async function fetchExplicitChunk(prs, repo) {
52
53
  throw new ShepherdError(`PR #${pr} not found`, EXIT.UNAVAILABLE);
53
54
  return raw;
54
55
  });
55
- for (const raw of rawPrs)
56
+ for (const raw of rawPrs) {
56
57
  await hydratePollSummaryChecks(raw, repo);
58
+ await refreshUnknownSummaryMergeability(raw, repo);
59
+ }
57
60
  return { prs: rawPrs, viewerCanAdminister: result.data.repository.viewerCanAdminister };
58
61
  }
59
62
  /**
@@ -64,8 +67,10 @@ async function fetchStackSummary(opts, repo) {
64
67
  const anchor = opts.stackPrNumber;
65
68
  const topology = await readStackTopology(anchor, repo);
66
69
  const { stackNumber, stackSize, viewerLogin, viewerCanAdminister, ordered, allowedMergeMethods } = await readStackSummary(anchor, repo, topology.stackSize);
67
- for (const pr of ordered)
70
+ for (const pr of ordered) {
68
71
  await hydratePollSummaryChecks(pr, repo);
72
+ await refreshUnknownSummaryMergeability(pr, repo);
73
+ }
69
74
  const stackAncestry = stackAncestryGaps(ordered);
70
75
  const required = trunkRequiredContexts(ordered);
71
76
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
- "version": "0.56.0",
3
+ "version": "0.56.1",
4
4
  "description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
5
5
  "keywords": [
6
6
  "automation",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
- "version": "0.56.0",
3
+ "version": "0.56.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@0.56.0", "pr-shepherd-mcp"]
5
+ "args": ["--yes", "--package", "pr-shepherd@0.56.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@0.56.0", "pr-shepherd-mcp"]
4
+ "args": ["--yes", "--package", "pr-shepherd@0.56.1", "pr-shepherd-mcp"]
5
5
  }
6
6
  }