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

Incorrect deployment project artifact linked data not fixed during upgrade

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 7.2.0, 7.1.3
    • 7.1.1
    • Artifacts
    • None

    Description

      Issue Summary

      If Bamboo 7.0.x have incorrect deployment project artifact linked data, it is not fixed during upgrade to Bamboo 7.1.x

      Steps to Reproduce

      1. Install Bamboo 7.0.2
      2. Integrate with Bitbucket Server
      3. Use the following RSS Bamboo YAML Specs:
        ---
        # Build plan
        version: 2
        plan:
          project-key: SPECS
          name: bamboo specs
          key: STASH
        
        branches:
          create: for-new-branch
        
        stages:
          - Default Stage:
              jobs: 
                - Build
        Build:
          tasks:
            - script:
                - echo hello > test.txt
          artifacts:
            - name: test.txt
              pattern: test.txt
              shared: true
              required: true
        
        ---
        version: 2
        deployment:
          name: deployment
          source-plan: SPECS-STASH
         
        release-naming: release-1
         
        environments:
          - Production
         
        Production:
          triggers:
            - build-success
          tasks:
            - clean
            - artifact-download
            - script:
                - echo hello
        
      4. Run Specs build in Bamboo to create the build plan and deployment project
      5. Create a new branch in Bitbucket Server
        It will automatically create branch plan in Bamboo. The Specs build in the branch plan incorrectly linked deployment project with the branch plan
      6. Run master build plan or deployment project
        It works fine
      7. Upgrade Bamboo to version 7.1.1
      8. Delete the branch plan in Bamboo
      9. Run the build plan or deployment project

      Expected Results

      Deployment manage to download the artifact successfully

      Actual Results

      The below exception is thrown in the deployment log file:

      simple	25-Aug-2020 06:21:23	Starting task 'Artifact download' of type 'com.atlassian.bamboo.plugins.bamboo-artifact-downloader-plugin:artifactdownloadertask'
      simple	25-Aug-2020 06:21:23	Preparing to download plan result SPECS-STASH-2 artifact: Non required shared artifact: [test.txt], pattern: [test.txt]
      error	25-Aug-2020 06:21:23	Unable to download artifact Non required shared artifact: [test.txt], pattern: [test.txt]
      
      

      Notes

      • The incorrect deployment project linked bug have been fixed in Bamboo 7.1.1 but the problematic data isn't fixed during the upgrade
      • If there are 100 repositories with Specs and incorrect linked data, it will be troublesome to rerun Specs builds for all affected repositories

      Workaround

      1. Use the following SQL to look for affected repositories:
        SELECT vl.NAME as repository_name
        FROM VCS_LOCATION vl
        JOIN VCS_SPECS_STATE vss ON vss.VCS_LOCATION_ID=vl.VCS_LOCATION_ID
        JOIN VCS_SPECS_SOURCE vsso ON vsso.VCS_SPECS_STATE_ID=vss.VCS_SPECS_STATE_ID
        JOIN DEPLOYMENT_PROJECT dp ON dp.VCS_SPECS_SOURCE_ID=vsso.VCS_SPECS_SOURCE_ID
        JOIN DEPLOYMENT_PROJECT_ITEM dpi ON dpi.DEPLOYMENT_PROJECT_ID=dp.DEPLOYMENT_PROJECT_ID
        JOIN DEPLOYMENT_PROJECT_ITEM_BA dpib ON dpib.BAM_ARTIFACT_ITEM_ID=dpi.DEPLOYMENT_PROJECT_ITEM_ID
        JOIN ARTIFACT_DEFINITION ad ON ad.ARTIFACT_DEFINITION_ID=dpib.ARTIFACT_DEFINITION_ID
        JOIN BUILD bj ON bj.BUILD_ID=ad.PRODUCER_JOB_ID
        JOIN CHAIN_STAGE cs ON cs.STAGE_ID=bj.STAGE_ID
        JOIN BUILD bb ON bb.BUILD_ID=cs.BUILD_ID
        WHERE bb.BUILD_TYPE='CHAIN_BRANCH'
        GROUP BY vl.NAME;
        
      2. Rerun Specs build for the repository in the main branch again

      Attachments

        Issue Links

          Activity

            People

              mgardias Marcin Gardias
              klfoong Foong (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: