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

When multiple Linked Repositories reference the same external VCS, only one of the Plans will be elected to be set as Divergent/Specs branches

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Medium
    • None
    • 9.6.0, 9.2.12
    • Bamboo Specs, Plan Branches
    • None

    Description

      Issue Summary

      This is reproducible on Data Center:

      If multiple Linked Repositories are pointing to the same VCS repository with different "Change detection options", and multiple include/exclude changesets must be used by each Plan as a build trigger, then only one of the Plans will be chosen as a "Divergent Branch" (or Specs/Enhanced branch) once a branch is pushed to the repository.

      Divergent/Specs branches must be set on every Plan that is linked to that Repository and has Specs enabled as they use that to test different Plan structures before applying it on the default branch.

      Steps to Reproduce

      1. Create a Repository in Bitbucket
      2. Create 3 Linked Repositories in Bamboo pointing to the same repository created on Bitbucket, and assign different include/exclude changesets to each
      3. Create 3 Plans in Bamboo, each Plan pointing to one of the three Linked Repositories
      4. Migrate such Plans to Specs (Java or YAML) and push the changes to the Bitbucket repository
      5. Enable Specs on all three Linked Repository and Scan them to force the Plans to be updated to use Specs
      6. Create a new branch on the Bitbucket Repository with a small change to the Plan structure and push
      7. Observe in the logs that Bamboo will report either concurrency errors pointing to Bamboo Specs scan fails with IllegalStateException or, in case it passes, only the last scanned Plan will be created as "Divergent/Specs branch", while the other two first scanned plans will be created as "Plan branches"

      Expected Results

      Each Plan should have a distinct Divergent/Specs branch created successfully.

      Actual Results

      Only the last Plan within a multiple Plan group referencing Linked Repositories pointing to the same external VCS is selected as a candidate for Divergent/Specs branches creation. The other Plans that were also modified within the same commit and were listed before the last Plan on the list are created as normal "Plan branches".

      Here's the result of my own local reproduction of the tests, observe that only "PLAN3" is actually created as Divergent, while PLAN1 and PLAN2 are set as regular Plan branches.

      com.atlassian.bamboo.configuration.external.rss=DEBUG
      2024-03-28 14:20:11,719 DEBUG [20-BAM::SpecsDetection:pool-21-thread-3] [AllTypesSpecsImporter] Processing /var/atlassian/application-data/bamboo/local-working-dir/serverSide/REPOSITORY_STORED_SPECS/repository-155615234-branch_123/internal-yamls/plan/00000-ff86fa75-plan-BAM-PLAN1.yaml
      2024-03-28 14:20:11,730 DEBUG [20-BAM::SpecsDetection:pool-21-thread-3] [DivergentBranchSpecsConsumer] Plan BAM-PLAN1 is not in . Skipping branch update.
      
      2024-03-28 14:20:11,731 DEBUG [20-BAM::SpecsDetection:pool-21-thread-3] [AllTypesSpecsImporter] Processing /var/atlassian/application-data/bamboo/local-working-dir/serverSide/REPOSITORY_STORED_SPECS/repository-155615234-branch_123/internal-yamls/plan/00001-f5f14915-plan-BAM-PLAN2.yaml
      2024-03-28 14:20:11,742 DEBUG [20-BAM::SpecsDetection:pool-21-thread-3] [DivergentBranchSpecsConsumer] Plan BAM-PLAN2 is not in . Skipping branch update.
      
      2024-03-28 14:20:11,742 DEBUG [20-BAM::SpecsDetection:pool-21-thread-3] [AllTypesSpecsImporter] Processing /var/atlassian/application-data/bamboo/local-working-dir/serverSide/REPOSITORY_STORED_SPECS/repository-155615234-branch_123/internal-yamls/plan/00002-05d76a16-plan-BAM-PLAN3.yaml
      2024-03-28 14:20:11,752 INFO [20-BAM::SpecsDetection:pool-21-thread-3] [DivergentBranchSpecsConsumer] Updating divergent branch(es) for plan BAM-PLAN3 and branch VCS Branch [branch_123]
      2024-03-28 14:20:11,772 INFO [20-BAM::SpecsDetection:pool-21-thread-3] [DivergentBranchSpecsConsumer] Updating plan branch BAM-PLAN33 as divergent branch for plan BAM-PLAN3 and branch VCS Branch [branch_123]
      

      Workaround

      Due to locking and concurrency issues, Bamboo was not designed to allow a repository to be created multiple times as Linked Repositories as better reported here:

      A valid workaround:

      1. On your VCS, create an individual repository for each Plan that requires Divergent/Specs branches and set the Plan structure
      2. In Bamboo, create a Linked Repository pointing to the newly created repository and enable Specs on it
      3. Modify the Plan and assign the new "Specs" repository as the default Repository; move the original code repository as a secondary repository and adjust any Tasks/Jobs within the Plan to reference the original code repository's new location
      4. Disable Specs on the "code repository"
      5. Whenever a change to the Plan structure is required, the "Specs" repository must be modified, including the push of new branches to create Specs branches

      Attachments

        Activity

          People

            Unassigned Unassigned
            73868399605e Eduardo Alvarenga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: