On Monday, April 20, 2015 at 6:47:13 AM UTC-4, Tom Deblauwe wrote:
>
> I get a notification from Stash with a commit id from the "project.git" 
> repository(as expected), but jenkins tries to checkout that commit in the 
> "workflows.git" repository, NOT the "project.git" repository.
>

I think the root problem is that this notification behaves the wrong way.

Normally commit notification such as to /git/notifyCommit simply asks 
Jenkins to perform polling immediately: the notification is not trusted, 
just taken as a hint. Then the workflow job knows how to poll properly when 
multiple repositories were checked out.

But if the webhook tries to schedule a build immediately, as happens when 
you specify a commit hash 
<https://github.com/jenkinsci/git-plugin/blob/0c1a59a897d280691e1dad9a979445881fabac4d/src/main/java/hudson/plugins/git/GitStatus.java#L263-274>,
 
then this cannot work. Possibly Jenkins core needs to get an API so that 
you can schedule polling while still suggesting a particular commit to 
build. Then the Git plugin would need to use this API, so that when polling 
is actually run, the proposed commit would be verified as legitimate and 
then used to check out. This would work correctly for a project with 
multiple repositories, because the commit hash would be rejected as 
nonexistent in unrelated repositories.

The real solution is probably to move away from the enforced commit hash 
model altogether, and instead use the multibranch API plugin to support 
repositories which might offer new heads on various branches.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c7cb4ee6-50e9-4a12-9977-e5177443edda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to