PHPCI icon indicating copy to clipboard operation
PHPCI copied to clipboard

Building latest commit from a set of pushed commits

Open poul-kg opened this issue 10 years ago • 10 comments

When I develop a new feature, I create new local branch. When feature is done I merge this local branch with master and push to GIT. This results in a lot of commits in GIT as well as lot of builds in PHPCI. I want PHPCI to build from the latest commit only, and not create build from each and every new commit.

Is there a way how to achieve this?

poul-kg avatar Nov 17 '14 19:11 poul-kg

:+1: That would be great

EmmanuelVella avatar Dec 10 '14 13:12 EmmanuelVella

Should in progress builds be canceled? If not we could do a relatively simple pruning on the queue.

SamMousa avatar Jan 15 '15 12:01 SamMousa

This would be great. Many people use git to commit early and often and merging/pushing a branch could potentially spawn hundreds of jobs.

tomschlick avatar Feb 22 '15 14:02 tomschlick

I think it need to be an option. Here we want to see the status of all the commits (especially if people work local and commit a whole set of commits in one time)

But you can delete the builds while they didn't start yet, maybe it is nice to have the option to delete a set of builds in action.

tvbeek avatar Feb 24 '15 09:02 tvbeek

I don't understand the point of running builds on outdated / potentially broken commits.

If I push up 10 commits: commit number 8 could fix something I did in commit number 2. All I would care about is that as of commit 10 the build is good.

If there is an option I would think this should be default behavior and running a build per commit would be the option.

tomschlick avatar Feb 26 '15 22:02 tomschlick

If I push up 10 commits: commit number 8 could fix something I did in commit number 2. All I would care about is that as of commit 10 the build is good.

Yes, but if someone else broke something in number 2 and only number 10 is checked, it will look like you broke it.

As far as default behaviour, the whole point of CI is to report on changes over time. If not, and - as you suggest - you don't care about any history, you might as well just run your tests manually before you commit. Therefore it makes sense to me for default behaviour to be as it currently is.

I suspect both models are desirable for different use-cases, but the 'review every commit' model is definitely the most sensible default, and I would recommend it as best-practice for any project involving more than one person.

MarkMaldaba avatar Mar 09 '15 21:03 MarkMaldaba

:+1: for me; I just rebased a load of branches and pushed them all, every single commit has been created as a build!

asgrim avatar Jan 15 '16 16:01 asgrim

I tend to squash the history into one commit if I'm not interested in testing all of the distinct commits... Generally though we push individual commits to branches on an ongoing basis, so the builds don't stack up like that.

dancryer avatar Jan 15 '16 16:01 dancryer

@dancryer if you rebase that branch however, it rebuilds every single commit, even with a 4 minute build time, that can really stack up... :|

asgrim avatar Feb 08 '16 11:02 asgrim

Just to give you an idea of the scale of the problem, we have an open PR on a private project that currently has 122 commits, each build takes about 8 minutes to run (it runs on some slow IBM i hardware), which means when we come to rebase that (which we have to do to get the build to actually pass), this PR will take 16 HOURS to build because of this. Any other sane build system will only build the latest commit as discussed above. Additionally, if something is merged to master whilst something is building, every single subsequent build will fail, with messages like:

Checking out files:  99% (821/829)   
Checking out files: 100% (829/829)   
Checking out files: 100% (829/829), done.

Auto-merging phpunit.xml.dist
CONFLICT (add/add): Merge conflict in phpunit.xml.dist
... (redacted many conflit messages) ...
Auto-merging config/autoload/templates.global.php
CONFLICT (add/add): Merge conflict in config/autoload/templates.global.php
Auto-merging config/autoload/routes.global.php
CONFLICT (add/add): Merge conflict in config/autoload/routes.global.php
Auto-merging config/autoload/middleware-pipeline.global.php
CONFLICT (add/add): Merge conflict in config/autoload/middleware-pipeline.global.php
Auto-merging config/autoload/doctrine.global.php
CONFLICT (add/add): Merge conflict in config/autoload/doctrine.global.php
Auto-merging config/autoload/dependencies.global.php
CONFLICT (add/add): Merge conflict in config/autoload/dependencies.global.php
Auto-merging composer.json
CONFLICT (add/add): Merge conflict in composer.json
Automatic merge failed; fix conflicts and then commit the result.
Switched to a new branch 'phpci/1002'

Failed to clone remote git repository.
Exception: Could not create a working copy.

asgrim avatar Apr 14 '16 09:04 asgrim