Details
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.
- If the remote plan display name matches the display name of the current plan branch, Bamboo will get the artifact from that remote branch.
- 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