Harden issue artifact metadata
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user