Skip to content

Commit ff23d26

Browse files
committed
feat: multi select building block inputs
Adds support for multi select inputs and cleans up the building block resources code. Also corrects schema restrictions for allowed input/output types.
1 parent f352a47 commit ff23d26

13 files changed

+324
-377
lines changed

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,77 @@
1+
## v0.14.0
2+
3+
FEATURES:
4+
5+
- Support multi select building block inputs.
6+
- Payment method resources.
7+
8+
FIXES:
9+
10+
- Restrict allowed value types for building block inputs, combined inputs and outputs.
11+
112
## v0.13.0
213

314
FEATURES:
15+
416
- Add metering config support to `meshstack_mesh_platform` resource and data source.
517
- Add quotas to `meshstack_landingzone` resource and data source.
618

719
FIXES:
20+
821
- Correctly model nullable platform config fields.
922

1023
## v0.12.4
1124

1225
FEATURES:
26+
1327
- Add quota definitions to meshPlatforms.
1428

1529
## v0.12.3
1630

1731
FIXES:
32+
1833
- Bump terraform-plugin-docs and fix docs.
1934

2035
## v0.12.2
2136

2237
FIXES:
38+
2339
- Fix possible nil-pointer issue when handling obfuscated secrets.
2440

2541
## v0.12.1
2642

2743
FIXES:
44+
2845
- Handle obfuscated secrets in meshPlatform Azure Type.
2946

3047
## v0.12.0
3148

3249
FEATURES:
50+
3351
- Added `meshstack_mesh_platform` resource.
3452
- Added `meshstack_mesh_platform` data source.
3553

3654
FIXES:
55+
3756
- Fix landing zone data source.
3857

3958
## v0.11.0
4059

4160
FEATURES:
61+
4262
- Added `meshstack_mesh_landing_zone` resource.
4363
- Added `meshstack_mesh_landing_zone` data source.
4464
- Automatically set `type` inside platform_properties for landing zones.
4565

4666
FIXES:
67+
4768
- Fix landing zone status handling.
4869
- Make `type` a read-only property for landing zones.
4970

5071
## v0.10.1
5172

5273
FIXES:
74+
5375
- Correctly handle external changes to `meshstack_project` tags.
5476
- Prefer explicit provider configuration over environment variables.
5577
- Fix issues with optional `value_type` attributes for `meshstack_tag_definition`.
@@ -58,56 +80,66 @@ FIXES:
5880
## v0.10.0
5981

6082
FEATURES:
83+
6184
- Added `meshstack_workspace_user_binding` resource.
6285
- Added `meshstack_workspace_group_binding` resource.
6386

6487
## v0.9.0
6588

6689
FEATURES:
90+
6791
- Added polling for building block (v2) and tenant (v4) resources until creation and deletion are complete.
6892

6993
## v0.8.0
7094

7195
FEATURES:
96+
7297
- Added `meshstack_workspace` resource.
7398
- Added `meshstack_workspace` data source.
7499
- Added `meshstack_tenant_v4` resource.
75100
- Added `meshstack_tenant_v4` data source.
76101

77102
FIXES:
103+
78104
- Allow `value_code` in `meshstack_building_block_v2` and `meshstack_building_block` resources.
79105
- Documentation.
80106

81107
## v0.7.1
82108

83109
FEATURES:
110+
84111
- Source provider configuration from environment variables.
85112

86113
## v0.7.0
87114

88115
FEATURES:
116+
89117
- Added `meshstack_building_block_v2` data source.
90118
- Added `meshstack_building_block_v2` resource.
91119

92120
## v0.6.1
93121

94122
REFACTOR:
123+
95124
- Validate success responses by checking for HTTP status codes in the 2xx range
96125

97126
## v0.6.0
98127

99128
FEATURES:
129+
100130
- Added `meshstack_tag_definitions` data source.
101131
- Added `meshstack_tag_definition` data source.
102132
- Added `meshstack_tag_definition` resource.
103133

104134
## v0.5.5
105135

106136
FIXES:
137+
107138
- HTTP response code for tenant creation is now 201.
108139
- HTTP response code for project creation is now 201.
109140

110141
## v0.5.4
111142

112143
FIXES:
144+
113145
- HTTP response code for building block creation is now 201.

client/buildingblock.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const (
1414
MESH_BUILDING_BLOCK_IO_TYPE_INTEGER = "INTEGER"
1515
MESH_BUILDING_BLOCK_IO_TYPE_BOOLEAN = "BOOLEAN"
1616
MESH_BUILDING_BLOCK_IO_TYPE_SINGLE_SELECT = "SINGLE_SELECT"
17+
MESH_BUILDING_BLOCK_IO_TYPE_MULTI_SELECT = "MULTI_SELECT"
1718
MESH_BUILDING_BLOCK_IO_TYPE_FILE = "FILE"
1819
MESH_BUILDING_BLOCK_IO_TYPE_LIST = "LIST"
1920
MESH_BUILDING_BLOCK_IO_TYPE_CODE = "CODE"

client/buildingblock_v2.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,7 @@ func (c *MeshStackProviderClient) PollBuildingBlockV2UntilCompletion(ctx context
158158
var result *MeshBuildingBlockV2
159159

160160
err := retry.RetryContext(ctx, 30*time.Minute, c.waitForBuildingBlockV2CompletionFunc(uuid, &result))
161-
if err != nil {
162-
return nil, err
163-
}
164-
165-
return result, nil
161+
return result, err
166162
}
167163

168164
// waitForBuildingBlockV2CompletionFunc returns a RetryFunc that checks building block completion status
@@ -176,12 +172,12 @@ func (c *MeshStackProviderClient) waitForBuildingBlockV2CompletionFunc(uuid stri
176172
if current == nil {
177173
return retry.NonRetryableError(fmt.Errorf("building block was not found while waiting for completion"))
178174
}
175+
*result = current
179176

180177
// Check if we've reached a terminal state
181178
status := current.Status.Status
182179
switch status {
183180
case BUILDING_BLOCK_STATUS_SUCCEEDED:
184-
*result = current
185181
return nil // Success, stop retrying
186182
case BUILDING_BLOCK_STATUS_FAILED:
187183
return retry.NonRetryableError(fmt.Errorf("building block %s reached FAILED state", uuid))

client/tenant_v4.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,7 @@ func (c *MeshStackProviderClient) PollTenantV4UntilCreation(ctx context.Context,
153153
var result *MeshTenantV4
154154

155155
err := retry.RetryContext(ctx, 30*time.Minute, c.waitForTenantV4CreationFunc(uuid, &result))
156-
if err != nil {
157-
return nil, err
158-
}
159-
160-
return result, nil
156+
return result, err
161157
}
162158

163159
// waitForTenantV4CreationFunc returns a RetryFunc that checks tenant creation status

docs/data-sources/building_block_v2.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,18 @@ Read-Only:
7474
<a id="nestedatt--spec--inputs"></a>
7575
### Nested Schema for `spec.inputs`
7676

77+
Optional:
78+
79+
- `value_single_select` (String)
80+
7781
Read-Only:
7882

7983
- `value_bool` (Boolean)
8084
- `value_code` (String) Code value.
8185
- `value_file` (String)
8286
- `value_int` (Number)
83-
- `value_list` (String) JSON encoded list of objects.
84-
- `value_single_select` (String)
87+
- `value_list` (String) Deprecated: use `value_code` instead. JSON encoded list of objects.
88+
- `value_multi_select` (List of String) Multi-select value (list of strings).
8589
- `value_string` (String)
8690

8791

@@ -121,8 +125,5 @@ Read-Only:
121125

122126
- `value_bool` (Boolean)
123127
- `value_code` (String) Code value.
124-
- `value_file` (String)
125128
- `value_int` (Number)
126-
- `value_list` (String) JSON encoded list of objects.
127-
- `value_single_select` (String)
128129
- `value_string` (String)

docs/data-sources/buildingblock.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,24 @@ Read-Only:
5858
Read-Only:
5959

6060
- `display_name` (String) Display name for the Building Block as shown in meshPanel.
61-
- `inputs` (Attributes Map) Contains all Building Block inputs. Each input has exactly one value attribute set according to its' type. (see [below for nested schema](#nestedatt--spec--inputs))
61+
- `inputs` (Attributes Map) Contains all building block inputs. Each input has exactly one value attribute set according to its' type. (see [below for nested schema](#nestedatt--spec--inputs))
6262
- `parent_building_blocks` (Attributes List) List of parent Building Blocks. (see [below for nested schema](#nestedatt--spec--parent_building_blocks))
6363

6464
<a id="nestedatt--spec--inputs"></a>
6565
### Nested Schema for `spec.inputs`
6666

67+
Optional:
68+
69+
- `value_single_select` (String)
70+
6771
Read-Only:
6872

6973
- `value_bool` (Boolean)
7074
- `value_code` (String) Code value.
7175
- `value_file` (String)
7276
- `value_int` (Number)
73-
- `value_list` (String) JSON encoded list of objects.
74-
- `value_single_select` (String)
77+
- `value_list` (String) Deprecated: use `value_code` instead. JSON encoded list of objects.
78+
- `value_multi_select` (List of String) Multi-select value (list of strings).
7579
- `value_string` (String)
7680

7781

@@ -90,7 +94,7 @@ Read-Only:
9094

9195
Read-Only:
9296

93-
- `outputs` (Attributes Map) Building Block outputs. Each output has exactly one value attribute set. (see [below for nested schema](#nestedatt--status--outputs))
97+
- `outputs` (Attributes Map) Building block outputs. Each output has exactly one value attribute set. (see [below for nested schema](#nestedatt--status--outputs))
9498
- `status` (String) Execution status. One of `WAITING_FOR_DEPENDENT_INPUT`, `WAITING_FOR_OPERATOR_INPUT`, `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`.
9599

96100
<a id="nestedatt--status--outputs"></a>
@@ -100,8 +104,5 @@ Read-Only:
100104

101105
- `value_bool` (Boolean)
102106
- `value_code` (String) Code value.
103-
- `value_file` (String)
104107
- `value_int` (Number)
105-
- `value_list` (String) JSON encoded list of objects.
106-
- `value_single_select` (String)
107108
- `value_string` (String)

docs/resources/building_block_v2.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ Optional:
140140

141141
- `value_bool` (Boolean)
142142
- `value_code` (String) Code value.
143-
- `value_file` (String)
144143
- `value_int` (Number)
145-
- `value_list` (String) JSON encoded list of objects.
144+
- `value_multi_select` (List of String) Multi-select value (list of strings).
146145
- `value_single_select` (String)
147146
- `value_string` (String)
148147

@@ -159,14 +158,18 @@ Required:
159158
<a id="nestedatt--spec--combined_inputs"></a>
160159
### Nested Schema for `spec.combined_inputs`
161160

161+
Optional:
162+
163+
- `value_single_select` (String)
164+
162165
Read-Only:
163166

164167
- `value_bool` (Boolean)
165168
- `value_code` (String) Code value.
166169
- `value_file` (String)
167170
- `value_int` (Number)
168-
- `value_list` (String) JSON encoded list of objects.
169-
- `value_single_select` (String)
171+
- `value_list` (String) Deprecated: use `value_code` instead. JSON encoded list of objects.
172+
- `value_multi_select` (List of String) Multi-select value (list of strings).
170173
- `value_string` (String)
171174

172175

@@ -199,8 +202,5 @@ Read-Only:
199202

200203
- `value_bool` (Boolean)
201204
- `value_code` (String) Code value.
202-
- `value_file` (String)
203205
- `value_int` (Number)
204-
- `value_list` (String) JSON encoded list of objects.
205-
- `value_single_select` (String)
206206
- `value_string` (String)

docs/resources/buildingblock.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ Required:
7272

7373
Optional:
7474

75-
- `inputs` (Attributes Map) Building Block user inputs. Each input has exactly one value. Use the value attribute that corresponds to the desired input type, e.g. `value_int` to set an integer input, and leave the remaining attributes empty. (see [below for nested schema](#nestedatt--spec--inputs))
75+
- `inputs` (Attributes Map) Building block user inputs. Each input has exactly one value. Use the value attribute that corresponds to the desired input type, e.g. `value_int` to set an integer input, and leave the remaining attributes empty. (see [below for nested schema](#nestedatt--spec--inputs))
7676
- `parent_building_blocks` (Attributes List) List of parent Building Blocks. (see [below for nested schema](#nestedatt--spec--parent_building_blocks))
7777

7878
Read-Only:
7979

80-
- `combined_inputs` (Attributes Map) Contains all Building Block inputs. Each input has exactly one value attribute set according to its' type. (see [below for nested schema](#nestedatt--spec--combined_inputs))
80+
- `combined_inputs` (Attributes Map) Contains all building block inputs. Each input has exactly one value attribute set according to its' type. (see [below for nested schema](#nestedatt--spec--combined_inputs))
8181

8282
<a id="nestedatt--spec--inputs"></a>
8383
### Nested Schema for `spec.inputs`
@@ -86,9 +86,8 @@ Optional:
8686

8787
- `value_bool` (Boolean)
8888
- `value_code` (String) Code value.
89-
- `value_file` (String)
9089
- `value_int` (Number)
91-
- `value_list` (String) JSON encoded list of objects.
90+
- `value_multi_select` (List of String) Multi-select value (list of strings).
9291
- `value_single_select` (String)
9392
- `value_string` (String)
9493

@@ -105,14 +104,18 @@ Required:
105104
<a id="nestedatt--spec--combined_inputs"></a>
106105
### Nested Schema for `spec.combined_inputs`
107106

107+
Optional:
108+
109+
- `value_single_select` (String)
110+
108111
Read-Only:
109112

110113
- `value_bool` (Boolean)
111114
- `value_code` (String) Code value.
112115
- `value_file` (String)
113116
- `value_int` (Number)
114-
- `value_list` (String) JSON encoded list of objects.
115-
- `value_single_select` (String)
117+
- `value_list` (String) Deprecated: use `value_code` instead. JSON encoded list of objects.
118+
- `value_multi_select` (List of String) Multi-select value (list of strings).
116119
- `value_string` (String)
117120

118121

@@ -122,7 +125,7 @@ Read-Only:
122125

123126
Read-Only:
124127

125-
- `outputs` (Attributes Map) Building Block outputs. Each output has exactly one value attribute set. (see [below for nested schema](#nestedatt--status--outputs))
128+
- `outputs` (Attributes Map) Building block outputs. Each output has exactly one value attribute set. (see [below for nested schema](#nestedatt--status--outputs))
126129
- `status` (String) Execution status. One of `WAITING_FOR_DEPENDENT_INPUT`, `WAITING_FOR_OPERATOR_INPUT`, `PENDING`, `IN_PROGRESS`, `SUCCEEDED`, `FAILED`.
127130

128131
<a id="nestedatt--status--outputs"></a>
@@ -132,8 +135,5 @@ Read-Only:
132135

133136
- `value_bool` (Boolean)
134137
- `value_code` (String) Code value.
135-
- `value_file` (String)
136138
- `value_int` (Number)
137-
- `value_list` (String) JSON encoded list of objects.
138-
- `value_single_select` (String)
139139
- `value_string` (String)

0 commit comments

Comments
 (0)