merge-steward 0.5.5 → 0.5.6

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.
@@ -24,7 +24,7 @@ export class GitHubPRClient {
24
24
  const result = await exec("gh", [
25
25
  "pr", "view", String(prNumber),
26
26
  "--repo", this.repoFullName,
27
- "--json", "number,headRefName,headRefOid,reviewDecision,state",
27
+ "--json", "number,headRefName,headRefOid,reviewDecision,state,mergeStateStatus",
28
28
  ], { githubRepoFullName: this.repoFullName });
29
29
  const data = JSON.parse(result.stdout);
30
30
  return {
@@ -32,6 +32,7 @@ export class GitHubPRClient {
32
32
  branch: data.headRefName,
33
33
  headSha: data.headRefOid,
34
34
  mergeable: data.state === "OPEN",
35
+ mergeStateStatus: data.mergeStateStatus,
35
36
  reviewApproved: data.reviewDecision === "APPROVED",
36
37
  merged: data.state === "MERGED",
37
38
  };
@@ -114,6 +114,19 @@ async function prepareHead(ctx, entry) {
114
114
  // Gate: non-spinning — skip if base hasn't changed since last conflict.
115
115
  if (isRetryGated(entry, baseSha)) {
116
116
  emit(ctx, entry, "retry_gated", { baseSha, detail: "base unchanged since last conflict" });
117
+ try {
118
+ const prStatus = await ctx.github.getStatus(entry.prNumber);
119
+ if (prStatus.mergeStateStatus === "DIRTY") {
120
+ emit(ctx, entry, "budget_exhausted", {
121
+ baseSha,
122
+ detail: "retry gated and GitHub still reports merge conflict",
123
+ });
124
+ await evictEntry(ctx, entry, "integration_conflict");
125
+ }
126
+ }
127
+ catch {
128
+ // Best-effort check. If GitHub status is unavailable, preserve the non-spinning wait.
129
+ }
117
130
  return;
118
131
  }
119
132
  await performBranchRefresh(ctx, entry, baseSha);
package/dist/types.d.ts CHANGED
@@ -158,6 +158,7 @@ export interface PRStatus {
158
158
  branch: string;
159
159
  headSha: string;
160
160
  mergeable: boolean;
161
+ mergeStateStatus?: string | undefined;
161
162
  reviewApproved: boolean;
162
163
  merged: boolean;
163
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "merge-steward",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "Serial merge queue for GitHub — rebase, CI-gate, and merge PRs one at a time",
5
5
  "type": "module",
6
6
  "repository": {