Skip to content

Match Praefect's configuration format in Omnibus

Sami Hiltunen requested to merge smh-generic-praefect-templating into master

What does this MR do?

Praefect's and Omnibus's configuration formats deviate from each other. This has a few problems:

  1. The configuration keys differ in Omnibus from what Praefect uses. This makes things confusing as the keys for the same options are different in different contexts.

  2. This forces us to duplicate the configuration in Omnibus' template to map the different keys. This creates menial work and requires us to touch Omnibus everytime new configuration keys are added.

This commit solves the problem by matching the configuration format of Praefect in Omnibus completely with Praefect's own format. This is done by introducing the submap Gitlab['praefect']['configuration'] which gets directly serialized as TOML. As existing installations still depend on the old keys, compatbility code is added to transfer the configuration to their new locations. We should later deprecate the old keys and ask users to move the configuration to its new location.

Additionally, the default unneeded default values are removed. This ensures the default values are not duplicated and can be controlled for both source and Omnibus installations by just updating Praefect's source.

As tomlrb does not support encoding TOML, dependency to tomlib was added to do so.

Tests had a slight change as the compatibility code outputs some more empty sections in the resulting config file. This is harmless and the empty sections will go away once the compatibility code can be removed. The previous template was also adding bunch of empty unneeded empty sections, which will is no longer done and they'll go away once the compatibility code is removed.

Related issues

gitaly#4467 (closed)
gitaly#4466 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion

Required

  • Merge Request Title, and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • Pipeline is green on dev.gitlab.org if the change is touching anything besides documentation or internal cookbooks
  • trigger-package has a green pipeline running against latest commit

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for the GitLab Chart opened
Edited by Robert Marshall

Merge request reports