jenkinsci / remote-file-plugin

Remote File Plugin Repository
https://plugins.jenkins.io/remote-file/
MIT License
56 stars 16 forks source link

Bitbucket Notifications not working with Remote Jenkinsfile #120

Open jgmsb opened 2 years ago

jgmsb commented 2 years ago

Describe the bug Hi. I've detected that when using the Remote Jenkinsfile plugin with a bitbucket repository, the default bitbucket notification that comes with multibranch pipelines stops working. Even using the Bitbucket Build Status Notifier to force the notification doesn't work either.

To Reproduce Steps to reproduce the behavior:

  1. Having a vanilla multibranch pipeline with a bitbucket repo
  2. A bitbucket notification system working on this multibranch pipeline
  3. Getting the Remote Jenkinsfile Plugin and changing the Jenkins file system to the remote Jenkinsfile.
  4. Bitbucket notications stops working.

Expected behavior The bitbucket notifications should work with the Remote Jenkinsfile Plugin

Jenkins Version

Remote Jenkinsfile Plugin Version

puzzup commented 1 year ago

+1 The problem is caused by not propagating revision(but branch name is propagated) of the source branch revision. Can be checked with this code in Jenkinsfile, based on the way bitbucket-branch-source-plugin determinate commit to notify:

import jenkins.scm.api.SCMSource
import jenkins.scm.api.SCMRevision
import jenkins.scm.api.SCMRevisionAction

SCMSource s = SCMSource.SourceByItem.findSource(currentBuild.rawBuild.getParent())
SCMRevision r = SCMRevisionAction.getRevision(s, currentBuild.rawBuild)
println("Repo: ${s.getRepository()} Revision: ${r}")
dermyrddin commented 1 year ago

Same is happening with GitLab Branch Source plugin - no job statuses returned. Is there any workaround for this issue?

rikardthomasson commented 6 months ago

Any solutions to this issue?