Skip to content

core(report-generator): add url to CSV output #10656

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

Merged
merged 3 commits into from
Apr 29, 2020
Merged

core(report-generator): add url to CSV output #10656

merged 3 commits into from
Apr 29, 2020

Conversation

patrickhulce
Copy link
Collaborator

Summary
Pushing back against CSV as a thing is more work than making it better :)

Related Issues/PRs
closes #10654

@patrickhulce patrickhulce requested a review from a team as a code owner April 28, 2020 19:21
@patrickhulce patrickhulce requested review from connorjclark and removed request for a team April 28, 2020 19:21
const table = Object.values(lhr.categories).map(category => {
return category.auditRefs.map(auditRef => {
const audit = lhr.audits[auditRef.id];
// CSV validator wants all scores to be numeric, use -1 for now
const numericScore = audit.score === null ? -1 : audit.score;
return [category.title, audit.id, audit.title, audit.scoreDisplayMode, numericScore]
return [lhr.requestedUrl, lhr.finalUrl, category.title, audit.id, audit.title,
audit.scoreDisplayMode, numericScore]
Copy link
Collaborator

Choose a reason for hiding this comment

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

we gotta remove the push action. it doubles up on the lint errors

Copy link
Contributor

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

Pushing back against CSV as a thing is more work than making it better :)

yeah, we should just encourage someone to make an lhr -> csv tool and put it up on npm somewhere :)

const table = Object.values(lhr.categories).map(category => {
return category.auditRefs.map(auditRef => {
const audit = lhr.audits[auditRef.id];
// CSV validator wants all scores to be numeric, use -1 for now
const numericScore = audit.score === null ? -1 : audit.score;
return [category.title, audit.id, audit.title, audit.scoreDisplayMode, numericScore]
return [lhr.requestedUrl, lhr.finalUrl, category.title, audit.id, audit.title,
Copy link
Contributor

Choose a reason for hiding this comment

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

wait, so is there going to be two urls per line in the CSV?

Copy link
Contributor

Choose a reason for hiding this comment

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

wait, so is there going to be two urls per line in the CSV?

I can live with that and don't care, just to be clear :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

correct there will be :)

const table = Object.values(lhr.categories).map(category => {
return category.auditRefs.map(auditRef => {
const audit = lhr.audits[auditRef.id];
// CSV validator wants all scores to be numeric, use -1 for now
const numericScore = audit.score === null ? -1 : audit.score;
return [category.title, audit.id, audit.title, audit.scoreDisplayMode, numericScore]
return [lhr.requestedUrl, lhr.finalUrl, category.title, audit.id, audit.title,
audit.scoreDisplayMode, numericScore]
Copy link
Contributor

Choose a reason for hiding this comment

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

i respectfully disagree

yeah, I think that's an eslintrc bug

@patrickhulce patrickhulce merged commit 875e8af into master Apr 29, 2020
@patrickhulce patrickhulce deleted the csv_urls branch April 29, 2020 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The CLI --output csv option should include the requestedUrl in the output.
5 participants