question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upload target filesystem, Override File Naming

See original GitHub issue

Thanks to #139 I can now handle the JSON and HTML reports locally without having to upload the results to an LHCI server (thanks for that!).

In order to programmatically handle the files generated, I’d like to be able to define a consistent pattern for the files. For example:

IF I run lchi collect --url=https://pantheon.io/docs --url=https://some.staging.environment.io/docs, AND I define some extra parameter like --format=$URL-$PASS_NUM (just spit-balling on this) THEN the contents of .lighthouseci would look like:

.lighthouseci
|- lhr-https://pantheon.io/docs-1.html
|- lhr-https://pantheon.io/docs-1.json
|- lhr-https://pantheon.io/docs-2.html
|- lhr-https://pantheon.io/docs-2.json
|- lhr-https://pantheon.io/docs-3.html
|- lhr-https://pantheon.io/docs-3.json
|- lhr-https://some.staging.environment.io/docs-1.html
|- lhr-https://some.staging.environment.io/docs-1.json
|- lhr-https://some.staging.environment.io/docs-2.html
|- lhr-https://some.staging.environment.io/docs-2.json
|- lhr-https://some.staging.environment.io/docs-3.html
|- lhr-https://some.staging.environment.io/docs-3.json

Not that the filename needs to contain the full URL, this is just an example where it uses a parameter already defined in another flag. Anything consistently predictable would suite my needs.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:36 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
patrickhulcecommented, May 12, 2020

Thanks for the offer @staceytay! This is a slightly larger unscoped effort that has some interplay with breaking changes in #119 though, so I’m not sure it’s a great candidate for external PR help at the moment.

FWIW, all of the data is available for the GH action to build this output themselves. If we just agree on an interface for the manifest then there’s no need for this to block that issue.

How does everyone feel about…

interface EntrySummary {
  performance: number // all category scores on 0-1 scale
  accessibility: number
  'best-practices': number
  seo: number
  pwa: number
}

interface Entry {
  url: string // finalUrl of the run
  isRepresentativeRun: boolean // whether it was the median run for the URL
  jsonPath: string
  htmlPath: string
  summary: EntrySummary
}

// Manifest contains an array of entries, 1 for each run. 
// Let's say all are included by default, skipping over the `--include-all-reports` bit.
type Manifest = Array<Entry>

// Alternative, we group the entries by url
type Manifest = Record<string, Array<Entry>> 
3reactions
patrickhulcecommented, May 27, 2020

Quick poll on the expected behavior if manifest.json already exists in the target folder, should LHCI…

🚀 overwrite it 😕 throw an error and bail

Read more comments on GitHub >

github_iconTop Results From Across the Web

Edit filename in File Upload control before it is uploaded to the ...
I am going to walk you through a handy code snippet which can be used in case you wish to rename a file...
Read more >
django - ImageField overwrite image file with same name
A race condition where 2 processes save the same file at the same time can trigger an infinite loop in the base class...
Read more >
Files should be uploaded to per year/month directories by ...
Uploading thousands or millions of files into one directory is a very bad idea, which can have performance implications too. There are reports ......
Read more >
API Reference — fsspec 2022.11.0+13.g0974514.dirty ...
A special case is made for caching filesystems - the files will be down/uploaded together at the start or end of the context,...
Read more >
Creating File Systems - Oracle Help Center
If one file system associated to a mount target has '/' specified as an export path, you can't associate another file system with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found