patchrelay 0.46.0 → 0.47.0
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
|
@@ -21,6 +21,8 @@ export async function handleWatchCommand(params) {
|
|
|
21
21
|
process.stderr.write("Use `patchrelay issue list`, `patchrelay issue show <issueKey>`, or run the dashboard from a terminal.\n");
|
|
22
22
|
return 1;
|
|
23
23
|
}
|
|
24
|
+
if (!process.env.NODE_ENV)
|
|
25
|
+
process.env.NODE_ENV = "production";
|
|
24
26
|
const { render } = await import("ink");
|
|
25
27
|
const { createElement } = await import("react");
|
|
26
28
|
const { App } = await import("../watch/App.js");
|
package/dist/db/migrations.js
CHANGED
|
@@ -87,6 +87,7 @@ CREATE TABLE IF NOT EXISTS issue_sessions (
|
|
|
87
87
|
worker_id TEXT,
|
|
88
88
|
leased_until TEXT,
|
|
89
89
|
created_at TEXT NOT NULL,
|
|
90
|
+
display_updated_at TEXT NOT NULL,
|
|
90
91
|
updated_at TEXT NOT NULL,
|
|
91
92
|
UNIQUE(project_id, linear_issue_id)
|
|
92
93
|
);
|
|
@@ -249,6 +250,12 @@ export function runPatchRelayMigrations(connection) {
|
|
|
249
250
|
addColumnIfMissing(connection, "issues", "review_fix_attempts", "INTEGER NOT NULL DEFAULT 0");
|
|
250
251
|
// Preserve the PR head SHA seen when a run started so PatchRelay can
|
|
251
252
|
// verify that requested-changes work actually published a new head.
|
|
253
|
+
addColumnIfMissing(connection, "issue_sessions", "display_updated_at", "TEXT");
|
|
254
|
+
connection.prepare(`
|
|
255
|
+
UPDATE issue_sessions
|
|
256
|
+
SET display_updated_at = COALESCE(display_updated_at, updated_at, created_at)
|
|
257
|
+
WHERE display_updated_at IS NULL
|
|
258
|
+
`).run();
|
|
252
259
|
addColumnIfMissing(connection, "runs", "source_head_sha", "TEXT");
|
|
253
260
|
addColumnIfMissing(connection, "runs", "completion_check_thread_id", "TEXT");
|
|
254
261
|
addColumnIfMissing(connection, "runs", "completion_check_turn_id", "TEXT");
|
package/dist/db.js
CHANGED
|
@@ -236,6 +236,7 @@ function mapIssueSessionRow(row) {
|
|
|
236
236
|
...(row.worker_id !== null && row.worker_id !== undefined ? { workerId: String(row.worker_id) } : {}),
|
|
237
237
|
...(row.leased_until !== null && row.leased_until !== undefined ? { leasedUntil: String(row.leased_until) } : {}),
|
|
238
238
|
createdAt: String(row.created_at),
|
|
239
|
+
displayUpdatedAt: String(row.display_updated_at ?? row.updated_at),
|
|
239
240
|
updatedAt: String(row.updated_at),
|
|
240
241
|
};
|
|
241
242
|
}
|
|
@@ -58,9 +58,10 @@ export function syncIssueSessionFromIssue(params) {
|
|
|
58
58
|
ci_repair_attempts = ?,
|
|
59
59
|
queue_repair_attempts = ?,
|
|
60
60
|
review_fix_attempts = ?,
|
|
61
|
+
display_updated_at = ?,
|
|
61
62
|
updated_at = ?
|
|
62
63
|
WHERE project_id = ? AND linear_issue_id = ?
|
|
63
|
-
`).run(issue.issueKey ?? null, issue.projectId, issue.branchName ?? null, issue.worktreePath ?? null, issue.prNumber ?? null, issue.prHeadSha ?? null, issue.prAuthorLogin ?? null, sessionState, tracked.waitingReason ?? null, summaryText ?? null, activeThreadId ?? null, threadGeneration, issue.activeRunId ?? null, latestRunType ?? null, lastWakeReason ?? null, issue.ciRepairAttempts, issue.queueRepairAttempts, issue.reviewFixAttempts, now, issue.projectId, issue.linearIssueId);
|
|
64
|
+
`).run(issue.issueKey ?? null, issue.projectId, issue.branchName ?? null, issue.worktreePath ?? null, issue.prNumber ?? null, issue.prHeadSha ?? null, issue.prAuthorLogin ?? null, sessionState, tracked.waitingReason ?? null, summaryText ?? null, activeThreadId ?? null, threadGeneration, issue.activeRunId ?? null, latestRunType ?? null, lastWakeReason ?? null, issue.ciRepairAttempts, issue.queueRepairAttempts, issue.reviewFixAttempts, now, now, issue.projectId, issue.linearIssueId);
|
|
64
65
|
return;
|
|
65
66
|
}
|
|
66
67
|
connection.prepare(`
|
|
@@ -69,9 +70,9 @@ export function syncIssueSessionFromIssue(params) {
|
|
|
69
70
|
pr_number, pr_head_sha, pr_author_login, session_state, waiting_reason, summary_text,
|
|
70
71
|
active_thread_id, thread_generation, active_run_id, last_run_type, last_wake_reason,
|
|
71
72
|
ci_repair_attempts, queue_repair_attempts, review_fix_attempts,
|
|
72
|
-
created_at, updated_at
|
|
73
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
74
|
-
`).run(issue.projectId, issue.linearIssueId, issue.issueKey ?? null, issue.projectId, issue.branchName ?? null, issue.worktreePath ?? null, issue.prNumber ?? null, issue.prHeadSha ?? null, issue.prAuthorLogin ?? null, sessionState, tracked.waitingReason ?? null, summaryText ?? null, activeThreadId ?? null, threadGeneration, issue.activeRunId ?? null, latestRunType ?? null, lastWakeReason ?? null, issue.ciRepairAttempts, issue.queueRepairAttempts, issue.reviewFixAttempts, now, now);
|
|
73
|
+
created_at, display_updated_at, updated_at
|
|
74
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
75
|
+
`).run(issue.projectId, issue.linearIssueId, issue.issueKey ?? null, issue.projectId, issue.branchName ?? null, issue.worktreePath ?? null, issue.prNumber ?? null, issue.prHeadSha ?? null, issue.prAuthorLogin ?? null, sessionState, tracked.waitingReason ?? null, summaryText ?? null, activeThreadId ?? null, threadGeneration, issue.activeRunId ?? null, latestRunType ?? null, lastWakeReason ?? null, issue.ciRepairAttempts, issue.queueRepairAttempts, issue.reviewFixAttempts, now, now, now);
|
|
75
76
|
}
|
|
76
77
|
function resolveIssueSessionSummary(issue, runs, latestRun, existingSummaryText, explicitSummaryText) {
|
|
77
78
|
if (explicitSummaryText?.trim()) {
|
|
@@ -80,7 +80,7 @@ export class TrackedIssueListQuery {
|
|
|
80
80
|
const rows = this.db.connection
|
|
81
81
|
.prepare(`SELECT
|
|
82
82
|
s.project_id, s.linear_issue_id, s.issue_key, i.title,
|
|
83
|
-
i.current_linear_state, i.factory_state, i.delegated_to_patchrelay, s.session_state, s.waiting_reason, s.summary_text, s.
|
|
83
|
+
i.current_linear_state, i.factory_state, i.delegated_to_patchrelay, s.session_state, s.waiting_reason, s.summary_text, s.display_updated_at,
|
|
84
84
|
i.pending_run_type,
|
|
85
85
|
i.pr_number, i.pr_state, i.pr_head_sha, i.pr_review_state, i.pr_check_status, i.last_blocking_review_head_sha,
|
|
86
86
|
i.last_github_ci_snapshot_json,
|
|
@@ -144,7 +144,7 @@ export class TrackedIssueListQuery {
|
|
|
144
144
|
WHERE r.project_id = s.project_id AND r.linear_issue_id = s.linear_issue_id
|
|
145
145
|
ORDER BY r.id DESC LIMIT 1
|
|
146
146
|
)
|
|
147
|
-
ORDER BY s.
|
|
147
|
+
ORDER BY s.display_updated_at DESC, s.issue_key ASC`)
|
|
148
148
|
.all();
|
|
149
149
|
return rows.map((row) => {
|
|
150
150
|
const failureContext = parseGitHubFailureContext(typeof row.last_github_failure_context_json === "string" ? row.last_github_failure_context_json : undefined);
|
|
@@ -205,7 +205,7 @@ export class TrackedIssueListQuery {
|
|
|
205
205
|
...(typeof row.latest_run_completion_check_question === "string" ? { completionCheckQuestion: row.latest_run_completion_check_question } : {}),
|
|
206
206
|
...(typeof row.latest_run_completion_check_why === "string" ? { completionCheckWhy: row.latest_run_completion_check_why } : {}),
|
|
207
207
|
...(typeof row.latest_run_completion_check_recommended_reply === "string" ? { completionCheckRecommendedReply: row.latest_run_completion_check_recommended_reply } : {}),
|
|
208
|
-
startedAt: String(row.
|
|
208
|
+
startedAt: String(row.display_updated_at),
|
|
209
209
|
}
|
|
210
210
|
: undefined;
|
|
211
211
|
const latestEvent = this.db.issueSessions.listIssueSessionEvents(String(row.project_id), String(row.linear_issue_id), { limit: 1 }).at(-1);
|
|
@@ -256,7 +256,7 @@ export class TrackedIssueListQuery {
|
|
|
256
256
|
...(failureContext?.summary ? { latestFailureSummary: failureContext.summary } : {}),
|
|
257
257
|
...(waitingReason ? { waitingReason } : {}),
|
|
258
258
|
...(completionCheckActive ? { completionCheckActive } : {}),
|
|
259
|
-
updatedAt: String(row.
|
|
259
|
+
updatedAt: String(row.display_updated_at),
|
|
260
260
|
};
|
|
261
261
|
});
|
|
262
262
|
}
|