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
Auto Cancellation : Get faster results by only testing your most recent build #8
Comments
This is now live, and documented: https://docs.travis-ci.com/user/customizing-the-build/#Building-only-the-latest-commit Blog post: https://blog.travis-ci.com/2017-03-22-introducing-auto-cancellation |
If there are pushes on different branches will there be cancellations? Example: I push up my dev branch with a new commit. I then merge it into my master branch and push that up. Meanwhile, the dev branch is queued and a new push arrives on the master branch. Does the dev branch still run? The description here and on the broadcast are a bit unclear on this point. In any case, nice update, thanks. |
Is there a way to activate this via API? we want it in all our builds! @PeterDenton if that was the case, I would consider it a bug. The announced feature says PER BRANCH or PER PR, not PER WHOLE REPO. |
Hi @PeterDenton and @crunis @PeterDenton, @crunis is correct that this is applied per branch. Supporting the use case you described isn't super simple, but can be something for us to consider for the future. @crunis yes, we do have an API. You can find docs at https://developer.travis-ci.org, specifically https://developer.travis-ci.org/resource/user_setting#User%20setting. Although I notice that the docs need some updating (we are releasing these docs next week, along with our new V3 API) |
@joshk managed to use the API, thanks ! The "discoveries" I made that I would like to see in the documentation:
repository.slug can be used instead of the repository.id, but then we have to use %2F as the user / repo_name separator |
Thanks for the feedback @crunis I've looped in @renee-travisci who is part of our awesome engineering team, and leads a lot of the development on the API. Glad you got it all working! |
@joshk Would also love this in all my builds. Is there a plan to turn it on by default? It's a lot of work to change every single repo setting, and then keep changing it for any new repo we add. |
@jleclanche Once this is out of Beta this is definitely something I would be interested in. Thanks for the suggestion! |
👍 We've been wanting a feature like this for a while. |
@joshk, I would also suggest that this be the default setting. It conserves precious resources. |
Hey @LiNk-NY, yep, that was my thinking too! 😃 |
Nice.
What isn't cancelled is waiting jobs that are part of a matrix build where one job has started. I.e. if any job has started in a matrix build the Auto Cancellation will wait for the entire matrix to finish. I think the outstanding jobs of a build matrix should be cancelled but still allow the started jobs to complete. |
Very happy to see this...can't wait to delete our bot code |
Hi @grooverdan, thanks for the feedback! The current iteration of this feature allows for builds to finish if they have started. There is a possibility, especially if you have a busy team, that a build might never finish because your build (which might run for a long time) always gets cancelled by a new build. The second iteration of this feature will allow for running builds to be automatically cancelled when a new build comes in. @megies Thanks for the feedback. We are unlikely to add this to the |
Very useful feature, thanks! I'd like to have a better control on the branches where this is enabled, in particular I'd like to be able enable it for all branches with the exception of the main branches, for which I want to test all the commits. |
You guys rock. Must have seem me and other frantically reaching for that cancel button. Maybe setting on by default on, with override in settings and/or yaml file? That would be great! |
@joshk I'm not sure you have the same concept in mind as me. The concept i'm trying to convey (with job overloaded too many ways so I'm hoping this is consistent with current terminology) is: when a build starts it starts up to 5(4?) jobs. There may be more in the build same build that are there and haven't started. Auto Cancellation should cancel any jobs that are part of the same build that haven't started and leave the remaining jobs to finish. |
This feature is awesome! I already submitted this feedback via another channel, but: I can't safely use "auto cancel branch builds" unless I can enumerate the branches on which I never want this to happen - in other words, |
Thank you for rolling this out! Great work! |
Great idea, thank you! |
@akaralar Thanks for the feedback. We plan to support the ability to cancel currently running Jobs in the near future. @peternewman Sorry to hear that, could you email support@travis-ci.com and we can look into it. @lneuhaus Sorry to hear that you are having issues with this feature. Is the description at the top, or where you enable this feature, not clear? Could you email support@travis-ci.com explaining the problem further and we can look into it. Thanks a bundle! |
@joshk Quick question about this feature. What is the expected behavious when auto cancelation is Will a build properly run? |
Hi @LefterisJP, sorry, I'm not sure I understand. You mention force pushing by amending the last commit, was this |
Yeah so the last commit was pushed and built succesfully. Then when you amend it locally and force push to github again you would expect Travis to generate a build right even if autocancelation is on? We had an issue where Travis was not running a build, but I think we found the problem and it's not related to autocancelation. |
I would like to be able to disable this for certain branches, like |
@dwsteele Thanks for the feedback. There currently isn't a way to do that, but I do like that idea. I will note that for the second round of development. |
Question: what will happen to the place of jobs in the queue?
For now, I'm just posing the question :-) |
@hughperkins the feature is fairly simple in that it will cancel jobs for the entire Build, and add the new Build to the end (tail) of the queue. |
Great feature. It would be nice to be able to see in the Build history whether a branch was auto cancelled or cancelled manually. |
I turn this feature on, but then it keeps turning itself off again with no reason. |
@pllim could you please email support@travis-ci.com and we can look into it @jwg4 🤔 thank you for the good point. We can have a think about that as it could provide some value to make that change |
In many cases, only the last build is important. I am grateful for this service, so I do not want it to run when it is useless. My hope: This feature will reduce the number of builds that are executed and not considered. |
@IgorMinar's comment about force pushes definitely aligns with my use case:
I do this fairly often. To avoid breaking What I'd like instead is for any build, including those currently active, to be canceled whenever the commits they're building are no longer reachable from a ref. As an example:
Whenever this happens, I'll manually cancel the 5 builds from step (1), to let the 5 builds from step (3) take their place, for two reasons. First, the commits are going to be-rebuilt anyway. Second, the original 5 builds are tied to their commits, but Travis won't be able to |
@aprescott thanks for the feedback. This feature is unlikely to be added in the near future. It is actually fairly complicated to know when a sha is no longer reachable. A force push might over make one sha no longer accessible, or maybe 10, there isn't a reliable way to check. |
this feature rocks! i'm applying automated rolling updates to 5000+ repos, and it solves the PAINPOINT of accidentally triggering builds twice or thrice for the same repo : ) |
+1 |
This works amazingly. Even in my project that I'm alone I see the queue grow. Can't imagine one with multiple developers. It saves both time and resources. Keeps getting better! |
this is a great feature, it should be made the default. Not much point in running the tests for a branch that was just overwritten. At times I know I push many small edits (esp when updating the Readme, when I like to proofread the formatted copy) |
We've been using this for our iOS builds and have noticed the latest commit being cancelled occasionally, while a previous commit continues to build. Could be a race condition? |
Please add the option to cancel even running builds ... we have a repo that does 40 parallel jobs and it keeps clogging up the build pipeline ... ideally make canceling all active builds the default ... since that would be most resource-saving and most people do not care about results for something they just overwrote anyway ... |
If this is introduced, this should be an option and the current approach should still be available (default or not). For long-running builds it's interesting to get quicker feedback about issues on the branch even if it's from a previous build. |
@grosser Hey Michael, yep, that option will come soon! |
Thank you everyone for your amazing feedback! We have taken this feature out of beta, and will be addressing the request to add the ability to cancel running builds shortly. Happy Building The Travis CI Team |
Will this make it to enterprise at some point? |
Any update on cancelling running builds? |
It's not uncommon to have your waiting builds queue grow, especially if your team is pushing new code to GitHub every few minutes.
With Auto Cancellation, you can enable Travis to cancel waiting and outdated builds when new builds flow in from GitHub.
This setting can be enabled for Branch and Pull Request builds separately.
Builds will only be canceled if they are waiting to run, allowing for any running jobs to finish.
You can find this new setting on the Repository settings page.
This feature was released for beta testing soon on the 22nd of March. You can find the blog post announcement here: https://blog.travis-ci.com/2017-03-22-introducing-auto-cancellation
Please Note: We are looking at adding the ability to also cancel running jobs. If this is of interest to you and your team, please add the 🎉 emoji to this issue 😄
The text was updated successfully, but these errors were encountered: