plugin-git-manager 1.2.27 → 1.3.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/README.md +151 -108
- package/client-v2.d.ts +2 -2
- package/client-v2.js +1 -1
- package/client.d.ts +3 -3
- package/client.js +1 -1
- package/dist/client/{326.90c276058682b536.js → 313.d38fc1d40c4589b9.js} +1 -1
- package/dist/client/941.1793e67472872992.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/156.445366026c1cc9a8.js +10 -0
- package/dist/client-v2/{326.42b7b53651ffab3a.js → 313.3c867179c3a1e817.js} +1 -1
- package/dist/client-v2/434.19c7579c06b9077c.js +10 -0
- package/dist/client-v2/928.bba701b5a1ece58e.js +10 -0
- package/dist/client-v2/941.b0d55429cd053f32.js +10 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +9 -8
- package/dist/locale/en-US.json +396 -297
- package/dist/locale/vi-VN.json +384 -292
- package/dist/locale/zh-CN.json +150 -51
- package/dist/node_modules/simple-git/dist/cjs/index.js +25 -25
- package/dist/node_modules/simple-git/package.json +1 -1
- package/dist/node_modules/zod/index.cjs +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/actions/git-actions.js +90 -36
- package/dist/server/actions/gitlab-api.js +4 -2
- package/dist/server/actions/poller.js +5 -2
- package/dist/server/actions/review-cutover.js +137 -0
- package/dist/server/actions/review.js +150 -51
- package/dist/server/actions/role-permissions.js +1 -0
- package/dist/server/ai-tools.js +8 -9
- package/dist/server/collections/gitCodeReviews.js +10 -0
- package/dist/server/collections/gitReviewCutover.js +44 -0
- package/dist/server/collections/gitReviewFlows.js +3 -0
- package/dist/server/collections/gitReviewInbox.js +51 -0
- package/dist/server/collections/gitReviewProjects.js +43 -0
- package/dist/server/collections/gitReviewRequests.js +56 -0
- package/dist/server/index.js +8 -2
- package/dist/server/plugin.js +57 -20
- package/dist/server/poller.js +95 -74
- package/dist/server/repository-access.js +23 -5
- package/dist/server/request-method-policy.js +76 -0
- package/dist/server/review-control-access.js +79 -0
- package/dist/server/services/legacy-post-service.js +412 -0
- package/dist/server/services/registry-content-service.js +4 -3
- package/dist/server/services/review-service.js +1451 -0
- package/dist/server/services/review-source.js +325 -0
- package/dist/server/utils/get-repo-account.js +3 -2
- package/dist/server/utils/url-security.js +24 -0
- package/package.json +61 -43
- package/server.d.ts +2 -2
- package/server.js +1 -1
- package/src/client/__tests__/CommitHistory.test.tsx +79 -0
- package/src/client/__tests__/ReviewHistory.test.tsx +126 -0
- package/src/client/__tests__/RunReviewButton.test.tsx +84 -0
- package/src/client/__tests__/workflowRoutes.test.ts +65 -0
- package/src/client/ai-context.tsx +114 -114
- package/src/client/components/AIEmployeeSelect.tsx +63 -63
- package/src/client/components/CommitHistory.tsx +429 -374
- package/src/client/components/FileExplorer.tsx +386 -386
- package/src/client/components/GitAccounts.tsx +179 -179
- package/src/client/components/GitManagerSettings.tsx +160 -160
- package/src/client/components/GitOperations.tsx +220 -220
- package/src/client/components/LLMModelSelect.tsx +63 -63
- package/src/client/components/LLMServiceSelect.tsx +58 -58
- package/src/client/components/MarkdownView.tsx +80 -80
- package/src/client/components/MergeRequests.tsx +790 -790
- package/src/client/components/PollingStatus.tsx +225 -225
- package/src/client/components/RepositoryConfig.tsx +335 -335
- package/src/client/components/RepositoryPermissions.tsx +123 -123
- package/src/client/components/ReviewFlows.tsx +352 -303
- package/src/client/components/ReviewHistory.tsx +796 -566
- package/src/client/components/RunReviewButton.tsx +57 -173
- package/src/client/context/GitManagerContext.tsx +92 -92
- package/src/client/index.tsx +91 -82
- package/src/client/locale.ts +9 -9
- package/src/client/promptTemplates.ts +31 -31
- package/src/client/workflowRoutes.ts +42 -0
- package/src/client-v2/ai-context.tsx +99 -0
- package/src/client-v2/components/SubtreeSplits.tsx +547 -547
- package/src/client-v2/index.tsx +1 -1
- package/src/client-v2/locale.ts +8 -8
- package/src/client-v2/plugin.tsx +67 -39
- package/src/index.ts +2 -2
- package/src/locale/en-US.json +396 -297
- package/src/locale/vi-VN.json +384 -292
- package/src/locale/zh-CN.json +150 -51
- package/src/server/__tests__/git-actions.test.ts +24 -24
- package/src/server/__tests__/git-security.test.ts +170 -0
- package/src/server/__tests__/plugin-url-security.test.ts +17 -17
- package/src/server/__tests__/poller-lifecycle.test.ts +71 -0
- package/src/server/__tests__/poller.test.ts +37 -37
- package/src/server/__tests__/repository-access.test.ts +760 -752
- package/src/server/__tests__/review-service.integration.test.ts +1263 -0
- package/src/server/__tests__/review.test.ts +76 -137
- package/src/server/__tests__/role-permissions.test.ts +147 -147
- package/src/server/__tests__/smoke.test.ts +139 -17
- package/src/server/__tests__/subtree.test.ts +85 -85
- package/src/server/actions/git-actions.ts +540 -480
- package/src/server/actions/gitlab-api.ts +422 -411
- package/src/server/actions/poller.ts +39 -27
- package/src/server/actions/review-cutover.ts +121 -0
- package/src/server/actions/review.ts +1498 -1369
- package/src/server/actions/role-permissions.ts +331 -321
- package/src/server/actions/subtree.ts +508 -508
- package/src/server/ai-tools.ts +334 -319
- package/src/server/collections/gitAccounts.ts +56 -56
- package/src/server/collections/gitCodeReviews.ts +218 -199
- package/src/server/collections/gitRepositories.ts +87 -87
- package/src/server/collections/gitReviewCutover.ts +23 -0
- package/src/server/collections/gitReviewFlows.ts +120 -108
- package/src/server/collections/gitReviewInbox.ts +30 -0
- package/src/server/collections/gitReviewProjects.ts +22 -0
- package/src/server/collections/gitReviewRequests.ts +35 -0
- package/src/server/collections/gitSubtreeConfigs.ts +38 -38
- package/src/server/collections/gitSubtreeRuns.ts +30 -30
- package/src/server/index.ts +14 -2
- package/src/server/migrations/20260508000000-add-auto-review-flow-id.ts +29 -29
- package/src/server/migrations/20260712000000-add-git-accounts.ts +198 -198
- package/src/server/migrations/20260730000000-migrate-legacy-repository-permissions.ts +81 -81
- package/src/server/plugin.ts +409 -361
- package/src/server/poller.ts +365 -352
- package/src/server/repository-access.ts +803 -773
- package/src/server/request-method-policy.ts +56 -0
- package/src/server/review-control-access.ts +71 -0
- package/src/server/services/__tests__/registry-content-service.test.ts +359 -345
- package/src/server/services/__tests__/review-source.test.ts +226 -0
- package/src/server/services/legacy-post-service.ts +550 -0
- package/src/server/services/registry-content-service.ts +495 -484
- package/src/server/services/review-service.ts +1899 -0
- package/src/server/services/review-source.ts +359 -0
- package/src/server/utils/__tests__/redact.test.ts +56 -56
- package/src/server/utils/__tests__/url-security.test.ts +85 -85
- package/src/server/utils/get-repo-account.ts +51 -41
- package/src/server/utils/gitlab-url.ts +38 -38
- package/src/server/utils/redact.ts +87 -87
- package/src/server/utils/url-security.ts +128 -95
- package/dist/client/900.acf7d1fa22f95e71.js +0 -10
- package/dist/client-v2/434.7a27051db18526c0.js +0 -10
- package/dist/client-v2/900.f32b9dc85249fc0a.js +0 -10
|
@@ -34,7 +34,11 @@ __export(review_exports, {
|
|
|
34
34
|
resolveBackgroundReviewRoles: () => resolveBackgroundReviewRoles,
|
|
35
35
|
resolveImmutableReviewActorId: () => resolveImmutableReviewActorId,
|
|
36
36
|
reviewApprovePost: () => reviewApprovePost,
|
|
37
|
+
reviewLegacyPostStatus: () => reviewLegacyPostStatus,
|
|
38
|
+
reviewLegacyReleaseHold: () => reviewLegacyReleaseHold,
|
|
39
|
+
reviewLegacyRetryPost: () => reviewLegacyRetryPost,
|
|
37
40
|
reviewReject: () => reviewReject,
|
|
41
|
+
reviewWorkflowRetryPost: () => reviewWorkflowRetryPost,
|
|
38
42
|
triggerReview: () => triggerReview,
|
|
39
43
|
triggerReviewInternal: () => triggerReviewInternal,
|
|
40
44
|
unregisterReviewQueue: () => unregisterReviewQueue
|
|
@@ -80,12 +84,14 @@ async function withTriggerLock(app, key, fn) {
|
|
|
80
84
|
return app.lockManager.runExclusive(lockKey, fn, TRIGGER_LOCK_TTL_MS);
|
|
81
85
|
}
|
|
82
86
|
async function triggerReview(ctx, next) {
|
|
83
|
-
var _a, _b;
|
|
87
|
+
var _a, _b, _c;
|
|
84
88
|
const params = (0, import_repository_access.getEffectiveActionParams)(ctx);
|
|
85
89
|
const { flowId, repositoryId, targetType, mrIid, commitSha, branch, folderPath, extraInstructions } = params;
|
|
86
90
|
if (!repositoryId) ctx.throw(400, "repositoryId is required");
|
|
87
91
|
if (!targetType) ctx.throw(400, "targetType is required");
|
|
88
|
-
if (
|
|
92
|
+
if (targetType !== "mr" && targetType !== "commit" && targetType !== "branch" && targetType !== "folder") {
|
|
93
|
+
ctx.throw(400, "invalid targetType");
|
|
94
|
+
}
|
|
89
95
|
if (targetType === "mr" && !mrIid) ctx.throw(400, "mrIid is required for MR review");
|
|
90
96
|
if (targetType === "commit" && !commitSha) ctx.throw(400, "commitSha is required for commit review");
|
|
91
97
|
if (targetType === "branch" && !branch) ctx.throw(400, "branch is required for branch review");
|
|
@@ -96,25 +102,33 @@ async function triggerReview(ctx, next) {
|
|
|
96
102
|
const userId = (_b = (_a = ctx.state) == null ? void 0 : _a.currentUser) == null ? void 0 : _b.id;
|
|
97
103
|
try {
|
|
98
104
|
const reviewId = await triggerReviewInternal(ctx.app, {
|
|
99
|
-
flowId,
|
|
105
|
+
flowId: flowId != null ? Number(flowId) : null,
|
|
100
106
|
repositoryId: Number(repositoryId),
|
|
101
107
|
targetType,
|
|
102
108
|
mrIid: mrIid != null ? Number(mrIid) : null,
|
|
103
|
-
commitSha: commitSha
|
|
104
|
-
branch: branch
|
|
105
|
-
folderPath: targetType === "folder" ? folderPath : null,
|
|
106
|
-
extraInstructions,
|
|
109
|
+
commitSha: typeof commitSha === "string" ? commitSha : null,
|
|
110
|
+
branch: typeof branch === "string" ? branch : null,
|
|
111
|
+
folderPath: targetType === "folder" && typeof folderPath === "string" ? folderPath : null,
|
|
112
|
+
extraInstructions: typeof extraInstructions === "string" ? extraInstructions : void 0,
|
|
107
113
|
triggeredBy: "manual",
|
|
108
|
-
userId
|
|
114
|
+
userId,
|
|
115
|
+
actorRoles: Array.isArray((_c = ctx.state) == null ? void 0 : _c.currentRoles) ? ctx.state.currentRoles.filter((role) => typeof role === "string") : []
|
|
109
116
|
});
|
|
110
117
|
ctx.body = { success: true, data: { reviewId } };
|
|
111
118
|
} catch (err) {
|
|
112
|
-
|
|
119
|
+
const errorMessage = err.message || "Failed to trigger review";
|
|
120
|
+
const providerError = /^Git provider request failed \((\d+)\)$/.exec(errorMessage);
|
|
121
|
+
ctx.throw(
|
|
122
|
+
err.status || 400,
|
|
123
|
+
providerError ? ctx.t("Git provider request failed ({{status}})", { ns: "plugin-git-manager", status: providerError[1] }) : ctx.t(errorMessage, { ns: "plugin-git-manager" })
|
|
124
|
+
);
|
|
113
125
|
}
|
|
114
126
|
await next();
|
|
115
127
|
}
|
|
116
128
|
async function triggerReviewInternal(app, args) {
|
|
117
|
-
|
|
129
|
+
const plugin = app.pm.get("plugin-git-manager") || app.pm.get("git-manager");
|
|
130
|
+
if (!(plugin == null ? void 0 : plugin.reviewService)) throw new Error("Git review workflow service is unavailable");
|
|
131
|
+
return plugin.reviewService.enqueue(args);
|
|
118
132
|
}
|
|
119
133
|
async function triggerReviewInternalLocked(app, args) {
|
|
120
134
|
const db = app.db;
|
|
@@ -530,7 +544,7 @@ async function failQueuedReview(app, reviewId, err) {
|
|
|
530
544
|
}
|
|
531
545
|
async function processQueuedReview(app, message) {
|
|
532
546
|
await withReviewProcessLock(app, message.reviewId, async () => {
|
|
533
|
-
var _a, _b, _c, _d, _e, _f;
|
|
547
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
534
548
|
const db = app.db;
|
|
535
549
|
const reviewsRepo = db.getRepository("gitCodeReviews");
|
|
536
550
|
const review = await reviewsRepo.findOne({ filterByTk: message.reviewId });
|
|
@@ -538,8 +552,8 @@ async function processQueuedReview(app, message) {
|
|
|
538
552
|
(_b = (_a = app.log) == null ? void 0 : _a.warn) == null ? void 0 : _b.call(_a, `git review queue: review ${message.reviewId} not found, skipping`);
|
|
539
553
|
return;
|
|
540
554
|
}
|
|
541
|
-
if (review.get("status") !== "pending") {
|
|
542
|
-
(
|
|
555
|
+
if (review.get("status") !== "pending" || ((_c = review.get("metadata")) == null ? void 0 : _c.workflowManaged)) {
|
|
556
|
+
(_e = (_d = app.log) == null ? void 0 : _d.info) == null ? void 0 : _e.call(_d, `git review queue: review ${message.reviewId} is ${review.get("status")}, skipping`);
|
|
543
557
|
return;
|
|
544
558
|
}
|
|
545
559
|
const metadata = getQueuedReviewMetadata(review);
|
|
@@ -580,64 +594,141 @@ async function processQueuedReview(app, message) {
|
|
|
580
594
|
userId: actorUserId
|
|
581
595
|
});
|
|
582
596
|
} catch (err) {
|
|
583
|
-
(
|
|
597
|
+
(_g = (_f = app.log) == null ? void 0 : _f.error) == null ? void 0 : _g.call(_f, "git review queue: failed before review execution", {
|
|
598
|
+
error: (0, import_redact.redactPat)(err instanceof Error ? err.message : String(err))
|
|
599
|
+
});
|
|
584
600
|
await failQueuedReview(app, message.reviewId, err);
|
|
585
601
|
}
|
|
586
602
|
});
|
|
587
603
|
}
|
|
604
|
+
function legacyPostContext(ctx) {
|
|
605
|
+
var _a, _b, _c;
|
|
606
|
+
const actor = (_b = (_a = ctx.state) == null ? void 0 : _a.currentUser) == null ? void 0 : _b.id;
|
|
607
|
+
const roles = (_c = ctx.state) == null ? void 0 : _c.currentRoles;
|
|
608
|
+
if (typeof actor !== "string" && typeof actor !== "number" || !Array.isArray(roles) || !roles.every((role) => typeof role === "string")) {
|
|
609
|
+
ctx.throw(403, "Permission denied");
|
|
610
|
+
}
|
|
611
|
+
const plugin = ctx.app.pm.get("plugin-git-manager") || ctx.app.pm.get("git-manager");
|
|
612
|
+
if (!(plugin == null ? void 0 : plugin.legacyPostService)) ctx.throw(503, "Git review workflow service is unavailable");
|
|
613
|
+
return { service: plugin.legacyPostService, actor, roles };
|
|
614
|
+
}
|
|
615
|
+
async function legacyPostAction(ctx, run) {
|
|
616
|
+
try {
|
|
617
|
+
ctx.body = { success: true, data: await run() };
|
|
618
|
+
} catch (error) {
|
|
619
|
+
const status = error && typeof error === "object" && "status" in error && typeof error.status === "number" ? error.status : 400;
|
|
620
|
+
ctx.throw(
|
|
621
|
+
status,
|
|
622
|
+
ctx.t(error instanceof Error ? error.message : "Failed to reconcile review publication", {
|
|
623
|
+
ns: "plugin-git-manager"
|
|
624
|
+
})
|
|
625
|
+
);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
588
628
|
async function reviewApprovePost(ctx, next) {
|
|
589
|
-
|
|
629
|
+
const { reviewId, editedMarkdown, baseConfirmation } = (0, import_repository_access.getEffectiveActionParams)(ctx);
|
|
630
|
+
if (typeof reviewId !== "string" && typeof reviewId !== "number") ctx.throw(400, "reviewId is required");
|
|
631
|
+
const { service, actor, roles } = legacyPostContext(ctx);
|
|
632
|
+
await legacyPostAction(ctx, () => service.approve(reviewId, actor, roles, editedMarkdown, baseConfirmation));
|
|
633
|
+
await next();
|
|
634
|
+
}
|
|
635
|
+
async function reviewLegacyPostStatus(ctx, next) {
|
|
636
|
+
const { reviewId } = (0, import_repository_access.getEffectiveActionParams)(ctx);
|
|
637
|
+
if (typeof reviewId !== "string" && typeof reviewId !== "number") ctx.throw(400, "reviewId is required");
|
|
638
|
+
const { service, actor, roles } = legacyPostContext(ctx);
|
|
639
|
+
await legacyPostAction(ctx, () => service.status(reviewId, actor, roles));
|
|
640
|
+
await next();
|
|
641
|
+
}
|
|
642
|
+
async function reviewLegacyRetryPost(ctx, next) {
|
|
590
643
|
const params = (0, import_repository_access.getEffectiveActionParams)(ctx);
|
|
591
|
-
const { reviewId,
|
|
592
|
-
if (
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
if (
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
644
|
+
const { reviewId, confirmation, expectedAttempt, baseConfirmation } = params;
|
|
645
|
+
if (typeof reviewId !== "string" && typeof reviewId !== "number") ctx.throw(400, "reviewId is required");
|
|
646
|
+
if (Object.prototype.hasOwnProperty.call(params, "editedMarkdown")) {
|
|
647
|
+
ctx.throw(400, ctx.t("Review content cannot change while publication is unresolved", { ns: "plugin-git-manager" }));
|
|
648
|
+
}
|
|
649
|
+
if (confirmation !== "OUTBOUND_POST_STOPPED")
|
|
650
|
+
ctx.throw(400, ctx.t("Outbound post stop confirmation is required", { ns: "plugin-git-manager" }));
|
|
651
|
+
if (!Object.prototype.hasOwnProperty.call(params, "expectedAttempt") || expectedAttempt !== null && typeof expectedAttempt !== "string") {
|
|
652
|
+
ctx.throw(400, ctx.t("Refresh publication status before recovery", { ns: "plugin-git-manager" }));
|
|
653
|
+
}
|
|
654
|
+
const { service, actor, roles } = legacyPostContext(ctx);
|
|
655
|
+
await legacyPostAction(ctx, () => service.retry(reviewId, actor, roles, expectedAttempt, baseConfirmation));
|
|
656
|
+
await next();
|
|
657
|
+
}
|
|
658
|
+
async function reviewLegacyReleaseHold(ctx, next) {
|
|
659
|
+
const params = (0, import_repository_access.getEffectiveActionParams)(ctx);
|
|
660
|
+
const { reviewId, confirmation, expectedAttempt } = params;
|
|
661
|
+
if (typeof reviewId !== "string" && typeof reviewId !== "number") ctx.throw(400, "reviewId is required");
|
|
662
|
+
if (confirmation !== "OUTBOUND_POST_STOPPED")
|
|
663
|
+
ctx.throw(400, ctx.t("Outbound post stop confirmation is required", { ns: "plugin-git-manager" }));
|
|
664
|
+
if (!Object.prototype.hasOwnProperty.call(params, "expectedAttempt") || expectedAttempt !== null && typeof expectedAttempt !== "string") {
|
|
665
|
+
ctx.throw(400, ctx.t("Refresh publication status before recovery", { ns: "plugin-git-manager" }));
|
|
666
|
+
}
|
|
667
|
+
const { service, actor, roles } = legacyPostContext(ctx);
|
|
668
|
+
await legacyPostAction(ctx, async () => {
|
|
669
|
+
await service.releaseHold(reviewId, actor, roles, expectedAttempt);
|
|
670
|
+
return { reviewId };
|
|
616
671
|
});
|
|
617
|
-
ctx.body = { success: true, data: { reviewId, postedNoteId: noteId } };
|
|
618
672
|
await next();
|
|
619
673
|
}
|
|
620
674
|
async function reviewReject(ctx, next) {
|
|
621
|
-
var _a, _b;
|
|
675
|
+
var _a, _b, _c;
|
|
622
676
|
const params = (0, import_repository_access.getEffectiveActionParams)(ctx);
|
|
623
677
|
const { reviewId, reason } = params;
|
|
624
|
-
if (!reviewId
|
|
678
|
+
if (!reviewId || typeof reviewId !== "string" && typeof reviewId !== "number") {
|
|
679
|
+
ctx.throw(400, "reviewId is required");
|
|
680
|
+
}
|
|
625
681
|
const reviewsRepo = ctx.db.getRepository("gitCodeReviews");
|
|
626
682
|
const review = await reviewsRepo.findOne({ filterByTk: reviewId });
|
|
627
683
|
if (!review) ctx.throw(404, "Review not found");
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
684
|
+
if (((_a = review.get("metadata")) == null ? void 0 : _a.workflowManaged) || await ctx.db.getRepository("gitReviewInbox").findOne({ filter: { reviewId } })) {
|
|
685
|
+
ctx.throw(409, ctx.t("Use the workflow approval task for this review", { ns: "plugin-git-manager" }));
|
|
686
|
+
}
|
|
687
|
+
const userId = (_c = (_b = ctx.state) == null ? void 0 : _b.currentUser) == null ? void 0 : _c.id;
|
|
688
|
+
const [changed] = await ctx.db.getCollection("gitCodeReviews").model.update(
|
|
689
|
+
{
|
|
632
690
|
postStatus: "rejected",
|
|
633
691
|
approvedBy: userId ? String(userId) : null,
|
|
634
692
|
approvedAt: /* @__PURE__ */ new Date(),
|
|
635
693
|
error: reason ? `Rejected: ${reason}` : "Rejected"
|
|
636
|
-
}
|
|
637
|
-
|
|
694
|
+
},
|
|
695
|
+
{ where: { id: reviewId, status: "completed", targetType: "mr", postStatus: "pending_approval" } }
|
|
696
|
+
);
|
|
697
|
+
if (changed !== 1) ctx.throw(409, "Review is not awaiting approval");
|
|
638
698
|
ctx.body = { success: true, data: { reviewId } };
|
|
639
699
|
await next();
|
|
640
700
|
}
|
|
701
|
+
async function reviewWorkflowRetryPost(ctx, next) {
|
|
702
|
+
var _a, _b, _c;
|
|
703
|
+
const { reviewId, confirmation } = (0, import_repository_access.getEffectiveActionParams)(ctx);
|
|
704
|
+
if (typeof reviewId !== "string" && typeof reviewId !== "number") ctx.throw(400, "reviewId is required");
|
|
705
|
+
if (confirmation != null && confirmation !== "OUTBOUND_POST_STOPPED")
|
|
706
|
+
ctx.throw(400, ctx.t("Invalid publication confirmation", { ns: "plugin-git-manager" }));
|
|
707
|
+
const actor = (_b = (_a = ctx.state) == null ? void 0 : _a.currentUser) == null ? void 0 : _b.id;
|
|
708
|
+
const roles = (_c = ctx.state) == null ? void 0 : _c.currentRoles;
|
|
709
|
+
if (!actor || !Array.isArray(roles) || !roles.every((role) => typeof role === "string"))
|
|
710
|
+
ctx.throw(403, "Permission denied");
|
|
711
|
+
const plugin = ctx.app.pm.get("plugin-git-manager") || ctx.app.pm.get("git-manager");
|
|
712
|
+
if (!(plugin == null ? void 0 : plugin.reviewService)) ctx.throw(503, "Git review workflow service is unavailable");
|
|
713
|
+
try {
|
|
714
|
+
const result = await plugin.reviewService.retryPost(
|
|
715
|
+
reviewId,
|
|
716
|
+
actor,
|
|
717
|
+
roles,
|
|
718
|
+
confirmation === "OUTBOUND_POST_STOPPED"
|
|
719
|
+
);
|
|
720
|
+
ctx.body = { success: true, data: result };
|
|
721
|
+
} catch (error) {
|
|
722
|
+
const status = error && typeof error === "object" && "status" in error && typeof error.status === "number" ? error.status : 400;
|
|
723
|
+
ctx.throw(
|
|
724
|
+
status,
|
|
725
|
+
ctx.t(error instanceof Error ? error.message : "Failed to reconcile review publication", {
|
|
726
|
+
ns: "plugin-git-manager"
|
|
727
|
+
})
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
await next();
|
|
731
|
+
}
|
|
641
732
|
async function runReview(app, args) {
|
|
642
733
|
var _a, _b, _c, _d, _e, _f;
|
|
643
734
|
const db = app.db;
|
|
@@ -961,11 +1052,12 @@ async function fetchMrHeadSha(db, repo, mrIid) {
|
|
|
961
1052
|
const pat = (account == null ? void 0 : account.pat) || "";
|
|
962
1053
|
if (!pat) return null;
|
|
963
1054
|
const repoUrl = repo.get("repoUrl");
|
|
964
|
-
const isGitHub = (account == null ? void 0 : account.provider) === "github" || repoUrl.
|
|
1055
|
+
const isGitHub = (account == null ? void 0 : account.provider) === "github" || new URL(repoUrl).hostname === "github.com";
|
|
965
1056
|
try {
|
|
966
1057
|
if (isGitHub) {
|
|
967
1058
|
const { projectPath } = (0, import_gitlab_url.parseGitLabProject)(repoUrl);
|
|
968
1059
|
const response = await fetch(`https://api.github.com/repos/${projectPath}/pulls/${mrIid}`, {
|
|
1060
|
+
redirect: "error",
|
|
969
1061
|
headers: { Authorization: `Bearer ${pat}`, Accept: "application/vnd.github.v3+json" }
|
|
970
1062
|
});
|
|
971
1063
|
if (!response.ok) return null;
|
|
@@ -974,6 +1066,7 @@ async function fetchMrHeadSha(db, repo, mrIid) {
|
|
|
974
1066
|
} else {
|
|
975
1067
|
const { apiBase, encodedProject } = (0, import_gitlab_url.parseGitLabProject)(repoUrl);
|
|
976
1068
|
const response = await fetch(`${apiBase}/projects/${encodedProject}/merge_requests/${mrIid}`, {
|
|
1069
|
+
redirect: "error",
|
|
977
1070
|
headers: { "PRIVATE-TOKEN": pat, Accept: "application/json" }
|
|
978
1071
|
});
|
|
979
1072
|
if (!response.ok) return null;
|
|
@@ -988,11 +1081,12 @@ async function postNoteToGitLab(db, repo, mrIid, body) {
|
|
|
988
1081
|
const account = await (0, import_get_repo_account.getRepoAccount)(db, repo);
|
|
989
1082
|
const pat = (account == null ? void 0 : account.pat) || "";
|
|
990
1083
|
const repoUrl = repo.get("repoUrl");
|
|
991
|
-
const isGitHub = (account == null ? void 0 : account.provider) === "github" || repoUrl.
|
|
1084
|
+
const isGitHub = (account == null ? void 0 : account.provider) === "github" || new URL(repoUrl).hostname === "github.com";
|
|
992
1085
|
if (isGitHub) {
|
|
993
1086
|
if (!pat) throw new Error("Repository has no PAT configured");
|
|
994
1087
|
const { projectPath } = (0, import_gitlab_url.parseGitLabProject)(repoUrl);
|
|
995
1088
|
const response = await fetch(`https://api.github.com/repos/${projectPath}/issues/${mrIid}/comments`, {
|
|
1089
|
+
redirect: "error",
|
|
996
1090
|
method: "POST",
|
|
997
1091
|
headers: {
|
|
998
1092
|
Authorization: `Bearer ${pat}`,
|
|
@@ -1011,6 +1105,7 @@ async function postNoteToGitLab(db, repo, mrIid, body) {
|
|
|
1011
1105
|
if (!pat) throw new Error("Repository has no PAT configured");
|
|
1012
1106
|
const { apiBase, encodedProject } = (0, import_gitlab_url.parseGitLabProject)(repoUrl);
|
|
1013
1107
|
const response = await fetch(`${apiBase}/projects/${encodedProject}/merge_requests/${mrIid}/notes`, {
|
|
1108
|
+
redirect: "error",
|
|
1014
1109
|
method: "POST",
|
|
1015
1110
|
headers: {
|
|
1016
1111
|
"PRIVATE-TOKEN": pat,
|
|
@@ -1127,7 +1222,11 @@ async function recoverStuckReviews(app) {
|
|
|
1127
1222
|
resolveBackgroundReviewRoles,
|
|
1128
1223
|
resolveImmutableReviewActorId,
|
|
1129
1224
|
reviewApprovePost,
|
|
1225
|
+
reviewLegacyPostStatus,
|
|
1226
|
+
reviewLegacyReleaseHold,
|
|
1227
|
+
reviewLegacyRetryPost,
|
|
1130
1228
|
reviewReject,
|
|
1229
|
+
reviewWorkflowRetryPost,
|
|
1131
1230
|
triggerReview,
|
|
1132
1231
|
triggerReviewInternal,
|
|
1133
1232
|
unregisterReviewQueue
|
package/dist/server/ai-tools.js
CHANGED
|
@@ -42,6 +42,7 @@ module.exports = __toCommonJS(ai_tools_exports);
|
|
|
42
42
|
var import_zod = require("zod");
|
|
43
43
|
var gitlabApi = __toESM(require("./actions/gitlab-api"));
|
|
44
44
|
var gitActions = __toESM(require("./actions/git-actions"));
|
|
45
|
+
var import_repository_access = require("./repository-access");
|
|
45
46
|
function registerGitReviewAiTools(app) {
|
|
46
47
|
var _a, _b, _c, _d, _e;
|
|
47
48
|
const aiManager = app.aiManager;
|
|
@@ -49,10 +50,10 @@ function registerGitReviewAiTools(app) {
|
|
|
49
50
|
(_c = (_b = app.log) == null ? void 0 : _b.warn) == null ? void 0 : _c.call(_b, "plugin-git-manager: AIManager.toolsManager not available; skipping AI tool registration");
|
|
50
51
|
return;
|
|
51
52
|
}
|
|
52
|
-
const enforceAcl = (ctx, resource, action, params) => {
|
|
53
|
+
const enforceAcl = async (ctx, resource, action, params) => {
|
|
53
54
|
var _a2, _b2, _c2, _d2;
|
|
54
55
|
if (ctx.isBackgroundReview) {
|
|
55
|
-
if (params.repositoryId
|
|
56
|
+
if (String(params.repositoryId) !== String(ctx.reviewTargetRepositoryId)) {
|
|
56
57
|
const err = new Error("Permission denied: AI cannot access other repositories");
|
|
57
58
|
err.status = 403;
|
|
58
59
|
throw err;
|
|
@@ -66,14 +67,13 @@ function registerGitReviewAiTools(app) {
|
|
|
66
67
|
throw err;
|
|
67
68
|
}
|
|
68
69
|
const acl = (_b2 = ctx.app) == null ? void 0 : _b2.acl;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (!role) {
|
|
70
|
+
const roles = Array.isArray((_c2 = ctx == null ? void 0 : ctx.state) == null ? void 0 : _c2.currentRoles) ? ctx.state.currentRoles.filter((role) => typeof role === "string") : typeof ((_d2 = ctx == null ? void 0 : ctx.state) == null ? void 0 : _d2.currentRole) === "string" ? [ctx.state.currentRole] : [];
|
|
71
|
+
if (!roles.length || !(acl == null ? void 0 : acl.can)) {
|
|
72
72
|
const err = new Error("AI tool requires a resolvable role on the current user");
|
|
73
73
|
err.status = 403;
|
|
74
74
|
throw err;
|
|
75
75
|
}
|
|
76
|
-
const allowed =
|
|
76
|
+
const allowed = resource === "gitManager" && await (0, import_repository_access.hasRepositoryAccess)({ acl, roles, repositoryId: params.repositoryId, action });
|
|
77
77
|
if (!allowed) {
|
|
78
78
|
const err = new Error(`Permission denied: ${resource}:${action}`);
|
|
79
79
|
err.status = 403;
|
|
@@ -97,14 +97,13 @@ function registerGitReviewAiTools(app) {
|
|
|
97
97
|
return obj;
|
|
98
98
|
};
|
|
99
99
|
const runResourceAction = async (ctx, handler, params, gate) => {
|
|
100
|
-
|
|
101
|
-
enforceAcl(ctx, gate.resource, gate.action, params);
|
|
100
|
+
await enforceAcl(ctx, gate.resource, gate.action, params);
|
|
102
101
|
const synthCtx = {
|
|
103
102
|
...ctx,
|
|
104
103
|
app: ctx.app,
|
|
105
104
|
db: ctx.db,
|
|
106
105
|
action: { params },
|
|
107
|
-
request: { ...ctx.request || {}, body:
|
|
106
|
+
request: { ...ctx.request || {}, body: {} },
|
|
108
107
|
throw: (status, message) => {
|
|
109
108
|
const err = new Error(message);
|
|
110
109
|
err.status = status;
|
|
@@ -133,6 +133,7 @@ var gitCodeReviews_default = (0, import_database.defineCollection)({
|
|
|
133
133
|
"x-component": "Select",
|
|
134
134
|
enum: [
|
|
135
135
|
{ value: "pending", label: "Pending" },
|
|
136
|
+
{ value: "queued", label: "Queued" },
|
|
136
137
|
{ value: "running", label: "Running" },
|
|
137
138
|
{ value: "completed", label: "Completed" },
|
|
138
139
|
{ value: "failed", label: "Failed" }
|
|
@@ -184,6 +185,15 @@ var gitCodeReviews_default = (0, import_database.defineCollection)({
|
|
|
184
185
|
name: "postedNoteId",
|
|
185
186
|
interface: "input"
|
|
186
187
|
},
|
|
188
|
+
{ type: "string", name: "legacyPostFingerprint" },
|
|
189
|
+
{ type: "string", name: "legacyPostClaim" },
|
|
190
|
+
{ type: "string", name: "legacyPostProjectKey" },
|
|
191
|
+
{ type: "json", name: "legacyPostSource" },
|
|
192
|
+
{ type: "string", name: "legacyBaseProvenance" },
|
|
193
|
+
{ type: "string", name: "legacyBaseAcknowledgedBy" },
|
|
194
|
+
{ type: "date", name: "legacyBaseAcknowledgedAt" },
|
|
195
|
+
{ type: "string", name: "legacyHoldReleasedBy" },
|
|
196
|
+
{ type: "date", name: "legacyHoldReleasedAt" },
|
|
187
197
|
{
|
|
188
198
|
type: "string",
|
|
189
199
|
name: "approvedBy",
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var gitReviewCutover_exports = {};
|
|
28
|
+
__export(gitReviewCutover_exports, {
|
|
29
|
+
default: () => gitReviewCutover_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(gitReviewCutover_exports);
|
|
32
|
+
var import_database = require("@nocobase/database");
|
|
33
|
+
var gitReviewCutover_default = (0, import_database.defineCollection)({
|
|
34
|
+
name: "gitReviewCutover",
|
|
35
|
+
autoGenId: true,
|
|
36
|
+
createdAt: true,
|
|
37
|
+
updatedAt: true,
|
|
38
|
+
fields: [
|
|
39
|
+
{ name: "key", type: "string", unique: true, allowNull: false },
|
|
40
|
+
{ name: "state", type: "string", allowNull: false },
|
|
41
|
+
{ name: "confirmedBy", type: "string" },
|
|
42
|
+
{ name: "confirmedAt", type: "date" }
|
|
43
|
+
]
|
|
44
|
+
});
|
|
@@ -39,6 +39,9 @@ var gitReviewFlows_default = (0, import_database.defineCollection)({
|
|
|
39
39
|
createdAt: true,
|
|
40
40
|
updatedAt: true,
|
|
41
41
|
fields: [
|
|
42
|
+
{ type: "bigInt", name: "workflowId" },
|
|
43
|
+
{ type: "string", name: "workflowKey" },
|
|
44
|
+
{ type: "boolean", name: "reviewOnNewCommits", defaultValue: false },
|
|
42
45
|
{
|
|
43
46
|
type: "string",
|
|
44
47
|
name: "name",
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var gitReviewInbox_exports = {};
|
|
28
|
+
__export(gitReviewInbox_exports, {
|
|
29
|
+
default: () => gitReviewInbox_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(gitReviewInbox_exports);
|
|
32
|
+
var import_database = require("@nocobase/database");
|
|
33
|
+
var gitReviewInbox_default = (0, import_database.defineCollection)({
|
|
34
|
+
name: "gitReviewInbox",
|
|
35
|
+
autoGenId: true,
|
|
36
|
+
createdAt: true,
|
|
37
|
+
updatedAt: true,
|
|
38
|
+
fields: [
|
|
39
|
+
{ name: "projectKey", type: "string", allowNull: false, index: true },
|
|
40
|
+
{ name: "repositoryId", type: "integer", allowNull: false },
|
|
41
|
+
{ name: "reviewId", type: "integer", allowNull: false, unique: true },
|
|
42
|
+
{ name: "legacyReviewId", type: "integer", unique: true },
|
|
43
|
+
{ name: "eventKey", type: "string", unique: true },
|
|
44
|
+
{ name: "queuedAt", type: "date", allowNull: false },
|
|
45
|
+
{ name: "recoveredBy", type: "string" },
|
|
46
|
+
{ name: "recoveredAt", type: "date" },
|
|
47
|
+
{ name: "state", type: "string", allowNull: false, defaultValue: "queued" },
|
|
48
|
+
{ name: "blockedReason", type: "string" },
|
|
49
|
+
{ name: "payload", type: "json", allowNull: false }
|
|
50
|
+
]
|
|
51
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var gitReviewProjects_exports = {};
|
|
28
|
+
__export(gitReviewProjects_exports, {
|
|
29
|
+
default: () => gitReviewProjects_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(gitReviewProjects_exports);
|
|
32
|
+
var import_database = require("@nocobase/database");
|
|
33
|
+
var gitReviewProjects_default = (0, import_database.defineCollection)({
|
|
34
|
+
name: "gitReviewProjects",
|
|
35
|
+
autoGenId: true,
|
|
36
|
+
createdAt: true,
|
|
37
|
+
updatedAt: true,
|
|
38
|
+
fields: [
|
|
39
|
+
{ name: "projectKey", type: "string", unique: true, allowNull: false },
|
|
40
|
+
{ name: "activeInboxId", type: "integer" },
|
|
41
|
+
{ name: "legacyPostReviewId", type: "integer" }
|
|
42
|
+
]
|
|
43
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var gitReviewRequests_exports = {};
|
|
28
|
+
__export(gitReviewRequests_exports, {
|
|
29
|
+
default: () => gitReviewRequests_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(gitReviewRequests_exports);
|
|
32
|
+
var import_database = require("@nocobase/database");
|
|
33
|
+
var gitReviewRequests_default = (0, import_database.defineCollection)({
|
|
34
|
+
name: "gitReviewRequests",
|
|
35
|
+
autoGenId: true,
|
|
36
|
+
createdAt: true,
|
|
37
|
+
updatedAt: true,
|
|
38
|
+
fields: [
|
|
39
|
+
{ name: "inboxId", type: "integer", allowNull: false, unique: true },
|
|
40
|
+
{ name: "reviewId", type: "integer", allowNull: false },
|
|
41
|
+
{ name: "repositoryId", type: "integer", allowNull: false },
|
|
42
|
+
{ name: "flowId", type: "integer", allowNull: false },
|
|
43
|
+
{ name: "workflowId", type: "bigInt", allowNull: false },
|
|
44
|
+
{ name: "workflowKey", type: "string" },
|
|
45
|
+
{ name: "eventType", type: "string", allowNull: false },
|
|
46
|
+
{ name: "executionId", type: "bigInt", unique: true },
|
|
47
|
+
{ name: "fenced", type: "boolean", allowNull: false, defaultValue: false },
|
|
48
|
+
{ name: "llmClaims", type: "json" },
|
|
49
|
+
{ name: "resultFingerprint", type: "string" },
|
|
50
|
+
{ name: "postClaim", type: "string" },
|
|
51
|
+
{ name: "postClaimedAt", type: "date" },
|
|
52
|
+
{ name: "postResetBy", type: "string" },
|
|
53
|
+
{ name: "postResetAt", type: "date" },
|
|
54
|
+
{ name: "aiSettled", type: "boolean", allowNull: false, defaultValue: false }
|
|
55
|
+
]
|
|
56
|
+
});
|
package/dist/server/index.js
CHANGED
|
@@ -36,13 +36,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
37
|
var server_exports = {};
|
|
38
38
|
__export(server_exports, {
|
|
39
|
+
GitReviewService: () => import_review_service.GitReviewService,
|
|
39
40
|
PluginGitManagerServer: () => import_plugin2.PluginGitManagerServer,
|
|
40
|
-
default: () => import_plugin.default
|
|
41
|
+
default: () => import_plugin.default,
|
|
42
|
+
hasRepositoryAccess: () => import_repository_access.hasRepositoryAccess
|
|
41
43
|
});
|
|
42
44
|
module.exports = __toCommonJS(server_exports);
|
|
43
45
|
var import_plugin = __toESM(require("./plugin"));
|
|
44
46
|
var import_plugin2 = require("./plugin");
|
|
47
|
+
var import_review_service = require("./services/review-service");
|
|
48
|
+
var import_repository_access = require("./repository-access");
|
|
45
49
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
50
|
0 && (module.exports = {
|
|
47
|
-
|
|
51
|
+
GitReviewService,
|
|
52
|
+
PluginGitManagerServer,
|
|
53
|
+
hasRepositoryAccess
|
|
48
54
|
});
|