seed some more pr test data

This commit is contained in:
Kiril Videlov 2023-06-15 00:13:49 +02:00 committed by Kiril Videlov
parent a0a9846279
commit d48b67bc05
5 changed files with 21 additions and 17 deletions

View File

@ -89,7 +89,8 @@
}
]
}
]
],
"description": "Make drag & drop code a bit more dry\n"
},
{
"id": "Branch-sidebar-is-stuck-to-side-of-the-window:420",
@ -142,7 +143,8 @@
}
]
}
]
],
"description": "Branch sidebar is stuck to side of the window\n"
},
{
"id": "watcher-work-w:414",
@ -522,7 +524,8 @@
}
]
}
]
],
"description": "watcher handler run async\n"
},
{
"id": "ian/cursor-for-select-text-from-diff:409",
@ -545,7 +548,8 @@
}
]
}
]
],
"description": "Ian/cursor for select text from diff\n"
},
{
"id": "writers:407",
@ -940,6 +944,7 @@
}
]
}
]
],
"description": "Writers\nestablish a clear writer api pattern for different types"
}
]

View File

@ -43,6 +43,11 @@ def process_pr(pr_number):
shell=True,
text=True,
).splitlines()[0]
body = subprocess.check_output(
"gh pr view %s --json body -q '.body'" % pr_number,
shell=True,
text=True,
).splitlines()[0]
diff = subprocess.check_output("gh pr diff %s" % pr_number, shell=True, text=True)
patch = PatchSet(diff)
files = []
@ -65,19 +70,13 @@ def process_pr(pr_number):
"hunks": hunks,
}
files.append(file_out)
# commit = {
# "id": "Commit:" + branch_name + ":" + pr_number,
# "description": title,
# "committedAt": updated_at,
# "kind": "commit",
# "files": files,
# }
branch = {
"id": branch_name + ":" + pr_number,
"name": branch_name,
"active": True,
"kind": "branch",
"files": files,
"description": title + "\n" + body,
}
return branch
@ -87,7 +86,5 @@ prs = ["429", "420", "414", "409", "407"] # feel free to paste some some specif
branches = [process_pr(pr) for pr in prs]
print(branches)
with open("scripts/branch_testdata.json", "w") as json_file:
json.dump(branches, json_file, indent=4)

View File

@ -52,12 +52,12 @@
on:consider={handleDndEvent}
on:finalize={handleDndEvent}
>
{#each branches.filter((c) => c.active) as { id, name, files } (id)}
{#each branches.filter((c) => c.active) as { id, name, files, description } (id)}
<div
class="swimlane flex h-full w-96 snap-start scroll-ml-4 rounded-lg bg-zinc-900"
animate:flip={{ duration: flipDurationMs }}
>
<Lane {name} bind:files on:empty={handleEmpty} />
<Lane {name} {description} bind:files on:empty={handleEmpty} />
</div>
{/each}
</section>

View File

@ -8,6 +8,7 @@
import FileCard from './FileCard.svelte';
export let name: string;
export let description: string;
export let files: File[];
const flipDurationMs = 150;
@ -47,7 +48,7 @@
<div class="font-bold">{name}</div>
<textarea
class="h-14 w-full resize-none
rounded border-0 p-2 text-zinc-400 focus-within:h-32">markdown description of things</textarea
rounded border-0 p-2 text-zinc-400 focus-within:h-32">{description}</textarea
>
</div>
<div

View File

@ -23,4 +23,5 @@ export class Branch extends DndItem {
active!: boolean;
@Type(() => File)
files!: File[];
description!: string;
}