-
Bug
-
Resolution: Incomplete
-
Major
-
None
I have created a freestyle multi-branch project, and I've configured it to use the GitHub branch source plugin as shown on the attached screenshot. With this I am unable to build origin pull requests (from the same repo). All builds fail with the message in the log below.
How to reproduce:
- Start a clean Jenkins installation, possibly in a Docker container
- Install the github-branch-source-plugin and the multi-branch-project-plugin, possibly using install-plugins.sh multi-branch-project-plugin github-branch-source
- Add access credentials of the type Username with password using my predefined user with username jenkins-37144 and password 37144-jenkins. That is a GitHub user which has a repository with an open pull request.
- Create a Freestyle multi-branch project:
- Under Branch Sources, add GitHub as a source
- Configure jenkins-37144 as the owner
- Select the credentials from above
- Select jenkins-pr-test-repo as the repository
- Click Advanced... and make sure Build origin PRs (merged with base branch) is checked.
- Run the branch indexing for the job
- Run the job for the pull request and watch it fail with the error described below
The build fails with this in the log:
> git rev-parse origin/PR-27^{commit} # timeout=10 > git rev-parse origin1/PR-27^{commit} # timeout=10 > git rev-parse PR-27^{commit} # timeout=10 ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job. Finished: FAILURE
When running the same git commands manually, they fail as well, but providing origin/PR/27 instead of origin/PR-27 works:
> git rev-parse origin/PR-27^{commit} fatal: ambiguous argument 'origin/PR-27^{commit}': unknown revision or path not in the working tree. > git rev-parse origin/PR/27^{commit} 0bbc328a72b6083d593c1ae746f80fdba75aa61a
Good to know:
- All "non-PR" builds work fine.
- Everything outside of the screenshot is configured according to the defaults.
- The pull request exists and has no conflicts with the base branch.
- The GitHub repository is my organization's private repository.
- Builds are triggered by branch indexing.