@juangcarmona/lighthouse-sdlc 0.18.3 → 0.18.4
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/package.json +1 -1
- package/src/worker-recovery.mjs +3 -3
package/package.json
CHANGED
package/src/worker-recovery.mjs
CHANGED
|
@@ -192,7 +192,7 @@ export async function reconcilePublishedStage(api, repository, owner, issue, com
|
|
|
192
192
|
const expectedStatus = result.status === 'passed' ? 'completed' : question ? 'waiting' : 'blocked';
|
|
193
193
|
if (!interrupted && dispatch.receipt.status !== expectedStatus) return 'uncertain';
|
|
194
194
|
const projection = resultHandoffState({ status: result.status, stage: snapshot.stage, question });
|
|
195
|
-
if (
|
|
195
|
+
if ((projection.label && !issue.labels.some(l => l.name === projection.label) && !(interrupted && issue.labels.some(l => l.name === snapshot.stage))) || issue.labels.some(l => ['ready', 'triaged', 'needs-info', 'waiting-review', 'execution-failed', 'pr-draft', 'pr-ready'].includes(l.name) && l.name !== projection.label)) return 'uncertain';
|
|
196
196
|
let action = question ? `Owner: ${question} Reply here.` : 'None.';
|
|
197
197
|
let next = question ? `The answer will be checked against this question before ${snapshot.stage} continues.` : 'Any continuation follows the configured authorization.';
|
|
198
198
|
if (snapshot.stage === 'refine' && result.status === 'passed') {
|
|
@@ -205,10 +205,10 @@ export async function reconcilePublishedStage(api, repository, owner, issue, com
|
|
|
205
205
|
await checkDispatchClaim(api, repository, issue.number, { commentId: dispatch.commentId, requestId: dispatch.request.id, digest: dispatch.receipt.digest }, run.id);
|
|
206
206
|
const fresh = await api(`issues/${issue.number}`), freshComments = await issueComments(api, issue.number);
|
|
207
207
|
const currentRepo = await api(''), currentRevision = (await api(`commits/${encodeURIComponent(currentRepo.default_branch)}`)).sha;
|
|
208
|
-
if (currentRevision !== revision || (await api(`commits/${encodeURIComponent(dispatch.request.ref)}`)).sha !== workflowRevision || fresh.state !== 'open' || fresh.user?.login !== owner || fresh.pull_request || fresh.labels.some(l => ['agent-working', 'human-working'].includes(l.name) || incompatibleStage(l)) || (!fresh.labels.some(l => l.name === projection.label) && !(interrupted && fresh.labels.some(l => l.name === snapshot.stage))) || fresh.labels.some(l => ['ready', 'triaged', 'needs-info', 'waiting-review', 'execution-failed', 'pr-draft', 'pr-ready'].includes(l.name) && l.name !== projection.label) || intent(fresh, freshComments, owner) !== dispatch.request.taskDigest) return 'uncertain';
|
|
208
|
+
if (currentRevision !== revision || (await api(`commits/${encodeURIComponent(dispatch.request.ref)}`)).sha !== workflowRevision || fresh.state !== 'open' || fresh.user?.login !== owner || fresh.pull_request || fresh.labels.some(l => ['agent-working', 'human-working'].includes(l.name) || incompatibleStage(l)) || (projection.label && !fresh.labels.some(l => l.name === projection.label) && !(interrupted && fresh.labels.some(l => l.name === snapshot.stage))) || fresh.labels.some(l => ['ready', 'triaged', 'needs-info', 'waiting-review', 'execution-failed', 'pr-draft', 'pr-ready'].includes(l.name) && l.name !== projection.label) || intent(fresh, freshComments, owner) !== dispatch.request.taskDigest) return 'uncertain';
|
|
209
209
|
if (freshComments.some(c => c.user?.login === 'github-actions[bot]' && Number(c.id) > Number(dispatch.commentId) && c.body?.includes('<!-- lighthouse-dispatch:'))) return 'uncertain';
|
|
210
210
|
if (interrupted && fresh.labels.some(l => l.name === snapshot.stage)) {
|
|
211
|
-
if (!fresh.labels.some(l => l.name === projection.label)) {
|
|
211
|
+
if (projection.label && !fresh.labels.some(l => l.name === projection.label)) {
|
|
212
212
|
await checkDispatchClaim(api, repository, issue.number, { commentId: dispatch.commentId, requestId: dispatch.request.id, digest: dispatch.receipt.digest }, run.id);
|
|
213
213
|
await api(`issues/${issue.number}/labels`, 'POST', { labels: [projection.label] });
|
|
214
214
|
}
|