Config documentation autogeneration #14

Open
opened 2023-02-16 10:59:06 +00:00 by fyrchik · 1 comment
fyrchik commented 2023-02-16 10:59:06 +00:00 (Migrated from github.com)

We have multiple things which are in theory derivable from a single source of truth:

  1. Config example.
  2. Config documentation in any format.
  3. Config validator.

The goal is to have some "specification" together with a set of tools allowing us to generate anything we want from this spec (e.g. via Go text/template). So if we need to change anything in the config, we could alter specification and autogenerate all other pieces (xml markup for technical translators, maybe even autogenerating some ansible scripts).

I see 2 ways of writing this specification:

  1. JSON schema. Well-known format, though, hard to write for people not familiar with it.
  2. Go struct with YAML tags + comments.

We could discuss the specification itself as well as any other possible use-cases, that should be taken into account during the development.


I have a partially-completed example in this branch for neofs-node: https://github.com/fyrchik/neofs-node/tree/config-gen
It has 2 parts:

  1. Autogenerate a JSON schema approximation, to speed up adoption. Basically, instead of writing it from scratch, we can take already existing example and have some starting point automatically.
  2. Autogenerate anything with Go templates (in the branch, I have a template for MD config description).
We have multiple things which are in theory derivable from a single source of truth: 1. Config example. 2. Config documentation in any format. 3. Config validator. The goal is to have some "specification" together with a set of tools allowing us to generate anything we want from this spec (e.g. via Go text/template). So if we need to change anything in the config, we could alter specification and autogenerate all other pieces (xml markup for technical translators, maybe even autogenerating some ansible scripts). I see 2 ways of writing this specification: 1. JSON schema. Well-known format, though, hard to write for people not familiar with it. 2. Go struct with YAML tags + comments. We could discuss the specification itself as well as any other possible use-cases, that should be taken into account during the development. --- I have a partially-completed example in this branch for neofs-node: https://github.com/fyrchik/neofs-node/tree/config-gen It has 2 parts: 1. Autogenerate a JSON schema approximation, to speed up adoption. Basically, instead of writing it from scratch, we can take already existing example and have some starting point automatically. 2. Autogenerate anything with Go templates (in the branch, I have a template for MD config description).
pogpp was assigned by alexvanin 2023-03-23 11:56:52 +00:00
snegurochka added the
config
label 2023-05-03 17:14:33 +00:00

I have stumbled upon https://jsonnet.org/ which may be useful.

I have stumbled upon https://jsonnet.org/ which may be useful.
pogpp was unassigned by alexvanin 2024-05-23 14:21:46 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-http-gw#14
There is no content yet.