-
Notifications
You must be signed in to change notification settings - Fork 44
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
fix: Allow aiven provider to compile without fork #742
Conversation
06eb24d
to
70901f5
Compare
Diff for pulumi-azuread with merge commit b5a519a |
Diff for pulumi-random with merge commit 0e3da10 |
Diff for pulumi-random with merge commit b5a519a |
Diff for pulumi-azuread with merge commit 0e3da10 |
Diff for pulumi-gcp with merge commit b5a519a |
Diff for pulumi-gcp with merge commit 0e3da10 |
Diff for pulumi-azure with merge commit b5a519a |
Diff for pulumi-azure with merge commit 0e3da10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
// skip underscores and make sure the next one is capitalized. | ||
contract.Assertf(!nextCap, "Unexpected duplicate underscore: %v", name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Might be nice to have a comment explaining that we will ignore duplicate _
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
Attempting to use the upstream provider directly fails due to the assert removed here. I believe this change is safe to make, despite affecting all providers, as the assert causes tfgen to panic. No provider was previously allowed to use double underscores, therefore no backwards incompatible change can be caused by this. Background: The Aiven provider has data sources such as: > - `pg_partman_bgw__dot__interval` (String) > - `pg_partman_bgw__dot__role` (String) > - `pg_stat_statements__dot__track` (String) (Copied from their changelog.) The upstream provider uses a pair of routines to map `.` to `__dot__` and vice versa, and the patch in our fork of Aiven modifies that mapping to avoid double underscores: pulumi/terraform-provider-aiven@296d9e0d By allowing the bridge to generate the name, the upstream provider can be used without requiring the fork. The casing behavior is preserved, and `__dot__` is cased exactly as `_dot_` was before.
70901f5
to
996d506
Compare
Diff for pulumi-random with merge commit 9974297 |
Diff for pulumi-azuread with merge commit 9974297 |
Diff for pulumi-gcp with merge commit 9974297 |
Diff for pulumi-azure with merge commit 9974297 |
Attempting to use the upstream provider directly fails due to the assert removed here.
I believe this change is safe to make, despite affecting all providers, as the assert causes tfgen to panic. No provider was previously allowed to use double underscores, therefore no backwards incompatible change can be caused by this.
Background:
The Aiven provider has data sources such as:
The upstream provider uses a pair of routines to map
.
to__dot__
and vice versa, and the patch in our fork of Aiven modifies that mapping to avoid double underscores:pulumi/terraform-provider-aiven@296d9e0d
By allowing the bridge to generate the name, the upstream provider can be used without requiring the fork. The casing behavior is preserved, and
__dot__
is cased exactly as_dot_
was before.