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

Unable to manually build projects if pull request plugin is filled out. #6

Closed
JenRed12 opened this issue Sep 14, 2012 · 25 comments
Closed

Comments

@JenRed12
Copy link

If I attempt to build a project manually and have the pull request plugin enabled I get the following error:

Last Built Revision: Revision 6daa227a0bb360c2e330d20d1bd10c3babed2fa8 (detached)
Fetching changes from 1 remote Git repository
Fetching upstream changes from git@github.com:JenRed12/utui.git
No candidate revisions
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE

This was working correctly with public repos last week but seems to no longer work since I updated to new version this morning. It does not work for public or private repos.

@JenRed12
Copy link
Author

Also I do have version 1.33 version of the Github-api plugin

@janinko
Copy link
Owner

janinko commented Sep 14, 2012

Did you specified the commit to build? You need to set the sha1 parameter. In job settings you can check "this build is parametrized" and add string parameter named sha1 - Jenkins will then ask you for this parameter whenever you start it manually.

@JenRed12
Copy link
Author

Yes, I did specify ${sha1} and when I manually build I also have "this build is parametrized" checked with a sha1 parameter. It still seems to fail every time I try a manual build. This is still working when I create a pull request though.

@JenRed12
Copy link
Author

Has there been any progress on this one?

@doubleotoo
Copy link

+1

@janinko
Copy link
Owner

janinko commented Oct 3, 2012

Can you start the jenkins with java option -Dhudson.plugins.git.GitSCM.verbose="true", try to build the job again and post output of the build?

@mapayares
Copy link

+1

@mapayares
Copy link

Started by user Administrator
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@26c69727
Using strategy: Default
Last Built Revision: Revision 0d7c3860dba96ff025cc79de3a14f3765b58be92 (origin/pr/5/merge)
[Push_Test_Private_Repo] $ git rev-parse --verify HEAD
Fetching changes from 1 remote Git repository
Fetching upstream changes from
[Push_Test_Private_Repo] $ git fetch -t <git repo> +refs/pull/*:refs/remotes/origin/pr/*
getCandidateRevisions(false,${sha1},,,,remoteUrls=[git@github.com:JenRed12/utui.git],buildsByBranchName={origin/master=Build #59 of Revision 1e3f76aec9eaa4f8f76ebf81748b816ed5c532d1 (origin/master), origin/Test1=Build #6 of Revision f37c841808da37fe9b47a27be997494657851d0c (origin/Test1), origin/HEAD=Build #17 of Revision beeea900c50281a0ce01e1f4f96069865dd30c4a (origin/HEAD, origin/master), detached=Build #67 of Revision 6daa227a0bb360c2e330d20d1bd10c3babed2fa8 (detached), origin/pr/5/merge=Build #70 of Revision 0d7c3860dba96ff025cc79de3a14f3765b58be92 (origin/pr/5/merge)},lastBuild=Build #70 of Revision 0d7c3860dba96ff025cc79de3a14f3765b58be92 (origin/pr/5/merge)]) considering branches to build
[Push_Test_Private_Repo] $ git tag -l ${sha1}
Qualifying ${sha1} as a branch in repository origin -> origin/${sha1}
[Push_Test_Private_Repo] $ git rev-parse origin/${sha1}^{commit}
Failed to rev-parse: origin/${sha1}
No candidate revisions
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
SSH: Current build result is [FAILURE], not going to run.
Email was triggered for: Failure
Sending email for trigger: Failure
Sending email to: 
Finished: FAILURE

@hjr3
Copy link
Contributor

hjr3 commented Oct 20, 2012

This is actually working for me (on a private repo). I can even use a sha1 parameter that is a branch name. Example: origin/pr/45/merge

@janinko
Copy link
Owner

janinko commented Oct 21, 2012

@mapayares Did you looked at this comment? #6 (comment) Do you have your job parametrized and do you specify the sha1 parameter when starting the build?

@janinko
Copy link
Owner

janinko commented Oct 22, 2012

@JenRed12 Are you sure you have specified the parameter name in this build is parametrized correctly? It is just sha1 not ${sha1}. If you are sure, please start the jenkins with java option -Dhudson.plugins.git.GitSCM.verbose="true", try to build the job again and post output of the build.

@JenRed12
Copy link
Author

JenRed12 commented Nov 6, 2012

Yes I did specify sha1 as well as ${sha1} and it did not work. Here is the output of the build using sha1:

Started by user Administrator
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 f85613c5287e98cd322150c8bbadb057dbefa241 (origin/pr/9/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,sha1,,,,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/pr/9/merge=Build #78 of Revision f85613c5287e98cd322150c8bbadb057dbefa241 (origin/pr/9/merge), origin/HEAD=Build #17 of Revision beeea900c50281a0ce01e1f4f96069865dd30c4a (origin/HEAD, origin/master), detached=Build #67 of Revision 6daa227a0bb360c2e330d20d1bd10c3babed2fa8 (detached), origin/pr/8/merge=Build #77 of Revision 42602b95e3235ec4184d0c256a456977635873ff (origin/pr/8/merge), origin/pr/5/merge=Build #70 of Revision 0d7c3860dba96ff025cc79de3a14f3765b58be92 (origin/pr/5/merge)},lastBuild=Build #78 of Revision f85613c5287e98cd322150c8bbadb057dbefa241 (origin/pr/9/merge)]) considering branches to build
[Push_Test_Private_Repo] $ git tag -l sha1
Qualifying sha1 as a branch in repository origin -> origin/sha1
[Push_Test_Private_Repo] $ git rev-parse origin/sha1^{commit}
Failed to rev-parse: origin/sha1
No candidate revisions
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Email was triggered for: Failure
Sending email for trigger: Failure
Sending email to: jennifer.mitchell@tealium.com
Finished: FAILURE

@hjr3
Copy link
Contributor

hjr3 commented Nov 6, 2012

@JenRed12 That log looks funny. Have a look at #5. That discusses how to do a parameterized build.

@janinko
Copy link
Owner

janinko commented Nov 7, 2012

The line:

getCandidateRevisions(false,sha1,,,, ...

shuld have at the place of sha1 the commit id (sha) or branch specifier.
At issue #19 in your output from automatically triggered build there is line

getCandidateRevisions(false,origin/pr/9/merge,,,, ...

You see, there is origin/pr/9/merge instead of sha1.

When you click on Build Now and Jenkins ask you This build requires parameters: are you entering in the sha1 field the requested commit id (like c40b0052d71645e246d7ca6673a43bb16da669be), or branch specifier (like origin/pr/9/head or origin/pr/9/merge)?

If yes then there is something weird with Jenkins parameter replacement.

@JenRed12
Copy link
Author

JenRed12 commented Nov 7, 2012

I did get this one to work. This issue can be closed

@doubleotoo
Copy link

What was your solution?

On Nov 7, 2012, at 2:12 PM, Jen Frisk notifications@github.com wrote:

I did get this one to work. This issue can be closed


Reply to this email directly or view it on GitHub.

@JenRed12
Copy link
Author

JenRed12 commented Nov 7, 2012

I was able to use the commit number.

Example: c40b005

@hjr3
Copy link
Contributor

hjr3 commented Nov 7, 2012

If you use the commit number then you are testing the commit, not the PR.

@janinko janinko closed this as completed Nov 13, 2012
@ahinz
Copy link

ahinz commented Jan 21, 2013

I'm having this same problem. If I put in the changeset id (i.e. 3b36edf) it works fine. If I just let it build like normal it doesn't seem to work.

As @hjr3 said, this doesn't test the PR, just the individual commit. Not sure how to get around this.

@hjr3
Copy link
Contributor

hjr3 commented Jan 21, 2013

@ahinz You can try to put in the PR branch name. I haven't used this plugin for a while though.

@ahinz
Copy link

ahinz commented Jan 21, 2013

@hjr3 Did you go with a different plugin? Or did you find some way to make this work?

@hjr3
Copy link
Contributor

hjr3 commented Jan 21, 2013

@ahinz I am using a combination of Travis-CI and Jenkins. I will write up something in a bit!

@ahinz
Copy link

ahinz commented Jan 21, 2013

When it fails it looks something like this:

Jan 21, 2013 6:33:33 PM hudson.model.Run execute
INFO: Tree Map Cloud (v3) #5 main build action completed: SUCCESS
Jan 21, 2013 6:33:31 PM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of 2c9fccffa40d8f063e31040f99f5acf361704ccf to PENDING with url http://<jenkins>/job/<job>/5/ and mesage: Merged build started.
Jan 21, 2013 6:33:31 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest build
INFO: Merged build triggered.
Jan 21, 2013 6:33:31 PM org.jenkinsci.plugins.ghprb.GhprbRepo createCommitStatus
INFO: Setting status of 2c9fccffa40d8f063e31040f99f5acf361704ccf to PENDING with url null and mesage: Merged build triggered.
Jan 21, 2013 6:33:31 PM org.jenkinsci.plugins.ghprb.GhprbPullRequest <init>
INFO: Created pull request #8 by ahinz udpdated at: 1/21/13 6:32 PM sha: 2c9fccffa40d8f063e31040f99f5acf361704ccf
Jan 21, 2013 6:33:30 PM hudson.triggers.Trigger

@ahinz
Copy link

ahinz commented Jan 21, 2013

Ooops - I was being overzealous... if I wait 5 or so minutes it marks the PR as ok

@octaviantu
Copy link

Was there a solution found for this one? I'm getting the same issue.

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

7 participants