diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/actions/download-codegen/action.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/actions/download-codegen/action.yml new file mode 100644 index 0000000000..66a5643d7b --- /dev/null +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/actions/download-codegen/action.yml @@ -0,0 +1,21 @@ +name: Download the code generator binary +description: Downloads the code generator binary to `bin/`. + +runs: + using: "composite" + steps: + + - name: Download the code generator binary for #{{ .Config.Provider }}# + uses: #{{ .Config.ActionVersions.DownloadArtifact }}# + with: + #{{- if .Config.NoUpstream }}# + name: pulumi-gen-#{{ .Config.Provider }}# + #{{- else }}# + name: pulumi-tfgen-#{{ .Config.Provider }}# + #{{- end }}# + path: ${{ github.workspace }}/bin + + - name: Ensure the code generator binary for #{{ .Config.Provider }}# is executable + shell: bash + run: | + find ${{ github.workspace }} -name "pulumi-*-#{{ .Config.Provider }}#" -print -exec chmod +x {} \; diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/actions/download-tfgen/action.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/actions/download-tfgen/action.yml deleted file mode 100644 index 290ee58272..0000000000 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/actions/download-tfgen/action.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Download the tfgen binary -description: Downloads the tfgen binary to `bin/`. - -runs: - using: "composite" - steps: - - - name: Download pulumi-tfgen-#{{ .Config.Provider }}# - uses: #{{ .Config.ActionVersions.DownloadArtifact }}# - with: - name: pulumi-tfgen-#{{ .Config.Provider }}# - path: ${{ github.workspace }}/bin - - - name: Ensure pulumi-tfgen-#{{ .Config.Provider }}# is executable - shell: bash - run: | - find ${{ github.workspace }} -name "pulumi-*-#{{ .Config.Provider }}#" -print -exec chmod +x {} \; diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml index 057bb93bb8..9efedcd8bd 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/build_sdk.yml @@ -53,8 +53,8 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Prepare local workspace run: make prepare_local_workspace - - name: Download tfgen - uses: ./.github/actions/download-tfgen + - name: Download codegen + uses: ./.github/actions/download-codegen - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Restore makefile progress diff --git a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml index 83ca14df44..72ac72698d 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml +++ b/provider-ci/internal/pkg/templates/bridged-provider/.github/workflows/prerequisites.yml @@ -125,10 +125,14 @@ jobs: fi #{{- end }}# - - name: Upload pulumi-tfgen-#{{ .Config.Provider }}# + - name: Upload codegen binary for #{{ .Config.Provider }}# uses: #{{ .Config.ActionVersions.UploadArtifact }}# with: + #{{- if .Config.NoUpstream }}# + name: pulumi-gen-#{{ .Config.Provider }}# + #{{- else }}# name: pulumi-tfgen-#{{ .Config.Provider }}# + #{{- end }}# path: ${{ github.workspace }}/bin/pulumi-tfgen-#{{ .Config.Provider }}# retention-days: 30 diff --git a/provider-ci/internal/pkg/templates/bridged-provider/Makefile b/provider-ci/internal/pkg/templates/bridged-provider/Makefile index 68087b28c6..5160f8f5db 100644 --- a/provider-ci/internal/pkg/templates/bridged-provider/Makefile +++ b/provider-ci/internal/pkg/templates/bridged-provider/Makefile @@ -9,7 +9,11 @@ PROVIDER_PATH := provider/v#{{ .Config.MajorVersion }}# PROVIDER_PATH := provider #{{- end }}# VERSION_PATH := $(PROVIDER_PATH)/pkg/version.Version -TFGEN := pulumi-tfgen-$(PACK) +#{{- if .Config.NoUpstream }}# +CODEGEN := pulumi-gen-$(PACK) +#{{- else }}# +CODEGEN := pulumi-tfgen-$(PACK) +#{{- end }}# PROVIDER := pulumi-resource-$(PACK) JAVA_GEN := pulumi-java-gen TESTPARALLELISM := 10 @@ -111,8 +115,8 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet .make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_dotnet: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ +.make/generate_dotnet: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ echo "$(VERSION_GENERIC)" >version.txt @@ -125,8 +129,8 @@ build_dotnet: .make/build_dotnet generate_go: .make/generate_go build_go: .make/build_go .make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_go: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ +.make/generate_go: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) go --out sdk/go/ @touch $@ .make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @@ -152,8 +156,8 @@ build_java: .make/build_java generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs .make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_nodejs: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ +.make/generate_nodejs: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) nodejs --out sdk/nodejs/ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod @touch $@ .make/build_nodejs: .make/generate_nodejs @@ -167,8 +171,8 @@ build_nodejs: .make/build_nodejs generate_python: .make/generate_python build_python: .make/build_python .make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_python: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ +.make/generate_python: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) python --out sdk/python/ printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod cp README.md sdk/python/ @touch $@ @@ -186,8 +190,8 @@ build_python: .make/build_python #{{- if .Config.RegistryDocs }}# # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root build_registry_docs: .make/build_registry_docs -.make/build_registry_docs: .make/install_plugins bin/$(TFGEN) - bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs +.make/build_registry_docs: .make/install_plugins bin/$(CODEGEN) + bin/$(CODEGEN) registry-docs --out $(WORKING_DIR)/docs @touch $@ .PHONY: build_registry_docs #{{- end }}# @@ -226,7 +230,7 @@ install_nodejs_sdk: .make/install_nodejs_sdk install_python_sdk: .PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk -# Install Pulumi plugins required for TFGen to resolve references +# Install Pulumi plugins required for CODEGEN to resolve references install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -279,13 +283,13 @@ tfgen_no_deps: .make/schema .make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache .make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) .make/schema: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -.make/schema: bin/$(TFGEN) .make/install_plugins .make/upstream - $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) +.make/schema: bin/$(CODEGEN) .make/install_plugins .make/upstream + $(WORKING_DIR)/bin/$(CODEGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) @touch $@ -tfgen_build_only: bin/$(TFGEN) -bin/$(TFGEN): provider/*.go provider/go.* .make/upstream - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) +tfgen_build_only: bin/$(CODEGEN) +bin/$(CODEGEN): provider/*.go provider/go.* .make/upstream + (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(CODEGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(CODEGEN)) .PHONY: tfgen schema tfgen_no_deps tfgen_build_only #{{ if .Config.NoUpstream }}# upstream: .make/upstream @@ -342,7 +346,7 @@ ci-mgmt: .ci-mgmt.yaml # Start debug server for tfgen debug_tfgen: - dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) + dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(CODEGEN) -- schema --out provider/cmd/$(PROVIDER) .PHONY: debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/acme/.github/actions/download-tfgen/action.yml b/provider-ci/test-providers/acme/.github/actions/download-codegen/action.yml similarity index 59% rename from provider-ci/test-providers/acme/.github/actions/download-tfgen/action.yml rename to provider-ci/test-providers/acme/.github/actions/download-codegen/action.yml index 2b9b04b404..585ed7b574 100644 --- a/provider-ci/test-providers/acme/.github/actions/download-tfgen/action.yml +++ b/provider-ci/test-providers/acme/.github/actions/download-codegen/action.yml @@ -1,17 +1,17 @@ -name: Download the tfgen binary -description: Downloads the tfgen binary to `bin/`. +name: Download the code generator binary +description: Downloads the code generator binary to `bin/`. runs: using: "composite" steps: - - name: Download pulumi-tfgen-acme + - name: Download the code generator binary for acme uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: pulumi-tfgen-acme path: ${{ github.workspace }}/bin - - name: Ensure pulumi-tfgen-acme is executable + - name: Ensure the code generator binary for acme is executable shell: bash run: | find ${{ github.workspace }} -name "pulumi-*-acme" -print -exec chmod +x {} \; diff --git a/provider-ci/test-providers/acme/.github/workflows/build_sdk.yml b/provider-ci/test-providers/acme/.github/workflows/build_sdk.yml index df9017fc7d..3bd917dfb4 100644 --- a/provider-ci/test-providers/acme/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/acme/.github/workflows/build_sdk.yml @@ -59,8 +59,8 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Prepare local workspace run: make prepare_local_workspace - - name: Download tfgen - uses: ./.github/actions/download-tfgen + - name: Download codegen + uses: ./.github/actions/download-codegen - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Restore makefile progress diff --git a/provider-ci/test-providers/acme/.github/workflows/prerequisites.yml b/provider-ci/test-providers/acme/.github/workflows/prerequisites.yml index 8fe3e81efa..e4f170122b 100644 --- a/provider-ci/test-providers/acme/.github/workflows/prerequisites.yml +++ b/provider-ci/test-providers/acme/.github/workflows/prerequisites.yml @@ -95,7 +95,7 @@ jobs: Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. - - name: Upload pulumi-tfgen-acme + - name: Upload codegen binary for acme uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: name: pulumi-tfgen-acme diff --git a/provider-ci/test-providers/acme/Makefile b/provider-ci/test-providers/acme/Makefile index 22b96f6b91..3bea5cfb54 100644 --- a/provider-ci/test-providers/acme/Makefile +++ b/provider-ci/test-providers/acme/Makefile @@ -5,7 +5,7 @@ ORG := pulumiverse PROJECT := github.com/$(ORG)/pulumi-$(PACK) PROVIDER_PATH := provider VERSION_PATH := $(PROVIDER_PATH)/pkg/version.Version -TFGEN := pulumi-tfgen-$(PACK) +CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) JAVA_GEN := pulumi-java-gen TESTPARALLELISM := 10 @@ -95,8 +95,8 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet .make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_dotnet: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ +.make/generate_dotnet: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ echo "$(VERSION_GENERIC)" >version.txt @@ -109,8 +109,8 @@ build_dotnet: .make/build_dotnet generate_go: .make/generate_go build_go: .make/build_go .make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_go: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ +.make/generate_go: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) go --out sdk/go/ @touch $@ .make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @@ -136,8 +136,8 @@ build_java: .make/build_java generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs .make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_nodejs: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ +.make/generate_nodejs: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) nodejs --out sdk/nodejs/ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod @touch $@ .make/build_nodejs: .make/generate_nodejs @@ -151,8 +151,8 @@ build_nodejs: .make/build_nodejs generate_python: .make/generate_python build_python: .make/build_python .make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_python: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ +.make/generate_python: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) python --out sdk/python/ printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod cp README.md sdk/python/ @touch $@ @@ -193,7 +193,7 @@ install_nodejs_sdk: .make/install_nodejs_sdk install_python_sdk: .PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk -# Install Pulumi plugins required for TFGen to resolve references +# Install Pulumi plugins required for CODEGEN to resolve references install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -243,13 +243,13 @@ tfgen_no_deps: .make/schema .make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache .make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) .make/schema: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -.make/schema: bin/$(TFGEN) .make/install_plugins .make/upstream - $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) +.make/schema: bin/$(CODEGEN) .make/install_plugins .make/upstream + $(WORKING_DIR)/bin/$(CODEGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) @touch $@ -tfgen_build_only: bin/$(TFGEN) -bin/$(TFGEN): provider/*.go provider/go.* .make/upstream - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) +tfgen_build_only: bin/$(CODEGEN) +bin/$(CODEGEN): provider/*.go provider/go.* .make/upstream + (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(CODEGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(CODEGEN)) .PHONY: tfgen schema tfgen_no_deps tfgen_build_only # Apply patches to the upstream submodule, if it exists @@ -295,7 +295,7 @@ ci-mgmt: .ci-mgmt.yaml # Start debug server for tfgen debug_tfgen: - dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) + dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(CODEGEN) -- schema --out provider/cmd/$(PROVIDER) .PHONY: debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/aws/.github/actions/download-tfgen/action.yml b/provider-ci/test-providers/aws/.github/actions/download-codegen/action.yml similarity index 59% rename from provider-ci/test-providers/aws/.github/actions/download-tfgen/action.yml rename to provider-ci/test-providers/aws/.github/actions/download-codegen/action.yml index cec9b80482..0cbde64bc1 100644 --- a/provider-ci/test-providers/aws/.github/actions/download-tfgen/action.yml +++ b/provider-ci/test-providers/aws/.github/actions/download-codegen/action.yml @@ -1,17 +1,17 @@ -name: Download the tfgen binary -description: Downloads the tfgen binary to `bin/`. +name: Download the code generator binary +description: Downloads the code generator binary to `bin/`. runs: using: "composite" steps: - - name: Download pulumi-tfgen-aws + - name: Download the code generator binary for aws uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: pulumi-tfgen-aws path: ${{ github.workspace }}/bin - - name: Ensure pulumi-tfgen-aws is executable + - name: Ensure the code generator binary for aws is executable shell: bash run: | find ${{ github.workspace }} -name "pulumi-*-aws" -print -exec chmod +x {} \; diff --git a/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml b/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml index e3e8810850..a510ec448a 100644 --- a/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/aws/.github/workflows/build_sdk.yml @@ -71,8 +71,8 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Prepare local workspace run: make prepare_local_workspace - - name: Download tfgen - uses: ./.github/actions/download-tfgen + - name: Download codegen + uses: ./.github/actions/download-codegen - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Restore makefile progress diff --git a/provider-ci/test-providers/aws/.github/workflows/prerequisites.yml b/provider-ci/test-providers/aws/.github/workflows/prerequisites.yml index d53da69dd7..61712ad6c1 100644 --- a/provider-ci/test-providers/aws/.github/workflows/prerequisites.yml +++ b/provider-ci/test-providers/aws/.github/workflows/prerequisites.yml @@ -106,7 +106,7 @@ jobs: Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. - - name: Upload pulumi-tfgen-aws + - name: Upload codegen binary for aws uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: name: pulumi-tfgen-aws diff --git a/provider-ci/test-providers/aws/Makefile b/provider-ci/test-providers/aws/Makefile index b5541e27e4..8c95310e72 100644 --- a/provider-ci/test-providers/aws/Makefile +++ b/provider-ci/test-providers/aws/Makefile @@ -5,7 +5,7 @@ ORG := pulumi PROJECT := github.com/$(ORG)/pulumi-$(PACK) PROVIDER_PATH := provider/v6 VERSION_PATH := $(PROVIDER_PATH)/pkg/version.Version -TFGEN := pulumi-tfgen-$(PACK) +CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) JAVA_GEN := pulumi-java-gen TESTPARALLELISM := 10 @@ -95,8 +95,8 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet .make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_dotnet: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ +.make/generate_dotnet: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ echo "$(VERSION_GENERIC)" >version.txt @@ -109,8 +109,8 @@ build_dotnet: .make/build_dotnet generate_go: .make/generate_go build_go: .make/build_go .make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_go: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ +.make/generate_go: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) go --out sdk/go/ @touch $@ .make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @@ -136,8 +136,8 @@ build_java: .make/build_java generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs .make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_nodejs: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ +.make/generate_nodejs: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) nodejs --out sdk/nodejs/ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod @touch $@ .make/build_nodejs: .make/generate_nodejs @@ -151,8 +151,8 @@ build_nodejs: .make/build_nodejs generate_python: .make/generate_python build_python: .make/build_python .make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_python: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ +.make/generate_python: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) python --out sdk/python/ printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod cp README.md sdk/python/ @touch $@ @@ -193,7 +193,7 @@ install_nodejs_sdk: .make/install_nodejs_sdk install_python_sdk: .PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk -# Install Pulumi plugins required for TFGen to resolve references +# Install Pulumi plugins required for CODEGEN to resolve references install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -253,13 +253,13 @@ tfgen_no_deps: .make/schema .make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache .make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) .make/schema: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -.make/schema: bin/$(TFGEN) .make/install_plugins .make/upstream - $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) +.make/schema: bin/$(CODEGEN) .make/install_plugins .make/upstream + $(WORKING_DIR)/bin/$(CODEGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) @touch $@ -tfgen_build_only: bin/$(TFGEN) -bin/$(TFGEN): provider/*.go provider/go.* .make/upstream - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) +tfgen_build_only: bin/$(CODEGEN) +bin/$(CODEGEN): provider/*.go provider/go.* .make/upstream + (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(CODEGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(CODEGEN)) .PHONY: tfgen schema tfgen_no_deps tfgen_build_only # Apply patches to the upstream submodule, if it exists @@ -309,7 +309,7 @@ ci-mgmt: .ci-mgmt.yaml # Start debug server for tfgen debug_tfgen: - dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) + dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(CODEGEN) -- schema --out provider/cmd/$(PROVIDER) .PHONY: debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/cloudflare/.github/actions/download-tfgen/action.yml b/provider-ci/test-providers/cloudflare/.github/actions/download-codegen/action.yml similarity index 59% rename from provider-ci/test-providers/cloudflare/.github/actions/download-tfgen/action.yml rename to provider-ci/test-providers/cloudflare/.github/actions/download-codegen/action.yml index e66158af6d..fcb45dd961 100644 --- a/provider-ci/test-providers/cloudflare/.github/actions/download-tfgen/action.yml +++ b/provider-ci/test-providers/cloudflare/.github/actions/download-codegen/action.yml @@ -1,17 +1,17 @@ -name: Download the tfgen binary -description: Downloads the tfgen binary to `bin/`. +name: Download the code generator binary +description: Downloads the code generator binary to `bin/`. runs: using: "composite" steps: - - name: Download pulumi-tfgen-cloudflare + - name: Download the code generator binary for cloudflare uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: pulumi-tfgen-cloudflare path: ${{ github.workspace }}/bin - - name: Ensure pulumi-tfgen-cloudflare is executable + - name: Ensure the code generator binary for cloudflare is executable shell: bash run: | find ${{ github.workspace }} -name "pulumi-*-cloudflare" -print -exec chmod +x {} \; diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml b/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml index bf646200dd..ceb2cc1f29 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/build_sdk.yml @@ -62,8 +62,8 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Prepare local workspace run: make prepare_local_workspace - - name: Download tfgen - uses: ./.github/actions/download-tfgen + - name: Download codegen + uses: ./.github/actions/download-codegen - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Restore makefile progress diff --git a/provider-ci/test-providers/cloudflare/.github/workflows/prerequisites.yml b/provider-ci/test-providers/cloudflare/.github/workflows/prerequisites.yml index 6c60830d93..834596d95e 100644 --- a/provider-ci/test-providers/cloudflare/.github/workflows/prerequisites.yml +++ b/provider-ci/test-providers/cloudflare/.github/workflows/prerequisites.yml @@ -99,7 +99,7 @@ jobs: Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. - - name: Upload pulumi-tfgen-cloudflare + - name: Upload codegen binary for cloudflare uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: name: pulumi-tfgen-cloudflare diff --git a/provider-ci/test-providers/cloudflare/Makefile b/provider-ci/test-providers/cloudflare/Makefile index da49713a76..74f47b7697 100644 --- a/provider-ci/test-providers/cloudflare/Makefile +++ b/provider-ci/test-providers/cloudflare/Makefile @@ -5,7 +5,7 @@ ORG := pulumi PROJECT := github.com/$(ORG)/pulumi-$(PACK) PROVIDER_PATH := provider/v5 VERSION_PATH := $(PROVIDER_PATH)/pkg/version.Version -TFGEN := pulumi-tfgen-$(PACK) +CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) JAVA_GEN := pulumi-java-gen TESTPARALLELISM := 10 @@ -95,8 +95,8 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet .make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_dotnet: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ +.make/generate_dotnet: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ echo "$(VERSION_GENERIC)" >version.txt @@ -109,8 +109,8 @@ build_dotnet: .make/build_dotnet generate_go: .make/generate_go build_go: .make/build_go .make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_go: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ +.make/generate_go: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) go --out sdk/go/ @touch $@ .make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @@ -136,8 +136,8 @@ build_java: .make/build_java generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs .make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_nodejs: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ +.make/generate_nodejs: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) nodejs --out sdk/nodejs/ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod @touch $@ .make/build_nodejs: .make/generate_nodejs @@ -151,8 +151,8 @@ build_nodejs: .make/build_nodejs generate_python: .make/generate_python build_python: .make/build_python .make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_python: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ +.make/generate_python: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) python --out sdk/python/ printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod cp README.md sdk/python/ @touch $@ @@ -168,8 +168,8 @@ build_python: .make/build_python .PHONY: generate_python build_python # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root build_registry_docs: .make/build_registry_docs -.make/build_registry_docs: .make/install_plugins bin/$(TFGEN) - bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs +.make/build_registry_docs: .make/install_plugins bin/$(CODEGEN) + bin/$(CODEGEN) registry-docs --out $(WORKING_DIR)/docs @touch $@ .PHONY: build_registry_docs @@ -199,7 +199,7 @@ install_nodejs_sdk: .make/install_nodejs_sdk install_python_sdk: .PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk -# Install Pulumi plugins required for TFGen to resolve references +# Install Pulumi plugins required for CODEGEN to resolve references install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -253,13 +253,13 @@ tfgen_no_deps: .make/schema .make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache .make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) .make/schema: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -.make/schema: bin/$(TFGEN) .make/install_plugins .make/upstream - $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) +.make/schema: bin/$(CODEGEN) .make/install_plugins .make/upstream + $(WORKING_DIR)/bin/$(CODEGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) @touch $@ -tfgen_build_only: bin/$(TFGEN) -bin/$(TFGEN): provider/*.go provider/go.* .make/upstream - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) +tfgen_build_only: bin/$(CODEGEN) +bin/$(CODEGEN): provider/*.go provider/go.* .make/upstream + (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(CODEGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(CODEGEN)) .PHONY: tfgen schema tfgen_no_deps tfgen_build_only # Apply patches to the upstream submodule, if it exists @@ -305,7 +305,7 @@ ci-mgmt: .ci-mgmt.yaml # Start debug server for tfgen debug_tfgen: - dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) + dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(CODEGEN) -- schema --out provider/cmd/$(PROVIDER) .PHONY: debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/docker/.github/actions/download-tfgen/action.yml b/provider-ci/test-providers/docker/.github/actions/download-codegen/action.yml similarity index 59% rename from provider-ci/test-providers/docker/.github/actions/download-tfgen/action.yml rename to provider-ci/test-providers/docker/.github/actions/download-codegen/action.yml index dd032ae3e8..a11361c236 100644 --- a/provider-ci/test-providers/docker/.github/actions/download-tfgen/action.yml +++ b/provider-ci/test-providers/docker/.github/actions/download-codegen/action.yml @@ -1,17 +1,17 @@ -name: Download the tfgen binary -description: Downloads the tfgen binary to `bin/`. +name: Download the code generator binary +description: Downloads the code generator binary to `bin/`. runs: using: "composite" steps: - - name: Download pulumi-tfgen-docker + - name: Download the code generator binary for docker uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: name: pulumi-tfgen-docker path: ${{ github.workspace }}/bin - - name: Ensure pulumi-tfgen-docker is executable + - name: Ensure the code generator binary for docker is executable shell: bash run: | find ${{ github.workspace }} -name "pulumi-*-docker" -print -exec chmod +x {} \; diff --git a/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml b/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml index 822be86fc2..2d7af34aeb 100644 --- a/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/docker/.github/workflows/build_sdk.yml @@ -75,8 +75,8 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Prepare local workspace run: make prepare_local_workspace - - name: Download tfgen - uses: ./.github/actions/download-tfgen + - name: Download codegen + uses: ./.github/actions/download-codegen - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Restore makefile progress diff --git a/provider-ci/test-providers/docker/.github/workflows/prerequisites.yml b/provider-ci/test-providers/docker/.github/workflows/prerequisites.yml index f0fe74369f..1dd5edd5fb 100644 --- a/provider-ci/test-providers/docker/.github/workflows/prerequisites.yml +++ b/provider-ci/test-providers/docker/.github/workflows/prerequisites.yml @@ -112,7 +112,7 @@ jobs: Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. - - name: Upload pulumi-tfgen-docker + - name: Upload codegen binary for docker uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: name: pulumi-tfgen-docker diff --git a/provider-ci/test-providers/docker/Makefile b/provider-ci/test-providers/docker/Makefile index 5abc2ca117..2181b16c5a 100644 --- a/provider-ci/test-providers/docker/Makefile +++ b/provider-ci/test-providers/docker/Makefile @@ -5,7 +5,7 @@ ORG := pulumi PROJECT := github.com/$(ORG)/pulumi-$(PACK) PROVIDER_PATH := provider/v4 VERSION_PATH := $(PROVIDER_PATH)/pkg/version.Version -TFGEN := pulumi-tfgen-$(PACK) +CODEGEN := pulumi-tfgen-$(PACK) PROVIDER := pulumi-resource-$(PACK) JAVA_GEN := pulumi-java-gen TESTPARALLELISM := 10 @@ -95,8 +95,8 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet .make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_dotnet: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ +.make/generate_dotnet: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ echo "$(VERSION_GENERIC)" >version.txt @@ -109,8 +109,8 @@ build_dotnet: .make/build_dotnet generate_go: .make/generate_go build_go: .make/build_go .make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_go: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ +.make/generate_go: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) go --out sdk/go/ @touch $@ .make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @@ -136,8 +136,8 @@ build_java: .make/build_java generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs .make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_nodejs: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ +.make/generate_nodejs: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) nodejs --out sdk/nodejs/ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod @touch $@ .make/build_nodejs: .make/generate_nodejs @@ -151,8 +151,8 @@ build_nodejs: .make/build_nodejs generate_python: .make/generate_python build_python: .make/build_python .make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_python: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ +.make/generate_python: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) python --out sdk/python/ printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod cp README.md sdk/python/ @touch $@ @@ -168,8 +168,8 @@ build_python: .make/build_python .PHONY: generate_python build_python # Run the bridge's registry-docs command to generated the content of the installation docs/ folder at provider repo root build_registry_docs: .make/build_registry_docs -.make/build_registry_docs: .make/install_plugins bin/$(TFGEN) - bin/$(TFGEN) registry-docs --out $(WORKING_DIR)/docs +.make/build_registry_docs: .make/install_plugins bin/$(CODEGEN) + bin/$(CODEGEN) registry-docs --out $(WORKING_DIR)/docs @touch $@ .PHONY: build_registry_docs @@ -204,7 +204,7 @@ install_nodejs_sdk: .make/install_nodejs_sdk install_python_sdk: .PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk -# Install Pulumi plugins required for TFGen to resolve references +# Install Pulumi plugins required for CODEGEN to resolve references install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -256,13 +256,13 @@ tfgen_no_deps: .make/schema .make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache .make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) .make/schema: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -.make/schema: bin/$(TFGEN) .make/install_plugins .make/upstream - $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) +.make/schema: bin/$(CODEGEN) .make/install_plugins .make/upstream + $(WORKING_DIR)/bin/$(CODEGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) @touch $@ -tfgen_build_only: bin/$(TFGEN) -bin/$(TFGEN): provider/*.go provider/go.* .make/upstream - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) +tfgen_build_only: bin/$(CODEGEN) +bin/$(CODEGEN): provider/*.go provider/go.* .make/upstream + (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(CODEGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(CODEGEN)) .PHONY: tfgen schema tfgen_no_deps tfgen_build_only # Apply patches to the upstream submodule, if it exists @@ -308,7 +308,7 @@ ci-mgmt: .ci-mgmt.yaml # Start debug server for tfgen debug_tfgen: - dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) + dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(CODEGEN) -- schema --out provider/cmd/$(PROVIDER) .PHONY: debug_tfgen # Provider cross-platform build & packaging diff --git a/provider-ci/test-providers/eks/.github/actions/download-tfgen/action.yml b/provider-ci/test-providers/eks/.github/actions/download-codegen/action.yml similarity index 54% rename from provider-ci/test-providers/eks/.github/actions/download-tfgen/action.yml rename to provider-ci/test-providers/eks/.github/actions/download-codegen/action.yml index 44de0d5d63..67e15e24bd 100644 --- a/provider-ci/test-providers/eks/.github/actions/download-tfgen/action.yml +++ b/provider-ci/test-providers/eks/.github/actions/download-codegen/action.yml @@ -1,17 +1,17 @@ -name: Download the tfgen binary -description: Downloads the tfgen binary to `bin/`. +name: Download the code generator binary +description: Downloads the code generator binary to `bin/`. runs: using: "composite" steps: - - name: Download pulumi-tfgen-eks + - name: Download the code generator binary for eks uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: - name: pulumi-tfgen-eks + name: pulumi-gen-eks path: ${{ github.workspace }}/bin - - name: Ensure pulumi-tfgen-eks is executable + - name: Ensure the code generator binary for eks is executable shell: bash run: | find ${{ github.workspace }} -name "pulumi-*-eks" -print -exec chmod +x {} \; diff --git a/provider-ci/test-providers/eks/.github/workflows/build_sdk.yml b/provider-ci/test-providers/eks/.github/workflows/build_sdk.yml index c3b9763975..301ac6abdb 100644 --- a/provider-ci/test-providers/eks/.github/workflows/build_sdk.yml +++ b/provider-ci/test-providers/eks/.github/workflows/build_sdk.yml @@ -67,8 +67,8 @@ jobs: tools: pulumictl, pulumicli, ${{ matrix.language }} - name: Prepare local workspace run: make prepare_local_workspace - - name: Download tfgen - uses: ./.github/actions/download-tfgen + - name: Download codegen + uses: ./.github/actions/download-codegen - name: Update path run: echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" - name: Restore makefile progress diff --git a/provider-ci/test-providers/eks/.github/workflows/prerequisites.yml b/provider-ci/test-providers/eks/.github/workflows/prerequisites.yml index 98033db979..8350376f2b 100644 --- a/provider-ci/test-providers/eks/.github/workflows/prerequisites.yml +++ b/provider-ci/test-providers/eks/.github/workflows/prerequisites.yml @@ -102,10 +102,10 @@ jobs: Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. - - name: Upload pulumi-tfgen-eks + - name: Upload codegen binary for eks uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: - name: pulumi-tfgen-eks + name: pulumi-gen-eks path: ${{ github.workspace }}/bin/pulumi-tfgen-eks retention-days: 30 diff --git a/provider-ci/test-providers/eks/Makefile b/provider-ci/test-providers/eks/Makefile index e18d7bad14..d80c12d3e6 100644 --- a/provider-ci/test-providers/eks/Makefile +++ b/provider-ci/test-providers/eks/Makefile @@ -5,7 +5,7 @@ ORG := pulumi PROJECT := github.com/$(ORG)/pulumi-$(PACK) PROVIDER_PATH := provider/v3 VERSION_PATH := $(PROVIDER_PATH)/pkg/version.Version -TFGEN := pulumi-tfgen-$(PACK) +CODEGEN := pulumi-gen-$(PACK) PROVIDER := pulumi-resource-$(PACK) JAVA_GEN := pulumi-java-gen TESTPARALLELISM := 10 @@ -95,8 +95,8 @@ GEN_ENVS := PULUMI_HOME=$(GEN_PULUMI_HOME) PULUMI_CONVERT_EXAMPLES_CACHE_DIR=$(G generate_dotnet: .make/generate_dotnet build_dotnet: .make/build_dotnet .make/generate_dotnet: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_dotnet: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) dotnet --out sdk/dotnet/ +.make/generate_dotnet: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) dotnet --out sdk/dotnet/ cd sdk/dotnet/ && \ printf "module fake_dotnet_module // Exclude this directory from Go tools\n\ngo 1.17\n" > go.mod && \ echo "$(VERSION_GENERIC)" >version.txt @@ -109,8 +109,8 @@ build_dotnet: .make/build_dotnet generate_go: .make/generate_go build_go: .make/build_go .make/generate_go: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_go: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) go --out sdk/go/ +.make/generate_go: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) go --out sdk/go/ @touch $@ .make/build_go: .make/generate_go cd sdk && go list "$$(grep -e "^module" go.mod | cut -d ' ' -f 2)/go/..." | xargs -I {} bash -c 'go build {} && go clean -i {}' @@ -136,8 +136,8 @@ build_java: .make/build_java generate_nodejs: .make/generate_nodejs build_nodejs: .make/build_nodejs .make/generate_nodejs: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_nodejs: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) nodejs --out sdk/nodejs/ +.make/generate_nodejs: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) nodejs --out sdk/nodejs/ printf "module fake_nodejs_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/nodejs/go.mod @touch $@ .make/build_nodejs: .make/generate_nodejs @@ -151,8 +151,8 @@ build_nodejs: .make/build_nodejs generate_python: .make/generate_python build_python: .make/build_python .make/generate_python: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -.make/generate_python: .make/install_plugins bin/$(TFGEN) - $(GEN_ENVS) $(WORKING_DIR)/bin/$(TFGEN) python --out sdk/python/ +.make/generate_python: .make/install_plugins bin/$(CODEGEN) + $(GEN_ENVS) $(WORKING_DIR)/bin/$(CODEGEN) python --out sdk/python/ printf "module fake_python_module // Exclude this directory from Go tools\n\ngo 1.17\n" > sdk/python/go.mod cp README.md sdk/python/ @touch $@ @@ -193,7 +193,7 @@ install_nodejs_sdk: .make/install_nodejs_sdk install_python_sdk: .PHONY: install_dotnet_sdk install_go_sdk install_java_sdk install_nodejs_sdk install_python_sdk -# Install Pulumi plugins required for TFGen to resolve references +# Install Pulumi plugins required for CODEGEN to resolve references install_plugins: .make/install_plugins .make/install_plugins: export PULUMI_HOME := $(WORKING_DIR)/.pulumi .make/install_plugins: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) @@ -243,13 +243,13 @@ tfgen_no_deps: .make/schema .make/schema: export PULUMI_CONVERT_EXAMPLES_CACHE_DIR := $(WORKING_DIR)/.pulumi/examples-cache .make/schema: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) .make/schema: export PULUMI_MISSING_DOCS_ERROR := $(PULUMI_MISSING_DOCS_ERROR) -.make/schema: bin/$(TFGEN) .make/install_plugins .make/upstream - $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) +.make/schema: bin/$(CODEGEN) .make/install_plugins .make/upstream + $(WORKING_DIR)/bin/$(CODEGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION_GENERIC) go generate cmd/$(PROVIDER)/main.go) @touch $@ -tfgen_build_only: bin/$(TFGEN) -bin/$(TFGEN): provider/*.go provider/go.* .make/upstream - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) +tfgen_build_only: bin/$(CODEGEN) +bin/$(CODEGEN): provider/*.go provider/go.* .make/upstream + (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(CODEGEN) -ldflags "$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_EXTRAS)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(CODEGEN)) .PHONY: tfgen schema tfgen_no_deps tfgen_build_only upstream: .make/upstream @@ -290,7 +290,7 @@ ci-mgmt: .ci-mgmt.yaml # Start debug server for tfgen debug_tfgen: - dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(TFGEN) -- schema --out provider/cmd/$(PROVIDER) + dlv --listen=:2345 --headless=true --api-version=2 exec $(WORKING_DIR)/bin/$(CODEGEN) -- schema --out provider/cmd/$(PROVIDER) .PHONY: debug_tfgen # Provider cross-platform build & packaging