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

Build Size Check should be Differential #15134

Closed
jridgewell opened this issue May 7, 2018 · 10 comments
Closed

Build Size Check should be Differential #15134

jridgewell opened this issue May 7, 2018 · 10 comments

Comments

@jridgewell
Copy link
Contributor

Rather than having a maximum build size cap (which we have to bump continuously), we could check the build size difference.

The biggest downside to the max cap is that the changes are cumulative, and only the last PR that finally pushes it over the cap will fail.

This, however, would tell each PR how much it increases the size. So, if I add a simple method and it ends up increasing the size by 1kb, I can be informed.

We can discuss whether there should be a cap to the difference (maybe 1kb?), but I think the biggest use of this would just be a PR integration telling the difference.

@rsimha
Copy link
Contributor

rsimha commented May 7, 2018

/cc @choumx

@dreamofabear
Copy link

Probably in the minority opinion here but I like having a hard cap to avoid growth creep AKA "death by a thousand cuts". In other words, a differential size limit of 0. :)

My rationale is that most AMP engs work on extensions, so having some friction when increasing the size of v0.js, although annoying, is a good thing. It may even incentivize some engs to help contribute long-term fixes to these issues, e.g. #14480.

An eng can find out the differential by looking at how much the size cap has been exceeded, though I guess it's not as easy as having Travis do it for you.

@rsimha
Copy link
Contributor

rsimha commented May 7, 2018

I'm open to either mode (hard cap or differential), but either way, I'd like for the check to natively affect the status of PRs, instead of failing the Travis PR build.

The tool isn't a GitHub app (siddharthkp/bundlesize#219), but I believe there are other ways to achieve this.

@jpettitt
Copy link
Contributor

jpettitt commented May 8, 2018

FWIW I think the overall size cap (now we're looking at compressed size) is the way to go. As @kristoferbaxter has pointed out it's a proxy metric at best anyway. It would be nice the actual delta was displayed in the pr-check but the total size is what matters.

@rsimha
Copy link
Contributor

rsimha commented May 8, 2018

Showing the delta will involve doing two builds (takes time) or maintaining some kind of server look up table that maps commits on master to a build size.

Keep the ideas coming. I'll look into this soon :)

@jpettitt
Copy link
Contributor

jpettitt commented May 8, 2018

I don't suppose there is a way to hook the merge then build and auto commit a .master-size-<build>.json ... that would also give us a history of size by merge.

@rsimha
Copy link
Contributor

rsimha commented Jun 7, 2018

Assigning to @danielrozenberg for more updates on this.

@lannka
Copy link
Contributor

lannka commented Oct 11, 2018

The overall size is the metric we should keep an eye on, but the current travis setup can catch an innocent PR.

Imagine PR A & PR B both increase size by 0.2K, and we we have 0.3K budget. The 2 PRs will both pass Travis test, and get merged.

Then any following PRs will be blocked.

@danielrozenberg
Copy link
Member

@lannka that's correct, which is why we have #17043 :)

@danielrozenberg
Copy link
Member

Fixed 😄

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

No branches or pull requests

8 participants