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

Artifact Download Task does not download the artifact that matches the Plan's Display name when executed from a Default branch. Instead, it will download the artifact from the Default Plan

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 9.3.0, 9.1.2, 9.0.3, 9.2.3
    • 8.2.5, 9.1.0, 9.1.1, 9.2.1
    • Artifacts, Builds
    • None

    Description

      Issue Summary

      This is reproducible in Data Center:

      The Bamboo Artifact Download Task will not honour the following statement reported on this page. It will download artifacts from the Default Plan even when the Plan branch name matches a Plan branch on the source Plan.

      When downloading an artifact from a different plan, Bamboo will use the plan branch Display Name to decide the branch from which the artifact is coming from.

      1. If the remote plan display name matches the display name of the current plan branch, Bamboo will get the artifact from that remote branch.
      2. If there is no remote plan branch matching the current plan branch display name, Bamboo will get the artifact from the default plan branch.

      Steps to Reproduce

      • Create 2 repositories:
        • Repository 1. Create 2 branches, "master" (default) and "rc"
        • Repository 2. Create 1 default "rc" branch
      • Plan A:
        • Link it to Repository 1 
        • Create a default Branch=master and a Plan branch=rc
        • Configure a Script task that will echo "master" > branch.txt
        • Add branch.txt as an artifact "branch"
        • Run Plan A on the Default branch
      • Plan A:
        • Modify the script task echo "rc" > branch.txt
        • Run Plan A on the "rc" branch
        • You will end up with 2 distinct artifacts, one for each branch
      • Plan B:
        • Link it to Repository 2 
        • Create a default Branch=rc
        • Configure an Artifact Downloader Task to download the branch.txt artifact from Plan A
        • Configure a Script task to cat the contents of "branch.txt"

      Expected Results

      • Plan B (rc default branch) should echo "rc", the artifact contents of the "rc" branch of Plan A
      • The Artifact Downloader task should consider the branch name used by the Default branch as the "Display Name", as it does with Plan Branches.

      Actual Results

      • Plan B echoes "master", the artifact content of the default branch of Plan A
      • The Artifact Downloader task will only use the default branch contents of its target Plan when invoked from a Default branch

      Workaround

      • On Plan A and B, define a new common repository branch that is not being used by any Plans. "E.g. release_candidate"

      or

      • Modify "Repository 2" to use a different default branch name. That will force "Plan B" to follow that new name, so you can create the same "rc" Plan Branch on Plan B and it will work

      Attachments

        Issue Links

          Activity

            People

              851f15845f55 Mateusz Szmal
              73868399605e Eduardo Alvarenga
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: