Incorrect warning about a parallel step definition in Pipelines configuration

Issue #152 resolved
Sebastiaan Wiersema created an issue

In a specific case an invalid warning Schema validation: Property 'parallel' is not allowed is given. See the following code snippet for details:

definitions:
  steps:
    - step: &list-files
        name: "list files"
        script:
          - ls -l
    - step: &broken-step
        name: "Broken step"
        script:
          - pipe: random/image:tag
            variables:
              WORKING_ARG: "random-arg"
              # The warning "Schema validation: Property 'parallel' is not allowed" is caused by the array of arguments.
              # Remove the next two lines and the warning is gone. 
              BROKEN_ARGS:
                - "other-random-arg"

pipelines:
  default:
    # Works fine
    - parallel:
        - step: *list-files
        - step: *list-files
    # Is marked with "Schema validation: Property 'parallel' is not allowed" because of lines 15 and 16
    - parallel:
        - step: *list-files
        - step: *broken-step

The snippet is valid according to the Bitbucket Pipelines validator.

This is using IntelliJ Ultimate 2022.3.2 and Bitbucket Linky 2022.1.220.

Comments (2)

  1. Daniil Penkin staff

    Hey @Sebastiaan Wiersema , thanks for reporting this one!

    I see the problem and will check if this syntax should be supported – in such case I’ll update the schema accordingly.

    The Bitbucket Pipelines validator, sadly, is useless as soon as there’s a single YAML anchor in the file. For example, check out this obviously invalid content reported as valid.

    foo: &list-files
    bar:
    

    Linky on the other hand runs validation against JSON schema – the validation mechanism is built-in in IntelliJ. It isn’t perfect in terms of pointing at the error but covers more cases, including anchors.

    Cheers,
    Daniil

  2. Log in to comment