-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
feat(lightwallet): Add --budgets-path & Budgets constructor #8427
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lookin' really good @khempenius!
were you planning on wiring up --budgets-path
in the CLI to do the actual loading in this PR?
if not, it might make sense to split a tad further into just the Budgets
class with tests and then add the flag with wiring
I think it makes sense to add the CLI bits in this PR. That way the handoff of either a path or object will be clear. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice stuff here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is looking great
reminder for myself: since this won't (yet) be in the default config, we may need to add some tests to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost there, very excited for budgets! 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I'll defer to @brendankenny for the typing business
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some bigger requests, but this is all looking great.
A higher-level naming poll:
- should it be
settings.budgetsJSON
? Feels like it should just besettings.budgets
. - less serious: the budgets, plural, thing is going to trip people up :) It totally makes sense on settings and in the config (it's an array of budgets), but I keep writing
--budget-path
when it's--budgets-path
and wanting to refer to my site's budget (singular, though made up of multiple rules), not budgets. But I don't know how to make those two views harmonious :)
@@ -29,6 +29,33 @@ | |||
"disableStorageReset": false, | |||
"emulatedFormFactor": "mobile", | |||
"channel": "cli", | |||
"budgetsJSON": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you manually added this in? It's completely amazing you figured out this file even exists :) but it will run into the same issue as over in #8536, erased the next time someone updates the sample artifacts.
This file is generated by yarn update:sample-artifacts
, which calls update-report-fixtures.js
to run lighthouse against dbw_tester.html
.
I think making this permanent should be as easy as
- adding this object to a budget file somewhere. Since the artifacts come from
dbw_tester.html
, maybe it makes sense to have the budgets file inlighthouse-cli/test/fixtures/dobetterweb/budgets.json
? - adding
--budgets-path=${pathToThatPlace}
to theflags
inupdate-report-fixtures.js
- running
yarn update:sample-artifacts
to verify that the budget does indeed end up like this in this file git checkout -- lighthouse-core/test/results/artifacts/*
all the generated files (devtoolslog.json, this file, etc) to get back to the state in this PR because the files will have a bunch of other changes we don't want right now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can also do this in a follow up if it's not actually easy to do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can also do this in a follow up if it's not actually easy to do this
I'd say +1 to this. I've manually updated/undone every programmatic change to artifacts.json to avoid unnecessary changes in recent PRs, so IMO this isn't a deal breaker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SG
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this somehow related to why this branch is passing for me locally but failing remotely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khempenius it's probably the master failures #8583 #7122
I believe they're linux only, is your local Mac?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, makes sense. Yep, it's a Mac.
I have no strong feelings either way. I can see the case being made for either one, so I'll defer to those with stronger feelings :)
We start doing "did you mean" for our CLI flags? :) |
@brendankenny |
I put up a PR against this branch in https://github.com/khempenius/lighthouse/pull/1 to skip a few formatting review round trips :) Feel free to also cherry pick from it or not use it instead.
Ah nice, this looks great. Last naming question is for If it's just going to be confusing we can keep things as is (and use |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Summary:
Add
--budget-path
&Budget
class for LightWallet.Related Issues/PRs:
Initial discussion: #7176
#8675, #8427, #8709, #8708,#8522, #8539