diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 8b64380c..336094cb 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -130,6 +130,7 @@ jobs: - dotnet - go - java + generate_coverage_data: continue-on-error: true env: @@ -214,12 +215,15 @@ jobs: ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags + - name: Prepare upstream code + run: make upstream - name: Install Go uses: actions/setup-go@v5 with: - cache-dependency-path: | - sdk/go.sum go-version: 1.21.x + cache-dependency-path: | + provider/*.sum + upstream/*.sum - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.11.0 with: @@ -234,8 +238,14 @@ jobs: uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: pulumi/schema-tools - - name: Build tfgen & provider binaries - run: make provider + - name: Build schema generator binary + run: make tfgen_build_only + - name: Install plugins + run: make install_plugins + - name: Generate schema + run: make tfgen_no_deps + - name: Build provider binary + run: make provider_no_deps - name: Unit-test provider code run: make test_provider - if: github.event_name == 'pull_request' @@ -262,6 +272,33 @@ 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. + - if: github.event_name == 'pull_request' + name: Check Configuration section + run: | + sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt + jq -r '.config[] | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "MISSING_CONFIG<<$EOF"; + xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt + echo "$EOF"; + } >> "$GITHUB_ENV" + + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' + name: Comment on PR with Details of Configuration check + uses: thollander/actions-comment-pull-request@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + comment_tag: configurationCheck + message: >+ + ### Is README.md missing any configuration options? + + ${{ env.MISSING_CONFIG || 'No missing config!' }} + + + ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }} + ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }} + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} @@ -496,5 +533,3 @@ on: - v* - sdk/* - "**" - -# Ensure diff with ci-mgmt \ No newline at end of file diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index c62ac89a..5f91af19 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -114,6 +114,7 @@ jobs: with: name: ${{ matrix.language }}-sdk.tar.gz path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz + retention-days: 30 - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 @@ -130,6 +131,7 @@ jobs: - dotnet - go - java + lint: name: lint uses: ./.github/workflows/lint.yml @@ -152,12 +154,15 @@ jobs: ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags + - name: Prepare upstream code + run: make upstream - name: Install Go uses: actions/setup-go@v5 with: - cache-dependency-path: | - sdk/go.sum go-version: 1.21.x + cache-dependency-path: | + provider/*.sum + upstream/*.sum - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.11.0 with: @@ -172,8 +177,14 @@ jobs: uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: pulumi/schema-tools - - name: Build tfgen & provider binaries - run: make provider + - name: Build schema generator binary + run: make tfgen_build_only + - name: Install plugins + run: make install_plugins + - name: Generate schema + run: make tfgen_no_deps + - name: Build provider binary + run: make provider_no_deps - name: Unit-test provider code run: make test_provider - if: github.event_name == 'pull_request' @@ -200,6 +211,33 @@ 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. + - if: github.event_name == 'pull_request' + name: Check Configuration section + run: | + sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt + jq -r '.config[] | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "MISSING_CONFIG<<$EOF"; + xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt + echo "$EOF"; + } >> "$GITHUB_ENV" + + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' + name: Comment on PR with Details of Configuration check + uses: thollander/actions-comment-pull-request@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + comment_tag: configurationCheck + message: >+ + ### Is README.md missing any configuration options? + + ${{ env.MISSING_CONFIG || 'No missing config!' }} + + + ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }} + ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }} + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e8116f2e..7549cc74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -113,6 +113,7 @@ jobs: with: name: ${{ matrix.language }}-sdk.tar.gz path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz + retention-days: 30 - if: failure() && github.event_name == 'push' name: Notify Slack uses: 8398a7/action-slack@v3 @@ -129,6 +130,7 @@ jobs: - dotnet - go - java + create_docs_build: name: create_docs_build needs: tag_sdk @@ -166,12 +168,15 @@ jobs: ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags + - name: Prepare upstream code + run: make upstream - name: Install Go uses: actions/setup-go@v5 with: - cache-dependency-path: | - sdk/go.sum go-version: 1.21.x + cache-dependency-path: | + provider/*.sum + upstream/*.sum - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.11.0 with: @@ -186,8 +191,14 @@ jobs: uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: pulumi/schema-tools - - name: Build tfgen & provider binaries - run: make provider + - name: Build schema generator binary + run: make tfgen_build_only + - name: Install plugins + run: make install_plugins + - name: Generate schema + run: make tfgen_no_deps + - name: Build provider binary + run: make provider_no_deps - name: Unit-test provider code run: make test_provider - if: github.event_name == 'pull_request' @@ -214,6 +225,33 @@ 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. + - if: github.event_name == 'pull_request' + name: Check Configuration section + run: | + sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt + jq -r '.config[] | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "MISSING_CONFIG<<$EOF"; + xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt + echo "$EOF"; + } >> "$GITHUB_ENV" + + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' + name: Comment on PR with Details of Configuration check + uses: thollander/actions-comment-pull-request@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + comment_tag: configurationCheck + message: >+ + ### Is README.md missing any configuration options? + + ${{ env.MISSING_CONFIG || 'No missing config!' }} + + + ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }} + ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }} + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index ecc6096c..52714c8c 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -140,6 +140,7 @@ jobs: - dotnet - go - java + comment-notification: if: github.event_name == 'repository_dispatch' name: comment-notification @@ -177,12 +178,15 @@ jobs: ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 - name: Unshallow clone for tags run: git fetch --prune --unshallow --tags + - name: Prepare upstream code + run: make upstream - name: Install Go uses: actions/setup-go@v5 with: - cache-dependency-path: | - sdk/go.sum go-version: 1.21.x + cache-dependency-path: | + provider/*.sum + upstream/*.sum - name: Install pulumictl uses: jaxxstorm/action-install-gh-release@v1.11.0 with: @@ -197,8 +201,14 @@ jobs: uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: pulumi/schema-tools - - name: Build tfgen & provider binaries - run: make provider + - name: Build schema generator binary + run: make tfgen_build_only + - name: Install plugins + run: make install_plugins + - name: Generate schema + run: make tfgen_no_deps + - name: Build provider binary + run: make provider_no_deps - name: Unit-test provider code run: make test_provider - if: github.event_name == 'pull_request' @@ -225,6 +235,33 @@ 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. + - if: github.event_name == 'pull_request' + name: Check Configuration section + run: | + sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt + jq -r '.config[] | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + { + echo "MISSING_CONFIG<<$EOF"; + xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt + echo "$EOF"; + } >> "$GITHUB_ENV" + + - if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' + name: Comment on PR with Details of Configuration check + uses: thollander/actions-comment-pull-request@v2 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + comment_tag: configurationCheck + message: >+ + ### Is README.md missing any configuration options? + + ${{ env.MISSING_CONFIG || 'No missing config!' }} + + + ${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }} + ${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }} + - name: Tar provider binaries run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} diff --git a/Makefile b/Makefile index e80811f7..4f4688af 100644 --- a/Makefile +++ b/Makefile @@ -137,11 +137,14 @@ test_provider: @echo "" cd provider && go test -v -short ./... -parallel $(TESTPARALLELISM) -tfgen: export PULUMI_HOME := $(WORKING_DIR)/.pulumi -tfgen: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) -tfgen: install_plugins upstream - (cd provider && go build $(PULUMI_PROVIDER_BUILD_PARALLELISM) -o $(WORKING_DIR)/bin/$(TFGEN) -ldflags "-X $(PROJECT)/$(VERSION_PATH)=$(VERSION)" $(PROJECT)/$(PROVIDER_PATH)/cmd/$(TFGEN)) - PULUMI_CONVERT=$(PULUMI_CONVERT) PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION=$(PULUMI_CONVERT) $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) +tfgen: install_plugins upstream tfgen_no_deps + +tfgen_no_deps: export PULUMI_HOME := $(WORKING_DIR)/.pulumi +tfgen_no_deps: export PATH := $(WORKING_DIR)/.pulumi/bin:$(PATH) +tfgen_no_deps: export PULUMI_CONVERT := $(PULUMI_CONVERT) +tfgen_no_deps: export PULUMI_DISABLE_AUTOMATIC_PLUGIN_ACQUISITION := $(PULUMI_CONVERT) +tfgen_no_deps: tfgen_build_only + $(WORKING_DIR)/bin/$(TFGEN) schema --out provider/cmd/$(PROVIDER) (cd provider && VERSION=$(VERSION) go generate cmd/$(PROVIDER)/main.go) tfgen_build_only: