gocd-yaml-config-plugin
gocd-yaml-config-plugin copied to clipboard
Support YAML merge syntax
On the back of the handy 'common' section introduced in #32, it would be really handy if this plugin supported the YAML merge key, like this:
common:
material_yaml_config_plugin: &material_yaml_config_plugin
git: [email protected]:tomzo/gocd-yaml-config-plugin.git
auto_update: false
material_gocd:
git: [email protected]:gocd/gocd.git
auto_update: false
blacklist:
- externals/**/*.*
pipelines:
a_pipeline:
materials:
yaml_config_plugin:
<<: *material_yaml_config_plugin
destination: yaml_config_plugin
gocd:
<<: *material_gocd
destination: gocd
I had a look at yamlbeans recently and it seems it now has support for this, but a release has not been made since then. https://github.com/EsotericSoftware/yamlbeans/commit/095d83d
I suspect (but have not tested) that this is resolved by #62. Possibly just needs a test or two...
I ran into this issue as well... And nope, yamlbeans doesn't support the merge syntax: https://github.com/EsotericSoftware/yamlbeans/blob/master/src/com/esotericsoftware/yamlbeans/tokenizer/Tokenizer.java#L259
Why doesn't this plugin use snakeyaml? It's basically the best yaml parser for java out there, no contest: https://bitbucket.org/asomov/snakeyaml
Hi @reegnz
Why doesn't this plugin use snakeyaml? It's basically the best yaml parser for java out there, no contest
That wasn't obvious to me 2 years ago, when choosing a parser. It's not like yamlbeans says in the readme that it does not support this and that. If you are confident that snakeyaml would be better, then I have no problem with switching to it. If you or anyone can switch the parser and keep the existing tests passing, that would be great. If you want merge syntax to work, please add at least one test case with use of it.
Hi @tomzo, I was simply surprized that it didn't use snakeyaml since everywhere you see snakeyaml when you run into yaml parsing in java (eg. https://github.com/FasterXML/jackson-dataformat-yaml). :) I am pretty confident that snakeyaml is the best lib out there for yaml parsing in java. We discussed with my colleagues that we might try and contribute this change.
Is this still an issue? I see snakeyaml as a dependency in build.graddle
So is yamlbeans. Checked the code, still using yamlbeans for parsing the config.