paperclip-github-plugin 0.17.2 → 0.17.3
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/manifest.js +1 -1
- package/dist/worker.js +33 -21
- package/package.json +1 -1
package/dist/manifest.js
CHANGED
|
@@ -691,7 +691,7 @@ var COMPANY_METRIC_API_ROUTE_URL_PATH = `/api/plugins/${GITHUB_SYNC_PLUGIN_ID}/a
|
|
|
691
691
|
var require2 = createRequire(import.meta.url);
|
|
692
692
|
var packageJson = require2("../package.json");
|
|
693
693
|
var SCHEDULE_TICK_CRON = "* * * * *";
|
|
694
|
-
var MANIFEST_VERSION = "0.17.
|
|
694
|
+
var MANIFEST_VERSION = "0.17.3"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
|
|
695
695
|
var COMPANY_SECRET_REF_VALUE_SCHEMA = {
|
|
696
696
|
anyOf: [
|
|
697
697
|
{ type: "string" },
|
package/dist/worker.js
CHANGED
|
@@ -1075,6 +1075,7 @@ var ISSUE_INTERACTION_REASON_CODES = /* @__PURE__ */ new Set([
|
|
|
1075
1075
|
"github_sync_status_decision"
|
|
1076
1076
|
]);
|
|
1077
1077
|
var ISSUE_INTERACTION_MAX_SCAN_ROWS = 5e3;
|
|
1078
|
+
var ISSUE_INTERACTION_MAX_LIST_ROWS = 2e4;
|
|
1078
1079
|
var ISSUE_INTERACTION_MAX_REPEATED_ACTIONS = 10;
|
|
1079
1080
|
var SOURCES = /* @__PURE__ */ new Set(["agent_tool", "sync", "api_route", "operator_action", "backfill"]);
|
|
1080
1081
|
var OUTCOMES = /* @__PURE__ */ new Set(["observed", "changed", "noop", "failed"]);
|
|
@@ -11236,7 +11237,7 @@ async function synchronizePaperclipIssueStatuses(ctx, octokit, repository, mappi
|
|
|
11236
11237
|
importedIssue.remoteActionFingerprint = remoteActionFingerprint;
|
|
11237
11238
|
importedIssue.selectedPullRequestGate = effectiveGate ? { repositoryUrl: effectiveGate.repositoryUrl, number: effectiveGate.number } : void 0;
|
|
11238
11239
|
if (pendingWake2) importedIssue.pendingRemoteActionWake = pendingWake2;
|
|
11239
|
-
|
|
11240
|
+
delete importedIssue.activationPending;
|
|
11240
11241
|
await persistImportRegistry();
|
|
11241
11242
|
};
|
|
11242
11243
|
if (paperclipIssue.status === nextStatus) {
|
|
@@ -11254,24 +11255,28 @@ async function synchronizePaperclipIssueStatuses(ctx, octokit, repository, mappi
|
|
|
11254
11255
|
}, createWakeFingerprint) : void 0;
|
|
11255
11256
|
if (pendingWake2) importedIssue.pendingRemoteActionWake = pendingWake2;
|
|
11256
11257
|
if (pendingWake2 || isPendingInitialActivation) await persistImportRegistry();
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11258
|
+
const shouldClearExecutionPolicy = (shouldPreserveMaintainerWaitRouting || shouldClearCompletedExecutionPolicy) && Boolean(paperclipIssueSyncContext.executionPolicy);
|
|
11259
|
+
const hasStatusMutation = nextAssigneeChanged || shouldClearTransitionAssignee || shouldClearExecutionPolicy;
|
|
11260
|
+
if (hasStatusMutation) {
|
|
11261
|
+
updateSyncFailureContext(syncFailureContext, {
|
|
11262
|
+
phase: "updating_paperclip_status",
|
|
11263
|
+
repositoryUrl: repository.url,
|
|
11264
|
+
githubIssueNumber: githubIssue.number
|
|
11265
|
+
});
|
|
11266
|
+
await updatePaperclipIssueState(ctx, {
|
|
11267
|
+
companyId: mapping.companyId,
|
|
11268
|
+
issueId: importedIssue.paperclipIssueId,
|
|
11269
|
+
currentStatus: paperclipIssue.status,
|
|
11270
|
+
syncContext: paperclipIssueSyncContext,
|
|
11271
|
+
nextStatus,
|
|
11272
|
+
...nextAssigneeChanged && nextTransitionAssignee ? { nextAssignee: nextTransitionAssignee.principal } : {},
|
|
11273
|
+
...shouldClearTransitionAssignee ? { clearAssignee: true } : {},
|
|
11274
|
+
...shouldClearExecutionPolicy ? { clearExecutionPolicy: true } : {},
|
|
11275
|
+
transitionComment: "",
|
|
11276
|
+
actionFingerprint: actionJournalFingerprint,
|
|
11277
|
+
paperclipApiBaseUrl
|
|
11278
|
+
});
|
|
11279
|
+
}
|
|
11275
11280
|
if (pendingWake2) {
|
|
11276
11281
|
await persistObservedRemoteState(pendingWake2);
|
|
11277
11282
|
queuedIssueWakeups.push({
|
|
@@ -16731,6 +16736,7 @@ async function listIssueInteractionEvents(ctx, companyId, paperclipIssueId, rang
|
|
|
16731
16736
|
let ledgerStartedAt = null;
|
|
16732
16737
|
const fromMs = Date.parse(range.from);
|
|
16733
16738
|
const toMs = Date.parse(range.to);
|
|
16739
|
+
let listedRows = 0;
|
|
16734
16740
|
outer: for (let offset = 0; ; ) {
|
|
16735
16741
|
const page = await ctx.entities.list({
|
|
16736
16742
|
entityType: ISSUE_INTERACTION_ENTITY_TYPE,
|
|
@@ -16740,14 +16746,19 @@ async function listIssueInteractionEvents(ctx, companyId, paperclipIssueId, rang
|
|
|
16740
16746
|
offset
|
|
16741
16747
|
});
|
|
16742
16748
|
for (const entry of page) {
|
|
16743
|
-
|
|
16749
|
+
listedRows += 1;
|
|
16750
|
+
if (listedRows > ISSUE_INTERACTION_MAX_LIST_ROWS) {
|
|
16744
16751
|
scanTruncated = true;
|
|
16745
16752
|
break outer;
|
|
16746
16753
|
}
|
|
16747
|
-
scannedRows += 1;
|
|
16748
16754
|
if (entry.scopeKind !== "issue" || entry.scopeId !== paperclipIssueId) continue;
|
|
16749
16755
|
const raw = entry.data;
|
|
16750
16756
|
if (raw?.companyId !== companyId || raw?.paperclipIssueId !== paperclipIssueId) continue;
|
|
16757
|
+
if (scannedRows >= ISSUE_INTERACTION_MAX_SCAN_ROWS) {
|
|
16758
|
+
scanTruncated = true;
|
|
16759
|
+
break outer;
|
|
16760
|
+
}
|
|
16761
|
+
scannedRows += 1;
|
|
16751
16762
|
try {
|
|
16752
16763
|
const event = sanitizeIssueInteractionEvent(raw);
|
|
16753
16764
|
if (ledgerStartedAt === null || event.occurredAt < ledgerStartedAt) ledgerStartedAt = event.occurredAt;
|
|
@@ -18049,6 +18060,7 @@ function shouldStartWorkerHost(moduleUrl, entry = process.argv[1]) {
|
|
|
18049
18060
|
}
|
|
18050
18061
|
}
|
|
18051
18062
|
var __testing = {
|
|
18063
|
+
listIssueInteractionEvents,
|
|
18052
18064
|
buildDirectPullRequestActionFingerprint,
|
|
18053
18065
|
buildRemoteActionFingerprint,
|
|
18054
18066
|
canReservePendingWake,
|