Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Speed up builds by conditionally "returning early"? #1159

Closed
TravisCarden opened this issue Mar 8, 2017 · 6 comments
Closed

Speed up builds by conditionally "returning early"? #1159

TravisCarden opened this issue Mar 8, 2017 · 6 comments
Assignees
Labels
Enhancement A feature or feature request

Comments

@TravisCarden
Copy link
Contributor

One of the biggest drawbacks to running builds against pull requests is the time it adds to changes that don't actually need to be tested, like documentation edits, for example. I wonder if we could introduce some kind of white list concept whereby we "return early" if only files matching a given path pattern are changed. For example, if a pull requests only contains changes to Markdown files, there's probably no need to run automated tests or even generate a new build artifact. On most teams, that would be an instant savings of 10-30 minutes. Seems like we could probably come up with some sensible defaults for a white list easily enough to make for pretty good savings by default for most projects.

@grasmash grasmash added the Enhancement A feature or feature request label Mar 9, 2017
@grasmash
Copy link
Contributor

grasmash commented Mar 9, 2017

Sounds like a great idea!

@geerlingguy
Copy link
Contributor

One quick note—for things like docs changes et all, you can add [ci skip] or [skip ci] to the commit message itself. This isn't automatic (the developer needs to know to do this), but it does save a ton of time for docs-only or other changes that don't need to be run through the BLT gauntlet.

See: https://docs.travis-ci.com/user/customizing-the-build#Skipping-a-build

@grasmash
Copy link
Contributor

grasmash commented Mar 30, 2017

@TravisCarden does using [ci skip] sound like a reasonable solution?

@TravisCarden
Copy link
Contributor Author

TravisCarden commented Mar 31, 2017

@grasmash, I think it's a good tool to have at our disposal, but I don't think it renders the feature suggestion less valuable. I won't be encouraging my developers to selectively bypass testing because I think that invites accidents and abuse. But an agreed-upon, deterministic rule for when tests can be safely bypassed is different. "Doesn't require incidental judgment" is a good CI attribute. Given good defaults or a well-chosen project standard, people don't even have to know about it to benefit from it, either, which is also good. Honestly, I don't expect to have time to contribute the feature myself for a while, but I think it's a feature worth having, and therefore worth remembering. My two cents. 😃

@grasmash
Copy link
Contributor

grasmash commented May 3, 2017

Finding inspiration here: facebook/react#1768

@TravisCarden
Copy link
Contributor Author

Update: I realized today that if you cut a release from a commit with [skip ci] in the commit message, BLT won't generate a build artifact. @grasmash, I haven't looked too closely at your solution here (thanks for the work, by the way!), so I just wanted to surface this to make sure your approach isn't similarly affected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement A feature or feature request
Projects
None yet
Development

No branches or pull requests

3 participants