janinko / ghprb

github pull requests builder plugin for Jenkins
https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin
MIT License
369 stars 19 forks source link

Builder status stuck on first commit it has built. #263

Open mihneadb opened 9 years ago

mihneadb commented 9 years ago

Steps to reproduce:

mihneadb commented 9 years ago

This happens with ghprb:1.20 and github-api:1.67. Things work fine with ghprb:1.17 and github-api:1.66

mihneadb commented 9 years ago

Wrong - things work fine after restarting jenkins but after you push a commit and trigger another test it happens again. @janinko, have you seen this before? Thanks!

mihneadb commented 9 years ago

I've investigated a bit, it seems that the PR's head is not updated.

mihneadb commented 9 years ago

Found other reports of (probably) the same issue:

DavidTanner commented 9 years ago

Other than checking if the project is disabled, there haven't been any changes to GhprbPullRequest where the update logic exists. I also can't recreate it locally.

Are you using webhooks?

DavidTanner commented 9 years ago

Here is my testing repo https://github.com/DavidTanner/Testing/pull/14

mihneadb commented 9 years ago

@DavidTanner Yes, I am using webhooks + build phrase (not auto builds like in your test). Could you try to reproduce it that way? By reading through the code it seems that the object is instantiated once with the latest HEAD and it never gets updated (at least via webhook build phrase) -- or maybe I misread, but that's the behavior.

DavidTanner commented 9 years ago

Maybe the changes I have been making have fixed things, but it works with webhooks as well.

mihneadb commented 9 years ago

Are you planning a new release? Would love to try it out :).

DavidTanner commented 9 years ago

1.22.2 is out there, and that is what I was just testing with.

mihneadb commented 9 years ago

I've just tested with 1.22.2 and I encounter the same behavior. :( Triggering the build phrase after the 2nd commit merges the correct sha (latest version of the code), but updates the status of the first commit.

If you have any suggestions of what to try, pls let me know.

DavidTanner commented 9 years ago

The next step is to setup a logger, then if that doesn't give us the data we need then i can send you a rogue build with more logging. Go to Manage > System Log and add a logger for

org.jenkinsci.plugins.ghprb

That will log everything from the plugin.
After the commit you should see:

Pull request #X was updated ... New Commit. Sha: ...

That should happen before the comment gets sent.

mihneadb commented 9 years ago

Here are the logs. As you can see, the "pull req was updated" part does not show up. :(

https://gist.github.com/mihneadb/2d6ce82981f22168ff54

DavidTanner commented 9 years ago

Can you please retest with 1.24.8?

mihneadb commented 9 years ago

It's a bit difficult now since we've changed our setup, but I'll get back with the results whenever I get to it.