comfy-pr 1.4.1 → 1.4.2
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/package.json +1 -1
- package/src/CNRepos.ts +8 -0
- package/src/analyzePullsStatus.ts +3 -0
package/package.json
CHANGED
package/src/CNRepos.ts
CHANGED
|
@@ -94,6 +94,14 @@ CNRepos.createIndex(
|
|
|
94
94
|
},
|
|
95
95
|
).catch(() => {});
|
|
96
96
|
|
|
97
|
+
// Index to support early $match before $unwind in baseCRPullStatusPipeline (analyzePullsStatus.ts)
|
|
98
|
+
// Uses comments.state (scalar Task field) to avoid "Cannot index parallel arrays" error —
|
|
99
|
+
// crPulls.data is already one array level, so comments.data (another array) would be invalid.
|
|
100
|
+
CNRepos.createIndex(
|
|
101
|
+
{ "crPulls.data.comments.state": 1 },
|
|
102
|
+
{ name: "idx_crpulls_comments_state", sparse: true, background: true },
|
|
103
|
+
).catch(console.error);
|
|
104
|
+
|
|
97
105
|
// Note: pulls.mtime index is created by setup-performance-indexes.ts script
|
|
98
106
|
// Run: bun run db:setup-indexes
|
|
99
107
|
|
|
@@ -84,6 +84,9 @@ export function baseCRPullStatusPipeline(): Pipeline<
|
|
|
84
84
|
> {
|
|
85
85
|
return (
|
|
86
86
|
$pipeline(CNRepos)
|
|
87
|
+
// Early filter: skip docs whose crPulls have no fetched comments — avoids full-scan before $unwind
|
|
88
|
+
// Uses comments.state (scalar) not comments.data (array) to avoid "Cannot index parallel arrays"
|
|
89
|
+
.match({ "crPulls.data": { $elemMatch: { "comments.state": "ok" } } })
|
|
87
90
|
// get latest pr comments time
|
|
88
91
|
.set({
|
|
89
92
|
"crPulls.data.pull.latest_comment_at": {
|