Open rayvincent2 opened 1 year ago
thank you! I'll review as soon as i'm able.
The flaw that this PR has is that it only generates the SCMFileSystem from the PR's source branch and doesn't perform any kind of merge. It suits our needs as we always rebase all our PRs against the target branch. But I can see this may not be a solution that suits all cases. It may still need a little work.
Thanks @rayvincent2 - another issue is that this now places a required dependency on the Bitbucket Branch Source plugin.
It would be preferable to use the patterns described in the linked documentation to make this an Optional Dependency
Very good! Thanks for catching that and handing me the perfect resource to take it the extra step. Now I just need to carve out time to make that tweak. I'm a bit busy now, but will get around to it.
Is it possible to merge this PR?
PR Details
Add support for Bitbucket Pull Requests
Description
In order to properly retrieve Jenkins pipeline and template files in a repository, we must perform special detection and handling of BitBucket PRs. Since the SCMHead retrieved from a PR Jenkins branch doesn't have the correct information to create an SCMFileSystem, we must detect if the SCMHead is of type com.cloudbees.jenkins.plugins.bitbucket.PullRequestSCMHead and then create a custom SCMHead of type com.cloudbees.jenkins.plugins.bitbucket.BranchSCMHead which points to the HEAD of the PRs source branch. This allows us to create a SCMFileSystem that will allow us to retrieve the Jenkins pipeline_config.groovy and Jenkinsfile.
This PR fixes #308.
How Has This Been Tested
JTE was inoperable against BitBucket Server 7. After manually building the .hpi from this commit, we installed it and were able to confirm it working without issue.
Testing Environment:
Types of Changes
Checklist