-
assigned issue to
YAML validator inconsistent with online tool and Pipelines runtime
I have a pipelines yml file, and the validator in the plugin doesn’t agree with what’s valid YAML with both the online validation tool Atlassian provide, as well as the Pipelines runtime (i.e. whatever engine parses the yml file when a Pipeline runs).
There are a couple of issues I think I see. One set of problems is down to the use of YAML anchors in my yml file. Using a modified version of the example from this page:
definitions:
steps:
- step: &build-test
name: Build and test
script:
- mvn package
artifacts:
- target/**
pipelines:
branches:
develop:
- step: *build-test
name: build-test-1
master:
- step: *build-test
name: build-test-2
The online validator thinks this is valid, and this would work when run as a pipeline job.
Issue 1 is that the plugin’s yml validator thinks “steps” should not be present on line 2, though according to the YAML Anchors documentation, that is actually how you define an anchor.
Issue 2 is that the validator says that the “name” entries on lines 14 and 17 should not be present. Whilst raising this case, I noticed that the following change means this error will go away, however the validator in the plugin disagrees with the online tool and the actual runtime!
master: # was line 15 above
- step:
<<: *build-test
name: build-test-2
It’s nice to have yml syntax validation whilst having the file, though I’m not sure why the file needs to be considered valid locally to be able to run the job on the server. I guess that’s how the plugin works out what there is available to run.
Comments (44)
-
Account Deactivated -
Account Deactivated Thanks for pointing out these issues. This is definitely a new and somewhat experimental feature so getting bug reports will help us clean some of this up.
We should be able to correct both of these issues soon.
It should be noted that the local validation in the extension doesn't actually stop you from commiting the change if it's invalid and the server side should still build it fine. I realize this isn't great right now, but if you know the file is indeed valid, you should be able to commit it and build just fine.
-
Account Deactivated linked to:VSCODE-484
-
Account Deactivated - changed component to triaged
-
I have an issue similar to this:
services: - postgres
This directive ( that is totally fine and works on the pipelines ci) is marked as error in the vscode view : Incorrect type. Expected "object".
-
The definition for
caches
claims it should be an object, but it's actually an array/list. -
Related with
#160 -
Issue
#179was marked as a duplicate of this issue. -
Issue
#160was marked as a duplicate of this issue. -
Issue
#159was marked as a duplicate of this issue. -
Issue
#182was marked as a duplicate of this issue. -
- changed status to open
-
Issue
#195was marked as a duplicate of this issue. -
Any update on this?
-
- changed component to Bitbucket
-
Account Deactivated We also need to support the
clone
section that was added recently - https://bitbucket.org/blog/disabling-clones-in-pipelines-steps -
Yeah, can this be fixed sooner? When pipelines can’t build due to an error it suggest the validator which says it’s valid. That’s really not fun at all.
-
This is still an issue 562 days later. The validator still doesn’t catch things that Bitbucket pipelines fail builds for. It appears to be an indenting issue. Using VSCode.
-
I also noticed 2 issues with the schema:
- The
condition
section is not documented - Arrays passed to pipe arguments as documented here generate a validation error
- The
-
Newly implemented features in pipelines are not being ported to the YAML schema provided with VSCode. Looking at new artifacts' options: https://support.atlassian.com/bitbucket-cloud/docs/use-artifacts-in-steps/
Working in Pipelines, failing in VSCode. Same for the “condition” section which was added almost a year ago.
-
Issue
#536was marked as a duplicate of this issue. -
I’d like to se a resolution soon to this “major” issue
-
This issue is now over 2 years old. 6 other issues have been opened as duplicates of this, so the impact of this bug is greater than the vote count on this would have you believe. Pipelines has come a long way, but please please fix this bug.
-
For anyone using a JetBrains IDE, you can install this plugin and it will solve all your pipeline config file warnings
https://plugins.jetbrains.com/plugin/8015-bitbucket-linky -
Are there any updates?
@Pablo Tejada, thanks for suggestion, however, it did not resolve the pipeline warnings
-
34 Votes for this! Can we at least get an update?
-
@{557057:3695b794-cde3-43a2-99aa-c0fc6151b754} Is this being worked on? To fix many of the reported issues it should just require updating the json schema being used by extensions.
-
Account Deleted +1 hello Atlassian I can imagine you are busy but… fix it pls x)
-
Hello all,
Obviously our schema for
bitbucket-pipelines.yml
has diverged from the one actually used by Bitbucket Pipelines. i’m curious to know if you are using the schema to edit the YAML file in VS Code or if you’re creating the file elsewhere and there are non-existent errors being flagged one it’s opened in VS Code. -
For me it’s mostly getting errors while editing in VS Code or any other editor that automatically fetches the schema for tooltips and validation. It’s really annoying to get errors without being able to identify if it’s an actual problem or a schema problem. In some ways it’s better to not have a schema at all than being constantly distracted by red squigglies.
-
The age of this ticket (and the other ones just like it) and Atlassian’s prolonged refusal to fix the issue when it’s literally a schema change is the best argument I’ve ever seen for open source software.
-
@Nick Rundquist In a way thanks for asking.
The bare minimum would be to fix the online validation tool. It doesn’t help that a broken run suggest using the validator which says it’s valid.
Next best, update your definition of done for pipelines changes so that it includes schema fixes. -
@Nick Rundquist Thanks for looking at this!
I’m using the schema to validate the YAML file while editing it in VSCode.
I use it because it lets me know immediately if there are any issues, instead of waiting for it to be committed, pushed and fail in the pipeline - alternatively adding a manual process of validating the yaml in the online validation tool 🤮 after every edit.
The validation and code completion also means that I don’t have to search for and refer to the documentation as often. It allows me to stay in VSCode through the entire process. While this is not something that takes heaps of time, the proportional reduction huge. Having to search for errors that aren’t actually errors add some of that time back.
-
A temporary fix in vscode for this is to update
"additionalProperties": true
in the pipelines-schema.json. By default this is false, change it to true to allow properties that are not in the schema, otherwise you will need to manually add them.
-
I uninstalled atlascode because it was too bloated and now I’m using the schema from the IntelliJ extension. It was all I needed anyway and gets updated more frequently:
If you want to be able to configure step size, then use the version 030f8f3.
-
the
condition
property is still unsupported! This has been a really long time. Please add this to the schema. -
@Matt Miller - how can I set the
"additionalProperties": true
for the pipelines-schema.json file? It is coming from Atlassian via their extension for VSCode… -
There’s even a pull request open:
https://bitbucket.org/atlassianlabs/atlascode/pull-requests/999
What’s blocking this from being merged? -
@{557057:3695b794-cde3-43a2-99aa-c0fc6151b754} Could we please get some sort of status update on this?
-
Any updates on this? Cheers
-
Still waiting for updates
-
Account Deactivated LOL
-
It would also be really great to see this expanded to have
excludePaths
as well as the existingincludePaths
. -
any update on this…it is not rocket science but it took year for update
also agree that excludePaths is good for real world usage
- Log in to comment