-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] Load YAML anchors declared in external YAML files #743
Comments
@h6ah4i Thank you for your proposal! I think this is a very interesting proposal.
This is my opinion, and I also believe that in the context of testing, it should not be too DRY. I think the features of anchors and aliases should be sufficient. |
Thank you for reply 🙇♂️
Exactly. This is also my biggest concern.
You are totally right too, tests should not be too DRY and the technics 2, 3 and 4 are good practices for reducing duplication of runbook contents. The technic 4 seems like the closest thing to what I want to do, but this approach can be a huge pain if you have so many runbooks. (I am already use the technics 2 and 3.) Situations where I would like to use the
|
Thank you!! I do not want to put additional features directly into runn's YAML processing. I wish there was another way to do more. If you want to make runbooks more DRY, you may want to consider using runn as a package.
I have solved this by writing code that reads using runn.Runner option. Or the
runn.Var option could be used. |
Yes, using runn as a Go's test helper package offers great flexibility. Even so, I love using runn as a standalone tool because it's still powerful and very handy.
Thanks, I have not noticed the option! But unfortunately, it seems that it only supports runner without options (non map form in YAML format). It would be nice if we can specify YAML file(s) that contains runner setups in runbook format instead. |
On second thought, this scenario can be covered if HTTP runner have a global-headers option mentioned in #619. |
I have contributed a PR to enable YAML anchors and aliases in runn. Now, I want to empower the anchors and aliases feature more with the following feature that goccy/go-yaml provides. If we can use the feature effectively, we can write runbooks more DRY way.
[Draft] Specs.
--yaml-references
command line option that specifies where to load yaml files that define anchors globallyrunn run --yaml-references ./references/**/*.yml ./books/**/*.yml
ReferenceReaders()
functionread:parent
policy before passing the contentstestdata/references/**/*.yml
The text was updated successfully, but these errors were encountered: