Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-49417

Implement BitbucketSCMFileSystem.changesSince()

      I want to use the Bitbucket branch source in a multibranch pipeline, but only build commits that involve a change to certain paths. As I understand, this could be accomplished by writing a BranchBuildStrategy plugin, but such a plugin would need to use the changesSince() method, which is unimplemented in BitbucketSCMFileSystem.

      If anyone knows of another way to accomplish this, please let me know.

          [JENKINS-49417] Implement BitbucketSCMFileSystem.changesSince()

          Hi, I faced the same problem recently. I try to integrate a monorepo with many Jenkinsfile (~30) and for basic branch I could use this plugin https://plugins.jenkins.io/multibranch-build-strategy-extension/ to include build by region.

          But for PR it doesn't work, the problem is that the build strategy extension used code that try to cast the BitbucketSCMSource to AbstractGitSCMSource that throw an exception.

          After digging in the code I think it's best to extends AbstractGitSCMSource instead of SCMSource for BitbucketSCMSource, we then need to implement just one method getRemote() that should return the correct url for git clone regarding the current context.

          WDYT ?

          Guillaume Boucherie added a comment - Hi, I faced the same problem recently. I try to integrate a monorepo with many Jenkinsfile (~30) and for basic branch I could use this plugin https://plugins.jenkins.io/multibranch-build-strategy-extension/ to include build by region. But for PR it doesn't work, the problem is that the build strategy extension used code that try to cast the BitbucketSCMSource to AbstractGitSCMSource that throw an exception. After digging in the code I think it's best to extends AbstractGitSCMSource instead of SCMSource for BitbucketSCMSource, we then need to implement just one method getRemote() that should return the correct url for git clone regarding the current context. WDYT ?

          Nikolas Falco added a comment -

          This issue has been planned to be implemented using api.

          Nikolas Falco added a comment - This issue has been planned to be implemented using api.

          Ok, did someone started to do this ? If not I could try to find some spare time to bootstrap it. Let me know, I will be happy to help.

          Guillaume Boucherie added a comment - Ok, did someone started to do this ? If not I could try to find some spare time to bootstrap it. Let me know, I will be happy to help.

            nfalco Nikolas Falco
            mhackner Michael Hackner
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: