patchrelay 0.55.0 → 0.55.1
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/reactive-run-policy.js +10 -5
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -65,8 +65,9 @@ export class ReactiveRunPolicy {
|
|
|
65
65
|
if (!issue.prNumber || issue.prState !== "open") {
|
|
66
66
|
return undefined;
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
const blockingReviewHeadSha = resolveRequestedChangesBlockingHead(run, issue);
|
|
69
|
+
if (!blockingReviewHeadSha) {
|
|
70
|
+
return `Requested-changes run finished for PR #${issue.prNumber} without a recorded blocking review or starting head SHA. PatchRelay cannot verify that a new head was published.`;
|
|
70
71
|
}
|
|
71
72
|
try {
|
|
72
73
|
const snapshot = await readReactivePrSnapshot(this.config, run.projectId, issue.prNumber);
|
|
@@ -75,8 +76,8 @@ export class ReactiveRunPolicy {
|
|
|
75
76
|
if (!snapshot.headSha) {
|
|
76
77
|
return `Requested-changes run finished for PR #${issue.prNumber} but GitHub did not report a current head SHA.`;
|
|
77
78
|
}
|
|
78
|
-
if (snapshot.headSha ===
|
|
79
|
-
return `Requested-changes run finished for PR #${issue.prNumber} without pushing a new head; PatchRelay must not hand the same SHA back to review.`;
|
|
79
|
+
if (snapshot.headSha === blockingReviewHeadSha) {
|
|
80
|
+
return `Requested-changes run finished for PR #${issue.prNumber} without pushing a new head past blocking review SHA ${blockingReviewHeadSha.slice(0, 8)}; PatchRelay must not hand the same SHA back to review.`;
|
|
80
81
|
}
|
|
81
82
|
return undefined;
|
|
82
83
|
}
|
|
@@ -153,8 +154,9 @@ export class ReactiveRunPolicy {
|
|
|
153
154
|
return this.db.issues.getIssue(run.projectId, run.linearIssueId) ?? issue;
|
|
154
155
|
}
|
|
155
156
|
const headAdvanced = Boolean(snapshot.headSha && snapshot.headSha !== issue.lastGitHubFailureHeadSha);
|
|
157
|
+
const blockingReviewHeadSha = resolveRequestedChangesBlockingHead(run, issue);
|
|
156
158
|
const reviewFixHeadAdvanced = isRequestedChangesRunType(run.runType)
|
|
157
|
-
&& Boolean(snapshot.headSha &&
|
|
159
|
+
&& Boolean(snapshot.headSha && blockingReviewHeadSha && snapshot.headSha !== blockingReviewHeadSha);
|
|
158
160
|
this.upsertIssueIfLeaseHeld(run.projectId, run.linearIssueId, {
|
|
159
161
|
projectId: run.projectId,
|
|
160
162
|
linearIssueId: run.linearIssueId,
|
|
@@ -311,6 +313,9 @@ function resolveReactiveBaselineHead(run, issue) {
|
|
|
311
313
|
}
|
|
312
314
|
return undefined;
|
|
313
315
|
}
|
|
316
|
+
function resolveRequestedChangesBlockingHead(run, issue) {
|
|
317
|
+
return issue.lastBlockingReviewHeadSha ?? run.sourceHeadSha;
|
|
318
|
+
}
|
|
314
319
|
function isReactiveScopeRiskPath(filePath) {
|
|
315
320
|
return REACTIVE_SCOPE_RISK_EXACT_PATHS.has(filePath)
|
|
316
321
|
|| REACTIVE_SCOPE_RISK_PREFIXES.some((prefix) => filePath.startsWith(prefix));
|