Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-22057

Bamboo using api.github.com URL while creating plan branch with Github Enterprise linked repositories

    XMLWordPrintable

Details

    Description

      Issue Summary

      This is reproducible on Data Center: (yes) 

      Bamboo is referring to https://api.github.com/ to a Github Enterprise linked repository while creating a plan branch when PR is created in the source repository.

      The problem is not seen when this repository is used in the source code checkout task. 

      Steps to Reproduce

      1. Link a Github repository in Bamboo.
      2. Make sure to check the option of Using GitHub Enterprise while linking this repository in Bamboo and provide the Base URL, for example https://yourcompany.com refer below image
      3. Crete a plan in Bamboo and link this repository to this plan.
      4. Go the Branch tab under plan configuration and choose the option of Create plan branch > When new branch in repository is created.
      5. Add a new source code checkout task which checks out this repository to this plan. 
      6. Create a new branch in Github Enterprise repository.

      Expected Results

      1. The Source code checkout task checks out this repository properly and in the logs we'll expect to see the baseurl (https://yourcompany.com) configured as the GIT URL.
      2. New plan branch is created in Bamboo as per step 6 in the above section. 

      Actual Results

      1. The source code checkout task works properly and we can see in the build logs that Bamboo is checking out the correct GIT URL

      Fetching 'refs/heads/main' from 'https://yourcompany.com/test/bamboo-test.git'.
      

      2. The plan branch creation fails, because Bamboo points to api.github.com instead of yourcompany.com and gives 401 error, see the logs below

      Response from GET https://api.github.com/repos/abc@yourcompany.com/bamboo-test/pulls?per_page=100 (401)
      WARN [12-PullRequestDetectionBackgroundThread:pool-16-thread-1] [PullRequestDetector$1] com.atlassian.bamboo.plugins.git.GitHubAccessor$GitHubException: Bad credentials
      com.atlassian.bamboo.repository.RepositoryException: com.atlassian.bamboo.plugins.git.GitHubAccessor$GitHubException: Bad credentials
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Attachments

        Issue Links

          Activity

            People

              851f15845f55 Mateusz Szmal
              4f38d6bf51c0 Shashank Kumar
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: