From 1d58207802a20ab18e973449cabb1c31a1551a06 Mon Sep 17 00:00:00 2001 From: Kyle Goyette Date: Tue, 24 Sep 2024 08:08:16 -0700 Subject: [PATCH 1/4] wip --- examples/provider/provider.tf | 5 +++-- internal/provider/run_queue_resource.go | 2 +- tools/tools.go | 12 ++++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 2e41927..f49391b 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1,8 +1,9 @@ +# Copyright (c) HashiCorp, Inc. + terraform { required_providers { wandb = { - source = "wandb/wandb" - version = "0.1.0" + source = "wandb/wandb" } } } diff --git a/internal/provider/run_queue_resource.go b/internal/provider/run_queue_resource.go index 3183ebc..a025a49 100644 --- a/internal/provider/run_queue_resource.go +++ b/internal/provider/run_queue_resource.go @@ -47,7 +47,7 @@ func (r *RunQueueResource) Metadata(ctx context.Context, req resource.MetadataRe func (r *RunQueueResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) { resp.Schema = schema.Schema{ - MarkdownDescription: "RunQueue resource used with W&B Launch. See: https://docs.wandb.ai/guides/launch", + MarkdownDescription: "RunQueue resource used with W&B Launch. See: https://docs.wandb.ai/guides/launch. See [here](https://github.com/wandb/terraform-provider-wandb/blob/main/examples/resources/run_queue/resource.tf) for an example", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ diff --git a/tools/tools.go b/tools/tools.go index 867d3a2..950ed45 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -1,11 +1,19 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 -//go:build tools +//go:build generate package tools import ( - // Documentation generation + _ "github.com/hashicorp/copywrite" _ "github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs" ) + +// Format Terraform code for use in documentation. +// If you do not have Terraform installed, you can remove the formatting command, but it is suggested +// to ensure the documentation is formatted properly. +//go:generate terraform fmt -recursive ../examples/ + +// Generate documentation. +//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs generate --provider-dir .. -provider-name wandb From ffabe4730cfeb3209cd8d80c10e26de3c8a6db2b Mon Sep 17 00:00:00 2001 From: Kyle Goyette Date: Tue, 24 Sep 2024 08:08:36 -0700 Subject: [PATCH 2/4] fix docs --- docs/index.md | 5 +++-- docs/resources/run_queue.md | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/index.md b/docs/index.md index bb9b4fa..2ba2cf4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,11 +13,12 @@ description: |- ## Example Usage ```terraform +# Copyright (c) HashiCorp, Inc. + terraform { required_providers { wandb = { - source = "wandb/wandb" - version = "0.1.0" + source = "wandb/wandb" } } } diff --git a/docs/resources/run_queue.md b/docs/resources/run_queue.md index fa010fd..085161c 100644 --- a/docs/resources/run_queue.md +++ b/docs/resources/run_queue.md @@ -3,12 +3,12 @@ page_title: "wandb_run_queue Resource - wandb" subcategory: "" description: |- - RunQueue resource used with W&B Launch. See: https://docs.wandb.ai/guides/launch + RunQueue resource used with W&B Launch. See: https://docs.wandb.ai/guides/launch. See here https://github.com/wandb/terraform-provider-wandb/blob/main/examples/resources/run_queue/resource.tf for an example --- # wandb_run_queue (Resource) -RunQueue resource used with W&B Launch. See: https://docs.wandb.ai/guides/launch +RunQueue resource used with W&B Launch. See: https://docs.wandb.ai/guides/launch. See [here](https://github.com/wandb/terraform-provider-wandb/blob/main/examples/resources/run_queue/resource.tf) for an example From ef4ad2e351561164e2133835d7772f7ca2f27b0b Mon Sep 17 00:00:00 2001 From: Kyle Goyette Date: Tue, 24 Sep 2024 08:12:54 -0700 Subject: [PATCH 3/4] wip --- examples/provider/provider.tf | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index f49391b..dad3339 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1,5 +1,3 @@ -# Copyright (c) HashiCorp, Inc. - terraform { required_providers { wandb = { From bcb5fb0a7d39399033ff4c4968eb0739d5c8833b Mon Sep 17 00:00:00 2001 From: Kyle Goyette Date: Tue, 24 Sep 2024 08:13:27 -0700 Subject: [PATCH 4/4] wip --- docs/index.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/index.md b/docs/index.md index 2ba2cf4..488703a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,8 +13,6 @@ description: |- ## Example Usage ```terraform -# Copyright (c) HashiCorp, Inc. - terraform { required_providers { wandb = {