Skip to content

Commit

Permalink
Add conditional for wiping the version from the schema when generatin…
Browse files Browse the repository at this point in the history
…g docs for a dynmaically bridged provider
  • Loading branch information
guineveresaenger committed Dec 11, 2024
1 parent 334d6b7 commit 71764f7
Showing 5 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "b2",
"version": "0.8.9",
"description": "A Pulumi provider dynamically bridged from b2.",
"attribution": "This Pulumi package is based on the [`b2` Terraform Provider](https://github.com/backblaze/terraform-provider-b2).",
"repository": "https://github.com/backblaze/terraform-provider-b2",
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "databricks",
"version": "1.50.0",
"description": "A Pulumi provider dynamically bridged from databricks.",
"attribution": "This Pulumi package is based on the [`databricks` Terraform Provider](https://github.com/databricks/terraform-provider-databricks).",
"repository": "https://github.com/databricks/terraform-provider-databricks",
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "random",
"version": "3.3.0",
"description": "A Pulumi provider dynamically bridged from random.",
"attribution": "This Pulumi package is based on the [`random` Terraform Provider](https://github.com/hashicorp/terraform-provider-random).",
"repository": "https://github.com/hashicorp/terraform-provider-random",
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "random",
"version": "3.6.3",
"description": "A Pulumi provider dynamically bridged from random.",
"attribution": "This Pulumi package is based on the [`random` Terraform Provider](https://github.com/hashicorp/terraform-provider-random).",
"repository": "https://github.com/hashicorp/terraform-provider-random",
8 changes: 5 additions & 3 deletions pkg/tfgen/generate.go
Original file line number Diff line number Diff line change
@@ -1009,9 +1009,11 @@ func (g *Generator) UnstableGenerateFromSchema(genSchemaResult *GenerateSchemaRe
}
files["_index.md"] = content
case Schema:
// Omit the version so that the spec is stable if the version is e.g. derived from the current Git commit hash.
pulumiPackageSpec.Version = ""

// For pulumi-owned (not dynamically bridged) providers, omit the version so that the spec is stable
// if the version is e.g. derived from the current Git commit hash.
if strings.Contains(g.info.Repository, "pulumi") {
pulumiPackageSpec.Version = ""
}
bytes, err := json.MarshalIndent(pulumiPackageSpec, "", " ")
if err != nil {
return nil, errors.Wrapf(err, "failed to marshal schema")

0 comments on commit 71764f7

Please sign in to comment.