-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Download upstream docs for dynamically bridged provider (#2664)
This pull request adds logic that enables us to generate resource docs for a dynamically bridged provider using the upstream dependency. Usage for remote providers: `pulumi package get-schema terraform-provider <registry address> <version> fullDocs=<true|false>`. Adds a parameterized arg field to `pulumi package get-schema terraform-provider <registry address> <version>` called `fullDocs`, which when set to `true` will instruct the bridge to `git clone --depth 1 -b <version> <terraform provider github repo> <local dir for dynamic docs>`. This allows us to keep the exact same docs logic we have established. The shallow clone targets the exact doc version we need. (*) For this, we infer the github repo from the OpenTofu org name. It is based on the assumption that `registry.opentofu.org/org/foo` is based on a provider that lives at `github.com/org/terraform-provider-foo`. OpenTofu says their protocol follows that of the HashiCorp Terraform Registry which [requires an org/user and a provider name of the format `terraform-provider-foo`](https://developer.hashicorp.com/terraform/registry/providers/publishing) and we have historical evidence that GitHub is the most commonly used source host for terraform providers. See also opentofu/registry#1337. Usage for local providers: `pulumi package get-schema terraform-provider <local-path> upstreamRepoPath=<localPath>`. Here, the local docs path gets read directly into `upstreamRepoPath`. The one thing that is perhaps missing here is to expand the remote args to allow to take a source repo as an additional argument. However, our internal use case is primarily one of automation, so this is not an immediate need. (*)Cloning docs for the AWS terraform provider at v5.70.0 has the following time performance: ``` git clone --depth 1 -b v5.70.0 awsDir 2.06s user 1.62s system 34% cpu 10.713 total ``` Fixes #2607
- Loading branch information
1 parent
143b3ee
commit 334d6b7
Showing
31 changed files
with
1,239 additions
and
87 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.