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

Issue #15355 resolved
Brian Dayhoff
created an issue

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

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.

Example Screencap of the Referenced Error

Official response

Comments (9)

  1. Brian Dayhoff reporter

    You will notice in the screencap, that the entire step section for dev sound be aliasing the same step section for master. The actual pipeline runner handles this correctly, but the frontend validation does not.

  2. Aneita Yang staff

    Hey Brian,

    Thanks for bringing this to our attention! I'll keep you updated on our progress on this bug via this issue.

    In the meantime, you can bypass this bug by going into your repository Settings > Pipelines and enabling Pipelines, then pushing your bitbucket-pipelines.yml file to your repository from the command line.

  3. Matt Ryall staff

    Reducing priority as this issue can be worked around and doesn't affect many users.

    We probably won't fix this immediately, as we have other higher priority issues. Please use the workaround in the meantime of committing the file first then enabling Pipelines.

  4. Davina Adisusila staff

    Hi @Brian Dayhoff

    Thanks again for bringing this to our attention. We have released a fix to now support anchors and references/aliases in the Pipelines YAML validator. This means you can define some configuration once and reuse it elsewhere in your bitbucket-pipelines.yml.

    Cheers,
    Davina

  5. Log in to comment