paperclip-github-plugin 0.9.13 → 0.9.14
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/README.md +0 -1
- package/dist/manifest.js +1 -1
- package/dist/worker.js +2 -72
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -186,7 +186,6 @@ Additional behavior:
|
|
|
186
186
|
- Sync-driven handoffs to agent assignees best-effort enqueue an explicit wakeup so the next reviewer, approver, or executor can pick the issue up even when their agent is not running heartbeats.
|
|
187
187
|
- Open imported issues that are already in `backlog` stay in `backlog` until someone changes them in Paperclip.
|
|
188
188
|
- If an imported issue is `done` or `cancelled` and GitHub shows it open again with no linked pull request, sync moves it to `todo` so agents can pick it up again.
|
|
189
|
-
- When an issue has a scheduled Paperclip issue monitor, GitHub Sync lets that monitor own the wait. It still refreshes GitHub metadata, but it does not change the issue's Paperclip status, assignee, execution state, transition comments, or wakeups until the monitor fires or is cleared.
|
|
190
189
|
- Trusted new GitHub comments from the original issue author or a verified maintainer/admin can move an open imported issue back into active work, whether the new comment lands on the source issue, in a linked pull request's top-level comment stream, or in a linked pull request review thread; GitHub Sync uses `in_progress` when it can route the issue to an executor and otherwise `todo`.
|
|
191
190
|
- When the sync changes a Paperclip issue status, it adds a Paperclip comment explaining what changed and why.
|
|
192
191
|
|
package/dist/manifest.js
CHANGED
|
@@ -642,7 +642,7 @@ var PULL_REQUEST_ASSET_API_ROUTE_URL_PATH = `/api/plugins/${GITHUB_SYNC_PLUGIN_I
|
|
|
642
642
|
var require2 = createRequire(import.meta.url);
|
|
643
643
|
var packageJson = require2("../package.json");
|
|
644
644
|
var SCHEDULE_TICK_CRON = "* * * * *";
|
|
645
|
-
var MANIFEST_VERSION = "0.9.
|
|
645
|
+
var MANIFEST_VERSION = "0.9.14"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
|
|
646
646
|
var manifest = {
|
|
647
647
|
id: GITHUB_SYNC_PLUGIN_ID,
|
|
648
648
|
apiVersion: 1,
|
package/dist/worker.js
CHANGED
|
@@ -5421,8 +5421,7 @@ function normalizePaperclipIssueExecutionState(value) {
|
|
|
5421
5421
|
const lastDecisionId = normalizeOptionalString2(record.lastDecisionId) ?? null;
|
|
5422
5422
|
const lastDecisionOutcome = normalizeOptionalString2(record.lastDecisionOutcome) ?? null;
|
|
5423
5423
|
const completedStageIds = Array.isArray(record.completedStageIds) ? record.completedStageIds.map((stageId) => normalizeOptionalString2(stageId)).filter((stageId) => Boolean(stageId)) : [];
|
|
5424
|
-
|
|
5425
|
-
if (!status && currentStageId === null && currentStageIndex === null && currentStageType === null && currentParticipant === null && returnAssignee === null && completedStageIds.length === 0 && lastDecisionId === null && lastDecisionOutcome === null && monitor === null) {
|
|
5424
|
+
if (!status && currentStageId === null && currentStageIndex === null && currentStageType === null && currentParticipant === null && returnAssignee === null && completedStageIds.length === 0 && lastDecisionId === null && lastDecisionOutcome === null) {
|
|
5426
5425
|
return null;
|
|
5427
5426
|
}
|
|
5428
5427
|
return {
|
|
@@ -5434,25 +5433,7 @@ function normalizePaperclipIssueExecutionState(value) {
|
|
|
5434
5433
|
returnAssignee,
|
|
5435
5434
|
completedStageIds,
|
|
5436
5435
|
...lastDecisionId !== null ? { lastDecisionId } : {},
|
|
5437
|
-
...lastDecisionOutcome !== null ? { lastDecisionOutcome } : {}
|
|
5438
|
-
...monitor !== null ? { monitor } : {}
|
|
5439
|
-
};
|
|
5440
|
-
}
|
|
5441
|
-
function normalizePaperclipIssueMonitorState(value) {
|
|
5442
|
-
if (!value || typeof value !== "object") {
|
|
5443
|
-
return null;
|
|
5444
|
-
}
|
|
5445
|
-
const record = value;
|
|
5446
|
-
const status = normalizeOptionalString2(record.status);
|
|
5447
|
-
const clearedAt = normalizeOptionalString2(record.clearedAt) ?? null;
|
|
5448
|
-
const clearReason = normalizeOptionalString2(record.clearReason) ?? null;
|
|
5449
|
-
if (!status && clearedAt === null && clearReason === null && Object.keys(record).length === 0) {
|
|
5450
|
-
return null;
|
|
5451
|
-
}
|
|
5452
|
-
return {
|
|
5453
|
-
...status ? { status } : {},
|
|
5454
|
-
clearedAt,
|
|
5455
|
-
clearReason
|
|
5436
|
+
...lastDecisionOutcome !== null ? { lastDecisionOutcome } : {}
|
|
5456
5437
|
};
|
|
5457
5438
|
}
|
|
5458
5439
|
function getPaperclipIssueAssigneePrincipal(issue) {
|
|
@@ -5478,17 +5459,6 @@ function getPaperclipIssueSyncContext(issue) {
|
|
|
5478
5459
|
executionState: normalizePaperclipIssueExecutionState(record.executionState)
|
|
5479
5460
|
};
|
|
5480
5461
|
}
|
|
5481
|
-
function hasScheduledPaperclipIssueMonitor(syncContext) {
|
|
5482
|
-
const monitor = syncContext.executionState?.monitor;
|
|
5483
|
-
if (!monitor) {
|
|
5484
|
-
return false;
|
|
5485
|
-
}
|
|
5486
|
-
if (monitor.clearedAt || monitor.clearReason) {
|
|
5487
|
-
return false;
|
|
5488
|
-
}
|
|
5489
|
-
const normalizedStatus = monitor.status?.trim().toLowerCase();
|
|
5490
|
-
return normalizedStatus === "scheduled";
|
|
5491
|
-
}
|
|
5492
5462
|
function hasUnresolvedPaperclipIssueBlockerSummary(blockers) {
|
|
5493
5463
|
if (!Array.isArray(blockers)) {
|
|
5494
5464
|
return false;
|
|
@@ -5708,13 +5678,6 @@ function isClearableMaintainerWaitExecutionState(executionState) {
|
|
|
5708
5678
|
if (executionState === null) {
|
|
5709
5679
|
return true;
|
|
5710
5680
|
}
|
|
5711
|
-
if (hasScheduledPaperclipIssueMonitor({
|
|
5712
|
-
assignee: null,
|
|
5713
|
-
executionPolicy: null,
|
|
5714
|
-
executionState
|
|
5715
|
-
})) {
|
|
5716
|
-
return false;
|
|
5717
|
-
}
|
|
5718
5681
|
if (executionState.currentParticipant !== null || executionState.returnAssignee !== null || executionState.currentStageId !== null || executionState.currentStageIndex !== null || executionState.currentStageType !== null || executionState.completedStageIds.length > 0 || executionState.lastDecisionId || executionState.lastDecisionOutcome) {
|
|
5719
5682
|
return false;
|
|
5720
5683
|
}
|
|
@@ -9559,18 +9522,6 @@ async function cancelUnmappedTransferredGitHubIssue(ctx, params) {
|
|
|
9559
9522
|
};
|
|
9560
9523
|
}
|
|
9561
9524
|
const paperclipIssueSyncContext = getPaperclipIssueSyncContext(paperclipIssue);
|
|
9562
|
-
if (hasScheduledPaperclipIssueMonitor(paperclipIssueSyncContext)) {
|
|
9563
|
-
ctx.logger.info("GitHub sync skipped transferred issue cancellation because an issue monitor is scheduled.", {
|
|
9564
|
-
companyId,
|
|
9565
|
-
issueId: params.importedIssue.paperclipIssueId,
|
|
9566
|
-
transferredRepositoryUrl: params.transferredRepository.url,
|
|
9567
|
-
currentStatus: paperclipIssue.status,
|
|
9568
|
-
resolvedStatus: "cancelled"
|
|
9569
|
-
});
|
|
9570
|
-
return {
|
|
9571
|
-
updatedStatusesCount: 0
|
|
9572
|
-
};
|
|
9573
|
-
}
|
|
9574
9525
|
await unlinkPaperclipIssueFromGitHub(ctx, {
|
|
9575
9526
|
companyId,
|
|
9576
9527
|
issueId: params.importedIssue.paperclipIssueId
|
|
@@ -9899,17 +9850,6 @@ async function synchronizePaperclipIssueStatuses(ctx, octokit, repository, mappi
|
|
|
9899
9850
|
importedIssue.lastSeenCommentCount = snapshot.commentCount;
|
|
9900
9851
|
importedIssue.lastSeenGitHubState = snapshot.state;
|
|
9901
9852
|
importedIssue.linkedPullRequestCommentCounts = currentLinkedPullRequestCommentCounts;
|
|
9902
|
-
if (hasScheduledPaperclipIssueMonitor(paperclipIssueSyncContext)) {
|
|
9903
|
-
ctx.logger.info("GitHub sync skipped Paperclip issue state changes because an issue monitor is scheduled.", {
|
|
9904
|
-
companyId: mapping.companyId,
|
|
9905
|
-
issueId: importedIssue.paperclipIssueId,
|
|
9906
|
-
repositoryUrl: repository.url,
|
|
9907
|
-
githubIssueNumber: githubIssue.number,
|
|
9908
|
-
currentStatus: paperclipIssue.status,
|
|
9909
|
-
resolvedStatus: nextStatus
|
|
9910
|
-
});
|
|
9911
|
-
continue;
|
|
9912
|
-
}
|
|
9913
9853
|
if (paperclipIssue.status === nextStatus) {
|
|
9914
9854
|
if (shouldClearTransitionAssignee || shouldClearCompletedExecutionPolicy) {
|
|
9915
9855
|
updateSyncFailureContext(syncFailureContext, {
|
|
@@ -10166,16 +10106,6 @@ async function synchronizePaperclipPullRequestIssueStatuses(ctx, octokit, mappin
|
|
|
10166
10106
|
const shouldClearTransitionAssignee = nextStatus === "in_review" && (nextTransitionAssignee === null || shouldPreserveMaintainerWaitRouting) && paperclipIssueSyncContext.assignee !== null;
|
|
10167
10107
|
const nextAssigneeChanged = nextTransitionAssignee ? !doesPaperclipIssueAssigneeMatch(paperclipIssueSyncContext.assignee, nextTransitionAssignee.principal) : false;
|
|
10168
10108
|
const shouldWakeTransitionAssignee = paperclipIssue.status !== nextStatus && nextTransitionAssignee?.principal.kind === "agent" && isActionablePaperclipIssueStatus(nextStatus) && (nextAssigneeChanged || paperclipIssue.status !== nextStatus);
|
|
10169
|
-
if (hasScheduledPaperclipIssueMonitor(paperclipIssueSyncContext)) {
|
|
10170
|
-
ctx.logger.info("GitHub sync skipped Paperclip pull request issue state changes because an issue monitor is scheduled.", {
|
|
10171
|
-
companyId: mapping.companyId,
|
|
10172
|
-
issueId: paperclipIssueId,
|
|
10173
|
-
repositoryUrl: primaryRepository?.url,
|
|
10174
|
-
currentStatus: paperclipIssue.status,
|
|
10175
|
-
resolvedStatus: nextStatus
|
|
10176
|
-
});
|
|
10177
|
-
continue;
|
|
10178
|
-
}
|
|
10179
10109
|
if (paperclipIssue.status === nextStatus) {
|
|
10180
10110
|
if (shouldClearTransitionAssignee || shouldClearCompletedExecutionPolicy) {
|
|
10181
10111
|
updateSyncFailureContext(syncFailureContext, {
|