@knpkv/codecommit-core 0.2.0 → 0.4.0
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 +66 -0
- package/dist/AwsClient/createPullRequest.d.ts +1 -6
- package/dist/AwsClient/createPullRequest.d.ts.map +1 -1
- package/dist/AwsClient/createPullRequest.js +3 -11
- package/dist/AwsClient/createPullRequest.js.map +1 -1
- package/dist/AwsClient/getCallerIdentity.d.ts +5 -6
- package/dist/AwsClient/getCallerIdentity.d.ts.map +1 -1
- package/dist/AwsClient/getCallerIdentity.js +7 -12
- package/dist/AwsClient/getCallerIdentity.js.map +1 -1
- package/dist/AwsClient/getCommentsForPullRequest.d.ts +1 -6
- package/dist/AwsClient/getCommentsForPullRequest.d.ts.map +1 -1
- package/dist/AwsClient/getCommentsForPullRequest.js +9 -16
- package/dist/AwsClient/getCommentsForPullRequest.js.map +1 -1
- package/dist/AwsClient/getPullRequest.d.ts +2 -7
- package/dist/AwsClient/getPullRequest.d.ts.map +1 -1
- package/dist/AwsClient/getPullRequest.js +13 -26
- package/dist/AwsClient/getPullRequest.js.map +1 -1
- package/dist/AwsClient/getPullRequests.d.ts.map +1 -1
- package/dist/AwsClient/getPullRequests.js +16 -13
- package/dist/AwsClient/getPullRequests.js.map +1 -1
- package/dist/AwsClient/index.d.ts +3 -2
- package/dist/AwsClient/index.d.ts.map +1 -1
- package/dist/AwsClient/index.js.map +1 -1
- package/dist/AwsClient/internal.d.ts +47 -11
- package/dist/AwsClient/internal.d.ts.map +1 -1
- package/dist/AwsClient/internal.js +38 -9
- package/dist/AwsClient/internal.js.map +1 -1
- package/dist/AwsClient/listBranches.d.ts +1 -6
- package/dist/AwsClient/listBranches.d.ts.map +1 -1
- package/dist/AwsClient/listBranches.js +3 -11
- package/dist/AwsClient/listBranches.js.map +1 -1
- package/dist/AwsClient/updatePullRequestDescription.d.ts +1 -6
- package/dist/AwsClient/updatePullRequestDescription.d.ts.map +1 -1
- package/dist/AwsClient/updatePullRequestDescription.js +3 -11
- package/dist/AwsClient/updatePullRequestDescription.js.map +1 -1
- package/dist/AwsClient/updatePullRequestTitle.d.ts +1 -6
- package/dist/AwsClient/updatePullRequestTitle.d.ts.map +1 -1
- package/dist/AwsClient/updatePullRequestTitle.js +3 -11
- package/dist/AwsClient/updatePullRequestTitle.js.map +1 -1
- package/dist/CacheService/CacheError.d.ts +21 -0
- package/dist/CacheService/CacheError.d.ts.map +1 -0
- package/dist/CacheService/CacheError.js +17 -0
- package/dist/CacheService/CacheError.js.map +1 -0
- package/dist/CacheService/Database.d.ts +13 -0
- package/dist/CacheService/Database.d.ts.map +1 -0
- package/dist/CacheService/Database.js +34 -0
- package/dist/CacheService/Database.js.map +1 -0
- package/dist/CacheService/EventsHub.d.ts +163 -0
- package/dist/CacheService/EventsHub.d.ts.map +1 -0
- package/dist/CacheService/EventsHub.js +22 -0
- package/dist/CacheService/EventsHub.js.map +1 -0
- package/dist/CacheService/diff.d.ts +28 -0
- package/dist/CacheService/diff.d.ts.map +1 -0
- package/dist/CacheService/diff.js +102 -0
- package/dist/CacheService/diff.js.map +1 -0
- package/dist/CacheService/index.d.ts +17 -0
- package/dist/CacheService/index.d.ts.map +1 -0
- package/dist/CacheService/index.js +15 -0
- package/dist/CacheService/index.js.map +1 -0
- package/dist/CacheService/migrations/0001_initial.d.ts +5 -0
- package/dist/CacheService/migrations/0001_initial.d.ts.map +1 -0
- package/dist/CacheService/migrations/0001_initial.js +72 -0
- package/dist/CacheService/migrations/0001_initial.js.map +1 -0
- package/dist/CacheService/migrations/0002_indexes.d.ts +5 -0
- package/dist/CacheService/migrations/0002_indexes.d.ts.map +1 -0
- package/dist/CacheService/migrations/0002_indexes.js +7 -0
- package/dist/CacheService/migrations/0002_indexes.js.map +1 -0
- package/dist/CacheService/migrations/0003_add_health_score.d.ts +5 -0
- package/dist/CacheService/migrations/0003_add_health_score.d.ts.map +1 -0
- package/dist/CacheService/migrations/0003_add_health_score.js +4 -0
- package/dist/CacheService/migrations/0003_add_health_score.js.map +1 -0
- package/dist/CacheService/migrations/0004_unify_notifications.d.ts +5 -0
- package/dist/CacheService/migrations/0004_unify_notifications.d.ts.map +1 -0
- package/dist/CacheService/migrations/0004_unify_notifications.js +7 -0
- package/dist/CacheService/migrations/0004_unify_notifications.js.map +1 -0
- package/dist/CacheService/repos/CommentRepo.d.ts +16 -0
- package/dist/CacheService/repos/CommentRepo.d.ts.map +1 -0
- package/dist/CacheService/repos/CommentRepo.js +42 -0
- package/dist/CacheService/repos/CommentRepo.js.map +1 -0
- package/dist/CacheService/repos/NotificationRepo.d.ts +48 -0
- package/dist/CacheService/repos/NotificationRepo.d.ts.map +1 -0
- package/dist/CacheService/repos/NotificationRepo.js +128 -0
- package/dist/CacheService/repos/NotificationRepo.js.map +1 -0
- package/dist/CacheService/repos/PullRequestRepo.d.ts +112 -0
- package/dist/CacheService/repos/PullRequestRepo.d.ts.map +1 -0
- package/dist/CacheService/repos/PullRequestRepo.js +146 -0
- package/dist/CacheService/repos/PullRequestRepo.js.map +1 -0
- package/dist/CacheService/repos/SubscriptionRepo.d.ts +20 -0
- package/dist/CacheService/repos/SubscriptionRepo.d.ts.map +1 -0
- package/dist/CacheService/repos/SubscriptionRepo.js +49 -0
- package/dist/CacheService/repos/SubscriptionRepo.js.map +1 -0
- package/dist/CacheService/repos/SyncMetadataRepo.d.ts +14 -0
- package/dist/CacheService/repos/SyncMetadataRepo.d.ts.map +1 -0
- package/dist/CacheService/repos/SyncMetadataRepo.js +36 -0
- package/dist/CacheService/repos/SyncMetadataRepo.js.map +1 -0
- package/dist/ConfigService/backup.d.ts +9 -0
- package/dist/ConfigService/backup.d.ts.map +1 -0
- package/dist/ConfigService/backup.js +22 -0
- package/dist/ConfigService/backup.js.map +1 -0
- package/dist/ConfigService/detectProfiles.d.ts +1 -1
- package/dist/ConfigService/index.d.ts +8 -1
- package/dist/ConfigService/index.d.ts.map +1 -1
- package/dist/ConfigService/index.js +13 -2
- package/dist/ConfigService/index.js.map +1 -1
- package/dist/ConfigService/internal.d.ts +6 -0
- package/dist/ConfigService/internal.d.ts.map +1 -1
- package/dist/ConfigService/internal.js +3 -1
- package/dist/ConfigService/internal.js.map +1 -1
- package/dist/ConfigService/load.d.ts +3 -1
- package/dist/ConfigService/load.d.ts.map +1 -1
- package/dist/ConfigService/load.js +6 -4
- package/dist/ConfigService/load.js.map +1 -1
- package/dist/ConfigService/reset.d.ts +10 -0
- package/dist/ConfigService/reset.d.ts.map +1 -0
- package/dist/ConfigService/reset.js +28 -0
- package/dist/ConfigService/reset.js.map +1 -0
- package/dist/ConfigService/save.d.ts +1 -1
- package/dist/ConfigService/validate.d.ts +31 -0
- package/dist/ConfigService/validate.d.ts.map +1 -0
- package/dist/ConfigService/validate.js +33 -0
- package/dist/ConfigService/validate.js.map +1 -0
- package/dist/DateUtils.d.ts +1 -1
- package/dist/DateUtils.d.ts.map +1 -1
- package/dist/DateUtils.js +2 -2
- package/dist/DateUtils.js.map +1 -1
- package/dist/Domain.d.ts +185 -8
- package/dist/Domain.d.ts.map +1 -1
- package/dist/Domain.js +25 -6
- package/dist/Domain.js.map +1 -1
- package/dist/HealthScore.d.ts.map +1 -1
- package/dist/HealthScore.js +1 -3
- package/dist/HealthScore.js.map +1 -1
- package/dist/PRService/index.d.ts +46 -18
- package/dist/PRService/index.d.ts.map +1 -1
- package/dist/PRService/index.js +58 -27
- package/dist/PRService/index.js.map +1 -1
- package/dist/PRService/internal.d.ts +86 -1
- package/dist/PRService/internal.d.ts.map +1 -1
- package/dist/PRService/internal.js +106 -1
- package/dist/PRService/internal.js.map +1 -1
- package/dist/PRService/refresh.d.ts +10 -4
- package/dist/PRService/refresh.d.ts.map +1 -1
- package/dist/PRService/refresh.js +30 -88
- package/dist/PRService/refresh.js.map +1 -1
- package/dist/PRService/refreshEnrich.d.ts +15 -0
- package/dist/PRService/refreshEnrich.d.ts.map +1 -0
- package/dist/PRService/refreshEnrich.js +72 -0
- package/dist/PRService/refreshEnrich.js.map +1 -0
- package/dist/PRService/refreshFetch.d.ts +20 -0
- package/dist/PRService/refreshFetch.d.ts.map +1 -0
- package/dist/PRService/refreshFetch.js +78 -0
- package/dist/PRService/refreshFetch.js.map +1 -0
- package/dist/PRService/refreshResolve.d.ts +29 -0
- package/dist/PRService/refreshResolve.d.ts.map +1 -0
- package/dist/PRService/refreshResolve.js +84 -0
- package/dist/PRService/refreshResolve.js.map +1 -0
- package/dist/PRService/refreshScore.d.ts +9 -0
- package/dist/PRService/refreshScore.d.ts.map +1 -0
- package/dist/PRService/refreshScore.js +24 -0
- package/dist/PRService/refreshScore.js.map +1 -0
- package/dist/PRService/refreshSinglePR.d.ts +13 -0
- package/dist/PRService/refreshSinglePR.d.ts.map +1 -0
- package/dist/PRService/refreshSinglePR.js +102 -0
- package/dist/PRService/refreshSinglePR.js.map +1 -0
- package/dist/PRService/setAllAccounts.d.ts +1 -3
- package/dist/PRService/setAllAccounts.d.ts.map +1 -1
- package/dist/PRService/setAllAccounts.js +2 -2
- package/dist/PRService/setAllAccounts.js.map +1 -1
- package/dist/PRService/toggleAccount.d.ts +1 -3
- package/dist/PRService/toggleAccount.d.ts.map +1 -1
- package/dist/PRService/toggleAccount.js +2 -2
- package/dist/PRService/toggleAccount.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
- package/dist/NotificationsService.d.ts +0 -45
- package/dist/NotificationsService.d.ts.map +0 -1
- package/dist/NotificationsService.js +0 -57
- package/dist/NotificationsService.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/PRService/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/PRService/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,E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AC,WAAW,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/G,iBAAiB,EAAE,CAAC,YAAoB,EAAE,IAAmB,EAAE,EAAE,CAC/D,WAAW,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,IAAI,CACvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAoC,CAAC,CAAC,CACvF;YACH,eAAe,EAAE,CAAC,YAAoB,EAAE,IAAmB,EAAE,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;SAC7G,CAAA;IACH,CAAC,CAAC;CACH,CAAC;CAAG;AAEL,mFAAmF;AACnF,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAA"}
|
|
@@ -1,7 +1,92 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @internal
|
|
3
3
|
*/
|
|
4
|
+
import { Schema } from "effect";
|
|
4
5
|
import type { SubscriptionRef } from "effect";
|
|
5
|
-
import
|
|
6
|
+
import { UpsertInput } from "../CacheService/repos/PullRequestRepo.js";
|
|
7
|
+
import { type AppState, type PRCommentLocation, PullRequest } from "../Domain.js";
|
|
6
8
|
export type PRState = SubscriptionRef.SubscriptionRef<AppState>;
|
|
9
|
+
export declare const CachedPRToPullRequest: Schema.transform<Schema.SchemaClass<{
|
|
10
|
+
readonly link: string;
|
|
11
|
+
readonly awsAccountId: string;
|
|
12
|
+
readonly id: string & import("effect/Brand").Brand<"PullRequestId">;
|
|
13
|
+
readonly title: string;
|
|
14
|
+
readonly author: string;
|
|
15
|
+
readonly repositoryName: string & import("effect/Brand").Brand<"RepositoryName">;
|
|
16
|
+
readonly creationDate: Date;
|
|
17
|
+
readonly lastModifiedDate: Date;
|
|
18
|
+
readonly status: "OPEN" | "CLOSED" | "MERGED";
|
|
19
|
+
readonly sourceBranch: string;
|
|
20
|
+
readonly destinationBranch: string;
|
|
21
|
+
readonly isMergeable: boolean;
|
|
22
|
+
readonly isApproved: boolean;
|
|
23
|
+
readonly description: string | null;
|
|
24
|
+
readonly commentCount: number | null;
|
|
25
|
+
readonly healthScore: number | null;
|
|
26
|
+
readonly fetchedAt: string;
|
|
27
|
+
readonly accountProfile: string & import("effect/Brand").Brand<"AwsProfileName">;
|
|
28
|
+
readonly accountRegion: string & import("effect/Brand").Brand<"AwsRegion">;
|
|
29
|
+
}, {
|
|
30
|
+
readonly link: string;
|
|
31
|
+
readonly awsAccountId: string;
|
|
32
|
+
readonly id: string & import("effect/Brand").Brand<"PullRequestId">;
|
|
33
|
+
readonly title: string;
|
|
34
|
+
readonly author: string;
|
|
35
|
+
readonly repositoryName: string & import("effect/Brand").Brand<"RepositoryName">;
|
|
36
|
+
readonly creationDate: Date;
|
|
37
|
+
readonly lastModifiedDate: Date;
|
|
38
|
+
readonly status: "OPEN" | "CLOSED" | "MERGED";
|
|
39
|
+
readonly sourceBranch: string;
|
|
40
|
+
readonly destinationBranch: string;
|
|
41
|
+
readonly isMergeable: boolean;
|
|
42
|
+
readonly isApproved: boolean;
|
|
43
|
+
readonly description: string | null;
|
|
44
|
+
readonly commentCount: number | null;
|
|
45
|
+
readonly healthScore: number | null;
|
|
46
|
+
readonly fetchedAt: string;
|
|
47
|
+
readonly accountProfile: string & import("effect/Brand").Brand<"AwsProfileName">;
|
|
48
|
+
readonly accountRegion: string & import("effect/Brand").Brand<"AwsRegion">;
|
|
49
|
+
}, never>, typeof PullRequest>;
|
|
50
|
+
export declare const decodeCachedPR: (i: {
|
|
51
|
+
readonly link: string;
|
|
52
|
+
readonly awsAccountId: string;
|
|
53
|
+
readonly id: string & import("effect/Brand").Brand<"PullRequestId">;
|
|
54
|
+
readonly title: string;
|
|
55
|
+
readonly author: string;
|
|
56
|
+
readonly repositoryName: string & import("effect/Brand").Brand<"RepositoryName">;
|
|
57
|
+
readonly creationDate: Date;
|
|
58
|
+
readonly lastModifiedDate: Date;
|
|
59
|
+
readonly status: "OPEN" | "CLOSED" | "MERGED";
|
|
60
|
+
readonly sourceBranch: string;
|
|
61
|
+
readonly destinationBranch: string;
|
|
62
|
+
readonly isMergeable: boolean;
|
|
63
|
+
readonly isApproved: boolean;
|
|
64
|
+
readonly description: string | null;
|
|
65
|
+
readonly commentCount: number | null;
|
|
66
|
+
readonly healthScore: number | null;
|
|
67
|
+
readonly fetchedAt: string;
|
|
68
|
+
readonly accountProfile: string & import("effect/Brand").Brand<"AwsProfileName">;
|
|
69
|
+
readonly accountRegion: string & import("effect/Brand").Brand<"AwsRegion">;
|
|
70
|
+
}, overrideOptions?: import("effect/SchemaAST").ParseOptions) => PullRequest;
|
|
71
|
+
export declare const PullRequestToUpsertInput: Schema.transform<Schema.Struct<{
|
|
72
|
+
id: typeof Schema.String;
|
|
73
|
+
awsAccountId: typeof Schema.String;
|
|
74
|
+
accountProfile: typeof Schema.String;
|
|
75
|
+
accountRegion: typeof Schema.String;
|
|
76
|
+
title: typeof Schema.String;
|
|
77
|
+
description: Schema.NullOr<typeof Schema.String>;
|
|
78
|
+
author: typeof Schema.String;
|
|
79
|
+
repositoryName: typeof Schema.String;
|
|
80
|
+
creationDate: typeof Schema.String;
|
|
81
|
+
lastModifiedDate: typeof Schema.String;
|
|
82
|
+
status: typeof Schema.String;
|
|
83
|
+
sourceBranch: typeof Schema.String;
|
|
84
|
+
destinationBranch: typeof Schema.String;
|
|
85
|
+
isMergeable: typeof Schema.Number;
|
|
86
|
+
isApproved: typeof Schema.Number;
|
|
87
|
+
commentCount: Schema.NullOr<typeof Schema.Number>;
|
|
88
|
+
link: typeof Schema.String;
|
|
89
|
+
}>, typeof PullRequest>;
|
|
90
|
+
export declare const prToUpsertInput: (pr: PullRequest, awsAccountId: string) => UpsertInput;
|
|
91
|
+
export declare const countAllComments: (locations: ReadonlyArray<PRCommentLocation>) => number;
|
|
7
92
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/PRService/internal.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/PRService/internal.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAqB,WAAW,EAAE,MAAM,0CAA0C,CAAA;AACzF,OAAO,EAAE,KAAK,QAAQ,EAAsB,KAAK,iBAAiB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAErG,MAAM,MAAM,OAAO,GAAG,eAAe,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAA;AAE/D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAkDjC,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;4EAA2C,CAAA;AAEtE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;uBAgDpC,CAAA;AAID,eAAO,MAAM,eAAe,GAAI,IAAI,WAAW,EAAE,cAAc,MAAM,KAAG,WAGtE,CAAA;AAKF,eAAO,MAAM,gBAAgB,GAAI,WAAW,aAAa,CAAC,iBAAiB,CAAC,KAAG,MAI5E,CAAA"}
|
|
@@ -1,2 +1,107 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
import { Schema } from "effect";
|
|
5
|
+
import { CachedPullRequest, UpsertInput } from "../CacheService/repos/PullRequestRepo.js";
|
|
6
|
+
import { PullRequest } from "../Domain.js";
|
|
7
|
+
export const CachedPRToPullRequest = Schema.transform(Schema.typeSchema(CachedPullRequest), PullRequest, {
|
|
8
|
+
strict: true,
|
|
9
|
+
decode: (row) => ({
|
|
10
|
+
id: row.id,
|
|
11
|
+
title: row.title,
|
|
12
|
+
description: row.description ?? undefined,
|
|
13
|
+
author: row.author,
|
|
14
|
+
repositoryName: row.repositoryName,
|
|
15
|
+
creationDate: row.creationDate,
|
|
16
|
+
lastModifiedDate: row.lastModifiedDate,
|
|
17
|
+
link: row.link,
|
|
18
|
+
account: {
|
|
19
|
+
profile: row.accountProfile,
|
|
20
|
+
region: row.accountRegion,
|
|
21
|
+
awsAccountId: row.awsAccountId
|
|
22
|
+
},
|
|
23
|
+
status: row.status,
|
|
24
|
+
sourceBranch: row.sourceBranch,
|
|
25
|
+
destinationBranch: row.destinationBranch,
|
|
26
|
+
isMergeable: row.isMergeable,
|
|
27
|
+
isApproved: row.isApproved,
|
|
28
|
+
commentCount: row.commentCount ?? undefined,
|
|
29
|
+
healthScore: row.healthScore ?? undefined,
|
|
30
|
+
fetchedAt: row.fetchedAt ? new Date(row.fetchedAt) : undefined
|
|
31
|
+
}),
|
|
32
|
+
encode: (_encoded, pr) => ({
|
|
33
|
+
id: pr.id,
|
|
34
|
+
awsAccountId: pr.account.awsAccountId ?? "",
|
|
35
|
+
accountProfile: pr.account.profile,
|
|
36
|
+
accountRegion: pr.account.region,
|
|
37
|
+
title: pr.title,
|
|
38
|
+
description: pr.description ?? null,
|
|
39
|
+
author: pr.author,
|
|
40
|
+
repositoryName: pr.repositoryName,
|
|
41
|
+
creationDate: pr.creationDate,
|
|
42
|
+
lastModifiedDate: pr.lastModifiedDate,
|
|
43
|
+
status: pr.status,
|
|
44
|
+
sourceBranch: pr.sourceBranch,
|
|
45
|
+
destinationBranch: pr.destinationBranch,
|
|
46
|
+
isMergeable: pr.isMergeable,
|
|
47
|
+
isApproved: pr.isApproved,
|
|
48
|
+
commentCount: pr.commentCount ?? null,
|
|
49
|
+
healthScore: pr.healthScore ?? null,
|
|
50
|
+
link: pr.link,
|
|
51
|
+
fetchedAt: pr.fetchedAt?.toISOString() ?? ""
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
export const decodeCachedPR = Schema.decodeSync(CachedPRToPullRequest);
|
|
55
|
+
export const PullRequestToUpsertInput = Schema.transform(UpsertInput, PullRequest, {
|
|
56
|
+
strict: false,
|
|
57
|
+
decode: (row) => ({
|
|
58
|
+
id: row.id,
|
|
59
|
+
title: row.title,
|
|
60
|
+
description: row.description ?? undefined,
|
|
61
|
+
author: row.author,
|
|
62
|
+
repositoryName: row.repositoryName,
|
|
63
|
+
creationDate: new Date(row.creationDate),
|
|
64
|
+
lastModifiedDate: new Date(row.lastModifiedDate),
|
|
65
|
+
link: row.link,
|
|
66
|
+
account: {
|
|
67
|
+
profile: row.accountProfile,
|
|
68
|
+
region: row.accountRegion,
|
|
69
|
+
awsAccountId: row.awsAccountId
|
|
70
|
+
},
|
|
71
|
+
status: row.status,
|
|
72
|
+
sourceBranch: row.sourceBranch,
|
|
73
|
+
destinationBranch: row.destinationBranch,
|
|
74
|
+
isMergeable: row.isMergeable === 1,
|
|
75
|
+
isApproved: row.isApproved === 1,
|
|
76
|
+
commentCount: row.commentCount ?? undefined,
|
|
77
|
+
healthScore: undefined,
|
|
78
|
+
fetchedAt: undefined
|
|
79
|
+
}),
|
|
80
|
+
encode: (_encoded, pr) => ({
|
|
81
|
+
id: pr.id,
|
|
82
|
+
awsAccountId: pr.account.awsAccountId ?? "",
|
|
83
|
+
accountProfile: pr.account.profile,
|
|
84
|
+
accountRegion: pr.account.region,
|
|
85
|
+
title: pr.title,
|
|
86
|
+
description: pr.description ?? null,
|
|
87
|
+
author: pr.author,
|
|
88
|
+
repositoryName: pr.repositoryName,
|
|
89
|
+
creationDate: pr.creationDate.toISOString(),
|
|
90
|
+
lastModifiedDate: pr.lastModifiedDate.toISOString(),
|
|
91
|
+
status: pr.status,
|
|
92
|
+
sourceBranch: pr.sourceBranch,
|
|
93
|
+
destinationBranch: pr.destinationBranch,
|
|
94
|
+
isMergeable: pr.isMergeable ? 1 : 0,
|
|
95
|
+
isApproved: pr.isApproved ? 1 : 0,
|
|
96
|
+
commentCount: pr.commentCount ?? null,
|
|
97
|
+
link: pr.link
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
const encodePRToUpsert = Schema.encodeSync(PullRequestToUpsertInput);
|
|
101
|
+
export const prToUpsertInput = (pr, awsAccountId) => ({
|
|
102
|
+
...encodePRToUpsert(pr),
|
|
103
|
+
awsAccountId
|
|
104
|
+
});
|
|
105
|
+
const countThreadComments = (thread) => 1 + thread.replies.reduce((sum, r) => sum + countThreadComments(r), 0);
|
|
106
|
+
export const countAllComments = (locations) => locations.reduce((sum, loc) => sum + loc.comments.reduce((s, t) => s + countThreadComments(t), 0), 0);
|
|
2
107
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/PRService/internal.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../src/PRService/internal.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAA;AACzF,OAAO,EAA6D,WAAW,EAAE,MAAM,cAAc,CAAA;AAIrG,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,SAAS,CACnD,MAAM,CAAC,UAAU,CAAC,iBAAiB,CAAC,EACpC,WAAW,EACX;IACE,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAChB,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,SAAS;QACz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AAM,eAAe,GAAG,CAAC,EAAe,EAAE,YAAoB,EAAe,EAAE,CAAC,CAAC;IACtF,GAAG,gBAAgB,CAAC,EAAE,CAAC;IACvB,YAAY;CACb,CAAC,CAAA;AAEF,MAAM,mBAAmB,GAAG,CAAC,MAAqB,EAAU,EAAE,CAC5D,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAExE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAA2C,EAAU,EAAE,CACtF,SAAS,CAAC,MAAM,CACd,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAChF,CAAC,CACF,CAAA"}
|
|
@@ -2,9 +2,15 @@
|
|
|
2
2
|
* @internal
|
|
3
3
|
*/
|
|
4
4
|
import { Effect } from "effect";
|
|
5
|
-
import { AwsClient } from "../AwsClient/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import type { AwsClient } from "../AwsClient/index.js";
|
|
6
|
+
import { EventsHub } from "../CacheService/EventsHub.js";
|
|
7
|
+
import type { CommentRepo } from "../CacheService/repos/CommentRepo.js";
|
|
8
|
+
import type { NotificationRepo } from "../CacheService/repos/NotificationRepo.js";
|
|
9
|
+
import type { PullRequestRepo } from "../CacheService/repos/PullRequestRepo.js";
|
|
10
|
+
import type { SubscriptionRepo } from "../CacheService/repos/SubscriptionRepo.js";
|
|
11
|
+
import { SyncMetadataRepo } from "../CacheService/repos/SyncMetadataRepo.js";
|
|
12
|
+
import type { ConfigService } from "../ConfigService/index.js";
|
|
8
13
|
import type { PRState } from "./internal.js";
|
|
9
|
-
export
|
|
14
|
+
export type RefreshDeps = ConfigService | AwsClient | PullRequestRepo | CommentRepo | NotificationRepo | SubscriptionRepo | SyncMetadataRepo | EventsHub;
|
|
15
|
+
export declare const makeRefresh: (state: PRState) => Effect.Effect<void, never, AwsClient | EventsHub | CommentRepo | NotificationRepo | PullRequestRepo | SubscriptionRepo | SyncMetadataRepo | ConfigService>;
|
|
10
16
|
//# sourceMappingURL=refresh.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../src/PRService/refresh.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAA0B,MAAM,
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../src/PRService/refresh.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAA0B,MAAM,EAAmB,MAAM,QAAQ,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAM5C,MAAM,MAAM,WAAW,GACnB,aAAa,GACb,SAAS,GACT,eAAe,GACf,WAAW,GACX,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,SAAS,CAAA;AAEb,eAAO,MAAM,WAAW,gLAmDvB,CAAA"}
|
|
@@ -1,100 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @internal
|
|
3
3
|
*/
|
|
4
|
-
import { Cause, Clock, DateTime, Effect,
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export const makeRefresh =
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
...s,
|
|
17
|
-
pullRequests: [],
|
|
18
|
-
status: "loading",
|
|
19
|
-
error: undefined
|
|
20
|
-
}));
|
|
21
|
-
yield* notificationsService.clear;
|
|
22
|
-
const config = yield* configService.load.pipe(Effect.catchAll((e) => Effect.fail(new Error(`Config load failed: ${e.message}`))));
|
|
23
|
-
const detected = yield* configService.detectProfiles.pipe(Effect.catchAll(() => Effect.succeed([])));
|
|
24
|
-
const accountsState = detected.map((d) => {
|
|
25
|
-
const configured = config.accounts.find((a) => a.profile === d.name);
|
|
26
|
-
return {
|
|
27
|
-
profile: d.name,
|
|
28
|
-
region: configured?.regions?.[0] ?? d.region ?? "",
|
|
29
|
-
enabled: configured?.enabled ?? false
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
yield* SubscriptionRef.update(state, (s) => ({ ...s, accounts: accountsState }));
|
|
33
|
-
const enabledAccounts = config.accounts.filter((a) => a.enabled);
|
|
34
|
-
if (enabledAccounts.length === 0) {
|
|
35
|
-
const now = yield* Clock.currentTimeMillis;
|
|
36
|
-
yield* SubscriptionRef.update(state, (s) => ({ ...s, status: "idle", lastUpdated: DateTime.toDate(DateTime.unsafeMake(now)) }));
|
|
4
|
+
import { Cause, Clock, DateTime, Effect, SubscriptionRef } from "effect";
|
|
5
|
+
import { EventsHub } from "../CacheService/EventsHub.js";
|
|
6
|
+
import { SyncMetadataRepo } from "../CacheService/repos/SyncMetadataRepo.js";
|
|
7
|
+
import { enrichComments } from "./refreshEnrich.js";
|
|
8
|
+
import { fetchAndUpsertPRs } from "./refreshFetch.js";
|
|
9
|
+
import { resolveAccounts } from "./refreshResolve.js";
|
|
10
|
+
import { calculateHealthScores } from "./refreshScore.js";
|
|
11
|
+
export const makeRefresh = Effect.fn("PRService.refresh")(function* (state) {
|
|
12
|
+
const hub = yield* EventsHub;
|
|
13
|
+
const syncMetadataRepo = yield* SyncMetadataRepo;
|
|
14
|
+
const resolved = yield* resolveAccounts(state);
|
|
15
|
+
if (!resolved)
|
|
37
16
|
return;
|
|
38
|
-
}
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
yield*
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
statusDetail: accountLabels.join(", ")
|
|
46
|
-
}));
|
|
47
|
-
const streams = enabledAccounts.flatMap((account) => (account.regions ?? []).map((region) => {
|
|
48
|
-
const label = `${account.profile} (${region})`;
|
|
49
|
-
return awsClient.getPullRequests({ profile: account.profile, region }).pipe(Stream.map((pr) => ({ pr, label })), Stream.catchAllCause((cause) => {
|
|
50
|
-
const errorStr = Cause.pretty(cause).split("\n")[0] ?? "Unknown error";
|
|
51
|
-
return Stream.fromEffect(notificationsService.add({
|
|
52
|
-
type: "error",
|
|
53
|
-
title: label,
|
|
54
|
-
message: errorStr
|
|
55
|
-
})).pipe(Stream.flatMap(() => Stream.empty));
|
|
56
|
-
}));
|
|
17
|
+
const { accountIdMap, currentUser, enabledAccounts, subscribedRef } = resolved;
|
|
18
|
+
const staleNow = yield* Clock.currentTimeMillis;
|
|
19
|
+
const staleThreshold = DateTime.toDate(DateTime.unsafeMake(staleNow)).toISOString().slice(0, 19) + "Z";
|
|
20
|
+
yield* hub.batch(Effect.gen(function* () {
|
|
21
|
+
yield* fetchAndUpsertPRs({ state, enabledAccounts, accountIdMap, subscribedRef, currentUser, staleThreshold });
|
|
22
|
+
yield* enrichComments({ state, subscribedRef });
|
|
23
|
+
yield* calculateHealthScores(state);
|
|
57
24
|
}));
|
|
58
|
-
|
|
59
|
-
const prs = s.pullRequests;
|
|
60
|
-
const insertIdx = prs.findIndex((p) => p.creationDate.getTime() < pr.creationDate.getTime());
|
|
61
|
-
const newPrs = insertIdx === -1 ? [...prs, pr] : [...prs.slice(0, insertIdx), pr, ...prs.slice(insertIdx)];
|
|
62
|
-
return {
|
|
63
|
-
...s,
|
|
64
|
-
pullRequests: newPrs,
|
|
65
|
-
statusDetail: `${label} #${pr.id} ${pr.repositoryName}`
|
|
66
|
-
};
|
|
67
|
-
})));
|
|
25
|
+
// Set idle
|
|
68
26
|
const now = yield* Clock.currentTimeMillis;
|
|
69
|
-
yield* SubscriptionRef.update(state, (s) => ({
|
|
27
|
+
yield* SubscriptionRef.update(state, ({ statusDetail: _, ...s }) => ({
|
|
70
28
|
...s,
|
|
71
29
|
status: "idle",
|
|
72
|
-
statusDetail: undefined,
|
|
73
30
|
lastUpdated: DateTime.toDate(DateTime.unsafeMake(now))
|
|
74
31
|
}));
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
if (r !== undefined)
|
|
84
|
-
counts.set(`${r.accountId}:${r.id}`, r.commentCount);
|
|
85
|
-
}
|
|
86
|
-
if (counts.size > 0) {
|
|
87
|
-
yield* SubscriptionRef.update(state, (s) => ({
|
|
88
|
-
...s,
|
|
89
|
-
pullRequests: s.pullRequests.map((p) => {
|
|
90
|
-
const key = `${p.account.id}:${p.id}`;
|
|
91
|
-
const cc = counts.get(key);
|
|
92
|
-
return cc !== undefined ? new PullRequest({ ...p, commentCount: cc }) : p;
|
|
93
|
-
})
|
|
94
|
-
}));
|
|
95
|
-
}
|
|
96
|
-
}).pipe(Effect.withSpan("PRService.refresh"), Effect.timeout("120 seconds"), Effect.catchAllCause((cause) => {
|
|
97
|
-
const errorStr = Cause.pretty(cause).split("\n")[0] ?? "Unknown error";
|
|
32
|
+
// Sync metadata
|
|
33
|
+
yield* Effect.forEach(enabledAccounts, (account) => {
|
|
34
|
+
const awsAccountId = accountIdMap.get(account.profile) ?? account.profile;
|
|
35
|
+
return Effect.forEach(account.regions ?? [], (region) => syncMetadataRepo.update(awsAccountId, region), { discard: true });
|
|
36
|
+
}, { discard: true }).pipe(Effect.catchAll(() => Effect.void));
|
|
37
|
+
}, (effect, state) => effect.pipe(Effect.timeout("120 seconds"), Effect.catchAllCause((cause) => {
|
|
38
|
+
const squashed = Cause.squash(cause);
|
|
39
|
+
const errorStr = (squashed instanceof Error ? squashed.message : String(squashed)) || "Unknown error";
|
|
98
40
|
return SubscriptionRef.update(state, (s) => ({ ...s, status: "error", error: errorStr }));
|
|
99
|
-
}));
|
|
41
|
+
})));
|
|
100
42
|
//# sourceMappingURL=refresh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh.js","sourceRoot":"","sources":["../../src/PRService/refresh.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"refresh.js","sourceRoot":"","sources":["../../src/PRService/refresh.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAKxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAG5E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAYzD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,CAAC,mBAA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C,CAAA;AACpG,CAAC,CAAC,CACH,CACJ,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Phase 4: Fetch comments for each PR, diff, cache, and count.
|
|
4
|
+
*/
|
|
5
|
+
import { Effect, Ref } from "effect";
|
|
6
|
+
import { AwsClient } from "../AwsClient/index.js";
|
|
7
|
+
import { CommentRepo } from "../CacheService/repos/CommentRepo.js";
|
|
8
|
+
import { NotificationRepo } from "../CacheService/repos/NotificationRepo.js";
|
|
9
|
+
import { PullRequestRepo } from "../CacheService/repos/PullRequestRepo.js";
|
|
10
|
+
import { type PRState } from "./internal.js";
|
|
11
|
+
export declare const enrichComments: (params: {
|
|
12
|
+
readonly state: PRState;
|
|
13
|
+
readonly subscribedRef: Ref.Ref<Set<string>>;
|
|
14
|
+
}) => Effect.Effect<void, never, AwsClient | PullRequestRepo | CommentRepo | NotificationRepo>;
|
|
15
|
+
//# sourceMappingURL=refreshEnrich.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshEnrich.d.ts","sourceRoot":"","sources":["../../src/PRService/refreshEnrich.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAU,GAAG,EAAmB,MAAM,QAAQ,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAE1E,OAAO,EAAoB,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAqD9D,eAAO,MAAM,cAAc,GAAI,QAAQ;IACrC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;CAC7C,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,GAAG,eAAe,GAAG,WAAW,GAAG,gBAAgB,CA0CvF,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Phase 4: Fetch comments for each PR, diff, cache, and count.
|
|
4
|
+
*/
|
|
5
|
+
import { Effect, Option, Ref, SubscriptionRef } from "effect";
|
|
6
|
+
import { AwsClient } from "../AwsClient/index.js";
|
|
7
|
+
import { diffComments } from "../CacheService/diff.js";
|
|
8
|
+
import { CommentRepo } from "../CacheService/repos/CommentRepo.js";
|
|
9
|
+
import { NotificationRepo } from "../CacheService/repos/NotificationRepo.js";
|
|
10
|
+
import { PullRequestRepo } from "../CacheService/repos/PullRequestRepo.js";
|
|
11
|
+
import { countAllComments } from "./internal.js";
|
|
12
|
+
const enrichSinglePR = (row, subscribedSnapshot) => Effect.gen(function* () {
|
|
13
|
+
const awsClient = yield* AwsClient;
|
|
14
|
+
const commentRepo = yield* CommentRepo;
|
|
15
|
+
const notificationRepo = yield* NotificationRepo;
|
|
16
|
+
const awsAccountId = row.awsAccountId;
|
|
17
|
+
const prId = row.id;
|
|
18
|
+
const locs = yield* awsClient.getCommentsForPullRequest({
|
|
19
|
+
account: {
|
|
20
|
+
profile: row.accountProfile,
|
|
21
|
+
region: row.accountRegion
|
|
22
|
+
},
|
|
23
|
+
pullRequestId: prId,
|
|
24
|
+
repositoryName: row.repositoryName
|
|
25
|
+
}).pipe(Effect.catchAll(() => Effect.succeed(undefined)));
|
|
26
|
+
if (locs && awsAccountId) {
|
|
27
|
+
// Diff comments for subscribed PRs
|
|
28
|
+
if (subscribedSnapshot.has(`${awsAccountId}:${prId}`)) {
|
|
29
|
+
const cachedComments = yield* commentRepo.find(awsAccountId, prId).pipe(Effect.catchAll(() => Effect.succeed(Option.none())));
|
|
30
|
+
if (Option.isSome(cachedComments)) {
|
|
31
|
+
const notifications = diffComments(cachedComments.value, locs, prId, awsAccountId);
|
|
32
|
+
yield* Effect.forEach(notifications, (n) => notificationRepo.add(n), { discard: true }).pipe(Effect.catchAll(() => Effect.void));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// Cache comments
|
|
36
|
+
yield* commentRepo.upsert(awsAccountId, prId, JSON.stringify(locs)).pipe(Effect.catchAll(() => Effect.void));
|
|
37
|
+
}
|
|
38
|
+
// Fallback: use cached comment count from DB
|
|
39
|
+
let commentCount = locs ? countAllComments(locs) : 0;
|
|
40
|
+
if (!locs && awsAccountId) {
|
|
41
|
+
const cached = yield* commentRepo.find(awsAccountId, prId).pipe(Effect.catchAll(() => Effect.succeed(Option.none())));
|
|
42
|
+
if (Option.isSome(cached)) {
|
|
43
|
+
commentCount = countAllComments(cached.value);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return awsAccountId ? Option.some({ awsAccountId, commentCount, id: prId }) : Option.none();
|
|
47
|
+
});
|
|
48
|
+
export const enrichComments = (params) => Effect.gen(function* () {
|
|
49
|
+
const prRepo = yield* PullRequestRepo;
|
|
50
|
+
const { state, subscribedRef } = params;
|
|
51
|
+
const freshPRs = yield* prRepo.findAll().pipe(Effect.catchAll(() => Effect.succeed([])));
|
|
52
|
+
const subscribedSnapshot = yield* Ref.get(subscribedRef);
|
|
53
|
+
const enrichedRef = yield* Ref.make(0);
|
|
54
|
+
yield* SubscriptionRef.update(state, (s) => ({
|
|
55
|
+
...s,
|
|
56
|
+
statusDetail: `fetching comments (0/${freshPRs.length})`
|
|
57
|
+
}));
|
|
58
|
+
const enrichments = yield* Effect.forEach(freshPRs, (row) => Effect.gen(function* () {
|
|
59
|
+
const result = yield* enrichSinglePR(row, subscribedSnapshot);
|
|
60
|
+
const n = yield* Ref.updateAndGet(enrichedRef, (v) => v + 1);
|
|
61
|
+
yield* SubscriptionRef.update(state, (s) => ({
|
|
62
|
+
...s,
|
|
63
|
+
statusDetail: `fetching comments (${n}/${freshPRs.length})`
|
|
64
|
+
}));
|
|
65
|
+
return result;
|
|
66
|
+
}), { concurrency: 2 });
|
|
67
|
+
yield* Effect.forEach(enrichments, (r) => Option.match(r, {
|
|
68
|
+
onNone: () => Effect.void,
|
|
69
|
+
onSome: ({ awsAccountId, commentCount, id }) => prRepo.updateCommentCount(awsAccountId, id, commentCount).pipe(Effect.catchAll(() => Effect.void))
|
|
70
|
+
}), { discard: true });
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=refreshEnrich.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshEnrich.js","sourceRoot":"","sources":["../../src/PRService/refreshEnrich.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAE1E,OAAO,EAAE,gBAAgB,EAAgB,MAAM,eAAe,CAAA;AAE9D,MAAM,cAAc,GAAG,CAAC,GAAsB,EAAE,kBAA+B,EAAE,EAAE,CACjF,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,SAAS,CAAA;IAClC,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,WAAW,CAAA;IACtC,MAAM,gBAAgB,GAAG,KAAK,CAAC,CAAC,gBAAgB,CAAA;IAEhD,MAAM,YAAY,GAAG,GAAG,CAAC,YAAY,CAAA;IACrC,MAAM,IAAI,GAAG,GAAG,CAAC,E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,CAAC,CAAC,EAAE;QACd,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI;QACzB,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,CAC7C,MAAM,CAAC,kBAAkB,CAAC,YAAY,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC,IAAI,CAC5D,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CACnC;KACJ,CAAC,EACJ,EAAE,OAAO,EAAE,IAAI,EAAE,CAClB,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Phase 3: Stream PRs from AWS, diff subscribed PRs, upsert to cache.
|
|
4
|
+
*/
|
|
5
|
+
import { Effect, Ref } from "effect";
|
|
6
|
+
import { AwsClient } from "../AwsClient/index.js";
|
|
7
|
+
import { NotificationRepo } from "../CacheService/repos/NotificationRepo.js";
|
|
8
|
+
import { PullRequestRepo } from "../CacheService/repos/PullRequestRepo.js";
|
|
9
|
+
import { SubscriptionRepo } from "../CacheService/repos/SubscriptionRepo.js";
|
|
10
|
+
import type { AccountConfig } from "../ConfigService/internal.js";
|
|
11
|
+
import { type PRState } from "./internal.js";
|
|
12
|
+
export declare const fetchAndUpsertPRs: (params: {
|
|
13
|
+
readonly state: PRState;
|
|
14
|
+
readonly enabledAccounts: ReadonlyArray<AccountConfig>;
|
|
15
|
+
readonly accountIdMap: Map<string, string>;
|
|
16
|
+
readonly subscribedRef: Ref.Ref<Set<string>>;
|
|
17
|
+
readonly currentUser: string | undefined;
|
|
18
|
+
readonly staleThreshold: string;
|
|
19
|
+
}) => Effect.Effect<void, never, AwsClient | PullRequestRepo | NotificationRepo | SubscriptionRepo>;
|
|
20
|
+
//# sourceMappingURL=refreshFetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshFetch.d.ts","sourceRoot":"","sources":["../../src/PRService/refreshFetch.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAS,MAAM,EAAU,GAAG,EAA2B,MAAM,QAAQ,CAAA;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,KAAK,OAAO,EAAmB,MAAM,eAAe,CAAA;AAE7D,eAAO,MAAM,iBAAiB,GAAI,QAAQ;IACxC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,eAAe,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IACtD,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C,QAAQ,CAAC,aAAa,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5C,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IACxC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;CAChC,KAAG,MAAM,CAAC,MAAM,CACf,IAAI,EACJ,KAAK,EACL,SAAS,GAAG,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CA4F/D,CAAA"}
|