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/build/fietsje/deps_monogon.go b/build/fietsje/deps_monogon.go
index 0abcd66..a584f19 100644
--- a/build/fietsje/deps_monogon.go
+++ b/build/fietsje/deps_monogon.go
@@ -124,6 +124,18 @@
// Used by metroctl to resolve XDG directories
p.collect("github.com/adrg/xdg", "v0.4.0")
+ // Used for generating proto docs in //build/proto_docs
+ p.collect("github.com/pseudomuto/protoc-gen-doc", "v1.5.0", patches("protoc-gen-doc-no-gogo.patch")).use(
+ "github.com/Masterminds/sprig",
+ "github.com/Masterminds/semver",
+ "github.com/aokoli/goutils",
+ "github.com/huandu/xstrings",
+ ).with(
+ disabledProtoBuild,
+ ).use(
+ "github.com/pseudomuto/protokit",
+ )
+
// First generate the repositories starlark rule into memory. This is because
// rendering will lock all unlocked dependencies, which might take a while. If a
// use were to interrupt it now, they would end up with an incomplete