Skip to content

Commit 37d2456

Browse files
authored
CLOUDP-336726: Autogenerate API Docs (#2711)
* add crdoc automation * move crdoc tool into its own go.mod * rename tools go.mod to toolbox * use modfile flag for go tool * go mod tidy
1 parent 0238636 commit 37d2456

File tree

6 files changed

+14619
-20
lines changed

6 files changed

+14619
-20
lines changed

.github/workflows/release-image.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ jobs:
289289
cp -rf helm-charts "$RELEASE_DIR/"
290290
cp bundle.Dockerfile "$RELEASE_DIR/bundle.Dockerfile"
291291
cp licenses.csv "$RELEASE_DIR/"
292+
cp docs/api-docs.md "$RELEASE_DIR/"
292293
293294
git fetch origin
294295
git checkout -f -b "$BRANCH" origin/main

.github/workflows/validate-manifests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
with:
1717
enable-cache: 'true'
1818
- name: Run testing
19-
run: devbox run -- 'make validate-manifests'
19+
run: devbox run -- 'make validate-manifests validate-api-docs'

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ ifneq ($(shell git ls-files -o -m --directory --exclude-standard --no-empty-dire
296296
$(info Detected files that need to be committed:)
297297
$(info $(shell git ls-files -o -m --directory --exclude-standard --no-empty-directory | sed -e "s/^/ /"))
298298
$(info )
299-
$(info Try running: make generate manifests)
299+
$(info Try running: make generate manifests api-docs)
300300
$(error Check: FAILED)
301301
else
302302
$(info Check: PASS)
@@ -650,7 +650,6 @@ tools/githubjobs/githubjobs: tools/githubjobs/*.go
650650
tools/scandeprecation/scandeprecation: tools/scandeprecation/*.go
651651
cd tools/scandeprecation && go test . && go build .
652652

653-
654653
.PHONY: slack-deprecations
655654
slack-deprecations: tools/scandeprecation/scandeprecation tools/githubjobs/githubjobs
656655
@echo "Computing and sending deprecation report to Slack..."
@@ -663,4 +662,12 @@ bump-version-file:
663662
jq '(.next | split(".") | map(tonumber) | .[1] += 1 | .[2] = 0 | map(tostring) | join(".")) as $$new_next | .current = .next | .next = $$new_next' $(VERSION_FILE) > $(VERSION_FILE).tmp && mv $(VERSION_FILE).tmp $(VERSION_FILE)
664663

665664
@echo "Version updated successfully:"
666-
@cat $(VERSION_FILE)
665+
@cat $(VERSION_FILE)
666+
667+
.PHONY: api-docs
668+
api-docs:
669+
go tool -modfile=tools/toolbox/go.mod crdoc --resources config/crd/bases --output docs/api-docs.md
670+
671+
.PHONY: validate-api-docs
672+
validate-api-docs: api-docs
673+
$(MAKE) check-missing-files

0 commit comments

Comments
 (0)