Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI Reporter Infrastructure and expandedJson reports #111

Merged
merged 14 commits into from
May 20, 2023

Conversation

harlan-zw
Copy link
Owner

@harlan-zw harlan-zw commented May 20, 2023

Description

This builds off of the great work started by @mastoj. The main refactoring changes are to support multiple reporting providers.

The main report generated will default to jsonExpanded in v1 of Unlighthouse as a breaking change. For now the jsonSimple is the default, this allows users to opt-in to different reporting strategies.

You can generate the new expandedJson report using --reporter expandedJson or ci.reporter: 'expandedJson'

Linked Issues

#98

Additional context

#107

@harlan-zw harlan-zw changed the title New CI Reporting Infrastructure CI Reporter Infrastructure - expandedJson reports May 20, 2023
@harlan-zw harlan-zw changed the title CI Reporter Infrastructure - expandedJson reports CI Reporter Infrastructure and expandedJson reports May 20, 2023
@harlan-zw harlan-zw mentioned this pull request May 20, 2023
@harlan-zw harlan-zw merged commit 1cf833e into main May 20, 2023
Copy link
Contributor

@mastoj mastoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't too far off :). Good that I could help somewhat.


You may want to generate reports that can be consumed by other tools. To do you can use the reporter options:
- `jsonSimple` - A simple JSON report which contains the URL and score. This is the default.
- `jsonExpanded` - A full JSON report which contains the URL, score, metric and category breakdowns.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also mention summary.

import { reportJsonExpanded } from './jsonExpanded'
import type { ReportJsonExpanded, ReportJsonSimple } from './types'

export function generateReportPayload(reporter: 'jsonExpanded', reports: UnlighthouseRouteReport[]): ReportJsonExpanded
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a nice way of overloading the function and still being sure the right one was called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants