@knpkv/codecommit-core 0.13.0 → 0.15.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.
Files changed (162) hide show
  1. package/dist/AwsClient/AwsClientGated.d.ts.map +1 -1
  2. package/dist/AwsClient/AwsClientGated.js +3 -3
  3. package/dist/AwsClient/AwsClientGated.js.map +1 -1
  4. package/dist/AwsClient/getPullRequests.d.ts +1 -0
  5. package/dist/AwsClient/getPullRequests.d.ts.map +1 -1
  6. package/dist/AwsClient/getPullRequests.js +10 -7
  7. package/dist/AwsClient/getPullRequests.js.map +1 -1
  8. package/dist/AwsClient/index.d.ts +1 -0
  9. package/dist/AwsClient/index.d.ts.map +1 -1
  10. package/dist/AwsClient/internal.d.ts +29 -8
  11. package/dist/AwsClient/internal.d.ts.map +1 -1
  12. package/dist/AwsClient/internal.js +5 -12
  13. package/dist/AwsClient/internal.js.map +1 -1
  14. package/dist/AwsClientConfig/internal/ProfileCredentialProvider.d.ts +18 -0
  15. package/dist/AwsClientConfig/internal/ProfileCredentialProvider.d.ts.map +1 -0
  16. package/dist/AwsClientConfig/internal/ProfileCredentialProvider.js +7 -0
  17. package/dist/AwsClientConfig/internal/ProfileCredentialProvider.js.map +1 -0
  18. package/dist/AwsClientConfig.d.ts +13 -22
  19. package/dist/AwsClientConfig.d.ts.map +1 -1
  20. package/dist/AwsClientConfig.js +37 -0
  21. package/dist/AwsClientConfig.js.map +1 -1
  22. package/dist/CacheService/Database.d.ts +1 -1
  23. package/dist/CacheService/Database.d.ts.map +1 -1
  24. package/dist/CacheService/Database.js +10 -2
  25. package/dist/CacheService/Database.js.map +1 -1
  26. package/dist/CacheService/diff.d.ts +5 -2
  27. package/dist/CacheService/diff.d.ts.map +1 -1
  28. package/dist/CacheService/diff.js +31 -13
  29. package/dist/CacheService/diff.js.map +1 -1
  30. package/dist/CacheService/migrations/0017_sandbox_region.d.ts +5 -0
  31. package/dist/CacheService/migrations/0017_sandbox_region.d.ts.map +1 -0
  32. package/dist/CacheService/migrations/0017_sandbox_region.js +4 -0
  33. package/dist/CacheService/migrations/0017_sandbox_region.js.map +1 -0
  34. package/dist/CacheService/migrations/0018_pull_request_coordinates.d.ts +6 -0
  35. package/dist/CacheService/migrations/0018_pull_request_coordinates.d.ts.map +1 -0
  36. package/dist/CacheService/migrations/0018_pull_request_coordinates.js +82 -0
  37. package/dist/CacheService/migrations/0018_pull_request_coordinates.js.map +1 -0
  38. package/dist/CacheService/migrations/0019_dependent_pr_coordinates.d.ts +6 -0
  39. package/dist/CacheService/migrations/0019_dependent_pr_coordinates.d.ts.map +1 -0
  40. package/dist/CacheService/migrations/0019_dependent_pr_coordinates.js +57 -0
  41. package/dist/CacheService/migrations/0019_dependent_pr_coordinates.js.map +1 -0
  42. package/dist/CacheService/migrations/0020_notification_coordinates.d.ts +6 -0
  43. package/dist/CacheService/migrations/0020_notification_coordinates.d.ts.map +1 -0
  44. package/dist/CacheService/migrations/0020_notification_coordinates.js +22 -0
  45. package/dist/CacheService/migrations/0020_notification_coordinates.js.map +1 -0
  46. package/dist/CacheService/repos/CommentRepo.d.ts +6 -2
  47. package/dist/CacheService/repos/CommentRepo.d.ts.map +1 -1
  48. package/dist/CacheService/repos/CommentRepo.js +46 -7
  49. package/dist/CacheService/repos/CommentRepo.js.map +1 -1
  50. package/dist/CacheService/repos/NotificationRepo.d.ts +2 -0
  51. package/dist/CacheService/repos/NotificationRepo.d.ts.map +1 -1
  52. package/dist/CacheService/repos/NotificationRepo.js +10 -3
  53. package/dist/CacheService/repos/NotificationRepo.js.map +1 -1
  54. package/dist/CacheService/repos/PullRequestRepo/index.d.ts +42 -7
  55. package/dist/CacheService/repos/PullRequestRepo/index.d.ts.map +1 -1
  56. package/dist/CacheService/repos/PullRequestRepo/index.js +2 -0
  57. package/dist/CacheService/repos/PullRequestRepo/index.js.map +1 -1
  58. package/dist/CacheService/repos/PullRequestRepo/mutations.d.ts +9 -5
  59. package/dist/CacheService/repos/PullRequestRepo/mutations.d.ts.map +1 -1
  60. package/dist/CacheService/repos/PullRequestRepo/mutations.js +61 -17
  61. package/dist/CacheService/repos/PullRequestRepo/mutations.js.map +1 -1
  62. package/dist/CacheService/repos/PullRequestRepo/queries.d.ts +48 -4
  63. package/dist/CacheService/repos/PullRequestRepo/queries.d.ts.map +1 -1
  64. package/dist/CacheService/repos/PullRequestRepo/queries.js +40 -5
  65. package/dist/CacheService/repos/PullRequestRepo/queries.js.map +1 -1
  66. package/dist/CacheService/repos/SandboxRepo.d.ts +45 -1
  67. package/dist/CacheService/repos/SandboxRepo.d.ts.map +1 -1
  68. package/dist/CacheService/repos/SandboxRepo.js +53 -8
  69. package/dist/CacheService/repos/SandboxRepo.js.map +1 -1
  70. package/dist/CacheService/repos/StatsRepo/index.d.ts +3 -0
  71. package/dist/CacheService/repos/StatsRepo/index.d.ts.map +1 -1
  72. package/dist/CacheService/repos/StatsRepo/internal.d.ts +6 -0
  73. package/dist/CacheService/repos/StatsRepo/internal.d.ts.map +1 -1
  74. package/dist/CacheService/repos/StatsRepo/internal.js +5 -5
  75. package/dist/CacheService/repos/StatsRepo/internal.js.map +1 -1
  76. package/dist/CacheService/repos/StatsRepo/queries.d.ts +1 -0
  77. package/dist/CacheService/repos/StatsRepo/queries.d.ts.map +1 -1
  78. package/dist/CacheService/repos/StatsRepo/queries.js +5 -4
  79. package/dist/CacheService/repos/StatsRepo/queries.js.map +1 -1
  80. package/dist/CacheService/repos/StatsRepo/reviewerData.d.ts +2 -0
  81. package/dist/CacheService/repos/StatsRepo/reviewerData.d.ts.map +1 -1
  82. package/dist/CacheService/repos/StatsRepo/reviewerData.js +38 -15
  83. package/dist/CacheService/repos/StatsRepo/reviewerData.js.map +1 -1
  84. package/dist/CacheService/repos/SubscriptionRepo.d.ts +11 -5
  85. package/dist/CacheService/repos/SubscriptionRepo.d.ts.map +1 -1
  86. package/dist/CacheService/repos/SubscriptionRepo.js +106 -12
  87. package/dist/CacheService/repos/SubscriptionRepo.js.map +1 -1
  88. package/dist/ChildEnv.d.ts +13 -0
  89. package/dist/ChildEnv.d.ts.map +1 -1
  90. package/dist/ChildEnv.js +50 -0
  91. package/dist/ChildEnv.js.map +1 -1
  92. package/dist/ConfigService/index.d.ts +2 -2
  93. package/dist/ConfigService/index.d.ts.map +1 -1
  94. package/dist/ConfigService/index.js +2 -2
  95. package/dist/ConfigService/index.js.map +1 -1
  96. package/dist/ConfigService/internal.d.ts +3 -21
  97. package/dist/ConfigService/internal.d.ts.map +1 -1
  98. package/dist/ConfigService/internal.js +1 -43
  99. package/dist/ConfigService/internal.js.map +1 -1
  100. package/dist/ConfigService/load.d.ts +3 -0
  101. package/dist/ConfigService/load.d.ts.map +1 -1
  102. package/dist/ConfigService/reset.d.ts +3 -0
  103. package/dist/ConfigService/reset.d.ts.map +1 -1
  104. package/dist/ConfigService/save.d.ts +3 -0
  105. package/dist/ConfigService/save.d.ts.map +1 -1
  106. package/dist/Domain.d.ts +19 -0
  107. package/dist/Domain.d.ts.map +1 -1
  108. package/dist/Domain.js +66 -3
  109. package/dist/Domain.js.map +1 -1
  110. package/dist/ManagedReviewProtocol.d.ts +5 -0
  111. package/dist/ManagedReviewProtocol.d.ts.map +1 -0
  112. package/dist/ManagedReviewProtocol.js +5 -0
  113. package/dist/ManagedReviewProtocol.js.map +1 -0
  114. package/dist/MockTransport.d.ts +24 -0
  115. package/dist/MockTransport.d.ts.map +1 -0
  116. package/dist/MockTransport.js +58 -0
  117. package/dist/MockTransport.js.map +1 -0
  118. package/dist/PRService/index.d.ts +15 -8
  119. package/dist/PRService/index.d.ts.map +1 -1
  120. package/dist/PRService/index.js +5 -5
  121. package/dist/PRService/index.js.map +1 -1
  122. package/dist/PRService/refreshDiffs.d.ts.map +1 -1
  123. package/dist/PRService/refreshDiffs.js +12 -3
  124. package/dist/PRService/refreshDiffs.js.map +1 -1
  125. package/dist/PRService/refreshEnrich.d.ts.map +1 -1
  126. package/dist/PRService/refreshEnrich.js +28 -11
  127. package/dist/PRService/refreshEnrich.js.map +1 -1
  128. package/dist/PRService/refreshFetch.d.ts.map +1 -1
  129. package/dist/PRService/refreshFetch.js +25 -13
  130. package/dist/PRService/refreshFetch.js.map +1 -1
  131. package/dist/PRService/refreshHistory.d.ts +1 -1
  132. package/dist/PRService/refreshHistory.d.ts.map +1 -1
  133. package/dist/PRService/refreshHistory.js +6 -4
  134. package/dist/PRService/refreshHistory.js.map +1 -1
  135. package/dist/PRService/refreshResolve.d.ts +4 -1
  136. package/dist/PRService/refreshResolve.d.ts.map +1 -1
  137. package/dist/PRService/refreshResolve.js +19 -6
  138. package/dist/PRService/refreshResolve.js.map +1 -1
  139. package/dist/PRService/refreshScore.d.ts.map +1 -1
  140. package/dist/PRService/refreshScore.js +4 -1
  141. package/dist/PRService/refreshScore.js.map +1 -1
  142. package/dist/PRService/refreshSinglePR.d.ts +9 -2
  143. package/dist/PRService/refreshSinglePR.d.ts.map +1 -1
  144. package/dist/PRService/refreshSinglePR.js +99 -33
  145. package/dist/PRService/refreshSinglePR.js.map +1 -1
  146. package/dist/ReviewProfile.d.ts +39 -0
  147. package/dist/ReviewProfile.d.ts.map +1 -1
  148. package/dist/ReviewProfile.js +72 -0
  149. package/dist/ReviewProfile.js.map +1 -1
  150. package/dist/SandboxService/DockerService.d.ts +2 -0
  151. package/dist/SandboxService/DockerService.d.ts.map +1 -1
  152. package/dist/SandboxService/DockerService.js +47 -16
  153. package/dist/SandboxService/DockerService.js.map +1 -1
  154. package/dist/SandboxService/SandboxService.d.ts +4 -0
  155. package/dist/SandboxService/SandboxService.d.ts.map +1 -1
  156. package/dist/SandboxService/SandboxService.js +112 -25
  157. package/dist/SandboxService/SandboxService.js.map +1 -1
  158. package/dist/StatsService/WeeklyStats.d.ts +7 -0
  159. package/dist/StatsService/WeeklyStats.d.ts.map +1 -1
  160. package/dist/StatsService/WeeklyStats.js +3 -0
  161. package/dist/StatsService/WeeklyStats.js.map +1 -1
  162. package/package.json +2 -1
@@ -1 +1 @@
1
- {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,uBAAuB,EAAE,aAAa;QACtC,0BAA0B,EAAE,aAAa;QACzC,oBAAoB,EAAE,aAAa;QACnC,mBAAmB,EAAE,aAAa;QAClC,oBAAoB,EAAE,aAAa;QACnC,gBAAgB,EAAE,aAAa;QAC/B,kBAAkB,EAAE,aAAa;QACjC,mBAAmB,EAAE,aAAa;QAClC,gBAAgB,EAAE,aAAa;QAC/B,wBAAwB,EAAE,aAAa;QACvC,qBAAqB,EAAE,aAAa;QACpC,uBAAuB,EAAE,aAAa;QACtC,sBAAsB,EAAE,aAAa;QACrC,8BAA8B,EAAE,aAAa;QAC7C,qBAAqB,EAAE,aAAa;QACpC,+BAA+B,EAAE,aAAa;QAC9C,+BAA+B,EAAE,aAAa;QAC9C,+BAA+B,EAAE,aAAa;KAC/C,CAAC;CACH,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAA"}
@@ -19,6 +19,8 @@ import type { ApprovalRule, PRCommentLocation } from "../Domain.js";
19
19
  export interface NewNotification {
20
20
  readonly pullRequestId: string;
21
21
  readonly awsAccountId: string;
22
+ readonly repositoryName?: string;
23
+ readonly accountRegion?: string;
22
24
  readonly type: string;
23
25
  readonly message: string;
24
26
  readonly title?: string;
@@ -30,6 +32,7 @@ export interface DiffablePR {
30
32
  readonly description?: string | null | undefined;
31
33
  readonly repositoryName: string;
32
34
  readonly accountProfile: string;
35
+ readonly accountRegion?: string;
33
36
  readonly status: string;
34
37
  readonly isApproved: boolean | number;
35
38
  readonly isMergeable: boolean | number;
@@ -39,6 +42,6 @@ export declare const diffPR: (cached: DiffablePR, fresh: DiffablePR, awsAccountI
39
42
  /**
40
43
  * Detect when currentUser is newly added to an approval pool.
41
44
  */
42
- export declare const diffApprovalPools: (cachedRules: ReadonlyArray<ApprovalRule>, freshRules: ReadonlyArray<ApprovalRule>, currentUser: string | undefined, prId: string, awsAccountId: string, prTitle?: string, profile?: string) => Array<NewNotification>;
43
- export declare const diffComments: (cached: ReadonlyArray<PRCommentLocation>, fresh: ReadonlyArray<PRCommentLocation>, pullRequestId: string, awsAccountId: string) => Array<NewNotification>;
45
+ export declare const diffApprovalPools: (cachedRules: ReadonlyArray<ApprovalRule>, freshRules: ReadonlyArray<ApprovalRule>, currentUser: string | undefined, prId: string, awsAccountId: string, prTitle?: string, profile?: string, repositoryName?: string, accountRegion?: string) => Array<NewNotification>;
46
+ export declare const diffComments: (cached: ReadonlyArray<PRCommentLocation>, fresh: ReadonlyArray<PRCommentLocation>, pullRequestId: string, awsAccountId: string, repositoryName?: string, accountRegion?: string) => Array<NewNotification>;
44
47
  //# sourceMappingURL=diff.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/CacheService/diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,YAAY,EAAiB,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAElF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IAChD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ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AC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IAChD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,CAAA;IACrC,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAAA;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAClD;AAID,eAAO,MAAM,MAAM,WACT,UAAU,SACX,UAAU,gBACH,MAAM,KACnB,KAAK,CAAC,eAAe,CAmEvB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB,gBACf,aAAa,CAAC,YAAY,CAAC,cAC5B,aAAa,CAAC,YAAY,CAAC,eAC1B,MAAM,GAAG,SAAS,QACzB,MAAM,gBACE,MAAM,YACV,MAAM,YACN,MAAM,mBACC,MAAM,kBACP,MAAM,KACrB,KAAK,CAAC,eAAe,CAiCvB,CAAA;AA0BD,eAAO,MAAM,YAAY,WACf,aAAa,CAAC,iBAAiB,CAAC,SACjC,aAAa,CAAC,iBAAiB,CAAC,iBACxB,MAAM,gBACP,MAAM,mBACH,MAAM,kBACP,MAAM,KACrB,KAAK,CAAC,eAAe,CAkCvB,CAAA"}
@@ -1,5 +1,12 @@
1
+ const isEnabled = (value) => value === true || value === 1;
1
2
  export const diffPR = (cached, fresh, awsAccountId) => {
2
- const base = { pullRequestId: fresh.id, awsAccountId, profile: fresh.accountProfile };
3
+ const base = {
4
+ pullRequestId: fresh.id,
5
+ awsAccountId,
6
+ profile: fresh.accountProfile,
7
+ ...((fresh.accountRegion !== undefined) && { accountRegion: fresh.accountRegion }),
8
+ repositoryName: fresh.repositoryName
9
+ };
3
10
  const label = `#${fresh.id} ${fresh.title} (${fresh.repositoryName})`;
4
11
  const notifications = [];
5
12
  // Skip comment diff when cached count is null/undefined (first fetch — no baseline to compare)
@@ -9,20 +16,24 @@ export const diffPR = (cached, fresh, awsAccountId) => {
9
16
  notifications.push({ ...base, type: "new_comment", title: fresh.title, message: `New comments on ${label}` });
10
17
  }
11
18
  }
12
- if (Boolean(fresh.isApproved) !== Boolean(cached.isApproved)) {
19
+ const freshApproved = isEnabled(fresh.isApproved);
20
+ const cachedApproved = isEnabled(cached.isApproved);
21
+ const freshMergeable = isEnabled(fresh.isMergeable);
22
+ const cachedMergeable = isEnabled(cached.isMergeable);
23
+ if (freshApproved !== cachedApproved) {
13
24
  notifications.push({
14
25
  ...base,
15
26
  type: "approval_changed",
16
27
  title: fresh.title,
17
- message: `Approval ${fresh.isApproved ? "granted" : "revoked"} on ${label}`
28
+ message: `Approval ${freshApproved ? "granted" : "revoked"} on ${label}`
18
29
  });
19
30
  }
20
- if (Boolean(fresh.isMergeable) !== Boolean(cached.isMergeable)) {
31
+ if (freshMergeable !== cachedMergeable) {
21
32
  notifications.push({
22
33
  ...base,
23
34
  type: "merge_changed",
24
35
  title: fresh.title,
25
- message: `${label} is ${fresh.isMergeable ? "now mergeable" : "no longer mergeable"}`
36
+ message: `${label} is ${freshMergeable ? "now mergeable" : "no longer mergeable"}`
26
37
  });
27
38
  }
28
39
  if (fresh.title !== cached.title) {
@@ -38,7 +49,7 @@ export const diffPR = (cached, fresh, awsAccountId) => {
38
49
  }
39
50
  if (fresh.status !== cached.status) {
40
51
  // CodeCommit sets isMergeable=false after merge, so CLOSED+!isMergeable = merged
41
- if (fresh.status === "CLOSED" && !fresh.isMergeable) {
52
+ if (fresh.status === "CLOSED" && !freshMergeable) {
42
53
  notifications.push({ ...base, type: "pr_merged", title: fresh.title, message: `${label} was merged` });
43
54
  }
44
55
  else if (fresh.status === "CLOSED") {
@@ -53,15 +64,17 @@ export const diffPR = (cached, fresh, awsAccountId) => {
53
64
  /**
54
65
  * Detect when currentUser is newly added to an approval pool.
55
66
  */
56
- export const diffApprovalPools = (cachedRules, freshRules, currentUser, prId, awsAccountId, prTitle, profile) => {
57
- if (!currentUser)
67
+ export const diffApprovalPools = (cachedRules, freshRules, currentUser, prId, awsAccountId, prTitle, profile, repositoryName, accountRegion) => {
68
+ if (currentUser === undefined || currentUser === "")
58
69
  return [];
59
70
  const wasInPool = cachedRules.some((r) => r.poolMembers.includes(currentUser));
60
71
  const nowInPool = freshRules.some((r) => r.poolMembers.includes(currentUser));
61
72
  const notifications = [];
62
73
  const optional = {
63
74
  ...((prTitle != null) && { title: prTitle }),
64
- ...((profile != null) && { profile })
75
+ ...((profile != null) && { profile }),
76
+ ...((repositoryName != null) && { repositoryName }),
77
+ ...((accountRegion != null) && { accountRegion })
65
78
  };
66
79
  if (!wasInPool && nowInPool) {
67
80
  notifications.push({
@@ -106,8 +119,13 @@ const flattenLocations = (locations) => {
106
119
  }
107
120
  return all;
108
121
  };
109
- export const diffComments = (cached, fresh, pullRequestId, awsAccountId) => {
110
- const base = { pullRequestId, awsAccountId };
122
+ export const diffComments = (cached, fresh, pullRequestId, awsAccountId, repositoryName, accountRegion) => {
123
+ const base = {
124
+ pullRequestId,
125
+ awsAccountId,
126
+ ...((repositoryName !== undefined) && { repositoryName }),
127
+ ...((accountRegion !== undefined) && { accountRegion })
128
+ };
111
129
  const cachedFlat = flattenLocations(cached);
112
130
  const freshFlat = flattenLocations(fresh);
113
131
  const cachedMap = new Map(cachedFlat.map((c) => [c.id, c]));
@@ -122,11 +140,11 @@ export const diffComments = (cached, fresh, pullRequestId, awsAccountId) => {
122
140
  hasNew = true;
123
141
  }
124
142
  const old = cachedMap.get(f.id);
125
- if (old && old.content !== f.content && !f.deleted && !hasEdited) {
143
+ if (old !== undefined && old.content !== f.content && f.deleted !== true && hasEdited === false) {
126
144
  notifications.push({ ...base, type: "comment_edited", message: `Comment edited on #${pullRequestId}` });
127
145
  hasEdited = true;
128
146
  }
129
- if (old && !old.deleted && f.deleted && !hasDeleted) {
147
+ if (old !== undefined && old.deleted === false && f.deleted === true && hasDeleted === false) {
130
148
  notifications.push({ ...base, type: "comment_deleted", message: `Comment deleted on #${pullRequestId}` });
131
149
  hasDeleted = true;
132
150
  }
@@ -1 +1 @@
1
- {"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/CacheService/diff.ts"],"names":[],"mappings":"AAwCA,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,MAAkB,EAClB,KAAiB,EACjB,YAAoB,EACI,EAAE;IAC1B,MAAM,IAAI,GAAG,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK,CAAC,cAAc,EAAE,CAAA;IACrF,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,cAAc,GAAG,CAAA;IACrE,MAAM,aAAa,GAA2B,EAAE,CAAA;IAEhD,+FAA+F;IAC/F,IAAI,MAAM,CAAC,YAAY,IAAI,IAAI,EAAE,CAAC;QAChC,MAAM,aAAa,GAAG,KAAK,CAAC,YAAY,IAAI,CAAC,CAAA;QAC7C,IAAI,aAAa,GAAG,MAAM,CAAC,YAAY,EAAE,CAAC;YACxC,aAAa,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,mBAAmB,KAAK,EAAE,EAAE,CAAC,CAAA;QAC/G,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;Q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I,SAAS,EAAE,CAAC;QAC1B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACpC,aAAa,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,mBAAmB,aAAa,EAAE,EAAE,CAAC,CAAA;YACjG,MAAM,GAAG,IAAI,CAAA;QACf,CAAC;QACD,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QAC/B,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,KAAK,IAAI,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;YAChG,aAAa,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,sBAAsB,aAAa,EAAE,EAAE,CAAC,CAAA;YACvG,SAAS,GAAG,IAAI,CAAA;QAClB,CAAC;QACD,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,OAAO,KAAK,IAAI,IAAI,UAAU,KAAK,KAAK,EAAE,CAAC;YAC7F,aAAa,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,uBAAuB,aAAa,EAAE,EAAE,CAAC,CAAA;YACzG,UAAU,GAAG,IAAI,CAAA;QACnB,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as SqlClient from "effect/unstable/sql/SqlClient";
3
+ declare const _default: Effect.Effect<readonly import("effect/unstable/sql/SqlConnection").Row[], import("effect/unstable/sql/SqlError").SqlError, SqlClient.SqlClient>;
4
+ export default _default;
5
+ //# sourceMappingURL=0017_sandbox_region.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0017_sandbox_region.d.ts","sourceRoot":"","sources":["../../../src/CacheService/migrations/0017_sandbox_region.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA"}
@@ -0,0 +1,4 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as SqlClient from "effect/unstable/sql/SqlClient";
3
+ export default Effect.flatMap(SqlClient.SqlClient, (sql) => sql `ALTER TABLE sandboxes ADD COLUMN region TEXT`);
4
+ //# sourceMappingURL=0017_sandbox_region.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0017_sandbox_region.js","sourceRoot":"","sources":["../../../src/CacheService/migrations/0017_sandbox_region.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAE1D,eAAe,MAAM,CAAC,OAAO,CAC3B,SAAS,CAAC,SAAS,EACnB,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAA,8CAA8C,CAC3D,CAAA"}
@@ -0,0 +1,6 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as SqlClient from "effect/unstable/sql/SqlClient";
3
+ /** Re-key cached PR rows so repository and region are part of durable identity. */
4
+ declare const _default: Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient.SqlClient>;
5
+ export default _default;
6
+ //# sourceMappingURL=0018_pull_request_coordinates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0018_pull_request_coordinates.d.ts","sourceRoot":"","sources":["../../../src/CacheService/migrations/0018_pull_request_coordinates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAE1D,mFAAmF"}
@@ -0,0 +1,82 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as SqlClient from "effect/unstable/sql/SqlClient";
3
+ /** Re-key cached PR rows so repository and region are part of durable identity. */
4
+ export default Effect.flatMap(SqlClient.SqlClient, (sql) => Effect.gen(function* () {
5
+ yield* sql `DROP TRIGGER IF EXISTS pull_requests_ai`;
6
+ yield* sql `DROP TRIGGER IF EXISTS pull_requests_ad`;
7
+ yield* sql `DROP TRIGGER IF EXISTS pull_requests_au`;
8
+ yield* sql `DROP TABLE IF EXISTS pull_requests_fts`;
9
+ yield* sql `CREATE TABLE pull_requests_coordinates_new (
10
+ id TEXT NOT NULL,
11
+ aws_account_id TEXT NOT NULL,
12
+ repo_account_id TEXT,
13
+ account_profile TEXT NOT NULL,
14
+ account_region TEXT NOT NULL,
15
+ title TEXT NOT NULL,
16
+ description TEXT,
17
+ author TEXT NOT NULL,
18
+ repository_name TEXT NOT NULL,
19
+ creation_date TEXT NOT NULL,
20
+ last_modified_date TEXT NOT NULL,
21
+ status TEXT NOT NULL,
22
+ source_branch TEXT NOT NULL,
23
+ destination_branch TEXT NOT NULL,
24
+ is_mergeable INTEGER NOT NULL DEFAULT 0,
25
+ is_approved INTEGER NOT NULL DEFAULT 0,
26
+ comment_count INTEGER,
27
+ link TEXT NOT NULL,
28
+ fetched_at TEXT NOT NULL DEFAULT (datetime('now')),
29
+ files_added INTEGER,
30
+ files_modified INTEGER,
31
+ files_deleted INTEGER,
32
+ health_score REAL,
33
+ closed_at TEXT,
34
+ merged_by TEXT,
35
+ approved_by TEXT,
36
+ commented_by TEXT,
37
+ approval_rules TEXT DEFAULT '[]',
38
+ approved_by_arns TEXT,
39
+ PRIMARY KEY (aws_account_id, id, repository_name, account_region)
40
+ )`;
41
+ yield* sql `INSERT INTO pull_requests_coordinates_new (
42
+ id, aws_account_id, repo_account_id, account_profile, account_region,
43
+ title, description, author, repository_name, creation_date,
44
+ last_modified_date, status, source_branch, destination_branch,
45
+ is_mergeable, is_approved, comment_count, link, fetched_at,
46
+ files_added, files_modified, files_deleted, health_score, closed_at, merged_by,
47
+ approved_by, commented_by, approval_rules, approved_by_arns
48
+ ) SELECT
49
+ id, aws_account_id, repo_account_id, account_profile, account_region,
50
+ title, description, author, repository_name, creation_date,
51
+ last_modified_date, status, source_branch, destination_branch,
52
+ is_mergeable, is_approved, comment_count, link, fetched_at,
53
+ files_added, files_modified, files_deleted, health_score, closed_at, merged_by,
54
+ approved_by, commented_by, approval_rules, approved_by_arns
55
+ FROM pull_requests`;
56
+ yield* sql `DROP TABLE pull_requests`;
57
+ yield* sql `ALTER TABLE pull_requests_coordinates_new RENAME TO pull_requests`;
58
+ yield* sql `CREATE INDEX IF NOT EXISTS idx_pr_creation_date ON pull_requests(creation_date)`;
59
+ yield* sql `CREATE INDEX IF NOT EXISTS idx_pr_status ON pull_requests(status)`;
60
+ yield* sql `CREATE INDEX IF NOT EXISTS idx_pr_author ON pull_requests(author)`;
61
+ yield* sql `CREATE INDEX IF NOT EXISTS idx_pr_last_modified ON pull_requests(last_modified_date)`;
62
+ yield* sql `CREATE VIRTUAL TABLE pull_requests_fts USING fts5(
63
+ title, description, author, repository_name,
64
+ content='pull_requests', content_rowid='rowid'
65
+ )`;
66
+ yield* sql `CREATE TRIGGER pull_requests_ai AFTER INSERT ON pull_requests BEGIN
67
+ INSERT INTO pull_requests_fts(rowid, title, description, author, repository_name)
68
+ VALUES (new.rowid, new.title, new.description, new.author, new.repository_name);
69
+ END`;
70
+ yield* sql `CREATE TRIGGER pull_requests_ad AFTER DELETE ON pull_requests BEGIN
71
+ INSERT INTO pull_requests_fts(pull_requests_fts, rowid, title, description, author, repository_name)
72
+ VALUES ('delete', old.rowid, old.title, old.description, old.author, old.repository_name);
73
+ END`;
74
+ yield* sql `CREATE TRIGGER pull_requests_au AFTER UPDATE ON pull_requests BEGIN
75
+ INSERT INTO pull_requests_fts(pull_requests_fts, rowid, title, description, author, repository_name)
76
+ VALUES ('delete', old.rowid, old.title, old.description, old.author, old.repository_name);
77
+ INSERT INTO pull_requests_fts(rowid, title, description, author, repository_name)
78
+ VALUES (new.rowid, new.title, new.description, new.author, new.repository_name);
79
+ END`;
80
+ yield* sql `INSERT INTO pull_requests_fts(pull_requests_fts) VALUES ('rebuild')`;
81
+ }));
82
+ //# sourceMappingURL=0018_pull_request_coordinates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0018_pull_request_coordinates.js","sourceRoot":"","sources":["../../../src/CacheService/migrations/0018_pull_request_coordinates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAE1D,mFAAmF;AACnF,eAAe,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CACzD,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,KAAK,CAAC,CAAC,GAAG,CAAA,yCAAyC,CAAA;IACnD,KAAK,CAAC,CAAC,GAAG,CAAA,yCAAyC,CAAA;IACnD,KAAK,CAAC,CAAC,GAAG,CAAA,yCAAyC,CAAA;IACnD,KAAK,CAAC,CAAC,GAAG,CAAA,wCAAwC,CAAA;IAClD,KAAK,CAAC,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BR,CAAA;IACF,KAAK,CAAC,CAAC,GAAG,CAAA;;;;;;;;;;;;;;yBAcW,CAAA;IACrB,KAAK,CAAC,CAAC,GAAG,CAAA,0BAA0B,CAAA;IACpC,KAAK,CAAC,CAAC,GAAG,CAAA,mEAAmE,CAAA;IAC7E,KAAK,CAAC,CAAC,GAAG,CAAA,iFAAiF,CAAA;IAC3F,KAAK,CAAC,CAAC,GAAG,CAAA,mEAAmE,CAAA;IAC7E,KAAK,CAAC,CAAC,GAAG,CAAA,mEAAmE,CAAA;IAC7E,KAAK,CAAC,CAAC,GAAG,CAAA,sFAAsF,CAAA;IAChG,KAAK,CAAC,CAAC,GAAG,CAAA;;;MAGR,CAAA;IACF,KAAK,CAAC,CAAC,GAAG,CAAA;;;QAGN,CAAA;IACJ,KAAK,CAAC,CAAC,GAAG,CAAA;;;QAGN,CAAA;IACJ,KAAK,CAAC,CAAC,GAAG,CAAA;;;;;QAKN,CAAA;IACJ,KAAK,CAAC,CAAC,GAAG,CAAA,qEAAqE,CAAA;AACjF,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as SqlClient from "effect/unstable/sql/SqlClient";
3
+ /** Backfill uniquely attributable dependent rows while retaining ambiguous/orphan sentinels. */
4
+ declare const _default: Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient.SqlClient>;
5
+ export default _default;
6
+ //# sourceMappingURL=0019_dependent_pr_coordinates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0019_dependent_pr_coordinates.d.ts","sourceRoot":"","sources":["../../../src/CacheService/migrations/0019_dependent_pr_coordinates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAE1D,gGAAgG"}
@@ -0,0 +1,57 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as SqlClient from "effect/unstable/sql/SqlClient";
3
+ /** Backfill uniquely attributable dependent rows while retaining ambiguous/orphan sentinels. */
4
+ export default Effect.flatMap(SqlClient.SqlClient, (sql) => Effect.gen(function* () {
5
+ yield* sql `CREATE TABLE pr_comments_coordinates_new (
6
+ pull_request_id TEXT NOT NULL,
7
+ aws_account_id TEXT NOT NULL,
8
+ repository_name TEXT NOT NULL DEFAULT '',
9
+ account_region TEXT NOT NULL DEFAULT '',
10
+ locations_json TEXT NOT NULL,
11
+ fetched_at TEXT NOT NULL DEFAULT (datetime('now')),
12
+ PRIMARY KEY (aws_account_id, pull_request_id, repository_name, account_region)
13
+ )`;
14
+ yield* sql `INSERT INTO pr_comments_coordinates_new (
15
+ pull_request_id, aws_account_id, repository_name, account_region, locations_json, fetched_at
16
+ ) SELECT pull_request_id, aws_account_id,
17
+ CASE WHEN (SELECT count(*) FROM pull_requests p
18
+ WHERE p.aws_account_id = pr_comments.aws_account_id AND p.id = pr_comments.pull_request_id) = 1
19
+ THEN (SELECT p.repository_name FROM pull_requests p
20
+ WHERE p.aws_account_id = pr_comments.aws_account_id AND p.id = pr_comments.pull_request_id)
21
+ ELSE '' END,
22
+ CASE WHEN (SELECT count(*) FROM pull_requests p
23
+ WHERE p.aws_account_id = pr_comments.aws_account_id AND p.id = pr_comments.pull_request_id) = 1
24
+ THEN (SELECT p.account_region FROM pull_requests p
25
+ WHERE p.aws_account_id = pr_comments.aws_account_id AND p.id = pr_comments.pull_request_id)
26
+ ELSE '' END,
27
+ locations_json, fetched_at
28
+ FROM pr_comments`;
29
+ yield* sql `DROP TABLE pr_comments`;
30
+ yield* sql `ALTER TABLE pr_comments_coordinates_new RENAME TO pr_comments`;
31
+ yield* sql `CREATE TABLE pr_subscriptions_coordinates_new (
32
+ pull_request_id TEXT NOT NULL,
33
+ aws_account_id TEXT NOT NULL,
34
+ repository_name TEXT NOT NULL DEFAULT '',
35
+ account_region TEXT NOT NULL DEFAULT '',
36
+ subscribed_at TEXT NOT NULL DEFAULT (datetime('now')),
37
+ PRIMARY KEY (aws_account_id, pull_request_id, repository_name, account_region)
38
+ )`;
39
+ yield* sql `INSERT INTO pr_subscriptions_coordinates_new (
40
+ pull_request_id, aws_account_id, repository_name, account_region, subscribed_at
41
+ ) SELECT pull_request_id, aws_account_id,
42
+ CASE WHEN (SELECT count(*) FROM pull_requests p
43
+ WHERE p.aws_account_id = pr_subscriptions.aws_account_id AND p.id = pr_subscriptions.pull_request_id) = 1
44
+ THEN (SELECT p.repository_name FROM pull_requests p
45
+ WHERE p.aws_account_id = pr_subscriptions.aws_account_id AND p.id = pr_subscriptions.pull_request_id)
46
+ ELSE '' END,
47
+ CASE WHEN (SELECT count(*) FROM pull_requests p
48
+ WHERE p.aws_account_id = pr_subscriptions.aws_account_id AND p.id = pr_subscriptions.pull_request_id) = 1
49
+ THEN (SELECT p.account_region FROM pull_requests p
50
+ WHERE p.aws_account_id = pr_subscriptions.aws_account_id AND p.id = pr_subscriptions.pull_request_id)
51
+ ELSE '' END,
52
+ subscribed_at
53
+ FROM pr_subscriptions`;
54
+ yield* sql `DROP TABLE pr_subscriptions`;
55
+ yield* sql `ALTER TABLE pr_subscriptions_coordinates_new RENAME TO pr_subscriptions`;
56
+ }));
57
+ //# sourceMappingURL=0019_dependent_pr_coordinates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0019_dependent_pr_coordinates.js","sourceRoot":"","sources":["../../../src/CacheService/migrations/0019_dependent_pr_coordinates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAE1D,gGAAgG;AAChG,eAAe,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CACzD,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,KAAK,CAAC,CAAC,GAAG,CAAA;;;;;;;;MAQR,CAAA;IACF,KAAK,CAAC,CAAC,GAAG,CAAA;;;;;;;;;;;;;;uBAcS,CAAA;IACnB,KAAK,CAAC,CAAC,GAAG,CAAA,wBAAwB,CAAA;IAClC,KAAK,CAAC,CAAC,GAAG,CAAA,+DAA+D,CAAA;IAEzE,KAAK,CAAC,CAAC,GAAG,CAAA;;;;;;;MAOR,CAAA;IACF,KAAK,CAAC,CAAC,GAAG,CAAA;;;;;;;;;;;;;;4BAcc,CAAA;IACxB,KAAK,CAAC,CAAC,GAAG,CAAA,6BAA6B,CAAA;IACvC,KAAK,CAAC,CAAC,GAAG,CAAA,yEAAyE,CAAA;AACrF,CAAC,CAAC,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as SqlClient from "effect/unstable/sql/SqlClient";
3
+ /** Add exact PR coordinates to notifications while retaining legacy rows as unqualified. */
4
+ declare const _default: Effect.Effect<void, any, SqlClient.SqlClient>;
5
+ export default _default;
6
+ //# sourceMappingURL=0020_notification_coordinates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0020_notification_coordinates.d.ts","sourceRoot":"","sources":["../../../src/CacheService/migrations/0020_notification_coordinates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAgB1D,4FAA4F"}
@@ -0,0 +1,22 @@
1
+ import * as Effect from "effect/Effect";
2
+ import * as Predicate from "effect/Predicate";
3
+ import * as SqlClient from "effect/unstable/sql/SqlClient";
4
+ import * as SqlError from "effect/unstable/sql/SqlError";
5
+ /** Only an already-present column is safe to treat as migration idempotence. */
6
+ const isDuplicateColumnError = (error) => {
7
+ if (!SqlError.isSqlError(error))
8
+ return false;
9
+ const reasonMessage = error.reason.message;
10
+ if (reasonMessage !== undefined && /duplicate column name/i.test(reasonMessage))
11
+ return true;
12
+ const cause = error.reason.cause;
13
+ return Predicate.hasProperty(cause, "message") &&
14
+ Predicate.isString(cause.message) &&
15
+ /duplicate column name/i.test(cause.message);
16
+ };
17
+ /** Add exact PR coordinates to notifications while retaining legacy rows as unqualified. */
18
+ export default Effect.flatMap(SqlClient.SqlClient, (sql) => Effect.all([
19
+ sql `ALTER TABLE notifications ADD COLUMN repository_name TEXT NOT NULL DEFAULT ''`.pipe(Effect.catchIf(isDuplicateColumnError, () => Effect.void)),
20
+ sql `ALTER TABLE notifications ADD COLUMN account_region TEXT NOT NULL DEFAULT ''`.pipe(Effect.catchIf(isDuplicateColumnError, () => Effect.void))
21
+ ]).pipe(Effect.asVoid));
22
+ //# sourceMappingURL=0020_notification_coordinates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0020_notification_coordinates.js","sourceRoot":"","sources":["../../../src/CacheService/migrations/0020_notification_coordinates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAC1D,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAA;AAExD,gFAAgF;AAChF,MAAM,sBAAsB,GAAqD,CAC/E,KAAK,EACuB,EAAE;IAC9B,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAC7C,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,OAAO,CAAA;IAC1C,IAAI,aAAa,KAAK,SAAS,IAAI,wBAAwB,CAAC,IAAI,CAAC,aAAa,CAAC;QAAE,OAAO,IAAI,CAAA;IAC5F,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAA;IAChC,OAAO,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC;QAC5C,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC;QACjC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChD,CAAC,CAAA;AAED,4FAA4F;AAC5F,eAAe,MAAM,CAAC,OAAO,CAC3B,SAAS,CAAC,SAAS,EACnB,CAAC,GAAG,EAAE,EAAE,CACN,MAAM,CAAC,GAAG,CAAC;IACT,GAAG,CAAA,+EAA+E,CAAC,IAAI,CACrF,MAAM,CAAC,OAAO,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1D;IACD,GAAG,CAAA,8EAA8E,CAAC,IAAI,CACpF,MAAM,CAAC,OAAO,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1D;CACF,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CACzB,CAAA"}
@@ -4,9 +4,13 @@ import * as SqlClient from "effect/unstable/sql/SqlClient";
4
4
  import type { PRCommentLocation } from "../../Domain.js";
5
5
  import { CacheError } from "../CacheError.js";
6
6
  import { EventsHub } from "../EventsHub.js";
7
+ export interface CommentCoordinates {
8
+ readonly repositoryName: string;
9
+ readonly accountRegion: string;
10
+ }
7
11
  declare const makeCommentRepo: Effect.Effect<{
8
- find: (awsAccountId: string, prId: string) => Effect.Effect<Option.Option<readonly PRCommentLocation[]>, CacheError, never>;
9
- upsert: (awsAccountId: string, prId: string, locationsJson: string) => Effect.Effect<void, CacheError, never>;
12
+ find: (awsAccountId: string, prId: string, coordinates?: CommentCoordinates) => Effect.Effect<Option.Option<readonly PRCommentLocation[]>, CacheError, never>;
13
+ upsert: (awsAccountId: string, prId: string, locationsJson: string, coordinates?: CommentCoordinates) => Effect.Effect<void, CacheError, never>;
10
14
  }, never, EventsHub | SqlClient.SqlClient>;
11
15
  export interface CommentRepoContract extends Success<typeof makeCommentRepo> {
12
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CommentRepo.d.ts","sourceRoot":"","sources":["../../../src/CacheService/repos/CommentRepo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAE1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAA;AAavD,QAAA,MAAM,eAAe;yBAsBI,MAAM,QAAQ,MAAM;2BAalB,MAAM,QAAQ,MAAM,iBAAiB,MAAM;0CAKpE,CAAA;AAEF,MAAM,WAAW,mBAAoB,SAAQ,OAAO,CAAC,OAAO,eAAe,CAAC;CAAG;;AAE/E,qBAAa,WAAY,SAAQ,gBAGf;IAChB,MAAM,CAAC,QAAQ,CAAC,OAAO,mMAEtB;CACF"}
1
+ {"version":3,"file":"CommentRepo.d.ts","sourceRoot":"","sources":["../../../src/CacheService/repos/CommentRepo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAE1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAA;AAOvD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC/B;AAUD,QAAA,MAAM,eAAe;yBAyDI,MAAM,QAAQ,MAAM,gBAAgB,kBAAkB;2BAoBpD,MAAM,QAAQ,MAAM,iBAAiB,MAAM,gBAAgB,kBAAkB;0CAKtG,CAAA;AAEF,MAAM,WAAW,mBAAoB,SAAQ,OAAO,CAAC,OAAO,eAAe,CAAC;CAAG;;AAE/E,qBAAa,WAAY,SAAQ,gBAGf;IAChB,MAAM,CAAC,QAAQ,CAAC,OAAO,mMAEtB;CACF"}
@@ -8,28 +8,67 @@ import { decodeCommentLocations } from "./commentLocations.js";
8
8
  const CommentRow = Schema.Struct({
9
9
  locationsJson: Schema.String
10
10
  });
11
+ const legacyCoordinate = "";
11
12
  const cacheError = (op) => (effect) => effect.pipe(Effect.mapError((cause) => new CacheError({ operation: `CommentRepo.${op}`, cause })), Effect.withSpan(`CommentRepo.${op}`));
12
13
  const makeCommentRepo = Effect.gen(function* () {
13
14
  const sql = yield* SqlClient.SqlClient;
14
15
  const hub = yield* EventsHub;
15
- const find_ = SqlSchema.findOneOption({
16
+ const findLegacy_ = SqlSchema.findOneOption({
16
17
  Result: CommentRow,
17
18
  Request: Schema.Struct({ awsAccountId: Schema.String, pullRequestId: Schema.String }),
18
19
  execute: (req) => sql `SELECT locations_json FROM pr_comments
19
20
  WHERE aws_account_id = ${req.awsAccountId}
20
- AND pull_request_id = ${req.pullRequestId}`
21
+ AND pull_request_id = ${req.pullRequestId}
22
+ AND repository_name = ${legacyCoordinate}
23
+ AND account_region = ${legacyCoordinate}`
21
24
  });
22
- const upsert_ = (awsAccountId, prId, locationsJson) => sql `INSERT OR REPLACE INTO pr_comments
23
- (aws_account_id, pull_request_id, locations_json, fetched_at)
24
- VALUES (${awsAccountId}, ${prId}, ${locationsJson}, datetime('now'))
25
+ const findExact_ = SqlSchema.findOneOption({
26
+ Result: CommentRow,
27
+ Request: Schema.Struct({
28
+ awsAccountId: Schema.String,
29
+ pullRequestId: Schema.String,
30
+ repositoryName: Schema.String,
31
+ accountRegion: Schema.String
32
+ }),
33
+ execute: (req) => sql `SELECT locations_json FROM pr_comments
34
+ WHERE aws_account_id = ${req.awsAccountId}
35
+ AND pull_request_id = ${req.pullRequestId}
36
+ AND (
37
+ (repository_name = ${req.repositoryName} AND account_region = ${req.accountRegion})
38
+ OR (
39
+ repository_name = ${legacyCoordinate}
40
+ AND account_region = ${legacyCoordinate}
41
+ AND (
42
+ SELECT count(*) FROM pull_requests
43
+ WHERE aws_account_id = ${req.awsAccountId} AND id = ${req.pullRequestId}
44
+ ) = 1
45
+ )
46
+ )
47
+ ORDER BY CASE
48
+ WHEN repository_name = ${req.repositoryName} AND account_region = ${req.accountRegion} THEN 0
49
+ ELSE 1
50
+ END
51
+ LIMIT 1`
52
+ });
53
+ const upsert_ = (awsAccountId, prId, locationsJson, coordinates) => sql `INSERT OR REPLACE INTO pr_comments
54
+ (aws_account_id, pull_request_id, repository_name, account_region, locations_json, fetched_at)
55
+ VALUES (${awsAccountId}, ${prId}, ${coordinates?.repositoryName ?? legacyCoordinate}, ${coordinates?.accountRegion ?? legacyCoordinate},
56
+ ${locationsJson}, datetime('now'))
25
57
  `.pipe(Effect.asVoid);
26
58
  const publish = hub.publish(RepoChange.Comments());
27
59
  const repo = {
28
- find: (awsAccountId, prId) => find_({ awsAccountId, pullRequestId: prId }).pipe(Effect.flatMap(Option.match({
60
+ find: (awsAccountId, prId, coordinates) => (coordinates === undefined
61
+ ? findLegacy_({ awsAccountId, pullRequestId: prId })
62
+ : findExact_({
63
+ awsAccountId,
64
+ pullRequestId: prId,
65
+ repositoryName: coordinates.repositoryName,
66
+ accountRegion: coordinates.accountRegion
67
+ })).pipe(Effect.flatMap(Option.match({
29
68
  onNone: () => Effect.succeed(Option.none()),
30
69
  onSome: (r) => decodeCommentLocations(r.locationsJson).pipe(Effect.map((decoded) => Option.some(decoded)))
31
70
  })), cacheError("find")),
32
- upsert: (awsAccountId, prId, locationsJson) => upsert_(awsAccountId, prId, locationsJson).pipe(Effect.tap(() => publish), cacheError("upsert"))
71
+ upsert: (awsAccountId, prId, locationsJson, coordinates) => upsert_(awsAccountId, prId, locationsJson, coordinates).pipe(Effect.tap(() => publish), cacheError("upsert"))
33
72
  };
34
73
  return repo;
35
74
  });
@@ -1 +1 @@
1
- {"version":3,"file":"CommentRepo.js","sourceRoot":"","sources":["../../../src/CacheService/repos/CommentRepo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/D,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAC1D,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,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AAU,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,IAAI,CACvE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,YAAY,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAC/D,CAAA;CACF"}
@@ -12,6 +12,8 @@ declare const NotificationRow: Schema.Struct<{
12
12
  readonly message: Schema.String;
13
13
  readonly title: Schema.String;
14
14
  readonly profile: Schema.String;
15
+ readonly repositoryName: Schema.String;
16
+ readonly accountRegion: Schema.String;
15
17
  readonly createdAt: Schema.String;
16
18
  readonly read: Schema.Number;
17
19
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationRepo.d.ts","sourceRoot":"","sources":["../../../src/CacheService/repos/NotificationRepo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,SAAS,MAAM,+BAA+B,CAAA;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAA;AAEvD,QAAA,MAAM,eAAe;;;;;;;;;;EAUnB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AACzD,YAAY,EAAE,eAAe,EAAE,CAAA;AAM/B,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAiBD,QAAA,MAAM,oBAAoB;qBAyEL;QACf,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;Q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AA;AACzD,YAAY,EAAE,eAAe,EAAE,CAAA;AAM/B,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAiBD,QAAA,MAAM,oBAAoB;qBA4EL;QACf,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;QAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;QACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;QACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;KACnC,KAAG,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE,UAAU,CAAC;aAoB5C,eAAe;mBAET;QACb,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;QACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;QACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;QACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAC/B;mBAwBc,MAAM;qBAEJ,MAAM;;;0CAWzB,CAAA;AAEF,MAAM,WAAW,wBAAyB,SAAQ,OAAO,CAAC,OAAO,oBAAoB,CAAC;CAAG;;AAEzF,qBAAa,gBAAiB,SAAQ,qBAGf;IACrB,MAAM,CAAC,QAAQ,CAAC,OAAO,wMAEtB;CACF"}
@@ -12,6 +12,8 @@ const NotificationRow = Schema.Struct({
12
12
  message: Schema.String,
13
13
  title: Schema.String,
14
14
  profile: Schema.String,
15
+ repositoryName: Schema.String,
16
+ accountRegion: Schema.String,
15
17
  createdAt: Schema.String,
16
18
  read: Schema.Number
17
19
  });
@@ -77,8 +79,13 @@ const makeNotificationRepo = Effect.gen(function* () {
77
79
  return sql `SELECT * FROM notifications WHERE id < ${req.cursor} ORDER BY id DESC LIMIT ${req.limit}`;
78
80
  }
79
81
  });
80
- const add_ = (n) => Clock.currentTimeMillis.pipe(Effect.flatMap((nowMs) => sql `INSERT INTO notifications (pull_request_id, aws_account_id, type, message, title, profile, created_at)
81
- VALUES (${n.pullRequestId}, ${n.awsAccountId}, ${n.type}, ${n.message}, ${n.title ?? ""}, ${n.profile ?? ""}, ${new Date(nowMs).toISOString()})`), Effect.asVoid);
82
+ const add_ = (n) => Clock.currentTimeMillis.pipe(Effect.flatMap((nowMs) => sql `INSERT INTO notifications (
83
+ pull_request_id, aws_account_id, type, message, title, profile,
84
+ repository_name, account_region, created_at
85
+ ) VALUES (
86
+ ${n.pullRequestId}, ${n.awsAccountId}, ${n.type}, ${n.message}, ${n.title ?? ""}, ${n.profile ?? ""},
87
+ ${n.repositoryName ?? ""}, ${n.accountRegion ?? ""}, ${new Date(nowMs).toISOString()}
88
+ )`), Effect.asVoid);
82
89
  const markRead_ = (id) => sql `UPDATE notifications SET read = 1 WHERE id = ${id}`.pipe(Effect.asVoid);
83
90
  const markUnread_ = (id) => sql `UPDATE notifications SET read = 0 WHERE id = ${id}`.pipe(Effect.asVoid);
84
91
  const markAllRead_ = () => sql `UPDATE notifications SET read = 1 WHERE read = 0`.pipe(Effect.asVoid);
@@ -105,7 +112,7 @@ const makeNotificationRepo = Effect.gen(function* () {
105
112
  title: n.title,
106
113
  profile: n.profile ?? ""
107
114
  }).pipe(Effect.tap(() => publish));
108
- if (!n.deduplicate) {
115
+ if (n.deduplicate !== true) {
109
116
  return insert.pipe(cacheError("addSystem"));
110
117
  }
111
118
  // Skip if an unread system notification with same profile+type already exists