Skip to content

Commit 51b3d78

Browse files
committed
fix: relax browser_sdk_version validation
1 parent 1554899 commit 51b3d78

File tree

9 files changed

+13
-18
lines changed

9 files changed

+13
-18
lines changed

docs/data-sources/all_keys.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Read-Only:
6161

6262
Read-Only:
6363

64-
- `browser_sdk_version` (String) The version of the browser SDK to load. Valid values are `7.x` and `8.x`.
64+
- `browser_sdk_version` (String) The version of the browser SDK to load.
6565
- `debug_enabled` (Boolean) Whether debug bundles & logging are enabled for this key.
6666
- `performance_monitoring_enabled` (Boolean) Whether performance monitoring is enabled for this key.
6767
- `session_replay_enabled` (Boolean) Whether session replay is enabled for this key.

docs/data-sources/key.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ data "sentry_key" "first" {
7070

7171
Read-Only:
7272

73-
- `browser_sdk_version` (String) The version of the browser SDK to load. Valid values are `7.x` and `8.x`.
73+
- `browser_sdk_version` (String) The version of the browser SDK to load.
7474
- `debug_enabled` (Boolean) Whether debug bundles & logging are enabled for this key.
7575
- `performance_monitoring_enabled` (Boolean) Whether performance monitoring is enabled for this key.
7676
- `session_replay_enabled` (Boolean) Whether session replay is enabled for this key.

docs/resources/key.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ resource "sentry_key" "default" {
5353

5454
Optional:
5555

56-
- `browser_sdk_version` (String) The version of the browser SDK to load. Valid values are `7.x` and `8.x`.
56+
- `browser_sdk_version` (String) The version of the browser SDK to load.
5757
- `debug_enabled` (Boolean) Whether debug bundles & logging are enabled for this key.
5858
- `performance_monitoring_enabled` (Boolean) Whether performance monitoring is enabled for this key.
5959
- `session_replay_enabled` (Boolean) Whether session replay is enabled for this key.

internal/provider/data_source_all_client_keys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (d *AllClientKeysDataSource) Schema(ctx context.Context, req datasource.Sch
111111
Computed: true,
112112
Attributes: map[string]schema.Attribute{
113113
"browser_sdk_version": schema.StringAttribute{
114-
MarkdownDescription: "The version of the browser SDK to load. Valid values are `7.x` and `8.x`.",
114+
MarkdownDescription: "The version of the browser SDK to load.",
115115
Computed: true,
116116
},
117117
"performance_monitoring_enabled": schema.BoolAttribute{

internal/provider/data_source_all_client_keys_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestAccAllClientKeysDataSource(t *testing.T) {
3636
"rate_limit_window": knownvalue.Null(),
3737
"rate_limit_count": knownvalue.Null(),
3838
"javascript_loader_script": knownvalue.MapExact(map[string]knownvalue.Check{
39-
"browser_sdk_version": knownvalue.StringExact("8.x"),
39+
"browser_sdk_version": knownvalue.NotNull(),
4040
"performance_monitoring_enabled": knownvalue.NotNull(),
4141
"session_replay_enabled": knownvalue.NotNull(),
4242
"debug_enabled": knownvalue.NotNull(),

internal/provider/data_source_client_key.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (d *ClientKeyDataSource) Schema(ctx context.Context, req datasource.SchemaR
150150
Computed: true,
151151
Attributes: map[string]schema.Attribute{
152152
"browser_sdk_version": schema.StringAttribute{
153-
MarkdownDescription: "The version of the browser SDK to load. Valid values are `7.x` and `8.x`.",
153+
MarkdownDescription: "The version of the browser SDK to load.",
154154
Computed: true,
155155
},
156156
"performance_monitoring_enabled": schema.BoolAttribute{

internal/provider/data_source_client_key_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func TestAccClientKeyDataSource_id(t *testing.T) {
8484
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_window"), knownvalue.Null()),
8585
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_count"), knownvalue.Null()),
8686
statecheck.ExpectKnownValue(rn, tfjsonpath.New("javascript_loader_script"), knownvalue.MapExact(map[string]knownvalue.Check{
87-
"browser_sdk_version": knownvalue.StringExact("8.x"),
87+
"browser_sdk_version": knownvalue.NotNull(),
8888
"performance_monitoring_enabled": knownvalue.Bool(true),
8989
"session_replay_enabled": knownvalue.Bool(true),
9090
"debug_enabled": knownvalue.Bool(false),
@@ -134,7 +134,7 @@ func TestAccClientKeyDataSource_name(t *testing.T) {
134134
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_window"), knownvalue.Null()),
135135
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_count"), knownvalue.Null()),
136136
statecheck.ExpectKnownValue(rn, tfjsonpath.New("javascript_loader_script"), knownvalue.MapExact(map[string]knownvalue.Check{
137-
"browser_sdk_version": knownvalue.StringExact("8.x"),
137+
"browser_sdk_version": knownvalue.NotNull(),
138138
"performance_monitoring_enabled": knownvalue.Bool(true),
139139
"session_replay_enabled": knownvalue.Bool(true),
140140
"debug_enabled": knownvalue.Bool(false),
@@ -184,7 +184,7 @@ func TestAccClientKeyDataSource_first(t *testing.T) {
184184
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_window"), knownvalue.Null()),
185185
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_count"), knownvalue.Null()),
186186
statecheck.ExpectKnownValue(rn, tfjsonpath.New("javascript_loader_script"), knownvalue.MapExact(map[string]knownvalue.Check{
187-
"browser_sdk_version": knownvalue.StringExact("8.x"),
187+
"browser_sdk_version": knownvalue.NotNull(),
188188
"performance_monitoring_enabled": knownvalue.Bool(true),
189189
"session_replay_enabled": knownvalue.Bool(true),
190190
"debug_enabled": knownvalue.Bool(false),

internal/provider/resource_client_key.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"net/http"
66

77
"github.com/hashicorp/terraform-plugin-framework-validators/resourcevalidator"
8-
"github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator"
98
"github.com/hashicorp/terraform-plugin-framework/attr"
109
"github.com/hashicorp/terraform-plugin-framework/diag"
1110
"github.com/hashicorp/terraform-plugin-framework/path"
@@ -16,7 +15,6 @@ import (
1615
"github.com/hashicorp/terraform-plugin-framework/resource/schema/objectplanmodifier"
1716
"github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier"
1817
"github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier"
19-
"github.com/hashicorp/terraform-plugin-framework/schema/validator"
2018
"github.com/hashicorp/terraform-plugin-framework/types"
2119
"github.com/hashicorp/terraform-plugin-framework/types/basetypes"
2220
"github.com/jianyuan/go-utils/maputils"
@@ -184,12 +182,9 @@ func (r *ClientKeyResource) Schema(ctx context.Context, req resource.SchemaReque
184182
Computed: true,
185183
Attributes: map[string]schema.Attribute{
186184
"browser_sdk_version": schema.StringAttribute{
187-
MarkdownDescription: "The version of the browser SDK to load. Valid values are `7.x` and `8.x`.",
185+
MarkdownDescription: "The version of the browser SDK to load.",
188186
Optional: true,
189187
Computed: true,
190-
Validators: []validator.String{
191-
stringvalidator.OneOf("7.x", "8.x"),
192-
},
193188
PlanModifiers: []planmodifier.String{
194189
stringplanmodifier.UseStateForUnknown(),
195190
},

internal/provider/resource_client_key_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func TestAccClientKeyResource_upgradeFromVersion(t *testing.T) {
152152
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_window"), knownvalue.Null()),
153153
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_count"), knownvalue.Null()),
154154
statecheck.ExpectKnownValue(rn, tfjsonpath.New("javascript_loader_script"), knownvalue.ObjectExact(map[string]knownvalue.Check{
155-
"browser_sdk_version": knownvalue.StringExact("8.x"),
155+
"browser_sdk_version": knownvalue.NotNull(),
156156
"performance_monitoring_enabled": knownvalue.Bool(true),
157157
"session_replay_enabled": knownvalue.Bool(true),
158158
"debug_enabled": knownvalue.Bool(false),
@@ -213,7 +213,7 @@ func TestAccClientKeyResource(t *testing.T) {
213213
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_window"), knownvalue.Null()),
214214
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_count"), knownvalue.Null()),
215215
statecheck.ExpectKnownValue(rn, tfjsonpath.New("javascript_loader_script"), knownvalue.ObjectExact(map[string]knownvalue.Check{
216-
"browser_sdk_version": knownvalue.StringExact("8.x"),
216+
"browser_sdk_version": knownvalue.NotNull(),
217217
"performance_monitoring_enabled": knownvalue.Bool(true),
218218
"session_replay_enabled": knownvalue.Bool(true),
219219
"debug_enabled": knownvalue.Bool(false),
@@ -232,7 +232,7 @@ func TestAccClientKeyResource(t *testing.T) {
232232
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_window"), knownvalue.Null()),
233233
statecheck.ExpectKnownValue(rn, tfjsonpath.New("rate_limit_count"), knownvalue.Null()),
234234
statecheck.ExpectKnownValue(rn, tfjsonpath.New("javascript_loader_script"), knownvalue.ObjectExact(map[string]knownvalue.Check{
235-
"browser_sdk_version": knownvalue.StringExact("8.x"),
235+
"browser_sdk_version": knownvalue.NotNull(),
236236
"performance_monitoring_enabled": knownvalue.Bool(true),
237237
"session_replay_enabled": knownvalue.Bool(true),
238238
"debug_enabled": knownvalue.Bool(false),

0 commit comments

Comments
 (0)