MCPcopy Create free account
hub / github.com/code-pushup/cli / transformGQLPlugin

Function transformGQLPlugin

packages/ci/src/lib/portal/transform.ts:77–104  ·  view source on GitHub ↗
(
  plugin: PluginFragment,
  issues: IssueFragment[],
)

Source from the content-addressed store, hash-verified

75}
76
77function transformGQLPlugin(
78 plugin: PluginFragment,
79 issues: IssueFragment[],
80): PluginReport {
81 return {
82 slug: plugin.slug,
83 title: plugin.title,
84 icon: plugin.icon,
85 ...(plugin.description && { description: plugin.description }),
86 ...(plugin.docsUrl && { docsUrl: plugin.docsUrl }),
87 audits: plugin.audits.edges.map(({ node }) =>
88 transformGQLAudit(
89 node,
90 issues.filter(
91 issue =>
92 issue.audit.plugin.slug === plugin.slug &&
93 issue.audit.slug === node.slug,
94 ),
95 ),
96 ),
97 groups: plugin.groups.map(transformGQLGroup),
98 ...(plugin.packageName && { packageName: plugin.packageName }),
99 ...(plugin.packageVersion && { version: plugin.packageVersion }),
100 // TODO: make plugin metadata required in Portal API?
101 date: plugin.runnerStartDate ?? '',
102 duration: plugin.runnerDuration ?? 0,
103 };
104}
105
106function transformGQLGroup(group: GroupFragment): Group {
107 return {

Callers 1

transformGQLReportFunction · 0.85

Calls 1

transformGQLAuditFunction · 0.85

Tested by

no test coverage detected