patchrelay 0.62.0 → 0.64.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 +3 -3
- package/dist/db/issue-store.js +26 -0
- package/dist/db/migrations.js +17 -0
- package/dist/merge-queue-protocol.js +11 -0
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
package/dist/db/issue-store.js
CHANGED
|
@@ -212,6 +212,18 @@ export class IssueStore {
|
|
|
212
212
|
sets.push("last_attempted_failure_at = @lastAttemptedFailureAt");
|
|
213
213
|
values.lastAttemptedFailureAt = params.lastAttemptedFailureAt;
|
|
214
214
|
}
|
|
215
|
+
if (params.lastPublishedPatchId !== undefined) {
|
|
216
|
+
sets.push("last_published_patch_id = @lastPublishedPatchId");
|
|
217
|
+
values.lastPublishedPatchId = params.lastPublishedPatchId;
|
|
218
|
+
}
|
|
219
|
+
if (params.lastPublishedIntegrationTreeId !== undefined) {
|
|
220
|
+
sets.push("last_published_integration_tree_id = @lastPublishedIntegrationTreeId");
|
|
221
|
+
values.lastPublishedIntegrationTreeId = params.lastPublishedIntegrationTreeId;
|
|
222
|
+
}
|
|
223
|
+
if (params.lastPublishedHeadSha !== undefined) {
|
|
224
|
+
sets.push("last_published_head_sha = @lastPublishedHeadSha");
|
|
225
|
+
values.lastPublishedHeadSha = params.lastPublishedHeadSha;
|
|
226
|
+
}
|
|
215
227
|
if (params.ciRepairAttempts !== undefined) {
|
|
216
228
|
sets.push("ci_repair_attempts = @ciRepairAttempts");
|
|
217
229
|
values.ciRepairAttempts = params.ciRepairAttempts;
|
|
@@ -251,6 +263,7 @@ export class IssueStore {
|
|
|
251
263
|
last_github_ci_snapshot_head_sha, last_github_ci_snapshot_gate_check_name, last_github_ci_snapshot_gate_check_status, last_github_ci_snapshot_json, last_github_ci_snapshot_settled_at,
|
|
252
264
|
last_queue_signal_at, last_queue_incident_json,
|
|
253
265
|
last_attempted_failure_head_sha, last_attempted_failure_signature, last_attempted_failure_at,
|
|
266
|
+
last_published_patch_id, last_published_integration_tree_id, last_published_head_sha,
|
|
254
267
|
ci_repair_attempts, queue_repair_attempts, review_fix_attempts, zombie_recovery_attempts, last_zombie_recovery_at, orchestration_settle_until,
|
|
255
268
|
updated_at
|
|
256
269
|
) VALUES (
|
|
@@ -264,6 +277,7 @@ export class IssueStore {
|
|
|
264
277
|
@lastGitHubCiSnapshotHeadSha, @lastGitHubCiSnapshotGateCheckName, @lastGitHubCiSnapshotGateCheckStatus, @lastGitHubCiSnapshotJson, @lastGitHubCiSnapshotSettledAt,
|
|
265
278
|
@lastQueueSignalAt, @lastQueueIncidentJson,
|
|
266
279
|
@lastAttemptedFailureHeadSha, @lastAttemptedFailureSignature, @lastAttemptedFailureAt,
|
|
280
|
+
@lastPublishedPatchId, @lastPublishedIntegrationTreeId, @lastPublishedHeadSha,
|
|
267
281
|
@ciRepairAttempts, @queueRepairAttempts, @reviewFixAttempts, @zombieRecoveryAttempts, @lastZombieRecoveryAt, @orchestrationSettleUntil,
|
|
268
282
|
@now
|
|
269
283
|
)
|
|
@@ -319,6 +333,9 @@ export class IssueStore {
|
|
|
319
333
|
lastAttemptedFailureHeadSha: params.lastAttemptedFailureHeadSha ?? null,
|
|
320
334
|
lastAttemptedFailureSignature: params.lastAttemptedFailureSignature ?? null,
|
|
321
335
|
lastAttemptedFailureAt: params.lastAttemptedFailureAt ?? null,
|
|
336
|
+
lastPublishedPatchId: params.lastPublishedPatchId ?? null,
|
|
337
|
+
lastPublishedIntegrationTreeId: params.lastPublishedIntegrationTreeId ?? null,
|
|
338
|
+
lastPublishedHeadSha: params.lastPublishedHeadSha ?? null,
|
|
322
339
|
ciRepairAttempts: params.ciRepairAttempts ?? 0,
|
|
323
340
|
queueRepairAttempts: params.queueRepairAttempts ?? 0,
|
|
324
341
|
reviewFixAttempts: params.reviewFixAttempts ?? 0,
|
|
@@ -705,6 +722,15 @@ export function mapIssueRow(row) {
|
|
|
705
722
|
...(row.last_attempted_failure_at !== null && row.last_attempted_failure_at !== undefined
|
|
706
723
|
? { lastAttemptedFailureAt: String(row.last_attempted_failure_at) }
|
|
707
724
|
: {}),
|
|
725
|
+
...(row.last_published_patch_id !== null && row.last_published_patch_id !== undefined
|
|
726
|
+
? { lastPublishedPatchId: String(row.last_published_patch_id) }
|
|
727
|
+
: {}),
|
|
728
|
+
...(row.last_published_integration_tree_id !== null && row.last_published_integration_tree_id !== undefined
|
|
729
|
+
? { lastPublishedIntegrationTreeId: String(row.last_published_integration_tree_id) }
|
|
730
|
+
: {}),
|
|
731
|
+
...(row.last_published_head_sha !== null && row.last_published_head_sha !== undefined
|
|
732
|
+
? { lastPublishedHeadSha: String(row.last_published_head_sha) }
|
|
733
|
+
: {}),
|
|
708
734
|
ciRepairAttempts: Number(row.ci_repair_attempts ?? 0),
|
|
709
735
|
queueRepairAttempts: Number(row.queue_repair_attempts ?? 0),
|
|
710
736
|
reviewFixAttempts: Number(row.review_fix_attempts ?? 0),
|
package/dist/db/migrations.js
CHANGED
|
@@ -333,6 +333,14 @@ export function runPatchRelayMigrations(connection) {
|
|
|
333
333
|
addColumnIfMissing(connection, "issues", "last_attempted_failure_head_sha", "TEXT");
|
|
334
334
|
addColumnIfMissing(connection, "issues", "last_attempted_failure_signature", "TEXT");
|
|
335
335
|
addColumnIfMissing(connection, "issues", "last_attempted_failure_at", "TEXT");
|
|
336
|
+
// Plan §4.1: track the last published change identity so future
|
|
337
|
+
// runs can detect patch-id-equivalent re-publishes (no-op pushes).
|
|
338
|
+
// Currently observability-only — populated when patchrelay observes
|
|
339
|
+
// a push it can attribute to itself; consumers (prompt assembly,
|
|
340
|
+
// post-hoc detection) layer in follow-up PRs.
|
|
341
|
+
addColumnIfMissing(connection, "issues", "last_published_patch_id", "TEXT");
|
|
342
|
+
addColumnIfMissing(connection, "issues", "last_published_integration_tree_id", "TEXT");
|
|
343
|
+
addColumnIfMissing(connection, "issues", "last_published_head_sha", "TEXT");
|
|
336
344
|
addColumnIfMissing(connection, "linear_installations", "health_status", "TEXT NOT NULL DEFAULT 'ok'");
|
|
337
345
|
addColumnIfMissing(connection, "linear_installations", "health_reason", "TEXT");
|
|
338
346
|
addColumnIfMissing(connection, "linear_installations", "health_updated_at", "TEXT");
|
|
@@ -407,6 +415,9 @@ function removeRetiredIssueColumnsIfPresent(connection) {
|
|
|
407
415
|
last_attempted_failure_head_sha TEXT,
|
|
408
416
|
last_attempted_failure_signature TEXT,
|
|
409
417
|
last_attempted_failure_at TEXT,
|
|
418
|
+
last_published_patch_id TEXT,
|
|
419
|
+
last_published_integration_tree_id TEXT,
|
|
420
|
+
last_published_head_sha TEXT,
|
|
410
421
|
ci_repair_attempts INTEGER NOT NULL DEFAULT 0,
|
|
411
422
|
queue_repair_attempts INTEGER NOT NULL DEFAULT 0,
|
|
412
423
|
review_fix_attempts INTEGER NOT NULL DEFAULT 0,
|
|
@@ -470,6 +481,9 @@ function removeRetiredIssueColumnsIfPresent(connection) {
|
|
|
470
481
|
last_attempted_failure_head_sha,
|
|
471
482
|
last_attempted_failure_signature,
|
|
472
483
|
last_attempted_failure_at,
|
|
484
|
+
last_published_patch_id,
|
|
485
|
+
last_published_integration_tree_id,
|
|
486
|
+
last_published_head_sha,
|
|
473
487
|
ci_repair_attempts,
|
|
474
488
|
queue_repair_attempts,
|
|
475
489
|
review_fix_attempts,
|
|
@@ -531,6 +545,9 @@ function removeRetiredIssueColumnsIfPresent(connection) {
|
|
|
531
545
|
last_attempted_failure_head_sha,
|
|
532
546
|
last_attempted_failure_signature,
|
|
533
547
|
last_attempted_failure_at,
|
|
548
|
+
last_published_patch_id,
|
|
549
|
+
last_published_integration_tree_id,
|
|
550
|
+
last_published_head_sha,
|
|
534
551
|
COALESCE(ci_repair_attempts, 0),
|
|
535
552
|
COALESCE(queue_repair_attempts, 0),
|
|
536
553
|
COALESCE(review_fix_attempts, 0),
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
export const DEFAULT_MERGE_QUEUE_LABEL = "queue";
|
|
2
2
|
export const DEFAULT_MERGE_QUEUE_CHECK_NAME = "merge-steward/queue";
|
|
3
3
|
export const DEFAULT_PRIORITY_QUEUE_LABEL = "queue:priority";
|
|
4
|
+
// Plan §2.4 defaults. Wired here so the resolver is the single source
|
|
5
|
+
// of truth for bus-contract values; consumers (review-quill subscribe,
|
|
6
|
+
// Linear-status sync, etc.) never read `project.github.*` directly.
|
|
7
|
+
export const DEFAULT_SPEC_READY_CHECK_NAME = "merge-steward/spec-ready";
|
|
8
|
+
export const DEFAULT_SPEC_BRANCH_PATTERN = "mq-spec-*";
|
|
9
|
+
export const DEFAULT_NO_CACHE_LABEL = "review:no-cache";
|
|
10
|
+
export const DEFAULT_QUEUED_FOR_DEPLOY_LABEL = "queued-for-deploy";
|
|
4
11
|
export function resolveMergeQueueProtocol(project) {
|
|
5
12
|
return {
|
|
6
13
|
repoFullName: project?.github?.repoFullName,
|
|
@@ -8,5 +15,9 @@ export function resolveMergeQueueProtocol(project) {
|
|
|
8
15
|
admissionLabel: project?.github?.mergeQueueLabel ?? DEFAULT_MERGE_QUEUE_LABEL,
|
|
9
16
|
evictionCheckName: project?.github?.mergeQueueCheckName ?? DEFAULT_MERGE_QUEUE_CHECK_NAME,
|
|
10
17
|
priorityLabel: project?.github?.priorityQueueLabel ?? DEFAULT_PRIORITY_QUEUE_LABEL,
|
|
18
|
+
specReadyCheckName: project?.github?.specReadyCheckName ?? DEFAULT_SPEC_READY_CHECK_NAME,
|
|
19
|
+
specBranchPattern: project?.github?.specBranchPattern ?? DEFAULT_SPEC_BRANCH_PATTERN,
|
|
20
|
+
noCacheLabel: project?.github?.noCacheLabel ?? DEFAULT_NO_CACHE_LABEL,
|
|
21
|
+
queuedForDeployLabel: project?.github?.queuedForDeployLabel ?? DEFAULT_QUEUED_FOR_DEPLOY_LABEL,
|
|
11
22
|
};
|
|
12
23
|
}
|