Skip to content

gitaly/config: Unify Git config validation

We have two different places where we perform validation of Git config keys:

- On startup via the Gitaly config to verify that the config keys as
  set up by the administrator are valid.

- When spawning a Git command to verify that the config keys we pass
  to Git are valid.

The validation we perform naturally differs between these two locations, where the validation on startup is a lot weaker than the validation we perform when spawning a Git command.

This has a major drawback: in case we determine the config to be valid on startup but invalid when spawning commands then Gitaly comes up as expected, but will then refuse to spawn any Git command at all. So even though it's running, it is basically completely broken and does not provide any working functionality whatsoever.

Improve the situation by using the same validation both on startup to verify the Gitaly configuration and when spawning Git commands. Like this, we will refuse to start Gitaly when it is misconfigured and thus alert an administrator early on that something is wrong. As Gitaly wouldn't have been able to serve any requests anyway this is not a regression but makes it possible to rectify configuration errors early on.

Changelog: changed

Merge request reports