This is driving me nuts. I'm using WebStorm as my IDE, and when editing my bitbucket-pipelines.yml file, it is giving me a schema validation error on the following block (generic example):
pipelines:
branches:
master:
- stage:
name: My Stage
steps:
- step:
name: My Step
It says that the property "stage" is not allowed. I have WebStorm pointing directly to https://api.bitbucket.org/schemas/pipelines-configuration for this file.
However, if I copy/paste the bitbucket-pipelines.yml file in its entirety to https://bitbucket.org/product/pipelines/validator , it says my configuration is valid.
What gives?? This is driving me crazy.
Hey @Max DeCurtins,
Pipelines developer here :)
The online validator is unfortunately indeed quite limited. For example, it doesn't handle a file with anchors and aliases at all. We are aware of this, and we will eventually improve it. The online validator also doesn't use the JSON schema, which has been introduced relatively recently.
However, the block you mentioned is actually highlighted as invalid by validator, and it shows the reason: script is missing in the step.
Once I add a script with a command, it becomes a valid configuration:
But this configuration looks valid in IntelliJ equipped with the JSON schema:
I assume you simplified the config to surface the issue. Can you post a sample which is closer to the original config in question, if not that config as is? Then I'll be able to tell what's wrong.
Cheers,
Daniil
Yeah I was just using a generic example in my post, I didn't flesh it out fully and that's why the snippet wasn't fully valid.
See a screenshot of the issue below. The "BB pipelines configuration" schema is me telling WebStorm to validate against the remote URL for the JSON schema just to be sure it's not using a bundled version or some other source.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Max DeCurtins,
Thanks for the screenshot, now it's clear what is wrong.
The problem is with the indentation of one of the step properties: lines 39-45 should be indented further to appear under their parent step (check out lines 47-50, for example – they are indented correctly).
Unfortunately, errors produced by JSON schema validation engine in IntelliJ sometimes don't point at the problem exactly, nor do they provide a detailed description of what was expected vs what was found.
I hope that one day we will come up with a better validation tool, but for now this is what we've got.
Let me know if this helped.
Cheers,
Daniil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.