Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-15355

Pipelines YAML validator fails with aliases, breaks enabling Pipelines on new repo

    XMLWordPrintable

Details

    Description

      I have a repo that runs fine through pipelines with the following structure:

      #!yml
      
      image: phpunit/phpunit:5.0.3
      pipelines:
          branches:
              master: # Master is the release branch. Releases automatically propogate when tagged with a version number.
                  - step: &testphp
                      script: # CI unit test step.
                        - apt-get update && apt-get install -y unzip
                        - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
                        - composer install
                        - phpunit -c phpunit.xml
              dev: # Tests must pass on dev before going to release on master.
                  - step: *testphp
      

      This has been running without issue for quite some time. I recently forked the repo to give it a dedicated repository for public releases, and Pipelines is telling me that the syntax is not valid because dev does not have the required script key. It absolutely does, and the engine that runs pipelines has no issue discovering it through the yml alias.

      However, whatever is authenticating the bitbucket-pipelines.yml before it has run at all is not parsing the yml correctly, and is apparently incapable of determining correct aliasing. This seems to only occur on a new repo that has not run pipelines at all yet, but detects a pipelines file.

      This has caused problems getting my branches out of sync between the development master branch and the release master branch, because the site will not allow the repo to have ssh keys set without pipelines being configured when a pipelines file is present.

      Relevant Uri Path:

      (only fires on an initial visit for a new repo that already has a pipelines file as outlined above)
      https://bitbucket.org/projectname/reponame/addon/pipelines/home#!/getting-started

      Repo where issue was noticed:

      https://bitbucket.org/oroborosframework/oroboros-core-releases

      Steps to reproduce:

      • Clone an existing repo locally
      • Edit the bitbucket-pipelines.yml as shown above, so the step key is aliased between two branches.
      • Push the repo to a new empty repository on Bitbucket Cloud
      • Visit the Pipelines tab. You will see the apparent (misconfigured) error message.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dda7258bc8d6 mopsyd
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: