[DO NOT MERGE] Sample of SDK gen using schema filter functionality#5825
Draft
guineveresaenger wants to merge 3 commits intomasterfrom
Draft
[DO NOT MERGE] Sample of SDK gen using schema filter functionality#5825guineveresaenger wants to merge 3 commits intomasterfrom
guineveresaenger wants to merge 3 commits intomasterfrom
Conversation
guineveresaenger
added a commit
to pulumi/pulumi-terraform-bridge
that referenced
this pull request
Sep 29, 2025
This pull request does several things: 1. Changes the `fixUpPropertyReference` function to mark up any such reference with a <span> tag that contains language-specific keys and values so a language-specific filter function can identify which value should be used for the language selected. The span looks as follows in the schema: `\u003cspan pulumi-lang-nodejs=\"`minUpper`\" pulumi-lang-dotnet=\"`MinUpper`\" pulumi-lang-go=\"`minUpper`\" pulumi-lang-python=\"`min_upper`\" pulumi-lang-yaml=\"`minUpper`\" pulumi-lang-java=\"`minUpper`\"\u003e`min_upper`\u003c/span\u003e` 2. Starts to fix a bug in `fixUpPropertyReference` where Dotnet was generating some property names in `snake_case` (TODO: proper capitalization for these property names is still missing) - see [example](https://github.com/pulumi/pulumi-random/pull/1869/files#diff-81676d671ec0f669c06325b0f7c93214146c124ccbf80cf9a624b183148b6059R51) 3. Creates a filter function that reads the provider's main schema from file and filters it for the correct language selectors on these spans and on the Pulumi Code Chooser (to avoid repeating examples translation), instead of re-generating the schema from scratch. 4. Adds new tests for `fixUpPropertyReference`; adds tests for the filter function. In this [pulumi-random PR](pulumi/pulumi-random#1869), you can see the changes to the SDK are minimal (the azure -> azurerm is unrelated; the Java changes are due to #3184 and haven't been rolled out to providers. Additional benefits: - We could use these spans in registry docsgen to fix up the broken default variable inflections there - Build time for the AWS Node SDK went from 130s to 26s; other SDKs are similar; smaller providers build the SDK almost instantaneously - Prompted us to build the Java SDK via pulumi package gen-sdk, reducing much future maintainer toil - it jsut comes for free with the Pulumi binary! - Paves the way for decoupling SDKgen from the terraform bridge in the future. This pull request does not address the following: - some conversion stat cleanup should happen for the SDK gen pass - we're still seeing conversion stat output, which is nonsensical. This can be in a separate pull request IMO. [I ran this against the AWS provider as well](pulumi/pulumi-aws#5825). The SDK inline documentation has a few extra empty section headers with this change, because we're not running the `description` field through the docs generator twice. **I think this is the correct bargain to make** - after this change, we can fix the docs rendering in _one_ place, and have the schema be the source of truth for everything. Fixes #1918.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example of schemagen using pulumi/pulumi-terraform-bridge#3188.