build/proto_docs: add proto documentation generator
This adds an HTML documentation generator for our Protobuf files.
It consists of a new Bazel rule `proto_docs` which wraps protoc-gen-doc.
protoc-gen-doc itself and go-proto-validator which it includes need
some light patching because of dumbness in the Go Proto ecosystem that
doesn't exist in our Bazel build.
This just hooks up everything, it does not yet do anything custom like
annotating our own authorization metadata or similar.
Change-Id: If6fd7c777210fea700e49242b5339cfafe7c030d
Reviewed-on: https://review.monogon.dev/c/monogon/+/452
Reviewed-by: Leopold Schabel <leo@nexantic.com>
diff --git a/third_party/go/patches/go-proto-validators-default-alias.patch b/third_party/go/patches/go-proto-validators-default-alias.patch
new file mode 100644
index 0000000..46f21a9
--- /dev/null
+++ b/third_party/go/patches/go-proto-validators-default-alias.patch
@@ -0,0 +1,29 @@
+From 49b5f957d01cd50e5303cfc0e6c7f350d7e1c24e Mon Sep 17 00:00:00 2001
+From: Lorenz Brun <lorenz@monogon.tech>
+Date: Tue, 30 Nov 2021 03:19:37 +0100
+Subject: [PATCH] Alias go_default_library in BUILD to make Gazelle work
+
+---
+ BUILD.bazel | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/BUILD.bazel b/BUILD.bazel
+index 9a1edd4..e5b8f96 100644
+--- a/BUILD.bazel
++++ b/BUILD.bazel
+@@ -14,6 +14,12 @@ gazelle(
+ # By default resolve the top-level package to the gogo variant as it's required for the plugin compilation.
+ # gazelle:resolve go github.com/mwitkow/go-proto-validators //:validators_gogo
+
++alias(
++ name = "go_default_library",
++ actual = "validators_golang",
++ visibility = ["//visibility:public"],
++)
++
+ go_proto_compiler(
+ name = "go_proto_validators",
+ options = ["gogoimport=false"],
+--
+2.25.1
+