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

The YML Validator for Pipelines does not show any syntax errors for yml anchors

      As per the title, the YML validator for Pipelines (https://bitbucket-pipelines.prod.public.atl-paas.net/validator) does not show any syntax errors for yml anchors.

      This is highlighted in this example public repository: https://bitbucket.org/rtest123/anchor-indentation/addon/pipelines/home#!

      Added by tboudale :

      I would also like to add that sometimes a YML anchor also breaks validation in other parts of the yml file.

      E.g.

      definitions: 
        steps:
          - step: &build-test
            name: Build and test
            script:
              - echo "hello"
            artifacts:
              - target/**
      
      pipelines:
        branches:
          anchor:
            -step: *build-test
          master:
            - step: *build-test
      
      

      Above^ the lack of a space between '-' and 'step' for the branch named 'anchor', is not indicated by the validator.

            [BCLOUD-18299] The YML Validator for Pipelines does not show any syntax errors for yml anchors

            Bump

            Asa Baylus added a comment - Bump

            Jason Harrison added a comment - - edited

            Adding a warning to the "Validator for bitbucket-pipelines.yml" page that anchors are not supported would be helpful.

            "Unable to validate this bitbucket-pipelines.yml file due to the presence of anchors."

            Jason Harrison added a comment - - edited Adding a warning to the "Validator for bitbucket-pipelines.yml" page that anchors are not supported would be helpful. "Unable to validate this bitbucket-pipelines.yml file due to the presence of anchors."

            YAML anchors also allows adding scripts (and passes validation) but actually trying to use them causes validation errors when running the pipeline. If fixing the validator is a big issue for Atlassian then at least improving the documentation would resolve many of the problems. Most companies provide a "complete configuration" yaml which shows examples of every type of resource, configuration, setup etc.

            e.g.

            https://circleci.com/docs/2.0/configuration-reference/#example-full-configuration

            Rupert Broad added a comment - YAML anchors also allows adding scripts (and passes validation) but actually trying to use them causes validation errors when running the pipeline. If fixing the validator is a big issue for Atlassian then at least improving the documentation would resolve many of the problems. Most companies provide a "complete configuration" yaml which shows examples of every type of resource, configuration, setup etc. e.g. https://circleci.com/docs/2.0/configuration-reference/#example-full-configuration

            Saurabh Singh (Inactive) added a comment - https://getsupport.atlassian.com/browse/BBS-134470

            Changing this to a Bug as the validator should handle anchors correctly.

            Mike Howells (Inactive) added a comment - Changing this to a Bug as the validator should handle anchors correctly.

            Aneita added a comment -

            Issue BCLOUD-18894 was marked as a duplicate of this issue.

            Aneita added a comment - Issue BCLOUD-18894 was marked as a duplicate of this issue.

            Aneita added a comment -

            Issue BCLOUD-18306 was marked as a duplicate of this issue.

            Aneita added a comment - Issue BCLOUD-18306 was marked as a duplicate of this issue.

            Aneita added a comment -

            As per the title, the YML validator for Pipelines (https://bitbucket-pipelines.prod.public.atl-paas.net/validator) does not show any syntax errors for yml anchors.

            This is highlighted in this example public repository: https://bitbucket.org/rtest123/anchor-indentation/addon/pipelines/home#!

            Aneita added a comment - As per the title, the YML validator for Pipelines ( https://bitbucket-pipelines.prod.public.atl-paas.net/validator ) does not show any syntax errors for yml anchors. This is highlighted in this example public repository: https://bitbucket.org/rtest123/anchor-indentation/addon/pipelines/home# !

            Aneita added a comment -

            Thanks for raising this.

            This configuration resulted in an error when the pipeline was executed because when the reference was expanded, we detected the pipeline didn't include some keywords that it was expecting.

            I've created a ticket in the team's backlog to look at this bug, however, this is low priority given the other things that we're working on. I'll update you on our progress on this bug via this ticket.

            Aneita added a comment - Thanks for raising this. This configuration resulted in an error when the pipeline was executed because when the reference was expanded, we detected the pipeline didn't include some keywords that it was expecting. I've created a ticket in the team's backlog to look at this bug, however, this is low priority given the other things that we're working on. I'll update you on our progress on this bug via this ticket.

              Unassigned Unassigned
              lmontiel@atlassian.com Leonardo M
              Affected customers:
              18 This affects my team
              Watchers:
              30 Start watching this issue

                Created:
                Updated: