-
Notifications
You must be signed in to change notification settings - Fork 41
YAML anchors cause linter failure when paths
is set
#18
Comments
Try changing the ordering of the anchor. I seem to recall there was a bug in the Go yaml parser where ordering of the anchor matters when unmarshaling into - - name: restore_master_caches
+ - <<: *drone_gcs_cache_common
+ name: restore_master_caches
when:
event: push
branch: master A good way to debug and see what is happening under the hood is to use the command line tools to see a before and after. I am not sure the minimum input required for this particular plugin but you could start with the following:
This will return the converted yaml. |
Oh wow, I think that worked! |
Thanks @bradrydzewski, yes I think we discussed this at one point. @tonglil Brad's comment describes the issue, in our testing we have seen reordering fix the problem. I would love to create an issue, or subscribe to an existing issue in the Go yaml parser. Brad, are you aware of any existing issues? The buildkite fork does not support issues. |
I have added documentation for this work around here https://github.com/meltwater/drone-convert-pathschanged/tree/9168edcd073b54e000ba4f8daad1e3e6d5afc7d9#yaml-anchors Closing this out |
@jimsheldon thank you for following up and documenting the workaround. |
Drone configs allow YAML anchors:
then in practice:
However, if combined with use of
when: paths:
, YAML anchors declared in the config cause Linter errors - they are apparently interpreted as steps with noname
attribute.Given:
This will break immediately when run by Drone:
If the
when
block is removed completely: everything works.when
also works whenpaths
is not present.Help?
The text was updated successfully, but these errors were encountered: