comfy-pr 0.2.18 → 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 CHANGED
@@ -2,6 +2,17 @@
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
+
14
+ ### [0.2.19](https://github.com/drip-art/Comfy-Registry-PR/compare/v0.2.18...v0.2.19) (2024-06-28)
15
+
5
16
  ### [0.2.18](https://github.com/drip-art/Comfy-Registry-PR/compare/v0.2.17...v0.2.18) (2024-06-27)
6
17
 
7
18
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "comfy-pr",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
4
4
  "description": "Make PRs that publishes ComfyUI Custom Nodes to [ComfyUI Registry]( https://www.comfyregistry.org/ ).",
5
5
  "keywords": [],
6
6
  "license": "ISC",
@@ -1,5 +1,5 @@
1
1
  import { $pipeline } from "@/packages/mongodb-pipeline-ts/$pipeline";
2
- import { peekYaml } from "peek-log";
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,8 +12,8 @@ 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());
16
-
15
+ // const r = peekYaml(await analyzePullsStatus());
16
+
17
17
  // await mkdir(".cache").catch(() => null);
18
18
  // await writeFile(".cache/dump.yaml", YAML.stringify(r));
19
19
  // await writeFile(".cache/dump.csv", csvFormat(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,9 +78,21 @@ 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
- comments_authors: "$comments.user.login",
84
+ comments_author: {
85
+ $trim: {
86
+ input: {
87
+ $reduce: {
88
+ input: "$comments.user.login",
89
+ initialValue: "",
90
+ in: { $concat: ["$$value", " ", "$$this"] },
91
+ },
92
+ },
93
+ chars: " ",
94
+ },
95
+ },
82
96
  lastwords: { $arrayElemAt: ["$comments", -1] },
83
97
  latest_comment_at: { $toDate: "$latest_comment_at" },
84
98
  actived_at: 1,
@@ -106,8 +120,9 @@ export function analyzePullsStatusPipeline() {
106
120
  lastwords: string;
107
121
  on_registry_at: Date;
108
122
  on_registry: boolean;
109
- comments_authors: string;
123
+ comments_author: string;
110
124
  ownername: string;
125
+ nickName: string;
111
126
  repository: string;
112
127
  state: "OPEN" | "MERGED" | "CLOSED";
113
128
  updated_at: Date;
@@ -38,9 +38,11 @@ const zFollowUpRule = z.object({
38
38
  author_email: mString,
39
39
  comments: mNumber,
40
40
  created_at: mDate,
41
+ comments_author: mString,
41
42
  head: mString,
42
43
  lastwords: mString,
43
44
  on_registry: z.boolean(),
45
+ nickName: mString,
44
46
  ownername: mString,
45
47
  state: z.enum(["OPEN", "CLOSED", "MERGED"]),
46
48
  updated_at: mDate,
@@ -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) =>
@@ -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(