comfy-pr 0.2.19 → 0.2.20
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/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/src/analyzePullsStatus.ts +16 -7
- package/src/followRuleSchema.ts +1 -0
- package/src/matchRelatedPulls.ts +36 -1
- package/src/updateCNReposInfo.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.2.20](https://github.com/drip-art/Comfy-Registry-PR/compare/v0.2.19...v0.2.20) (2024-07-02)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **comment-authors:** add ([847b14d](https://github.com/drip-art/Comfy-Registry-PR/commit/847b14d19b1c6bde1bb967c7ff8e7f44d93ac4eb))
|
|
10
|
+
- **comment-authors:** add ([d5ec4f1](https://github.com/drip-art/Comfy-Registry-PR/commit/d5ec4f1199d57b494e77c9613cc3789112be09e9))
|
|
11
|
+
- **misc:** 2024-06-28 meeting changes [@haohao](https://github.com/haohao) ([fe8aac6](https://github.com/drip-art/Comfy-Registry-PR/commit/fe8aac61d587c366a85f74d53b1572f0c74c0791))
|
|
12
|
+
- **misc:** 2024-06-28 meeting changes [@haohao](https://github.com/haohao) ([1cc72d5](https://github.com/drip-art/Comfy-Registry-PR/commit/1cc72d5127de0e7b0d3412706e4a6f0102a558e1))
|
|
13
|
+
|
|
5
14
|
### [0.2.19](https://github.com/drip-art/Comfy-Registry-PR/compare/v0.2.18...v0.2.19) (2024-06-28)
|
|
6
15
|
|
|
7
16
|
### [0.2.18](https://github.com/drip-art/Comfy-Registry-PR/compare/v0.2.17...v0.2.18) (2024-06-27)
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $pipeline } from "@/packages/mongodb-pipeline-ts/$pipeline";
|
|
2
|
-
import
|
|
2
|
+
import pMap from "p-map";
|
|
3
3
|
import prettyMs from "pretty-ms";
|
|
4
4
|
import type { z } from "zod";
|
|
5
5
|
import type { Task } from "../packages/mongodb-pipeline-ts/Task";
|
|
@@ -12,7 +12,7 @@ import type { zPullStatus } from "./zod/zPullsStatus";
|
|
|
12
12
|
// bun --env-file .env.production.local src/dump.ts > dump.csv
|
|
13
13
|
export const DashboardDetails = db.collection<any>("DashboardDetails");
|
|
14
14
|
if (import.meta.main) {
|
|
15
|
-
const r = peekYaml(await analyzePullsStatus());
|
|
15
|
+
// const r = peekYaml(await analyzePullsStatus());
|
|
16
16
|
|
|
17
17
|
// await mkdir(".cache").catch(() => null);
|
|
18
18
|
// await writeFile(".cache/dump.yaml", YAML.stringify(r));
|
|
@@ -22,6 +22,8 @@ if (import.meta.main) {
|
|
|
22
22
|
// await writeFile("src/zPullsStatus.ts", jsonToZod(await analyzePullsStatus({ limit: 1 }), "zPullsStatus", true));
|
|
23
23
|
|
|
24
24
|
// analyzePullsStatusPipeline
|
|
25
|
+
|
|
26
|
+
const base = await pMap(analyzePullsStatusPipeline().group({ _id: "$ownername" }).aggregate(), (e) => e);
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
export type PullStatus = z.infer<typeof zPullStatus>;
|
|
@@ -76,14 +78,20 @@ export function analyzePullsStatusPipeline() {
|
|
|
76
78
|
url: "$html_url",
|
|
77
79
|
author_email: "$base.user.email",
|
|
78
80
|
ownername: "$base.user.login",
|
|
81
|
+
nickName: "$base.user.name",
|
|
79
82
|
head: { $concat: ["$user.login", ":", "$type"] },
|
|
80
83
|
comments: { $size: "$comments" },
|
|
81
84
|
comments_author: {
|
|
82
|
-
|
|
83
|
-
input:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
$trim: {
|
|
86
|
+
input: {
|
|
87
|
+
$reduce: {
|
|
88
|
+
input: "$comments.user.login",
|
|
89
|
+
initialValue: "",
|
|
90
|
+
in: { $concat: ["$$value", " ", "$$this"] },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
chars: " ",
|
|
94
|
+
},
|
|
87
95
|
},
|
|
88
96
|
lastwords: { $arrayElemAt: ["$comments", -1] },
|
|
89
97
|
latest_comment_at: { $toDate: "$latest_comment_at" },
|
|
@@ -114,6 +122,7 @@ export function analyzePullsStatusPipeline() {
|
|
|
114
122
|
on_registry: boolean;
|
|
115
123
|
comments_author: string;
|
|
116
124
|
ownername: string;
|
|
125
|
+
nickName: string;
|
|
117
126
|
repository: string;
|
|
118
127
|
state: "OPEN" | "MERGED" | "CLOSED";
|
|
119
128
|
updated_at: Date;
|
package/src/followRuleSchema.ts
CHANGED
package/src/matchRelatedPulls.ts
CHANGED
|
@@ -6,7 +6,42 @@ import { readTemplateTitle } from "./readTemplateTitle";
|
|
|
6
6
|
|
|
7
7
|
export type RelatedPullsWithComments = Awaited<ReturnType<typeof fetchRelatedPullWithComments>>;
|
|
8
8
|
export type RelatedPull = Awaited<ReturnType<typeof matchRelatedPulls>>[number];
|
|
9
|
-
export async function matchRelatedPulls(pulls: GithubPullParsed[])
|
|
9
|
+
export async function matchRelatedPulls(pulls: GithubPullParsed[]): Promise<
|
|
10
|
+
(
|
|
11
|
+
| {
|
|
12
|
+
type: "pyproject";
|
|
13
|
+
pull: {
|
|
14
|
+
title: string;
|
|
15
|
+
number: number;
|
|
16
|
+
url: string;
|
|
17
|
+
html_url: string;
|
|
18
|
+
user: { login: string; html_url: string };
|
|
19
|
+
body: string | null;
|
|
20
|
+
prState: "closed" | "open" | "merged";
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
createdAt: Date;
|
|
23
|
+
updated_at: Date;
|
|
24
|
+
created_at: Date;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
| {
|
|
28
|
+
type: "publishcr";
|
|
29
|
+
pull: {
|
|
30
|
+
title: string;
|
|
31
|
+
number: number;
|
|
32
|
+
url: string;
|
|
33
|
+
html_url: string;
|
|
34
|
+
user: { login: string; html_url: string };
|
|
35
|
+
body: string | null;
|
|
36
|
+
prState: "closed" | "open" | "merged";
|
|
37
|
+
updatedAt: Date;
|
|
38
|
+
createdAt: Date;
|
|
39
|
+
updated_at: Date;
|
|
40
|
+
created_at: Date;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
)[]
|
|
44
|
+
> {
|
|
10
45
|
const pyproject = await readTemplateTitle("add-toml.md");
|
|
11
46
|
const publishcr = await readTemplateTitle("add-action.md");
|
|
12
47
|
const relatedPulls = await pMap(pulls, async (pull) =>
|
package/src/updateCNReposInfo.ts
CHANGED
|
@@ -26,13 +26,13 @@ export async function updateCNReposInfo() {
|
|
|
26
26
|
.then(({ data }) => data)
|
|
27
27
|
.then(TaskOK)
|
|
28
28
|
.catch(TaskError);
|
|
29
|
-
|
|
30
29
|
// Handle renamed repos
|
|
31
30
|
const { info, url } = await match(_info)
|
|
32
31
|
.with($OK, async (info) => {
|
|
33
32
|
const url = info.data.html_url;
|
|
34
33
|
if (url === repository) return { info, url: repository };
|
|
35
34
|
|
|
35
|
+
// console.log(info.data.use_squash_pr_title_as_default)
|
|
36
36
|
console.log("[INFO] Migrating renamed repo: \nfrom: ", repository + "\n to: " + url);
|
|
37
37
|
// migrate data into new CNRepo
|
|
38
38
|
await CNRepos.updateOne(
|