Open seabass-labrax opened 2 years ago
I'd be more than happy to lend a hand if you decide to take one of the options I described :)
The yaml package supports most of YAML 1.2, but preserves some behavior from 1.1 for backwards compatibility.
We are mainly using go-yaml
v3 which seems to be the best option regarding yaml 1.2.
My suggestion would be to replace https://github.com/ghodss/yaml by something using go-yaml
v3 (maybe by the change started in #384) and patch further bugs by contributing to go-yaml
v3 directly.
I've just made pull request #556 to document the present support for YAML 1.1 and that YAML 1.2 support is being added! :)
@seabass-labrax can you paste an 1.2 yaml example to test against here?
We mostly do support yaml 1.2 but not completly :/
only YAML 1.1
is accepted -> https://codeberg.org/6543/ci_yaml-test/commits/branch/main
else you get 400 -> failure to parse YAML from hook
back (web-hook response)
this has to do with https://gopkg.in/yaml.v3 lib
Clear and concise description of the problem
It would be convenient to be able to use YAML 1.2 for
.woodpecker.yml
and other such workflow files. I believe many users are likely to assume that Woodpecker supports the latest version of YAML, but it currently supports only YAML 1.1 (which was published in 2005).Adding an explicit version directive (
%YAML 1.2
) to.woodpecker.yml
results in the CI not being run, and the CI status not being shown at all in the Gitea (Codeberg) user interface. Woodpecker's own user interface displays the following error message:This message is generated by the
go-yaml
library, in itsyaml/parserc.go
file.Suggested solution
We could use a different YAML parsing library which does support YAML 1.2, or contribute support for YAML 1.2 upstream. This may be related to an existing issue and pull request relating to YAML support:
https://github.com/woodpecker-ci/woodpecker/issues/352 https://github.com/woodpecker-ci/woodpecker/pull/384
Alternative
We could also update the documentation to make it clear that only YAML 1.1 is supported. Currently, it is potentially confusing that the 'Getting Started' page on the Woodpecker documentation says that the format "is a superset of the widely used docker-compose file format", despite the fact that Docker Compose does support YAML 1.2.
Additional context
This is the error message I referred to earlier:
...and this is a pop-up message that appears if one tries to restart the failed build:
Validations