nishio-dens / bitbucket-pullrequest-builder-plugin

Bitbucket Pull Request Builder Plugin for Jenkins
Other
125 stars 145 forks source link

Updated to 1.5 and receiving message "skipping resolution of commit X, since it originates from another repository" #228

Open twherzog07 opened 4 years ago

twherzog07 commented 4 years ago

I finally got around to updating to 1.5 and now when a PR triggers a build, the changes are no longer checked out, even though all the project settings remain the same. It seems that something is configured incorrectly, because I'm getting this message when it attempts to find the latest hash

> git.exe fetch --tags --force --progress -- https://bitbucket.org/hdsinc/hdsdata.git +refs/heads/*:refs/remotes/origin/* # timeout=10
skipping resolution of commit 6b3c8101f90c, since it originates from another repository
 > git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
 > git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision 6440b4f4c97c8b193b4981e556a4ed36dc612bbb (refs/remotes/origin/master)

I'm not exactly sure what it means, so I don't know what I need to do to fix it. Any help would be appreciated, thanks!

cyberguard commented 3 years ago

Yes, I've been trying to find a solution to this for a while. I'm also bitbucket and can't figure out why it does not resolve the repository.

If I do a git checkout of that commit in my script it works, so the git fetch has it.

I nailed it down to this if statement in the git plugin :https://github.com/jenkinsci/git-plugin/blob/5edc26da3bd4962bdb8599ef1cbc40d335cd1129/src/main/java/hudson/plugins/git/GitSCM.java#L1139

which for for some reason does not match my configured repository (I only have one, I'm not using multiple repository)

I have not found a way (or had the time) to get some debug information on how the match between the commit repository and the configured repository happens. I'm not sure how to get a jenkins slave started under a debugger so that I can trace the code. Was hopping to be able to set debug level to trace or something.

derekatkins commented 2 years ago

This issue still exists; I am having this same issue (see https://github.com/jenkinsci/bitbucket-push-and-pull-request-plugin/issues/249 for my report on it). I think the issue might be related to the webhook sending the repo in HTTPS format whereas Jenkins is configured for SSH format. Or maybe not? @cyberguard -- Is there any way to debug the contents of rpa and also getRepositories() to see what it is that is being compared? I will note that I do not have a multiple-repository configuration, either. There is a comment in the git plugin that it is trying to avoid JENKINS-26587 -- should we open another Jenkins issue on this?

Yonnatan commented 2 years ago

From what i Tested , It fails only when you got a branch specifier set in the Git Plugin , in case of * or ** it will give out the error but will still checkout the relevant revision ,

While if you have something specified ( In my case release/ASW_*), and even if the BITBUCKET_SOURCE_BRANCH matches , It checkouts the branch , but on a different revision then the latest .