patchrelay 0.53.1 → 0.53.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.
package/dist/build-info.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { resolveMergeQueueProtocol } from "./merge-queue-protocol.js";
|
|
2
|
+
import { resolvePreferredCompletedLinearState } from "./linear-workflow.js";
|
|
2
3
|
import { buildMainRepairBranchName, buildMainRepairDescription, buildMainRepairPromptContext, buildMainRepairTitle, isMainRepairIssue, } from "./main-repair.js";
|
|
3
4
|
import { execCommand } from "./utils.js";
|
|
4
5
|
const MAIN_BRANCH_HEALTH_GRACE_MS = 120_000;
|
|
@@ -41,7 +42,7 @@ export class MainBranchHealthMonitor {
|
|
|
41
42
|
const summary = await this.readMainBranchFailure(project.github.repoFullName, baseBranch);
|
|
42
43
|
if (!summary) {
|
|
43
44
|
if (existing) {
|
|
44
|
-
this.resolveRecoveredMainRepair(existing);
|
|
45
|
+
await this.resolveRecoveredMainRepair(existing);
|
|
45
46
|
}
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
@@ -170,12 +171,39 @@ export class MainBranchHealthMonitor {
|
|
|
170
171
|
this.enqueueIssue(issue.projectId, issue.linearIssueId);
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
|
-
resolveRecoveredMainRepair(issue) {
|
|
174
|
+
async resolveRecoveredMainRepair(issue) {
|
|
174
175
|
if (issue.activeRunId !== undefined)
|
|
175
176
|
return;
|
|
176
177
|
if (issue.prState === "open" || issue.factoryState === "awaiting_queue" || issue.factoryState === "pr_open") {
|
|
177
178
|
return;
|
|
178
179
|
}
|
|
180
|
+
const linear = await this.linearProvider.forProject(issue.projectId).catch(() => undefined);
|
|
181
|
+
if (linear) {
|
|
182
|
+
const liveIssue = await linear.getIssue(issue.linearIssueId).catch(() => undefined);
|
|
183
|
+
if (liveIssue) {
|
|
184
|
+
const targetState = resolvePreferredCompletedLinearState(liveIssue);
|
|
185
|
+
const normalizedCurrent = liveIssue.stateName?.trim().toLowerCase();
|
|
186
|
+
if (targetState && normalizedCurrent !== targetState.trim().toLowerCase()) {
|
|
187
|
+
const updated = await linear.setIssueState(issue.linearIssueId, targetState).catch(() => undefined);
|
|
188
|
+
if (updated) {
|
|
189
|
+
this.db.upsertIssue({
|
|
190
|
+
projectId: issue.projectId,
|
|
191
|
+
linearIssueId: issue.linearIssueId,
|
|
192
|
+
...(updated.stateName ? { currentLinearState: updated.stateName } : {}),
|
|
193
|
+
...(updated.stateType ? { currentLinearStateType: updated.stateType } : {}),
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
this.db.upsertIssue({
|
|
199
|
+
projectId: issue.projectId,
|
|
200
|
+
linearIssueId: issue.linearIssueId,
|
|
201
|
+
...(liveIssue.stateName ? { currentLinearState: liveIssue.stateName } : {}),
|
|
202
|
+
...(liveIssue.stateType ? { currentLinearStateType: liveIssue.stateType } : {}),
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
179
207
|
this.db.issueSessions.clearPendingIssueSessionEventsRespectingActiveLease(issue.projectId, issue.linearIssueId);
|
|
180
208
|
this.db.upsertIssue({
|
|
181
209
|
projectId: issue.projectId,
|