Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a config section check for bridged providers #862

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,33 @@

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/dev/urandom ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied it from

EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
which was probably copied from this SO: https://stackoverflow.com/a/74232400

Looks like GH uses the sequence as an EOF marker and it's random so it doesn't match anything in the actual string.

{
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 }}
Expand Down
27 changes: 27 additions & 0 deletions provider-ci/test-workflows/aws/.github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,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 }}
Expand Down
27 changes: 27 additions & 0 deletions provider-ci/test-workflows/aws/.github/workflows/nightly-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,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 }}
Expand Down
27 changes: 27 additions & 0 deletions provider-ci/test-workflows/aws/.github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,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 }}
Expand Down
27 changes: 27 additions & 0 deletions provider-ci/test-workflows/aws/.github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,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 }}
Expand Down
27 changes: 27 additions & 0 deletions provider-ci/test-workflows/cloudflare/.github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,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 }}
Expand Down
27 changes: 27 additions & 0 deletions provider-ci/test-workflows/docker/.github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,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 }}
Expand Down
Loading
Loading