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.
- package/dist/github/pr-client.js +2 -1
- package/dist/reconciler.js +13 -0
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/github/pr-client.js
CHANGED
|
@@ -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
|
};
|
package/dist/reconciler.js
CHANGED
|
@@ -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