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

Conversation

VenelinMartinov
Copy link
Contributor

@VenelinMartinov VenelinMartinov commented Mar 26, 2024

fixes pulumi/pulumi-terraform-bridge#1585

This PR adds a check in bridged provider CI for configuration options in README.md.
CI will now comment on PRs if any configuration options are missing in the README.md

Tested in pulumi/pulumi-github#615 and pulumi/pulumi-xyz#31

@VenelinMartinov VenelinMartinov requested a review from a team March 26, 2024 14:07
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.

@t0yv0
Copy link
Member

t0yv0 commented Mar 26, 2024

I'm not a great fan of bash-in-yaml for something like this but it works for the moment.

@t0yv0 t0yv0 self-requested a review March 26, 2024 16:55
@VenelinMartinov VenelinMartinov merged commit fefbf2c into master Mar 26, 2024
5 checks passed
@VenelinMartinov VenelinMartinov deleted the vvm/add_config_section_check branch March 26, 2024 17:38
VenelinMartinov added a commit that referenced this pull request Mar 27, 2024
My jq syntax in #862 was off
yielding 0s and 1s for some providers:

pulumi/pulumi-azure#1917 (review)

The issue was that their schema had a defaults section in the config
block.

This PR fixes the jq syntax to correctly ignore that bit.
@VenelinMartinov VenelinMartinov mentioned this pull request Apr 9, 2024
VenelinMartinov added a commit that referenced this pull request May 8, 2024
Flag the check added in #862 to
only run for providers which have enabled it.

We should fix the warnings for a provider and then enable the check to
guard against regressions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure # Configuration section of README.md is up to date
2 participants