Skip to content

Better project tooling for snippets #393

@jack-berg

Description

@jack-berg

Up till now, we use kitchen-sink.yaml as a blunt instrument to:

  • Demonstrate the full configuration surface area of the schema
  • Validate that the schema works as we expect (i.e. make validate-examples)

This is results in a variety of problems:

  • kitchen-sink.yaml is huge!
  • Despite our best effort, kitchen-sink.yaml can't express all the configurable surface area. For example, see Add schema for composite sampler #390 using bits of the parent based sampler configuration, which has 5 configurable sampler properties, to express a new sampler.
  • kitchen-sink.yaml configuration is often nonsensical, as a result of the effort to document all the surface area.
  • kitchen-sink.yaml is annotated with comments generated from the JSON schema and meta schema, which is good for consistency, but limits our ability to convey bits of information about a specific example to users.

I think what we really need is:

  • A directory of snippets, e.g. /snippets
  • Where each file in /snippets contains a narrow demonstration of a particular piece of the larger schema
  • With build tooling which validates that each file adheres to the particular type it is demonstrating, leveraging a file naming convention of the form {type}_{snippet_description}.yaml with build tooling validating according to the {type} extracted from the file name.
  • Where snippets do not contain generated comments from the JSON schema and meta schema, but instead only include ad-hoc comments where needed
  • The generated schema-docs.md could leverage these snippets to detect usages of each type, and either link over to those snippets or directly embed their contents in the markdown.
  • And where this tooling ultimately allows kitchen-sink.yaml to be deleted, as it is essentially decomposed into a bunch of smaller focussed pieces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions