Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc35d3dd

Browse files
refactor: only show version requirements for new resources
Removed version requirements from resources that existed before Coder v2.0,as these requirements are not meaningful for established resources.Changes:- Updated docsgen to only add version notes when@SInCE: marker is present- Removed default v2.18.0 version assignment- Added@SInCE:v2.8.0 to workspace_preset data source- Updated documentation to clarify when to add version markersNow only resources/features introduced after v2.0 show version requirements:- coder_ai_task (v2.24.0)- coder_devcontainer (v2.21.0)- coder_workspace_preset (v2.8.0)- coder_app.hidden attribute (v2.16.0)Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
1 parent898c99d commitc35d3dd

17 files changed

+21
-54
lines changed

‎docs/data-sources/external_auth.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Use this data source to require users to authenticate with an external service prior to workspace creation. This can be used to[pre-authenticate external services](https://coder.com/docs/admin/external-auth) in a workspace. (e.g. Google Cloud, Github, Docker, etc.)
1212

13-
~>**Note:** This data source requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
14-
1513
##Example Usage
1614

1715
```terraform

‎docs/data-sources/parameter.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Use this data source to configure editable options for workspaces.
1212

13-
~>**Note:** This data source requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
14-
1513
##Example Usage
1614

1715
```terraform

‎docs/data-sources/provisioner.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Use this data source to get information about the Coder provisioner.
1212

13-
~>**Note:** This data source requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
14-
1513
##Example Usage
1614

1715
```terraform

‎docs/data-sources/workspace.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Use this data source to get information for the active workspace build.
1212

13-
~>**Note:** This data source requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
14-
1513
##Example Usage
1614

1715
```terraform

‎docs/data-sources/workspace_owner.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Use this data source to fetch information about the workspace owner.
1212

13-
~>**Note:** This data source requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
14-
1513
##Example Usage
1614

1715
```terraform

‎docs/data-sources/workspace_preset.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
page_title:"coder_workspace_preset Data Source - terraform-provider-coder"
44
subcategory:""
55
description:|-
6-
Use this data source to predefine common configurations for coder workspaces. Users will have the option to select a defined preset, which will automatically apply the selected configuration. Any parameters defined in the preset will be applied to the workspace. Parameters that are defined by the template but not defined by the preset will still be configurable when creating a workspace.
6+
Use this data source to predefine common configurations for coder workspaces. Users will have the option to select a defined preset, which will automatically apply the selected configuration. Any parameters defined in the preset will be applied to the workspace. Parameters that are defined by the template but not defined by the preset will still be configurable when creating a workspace. @since:v2.8.0
77
---
88

99
#coder_workspace_preset (Data Source)
1010

11-
Use this data source to predefine common configurations for coder workspaces. Users will have the option to select a defined preset, which will automatically apply the selected configuration. Any parameters defined in the preset will be applied to the workspace. Parameters that are defined by the template but not defined by the preset will still be configurable when creating a workspace.
11+
Use this data source to predefine common configurations for coder workspaces. Users will have the option to select a defined preset, which will automatically apply the selected configuration. Any parameters defined in the preset will be applied to the workspace. Parameters that are defined by the template but not defined by the preset will still be configurable when creating a workspace.@since:v2.8.0
1212

13-
~>**Note:** This data source requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
13+
~>**Note:** This data source requires[Coder v2.8.0](https://github.com/coder/coder/releases/tag/v2.8.0) or later.
1414

1515
##Example Usage
1616

‎docs/data-sources/workspace_tags.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Use this data source to configure workspace tags to select provisioners.
1212

13-
~>**Note:** This data source requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
14-
1513
##Example Usage
1614

1715
```terraform

‎docs/resources/agent.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Use this resource to associate an agent.
1212

13-
~>**Note:** This resource requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
14-
1513
##Example Usage
1614

1715
```terraform

‎docs/resources/agent_instance.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Use this resource to associate an instance ID with an agent for zero-trust authentication. This association is done automatically for`"google_compute_instance"`,`"aws_instance"`,`"azurerm_linux_virtual_machine"`, and`"azurerm_windows_virtual_machine"` resources.
1212

13-
~>**Note:** This resource requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
14-
1513
##Example Usage
1614

1715
```terraform

‎docs/resources/app.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Use this resource to define shortcuts to access applications in a workspace.
1212

13-
~>**Note:** This resource requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
14-
1513
##Example Usage
1614

1715
```terraform

‎docs/resources/env.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Use this resource to set an environment variable in a workspace. Note that this resource cannot be used to overwrite existing environment variables set on the`coder_agent` resource.
1212

13-
~>**Note:** This resource requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
14-
1513
##Example Usage
1614

1715
```terraform

‎docs/resources/metadata.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ description: |-
1111

1212
Use this resource to attach metadata to a resource. They will be displayed in the Coder dashboard alongside the resource. The resource containing the agent, and it's metadata, will be shown by default.
1313

14-
~>**Note:** This resource requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
15-
1614
Alternatively, to attach metadata to the agent, use a`metadata` block within a`coder_agent` resource.
1715

1816
##Example Usage

‎docs/resources/script.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ description: |-
1010

1111
Use this resource to run a script from an agent. When multiple scripts are assigned to the same agent, they are executed in parallel.
1212

13-
~>**Note:** This resource requires[Coder v2.18.0](https://github.com/coder/coder/releases/tag/v2.18.0) or later.
14-
1513
##Example Usage
1614

1715
```terraform

‎provider/VERSION_METADATA.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,12 @@ Results in documentation with:
8686
- `advanced_option` (Boolean) Enable advanced features. *(since v2.22.0)*
8787
```
8888

89-
##Default Versions
89+
##When to Add Version Information
9090

91-
- Resources without`@since:` markers default to`v2.18.0` (the base requirement)
92-
- Attributes without`@since:` markers don't show version information
93-
- Special resources have hardcoded defaults:
94-
-`coder_devcontainer`: v2.21.0
95-
-`coder_ai_task`: v2.24.0
91+
-**Add@since: markers** for resources introduced after Coder v2.0
92+
-**Add@since: markers** for attributes added to existing resources
93+
-**Don't add markers** for resources that existed before Coder v2.0
94+
- Resources and attributes without`@since:` markers won't show version information
9695

9796
##Best Practices
9897

‎provider/version_meta.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ const (
1717

1818
// V2_24_0 introduced AI task resources
1919
V2_24_0="v2.24.0"
20+
21+
// V2_8_0 introduced workspace preset data source
22+
V2_8_0="v2.8.0"
2023
)

‎provider/workspace_preset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func workspacePresetDataSource() *schema.Resource {
5858
return&schema.Resource{
5959
SchemaVersion:1,
6060

61-
Description:"Use this data source to predefine common configurations for coder workspaces. Users will have the option to select a defined preset, which will automatically apply the selected configuration. Any parameters defined in the preset will be applied to the workspace. Parameters that are defined by the template but not defined by the preset will still be configurable when creating a workspace.",
61+
Description:"Use this data source to predefine common configurations for coder workspaces. Users will have the option to select a defined preset, which will automatically apply the selected configuration. Any parameters defined in the preset will be applied to the workspace. Parameters that are defined by the template but not defined by the preset will still be configurable when creating a workspace. @since:v2.8.0",
6262

6363
ReadContext:func(ctx context.Context,rd*schema.ResourceData,iinterface{}) diag.Diagnostics {
6464
varpresetWorkspacePreset

‎scripts/docsgen/main.go

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,11 @@ func processVersionInformation(p *schema.Provider) error {
110110

111111
// Extract version from description
112112
version:=extractVersionFromDescription(dataSource.Description)
113-
ifversion=="" {
114-
// Default to v2.18.0 if no version specified
115-
version="v2.18.0"
116-
}
117-
118-
iferr:=addVersionToResourceDoc(docFile,dataSourceName,version,"data source");err!=nil {
119-
returnxerrors.Errorf("unable to add version to data-source doc file (data-source: %s): %w",dataSourceName,err)
113+
ifversion!="" {
114+
// Only add version note if explicitly specified
115+
iferr:=addVersionToResourceDoc(docFile,dataSourceName,version,"data source");err!=nil {
116+
returnxerrors.Errorf("unable to add version to data-source doc file (data-source: %s): %w",dataSourceName,err)
117+
}
120118
}
121119

122120
// Process attributes for version info
@@ -131,22 +129,13 @@ func processVersionInformation(p *schema.Provider) error {
131129

132130
// Extract version from description
133131
version:=extractVersionFromDescription(resource.Description)
134-
ifversion=="" {
135-
// Check for special cases
136-
switchresourceName {
137-
case"coder_devcontainer":
138-
version="v2.21.0"
139-
case"coder_ai_task":
140-
version="v2.24.0"
141-
default:
142-
version="v2.18.0"
132+
ifversion!="" {
133+
// Only add version note if explicitly specified
134+
iferr:=addVersionToResourceDoc(docFile,resourceName,version,"resource");err!=nil {
135+
returnxerrors.Errorf("unable to add version to resource doc file (resource: %s): %w",resourceName,err)
143136
}
144137
}
145138

146-
iferr:=addVersionToResourceDoc(docFile,resourceName,version,"resource");err!=nil {
147-
returnxerrors.Errorf("unable to add version to resource doc file (resource: %s): %w",resourceName,err)
148-
}
149-
150139
// Process attributes for version info
151140
iferr:=processAttributeVersions(docFile,resource.Schema);err!=nil {
152141
returnxerrors.Errorf("unable to process attribute versions for resource (resource: %s): %w",resourceName,err)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp