mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
Harden issue artifact metadata
This commit is contained in:
parent
96d266109b
commit
bbf77fcb69
6 changed files with 292 additions and 5 deletions
|
|
@ -100,6 +100,7 @@ describe("getIssueOutputs", () => {
|
|||
const result = getIssueOutputs([
|
||||
makeWorkProduct({ id: "pr-1", type: "pull_request" }),
|
||||
makeWorkProduct({ id: "doc-1", type: "document" }),
|
||||
makeWorkProduct({ id: "artifact-1", type: "artifact", provider: "custom", metadata: videoMetadata() }),
|
||||
]);
|
||||
expect(result.count).toBe(0);
|
||||
expect(result.primary).toBeNull();
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ function toTime(value: string | Date): number {
|
|||
* marked primary) comes first, then remaining artifacts by most-recent.
|
||||
*/
|
||||
export function getIssueOutputs(workProducts: IssueWorkProduct[] | null | undefined): IssueOutputs {
|
||||
const artifacts = (workProducts ?? []).filter((wp) => wp.type === "artifact");
|
||||
const artifacts = (workProducts ?? []).filter((wp) => wp.type === "artifact" && wp.provider === "paperclip");
|
||||
|
||||
const items: IssueOutputItem[] = artifacts.map((wp) => {
|
||||
const parsed = attachmentArtifactWorkProductMetadataSchema.safeParse(wp.metadata);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue