Open guineveresaenger opened 4 days ago
I would implement this via the Makefile:
-build_sdks: build_nodejs build_python build_dotnet build_go build_java build_registry_docs
+-build_sdks: build_nodejs build_python build_dotnet build_go build_java
-tfgen: install_plugins upstream tfgen_no_deps
+tfgen: install_plugins upstream tfgen_no_deps build_registry_docs\
It feels like generating docs is more in the make tfgen
category (with the schema) then as an SDK artifact.
Unfortunately @iwahbe's suggestion won't work - make registry_docs
depends on make tfgen
(having the provider binary, with edit rules).
It doesn't look like we're doing anything with the result of the build That's right, it's a plain "is this still valid" check
If we're just trying to assert that the files are up to date Not quite - my approach was perhaps a bit simplistic - I want to run this as a separate check that would fail if there were docs changes incompatible with docs replaces that have a hard fail baked into them.
It sounds like two things should happen here:
make tfgen
in the Makefile.Unfortunately @iwahbe's suggestion won't work -
make registry_docs
depends onmake tfgen
(having the provider binary, with edit rules).
This works for me (tested in random from a cleaned repo):
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 455c4723..225d1d7a 100644
--- a/Makefile
+++ b/Makefile
@@ -31,7 +31,7 @@ development: install_plugins provider build_sdks install_sdks
build: install_plugins provider build_sdks install_sdks
-build_sdks: build_nodejs build_python build_dotnet build_go build_java build_registry_docs
+build_sdks: build_nodejs build_python build_dotnet build_go build_java
install_go_sdk:
@@ -99,7 +99,7 @@ build_python: upstream
../venv/bin/python -m build .
# Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root
-build_registry_docs:
+build_registry_docs: upstream tfgen_build_only
$(WORKING_DIR)/bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs
clean:
@@ -155,7 +155,7 @@ test_provider:
@echo ""
cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM)
-tfgen: install_plugins upstream tfgen_no_deps
+tfgen: install_plugins upstream tfgen_no_deps build_registry_docs
tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi
tfgen_no_deps: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH)
It incurs minimal overhead of make tfgen
(only the actual docs generation is a new target) and builds correctly from a clean repo.
https://github.com/pulumi/pulumi-snowflake/issues/752 revealed that we weren't running registry docs build on pull requests. This addresses that issue. Index docs will now be built on pull requests in CI.