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

status fails to update after a successful build #19

Closed
ericbmerritt opened this issue Oct 21, 2012 · 26 comments
Closed

status fails to update after a successful build #19

ericbmerritt opened this issue Oct 21, 2012 · 26 comments

Comments

@ericbmerritt
Copy link

I have the builder working and it successfully builds pull requests for the organization (though manual builds continue to fail).

It successfully updates the pull request status when it starts to build. However, on completing the build successfully it fails to update the status. So the states remains ' Determining merge status — Merged build triggered' regardless that the build completed successfully.

Here is a bit of the log

Pull request builder: pr #5 Updated Sat Oct 20 17:13:37 PDT 2012
 Setting status of 62960605e6083b01600b714d7724bc6bd83e1fc6 to PENDING with url null and mesage: Merged build triggered.
 Pull request builder: Merged build triggered.
 Setting status of 62960605e6083b01600b714d7724bc6bd83e1fc6 to PENDING with url <hidden-for-security> and mesage: Merged build started.
 Oct 20, 2012 5:17:34 PM hudson.model.Run execute
INFO: f9_wf_lib pull request builder #3 main build action completed: SUCCESS

The (perhaps) interesting bit is that the url in the triggered notification is null while the url in the success notification is a valid url

@janinko
Copy link
Owner

janinko commented Oct 21, 2012

The null URL when triggered is OK because when triggered the URL isn't known yet.

@ericbmerritt
Copy link
Author

Ok. I was throwing it out as something I noticed. If that's not relevant i
don't have any ideas.

Sent from my iPhone

On Oct 20, 2012, at 20:16, "Honza Brázdil" notifications@github.com wrote:

The null URL when triggered is OK because when triggered the URL isn't
known yet.


Reply to this email directly or view it on
GitHubhttps://github.com//issues/19#issuecomment-9638672.

@janinko
Copy link
Owner

janinko commented Oct 22, 2012

Isn't there some stack trace in the log? Try to update to version 1.3.2 which have better logging and try it again.

@ericbmerritt
Copy link
Author

No, no stacktraces in the log at all unfortunately. I had to restart jenkins for a different reason and after the restart it now works fine. Though I still can't tell you why it was not working before.

@ericbmerritt
Copy link
Author

I spoke too soon. Restart fixed one of the repos, but it immediately stopped working again. I will update to 1.3.2 as soon as its available in the update center.

@JenRed12
Copy link

JenRed12 commented Nov 6, 2012

I am also having this same issue. I updated to 1.3.2 and the first pull request I created worked but any new commits or new pull requests no longer work. Here is the console output:

Github pull request #9 of commit fe0de206bef1d5f143ab332eff7e06e6128329f6 automatically merged.
Building in workspace /var/lib/jenkins/workspace/Push_Test_Private_Repo
Checkout:Push_Test_Private_Repo / /var/lib/jenkins/workspace/Push_Test_Private_Repo - hudson.remoting.LocalChannel@21300751
Using strategy: Default
Last Built Revision: Revision 42602b95e3235ec4184d0c256a456977635873ff (origin/pr/8/merge)
[Push_Test_Private_Repo] $ git rev-parse --verify HEAD
Fetching changes from 1 remote Git repository
Fetching upstream changes from git@github.com:JenRed12/utui.git
[Push_Test_Private_Repo] $ git fetch -t git@github.com:JenRed12/utui.git +refs/pull/*:refs/remotes/origin/pr/*
getCandidateRevisions(false,origin/pr/9/merge,,,,remoteUrls=[git@github.com:JenRed12/utui.git],buildsByBranchName={origin/master=Build #59 of Revision 1e3f76aec9eaa4f8f76ebf81748b816ed5c532d1 (origin/master), origin/pr/7/merge=Build #75 of Revision 1a2978e905cd6fe33faf7ccfb7cabd45f196eea6 (origin/pr/7/merge), origin/Test1=Build #6 of Revision f37c841808da37fe9b47a27be997494657851d0c (origin/Test1), origin/HEAD=Build #17 of Revision beeea900c50281a0ce01e1f4f96069865dd30c4a (origin/HEAD, origin/master), origin/pr/8/merge=Build #77 of Revision 42602b95e3235ec4184d0c256a456977635873ff (origin/pr/8/merge), detached=Build #67 of Revision 6daa227a0bb360c2e330d20d1bd10c3babed2fa8 (detached), origin/pr/5/merge=Build #70 of Revision 0d7c3860dba96ff025cc79de3a14f3765b58be92 (origin/pr/5/merge)},lastBuild=Build #77 of Revision 42602b95e3235ec4184d0c256a456977635873ff (origin/pr/8/merge)]) considering branches to build
[Push_Test_Private_Repo] $ git rev-parse origin/pr/9/merge^{commit}
rev-parse origin/pr/9/merge -> AnyObjectId[f85613c5287e98cd322150c8bbadb057dbefa241]
Found a new commit AnyObjectId[f85613c5287e98cd322150c8bbadb057dbefa241] to be built on origin/pr/9/merge
Commencing build of Revision f85613c5287e98cd322150c8bbadb057dbefa241 (origin/pr/9/merge)
Checking out Revision f85613c5287e98cd322150c8bbadb057dbefa241 (origin/pr/9/merge)
[Push_Test_Private_Repo] $ git checkout -f f85613c5287e98cd322150c8bbadb057dbefa241
[Push_Test_Private_Repo] $ git tag -a -f -m "Jenkins Build #78" jenkins-Push_Test_Private_Repo-78
No change to record in branch origin/pr/9/merge
No emails were triggered.
Email was triggered for: Success
Sending email for trigger: Success
Sending email to: jennifer.mitchell@tealium.com
Finished: SUCCESS

@JenRed12
Copy link

JenRed12 commented Nov 6, 2012

Also I did just find that if I comment in the pull request "ok to test" then the status updates correctly in GitHub.

@bendavies
Copy link

We have seen this to.
Have had to retrigger the build manually to make the status update.

@lilvinz
Copy link

lilvinz commented Dec 7, 2012

I have the same problem. Sometimes it just doesnt update the status on github.

This is log when its ok:

Dec 7, 2012 6:21:05 PM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of 9084f68671a36dea70674a838d00f1e73932feac to PENDING with url http://master-001.build.quantec-networks.de:8080/job/phoenixpilot-pull-request-builder/7/ and mesage: Merged build started.
Dec 7, 2012 6:22:04 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #52 was updated 12/7/12 6:21 PM, is updated 12/7/12 6:21 PM
Dec 7, 2012 6:22:04 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request was updated, but there isn't new comments nor commits. (But it may mean that commit status was updated)
Dec 7, 2012 6:22:04 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #41 was updated 12/7/12 6:13 PM, is updated 12/7/12 6:21 PM
Dec 7, 2012 6:22:04 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request was updated, but there isn't new comments nor commits. (But it may mean that commit status was updated)
Dec 7, 2012 6:22:04 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #40 was updated 12/7/12 6:20 PM, is updated 12/7/12 6:21 PM
Dec 7, 2012 6:22:04 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request was updated, but there isn't new comments nor commits. (But it may mean that commit status was updated)
Dec 7, 2012 6:27:31 PM hudson.model.Run execute
INFO: phoenixpilot-pull-request-builder #7 main build action completed: SUCCESS
Dec 7, 2012 6:28:04 PM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of 9084f68671a36dea70674a838d00f1e73932feac to SUCCESS with url http://master-001.build.quantec-networks.de:8080/job/phoenixpilot-pull-request-builder/7/ and mesage: Merged build finished.

This is when it fails:

Dec 7, 2012 6:28:04 PM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of 5770cc0bb83cbbdd11f9bf6558f3bfcfd6b2a621 to PENDING with url http://master-001.build.quantec-networks.de:8080/job/phoenixpilot-pull-request-builder/8/ and mesage: Merged build started.
Dec 7, 2012 6:29:04 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #52 was updated 12/7/12 6:21 PM, is updated 12/7/12 6:28 PM
Dec 7, 2012 6:29:04 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request was updated, but there isn't new comments nor commits. (But it may mean that commit status was updated)
Dec 7, 2012 6:29:04 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #40 was updated 12/7/12 6:21 PM, is updated 12/7/12 6:28 PM
Dec 7, 2012 6:29:04 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request was updated, but there isn't new comments nor commits. (But it may mean that commit status was updated)
Dec 7, 2012 6:34:52 PM hudson.model.Run execute
INFO: phoenixpilot-pull-request-builder #8 main build action completed: SUCCESS

@marcio0
Copy link

marcio0 commented Dec 18, 2012

I have the same problem on Jenkins 1.494 and plugin on version 1.4.
It updates the status when it starts building and when it fails, but never when it succeeds.
Restarting jenkins, clearing the PR info on the config and asking for a retest on the PR page had no effect.

Thats the output on the log:

Dec 18, 2012 11:01:26 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #855 was updated 12/18/12 10:26 AM, is updated 12/18/12 10:58 AM
Dec 18, 2012 11:01:27 AM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of acadcaca6e1b1058c83d79f61ea4ccb880d1d398 to PENDING with url null and mesage: Merged build triggered.
Dec 18, 2012 11:01:27 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest build
INFO: Merged build triggered.
Dec 18, 2012 11:01:27 AM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of acadcaca6e1b1058c83d79f61ea4ccb880d1d398 to SUCCESS with url http://192.168.8.245:8090/job/Pull%20request%20builder/18/ and mesage: Merged build finished.
Dec 18, 2012 11:02:49 AM hudson.model.Run execute
INFO: Pull request builder #19 main build action completed: SUCCESS

Anyone got a way to fix that?

@p0deje
Copy link
Contributor

p0deje commented Jan 23, 2013

Have the same problem. Any ideas about how to fix it?

@dfreudenberger
Copy link

same here, status won't update to success

@postalservice14
Copy link

Same here on version 1.5. Nothing in the logs either. :-(

@postalservice14
Copy link

Here is some logging I captured on version 1.5. (Domains and organization names have been changed for security) Not sure if this helps or not:

Feb 22, 2013 2:40:31 PM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of 30828af8b9bd277959a504c0a60461a57fd7465a to PENDING with url http://buildserver/job/Shared%20Pull%20Requests/1/ and message: Merged build started.
Feb 22, 2013 2:40:31 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #40 was updated on OrgName/Shared at 2/22/13 11:17 AM
Feb 22, 2013 2:30:32 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest build
INFO:  Merged build triggered.
Feb 22, 2013 2:30:32 PM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of 30828af8b9bd277959a504c0a60461a57fd7465a to PENDING with url null and message:  Merged build triggered.
Feb 22, 2013 2:30:31 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest <init>
INFO: Created pull request #40 on OrgName/Shared by johnkelly updated at: 2/22/13 11:17 AM SHA: 30828af8b9bd277959a504c0a60461a57fd7465a
Feb 22, 2013 2:20:31 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #203 was updated on OrgName/Core at 2/22/13 1:29 PM

@postalservice14
Copy link

What's interesting here, is that it looks like it's setting the commit status to pending after the build has completed (in my case successfully). The commit, I'm pretty sure, didn't have a status at all until the build finished.

@ericbmerritt
Copy link
Author

As the originator of this request. I just wanted to put out that we have not seen this behaviour in some time.

@bendavies
Copy link

I'll add that we are still seeing this issue.

@sigmaris
Copy link

I'm seeing a problem that may be related - the pull request builder is building pull requests and the builds are successful, but the commits are being marked as FAILED. Once I was watching the real-time updates on the Github pull request page and I think I saw the commit status change to SUCCESS but then immediately change to FAILED, but I'm not sure. This seems to have started after updating to the plugin version 1.5.1 and updating Jenkins and the Github and Github API plugins to the latest version. I have attached a log.

Mar 15, 2013 8:59:42 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request was updated on repo sigmaris/webserver but there aren't any new comments nor commits - that may mean that commit status was updated.
Mar 15, 2013 8:59:42 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #16 was updated on sigmaris/webserver at 3/15/13 8:58 AM
Mar 15, 2013 8:58:41 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request was updated on repo sigmaris/webserver but there aren't any new comments nor commits - that may mean that commit status was updated.
Mar 15, 2013 8:58:40 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #16 was updated on sigmaris/webserver at 3/15/13 8:57 AM
Mar 15, 2013 8:57:41 AM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of df23a72851759689ce5c2d1cadbe98089585b9ec to SUCCESS with url https://g1-jenkins.sigmaris.info/job/webserver-pullrequests/18/ and message: Merged build finished.
Mar 15, 2013 8:57:41 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request was updated on repo sigmaris/webserver but there aren't any new comments nor commits - that may mean that commit status was updated.
Mar 15, 2013 8:57:41 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #16 was updated on sigmaris/webserver at 3/15/13 8:56 AM
Mar 15, 2013 8:56:41 AM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of df23a72851759689ce5c2d1cadbe98089585b9ec to PENDING with url https://g1-jenkins.sigmaris.info/job/webserver-pullrequests/18/ and message: Merged build started.
Mar 15, 2013 8:56:41 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest build
INFO:  Merged build triggered.
Mar 15, 2013 8:56:41 AM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of df23a72851759689ce5c2d1cadbe98089585b9ec to PENDING with url null and message:  Merged build triggered.
Mar 15, 2013 8:56:41 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest
FINE: New commit. Sha: 353008dd70402de33a328bbb3ead9561ddb7b44b => df23a72851759689ce5c2d1cadbe98089585b9ec
Mar 15, 2013 8:56:41 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #16 was updated on sigmaris/webserver at 3/15/13 8:51 AM
Mar 15, 2013 8:52:41 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request was updated on repo sigmaris/webserver but there aren't any new comments nor commits - that may mean that commit status was updated.
Mar 15, 2013 8:52:41 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #16 was updated on sigmaris/webserver at 3/15/13 8:51 AM
Mar 15, 2013 8:51:40 AM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of 353008dd70402de33a328bbb3ead9561ddb7b44b to FAILURE with url https://g1-jenkins.sigmaris.info/job/webserver-pullrequests/17/ and message: Merged build finished.
Mar 15, 2013 8:51:40 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request was updated on repo sigmaris/webserver but there aren't any new comments nor commits - that may mean that commit status was updated.
Mar 15, 2013 8:51:40 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check
INFO: Pull request builder: pr #16 was updated on sigmaris/webserver at 3/15/13 8:50 AM
Mar 15, 2013 8:50:42 AM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of 353008dd70402de33a328bbb3ead9561ddb7b44b to PENDING with url https://g1-jenkins.sigmaris.info/job/webserver-pullrequests/17/ and message: Merged build started.
Mar 15, 2013 8:50:42 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest build
INFO:  Merged build triggered.
Mar 15, 2013 8:50:42 AM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of 353008dd70402de33a328bbb3ead9561ddb7b44b to PENDING with url null and message:  Merged build triggered.
Mar 15, 2013 8:50:42 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest <init>
INFO: Created pull request #16 on sigmaris/webserver by Mathew updated at: 3/15/13 8:50 AM SHA: 353008dd70402de33a328bbb3ead9561ddb7b44b
Mar 15, 2013 8:33:40 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest check

@janinko
Copy link
Owner

janinko commented Mar 15, 2013

Github provides api for listing history of all statuses on commit: https://api.github.com/repos/:user/:repo/statuses/:sha

@sigmaris
Copy link

Hmm. So, it seems like in chronological order, the commit in question got:

  1. a status of "pending" with a message of "Merged build started" and a URL to build 18
  2. a status of "pending" with a message of "Merged build triggered" and a URL of "null"
  3. a status of "pending" with a message of "Merged build triggered" and a URL of "null" (about a minute after the previous status)
  4. a status of "success" with a message of "Merged build finished" and a URL to build 18
  5. a status of "pending" with a message of "Merged build started" and a URL to build 18 (about a minute after the previous status)
  6. a status of "failure" with a message of "Merged build finished" and a URL to build 18 (about a minute after the previous status)

Might be worth noting I've set the pull request builder to poll every minute.

@sigmaris
Copy link

heh, OK - disregard the previous report. There were 2 Jenkins instances updating the same pull request and builds were failing on one of them, which explains the inconsistency.

@MargaretKrutikova
Copy link

I apologize in advance if I have missed some simple fix, but I have been struggling with it for a few days already.
I have been testing a basic setup with ghprb plugin, when a newly created pull request is automatically built and merged into the source branch. The status of the last commit is updated properly, however the status of the build remains "pending" after the pull request has been merged and closed by ghprb.

ghprb_issue

The logs:

First time build. Skipping changelog.
Merging the pull request
Pull request successfully merged
Finished: SUCCESS
Setting status of 4a6f9b58edeaac8e7d3368823de51373dec284d8 to SUCCESS with url <url> and message: 'Build finished. No test results found.'
Finished: SUCCESS

I have been trying to understand where this "pending" status gets retrieved from and have been checking github api for statuses, but the last status of the last commit is always success, and according to github docs it gets the last status of the commit to display. I would appreciate any help on this issue since nothing else worked for me.

@DavidTanner
Copy link
Collaborator

@MargaretKrutikova So nothing between the logs and the PR you posted are lining up for me. The sha in the logs doesn't match either of the ones you are posting from github. The ones from github don't even line up, the merged commit isn't the same as Test commit 25. Are you sure that is the only job that is running on this project? Please open a new issue also.

@MargaretKrutikova
Copy link

True, my apology, that was a log from a different test build. This is the one from the screenshot:

First time build. Skipping changelog.
Merging the pull request
Pull request successfully merged
Finished: SUCCESS
Setting status of 9414e9a5062e3f79ba38e21c43f2eea21ddafa9f to SUCCESS with url <url> and message: 'Build finished. No test results found.'
Finished: SUCCESS

I will open a new issue then.

@hierony94
Copy link

Sorry for comment in this again.

I have a similar problem.
In my case even the build started status doesn't view in the Github pull request.

Anybody could give suggestion about this?

@mtliendo
Copy link

mtliendo commented Sep 8, 2017

I also experienced the same issue...my CI was saying SUCCESS but not updating GitHub.

My solution was:

  1. Make sure in the jobs configure section, under build triggers, in the section titled "GitHub Pull Request Builder" that "Use github hooks for build triggering" is checked. I assume most of us got this far as the request from GitHub would never come to Jenkins to begin with.

  2. optional instead of using${sha1} since there're entire threads on that causing issues, I chose to use origin/pr/${ghprbPullId}/head instead. The ${ghprbPullId} env variable is provided by ghprb and is most likely all you care about anyways.

  3. Double check your logs to make sure that this isn't all just a credentials error and that in the job section: Source Code Mangement -> Git -> Repositories -> Credentials, that those credentials actually work.

  4. Most importantly, and what ended up getting it all to work for me: Make sure the user associated with those credentials is an OWNER of the project on GitHub and not just a member if you're in a group.
    photo sep 08 2 30 10 pm

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

No branches or pull requests