Skip to content

Commit 930f6c7

Browse files
committed
Remove support for solution file operations
- Deleted all logic, tests, and documentation related to solution file management. - Refactored codebase to exclude unused services, methods, and MIME type configurations linked to solution files. - Updated `WorkspaceSolution` model with new `datasetId` and `defaultParameterValues` fields.
1 parent 15449ce commit 930f6c7

File tree

21 files changed

+342
-1259
lines changed

21 files changed

+342
-1259
lines changed

api/src/integrationTest/kotlin/com/cosmotech/api/home/ControllerTestUtils.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ class ControllerTestUtils {
270270
key: String = WORKSPACE_KEY,
271271
name: String = WORKSPACE_NAME,
272272
solutionId: String,
273+
datasetId: String? = null,
274+
defaultParameterValues: MutableMap<String, String>? = null,
273275
description: String = "",
274276
version: String = "",
275277
runTemplateFilter: MutableList<String> = mutableListOf(),
@@ -289,7 +291,8 @@ class ControllerTestUtils {
289291
solutionId = solutionId,
290292
runTemplateFilter = runTemplateFilter,
291293
defaultRunTemplateDataset = defaultRunTemplateDataset,
292-
),
294+
datasetId = datasetId,
295+
defaultParameterValues = defaultParameterValues),
293296
description = description,
294297
version = version,
295298
datasetCopy = datasetCopy,
@@ -303,6 +306,8 @@ class ControllerTestUtils {
303306
key: String,
304307
name: String,
305308
solutionId: String,
309+
datasetId: String? = null,
310+
defaultParameterValues: MutableMap<String, String>? = null,
306311
description: String = "",
307312
runTemplateFilter: MutableList<String> = mutableListOf(),
308313
defaultRunTemplateDataset: MutableMap<String, Any> = mutableMapOf(),
@@ -320,7 +325,9 @@ class ControllerTestUtils {
320325
WorkspaceSolution(
321326
solutionId = solutionId,
322327
runTemplateFilter = runTemplateFilter,
323-
defaultRunTemplateDataset = defaultRunTemplateDataset),
328+
defaultRunTemplateDataset = defaultRunTemplateDataset,
329+
datasetId = datasetId,
330+
defaultParameterValues = defaultParameterValues),
324331
description = description,
325332
datasetCopy = datasetCopy,
326333
tags = tags,

api/src/integrationTest/kotlin/com/cosmotech/api/home/workspace/WorkspaceControllerTests.kt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ class WorkspaceControllerTests : ControllerTestBase() {
8181
WorkspaceAccessControl(id = PLATFORM_ADMIN_EMAIL, role = ROLE_ADMIN),
8282
WorkspaceAccessControl(id = NEW_USER_ID, role = NEW_USER_ROLE)))
8383

84+
val workspaceDatasetId = "d-12345678910"
8485
mvc.perform(
8586
post("/organizations/$organizationId/workspaces")
8687
.contentType(MediaType.APPLICATION_JSON)
@@ -90,6 +91,10 @@ class WorkspaceControllerTests : ControllerTestBase() {
9091
WORKSPACE_KEY,
9192
WORKSPACE_NAME,
9293
solutionId,
94+
workspaceDatasetId,
95+
mutableMapOf(
96+
"solution_parameter1" to "solution_parameter1_defaultValue",
97+
"solution_parameter2" to "solution_parameter2_defaultValue"),
9398
description,
9499
version,
95100
runTemplateFilter,
@@ -113,6 +118,13 @@ class WorkspaceControllerTests : ControllerTestBase() {
113118
.andExpect(jsonPath("$.solution.runTemplateFilter").value(runTemplateFilter))
114119
.andExpect(
115120
jsonPath("$.solution.defaultRunTemplateDataset").value(defaultRunTemplateDataset))
121+
.andExpect(jsonPath("$.solution.datasetId").value(workspaceDatasetId))
122+
.andExpect(
123+
jsonPath("$.solution.defaultParameterValues.solution_parameter1")
124+
.value("solution_parameter1_defaultValue"))
125+
.andExpect(
126+
jsonPath("$.solution.defaultParameterValues.solution_parameter2")
127+
.value("solution_parameter2_defaultValue"))
116128
.andExpect(jsonPath("$.datasetCopy").value(datasetCopy))
117129
.andExpect(jsonPath("$.tags").value(tags))
118130
.andExpect(jsonPath("$.webApp.url").value(url))
@@ -151,6 +163,7 @@ class WorkspaceControllerTests : ControllerTestBase() {
151163
"you_can_put" to "whatever_you_want_here",
152164
"even" to JSONObject(mapOf("object" to "if_you_want")))
153165

166+
val workspaceDatasetId = "d-12345678910"
154167
mvc.perform(
155168
patch("/organizations/$organizationId/workspaces/$workspaceId")
156169
.contentType(MediaType.APPLICATION_JSON)
@@ -160,6 +173,10 @@ class WorkspaceControllerTests : ControllerTestBase() {
160173
WORKSPACE_KEY,
161174
WORKSPACE_NAME,
162175
solutionId,
176+
workspaceDatasetId,
177+
mutableMapOf(
178+
"solution_parameter1" to "solution_parameter1_defaultValue",
179+
"solution_parameter2" to "solution_parameter2_defaultValue"),
163180
description,
164181
runTemplateFilter,
165182
defaultRunTemplateDataset,
@@ -180,6 +197,13 @@ class WorkspaceControllerTests : ControllerTestBase() {
180197
.andExpect(jsonPath("$.solution.runTemplateFilter").value(runTemplateFilter))
181198
.andExpect(
182199
jsonPath("$.solution.defaultRunTemplateDataset").value(defaultRunTemplateDataset))
200+
.andExpect(jsonPath("$.solution.datasetId").value(workspaceDatasetId))
201+
.andExpect(
202+
jsonPath("$.solution.defaultParameterValues.solution_parameter1")
203+
.value("solution_parameter1_defaultValue"))
204+
.andExpect(
205+
jsonPath("$.solution.defaultParameterValues.solution_parameter2")
206+
.value("solution_parameter2_defaultValue"))
183207
.andExpect(jsonPath("$.datasetCopy").value(datasetCopy))
184208
.andExpect(jsonPath("$.tags").value(tags))
185209
.andExpect(jsonPath("$.webApp.url").value(url))
@@ -230,6 +254,8 @@ class WorkspaceControllerTests : ControllerTestBase() {
230254
.andExpect(jsonPath("$[0].updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
231255
.andExpect(jsonPath("$[0].organizationId").value(organizationId))
232256
.andExpect(jsonPath("$[0].solution.solutionId").value(solutionId))
257+
.andExpect(jsonPath("$[0].solution.datasetId").value(null))
258+
.andExpect(jsonPath("$[0].solution.defaultParameterValues").value(null))
233259
.andExpect(jsonPath("$[0].security.default").value(ROLE_NONE))
234260
.andExpect(jsonPath("$[0].security.accessControlList[0].role").value(ROLE_ADMIN))
235261
.andExpect(jsonPath("$[0].security.accessControlList[0].id").value(PLATFORM_ADMIN_EMAIL))
@@ -240,6 +266,8 @@ class WorkspaceControllerTests : ControllerTestBase() {
240266
.andExpect(jsonPath("$[1].updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
241267
.andExpect(jsonPath("$[1].organizationId").value(organizationId))
242268
.andExpect(jsonPath("$[1].solution.solutionId").value(solutionId))
269+
.andExpect(jsonPath("$[1].solution.datasetId").value(null))
270+
.andExpect(jsonPath("$[1].solution.defaultParameterValues").value(null))
243271
.andExpect(jsonPath("$[1].security.default").value(ROLE_NONE))
244272
.andExpect(jsonPath("$[1].security.accessControlList[0].role").value(ROLE_ADMIN))
245273
.andExpect(jsonPath("$[1].security.accessControlList[0].id").value(PLATFORM_ADMIN_EMAIL))
@@ -268,6 +296,8 @@ class WorkspaceControllerTests : ControllerTestBase() {
268296
mutableMapOf(
269297
"you_can_put" to "whatever_you_want_here",
270298
"even" to JSONObject(mapOf("object" to "if_you_want")))
299+
300+
val workspaceDatasetId = "d-12345678910"
271301
val workspaceSecurity =
272302
WorkspaceSecurity(
273303
default = ROLE_NONE,
@@ -283,6 +313,10 @@ class WorkspaceControllerTests : ControllerTestBase() {
283313
WORKSPACE_KEY,
284314
WORKSPACE_NAME,
285315
solutionId,
316+
workspaceDatasetId,
317+
mutableMapOf(
318+
"solution_parameter1" to "solution_parameter1_defaultValue",
319+
"solution_parameter2" to "solution_parameter2_defaultValue"),
286320
description,
287321
version,
288322
runTemplateFilter,
@@ -312,6 +346,13 @@ class WorkspaceControllerTests : ControllerTestBase() {
312346
.andExpect(jsonPath("$.webApp.url").value(url))
313347
.andExpect(jsonPath("$.organizationId").value(organizationId))
314348
.andExpect(jsonPath("$.solution.solutionId").value(solutionId))
349+
.andExpect(jsonPath("$.solution.datasetId").value(workspaceDatasetId))
350+
.andExpect(
351+
jsonPath("$.solution.defaultParameterValues.solution_parameter1")
352+
.value("solution_parameter1_defaultValue"))
353+
.andExpect(
354+
jsonPath("$.solution.defaultParameterValues.solution_parameter2")
355+
.value("solution_parameter2_defaultValue"))
315356
.andExpect(jsonPath("$.security.default").value(ROLE_NONE))
316357
.andExpect(jsonPath("$.security.accessControlList[0].role").value(ROLE_ADMIN))
317358
.andExpect(jsonPath("$.security.accessControlList[0].id").value(PLATFORM_ADMIN_EMAIL))

api/src/integrationTest/resources/application-test.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,6 @@ csm:
8181
- text/plain
8282
- text/x-yaml
8383
- application/json
84-
solutions:
85-
- application/zip
86-
- application/xml
87-
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
88-
- application/x-tika-ooxml
89-
- text/csv
90-
- text/plain
91-
- text/x-yaml
92-
- application/json
9384
authorization:
9485
mail-jwt-claim: "email"
9586
roles-jwt-claim: "userRoles"

api/src/main/resources/application.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,6 @@ csm:
162162
- text/plain
163163
- text/x-yaml
164164
- application/json
165-
solutions:
166-
- application/zip
167-
- application/xml
168-
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
169-
- application/x-tika-ooxml
170-
- text/csv
171-
- text/plain
172-
- text/x-yaml
173-
- application/json
174165
datasets:
175166
- application/zip
176167
- application/xml

doc/.openapi-generator/FILES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ Models/Solution.md
6969
Models/SolutionAccessControl.md
7070
Models/SolutionCreateRequest.md
7171
Models/SolutionEditInfo.md
72-
Models/SolutionFile.md
7372
Models/SolutionRole.md
7473
Models/SolutionSecurity.md
7574
Models/SolutionUpdateRequest.md

doc/Apis/SolutionApi.md

Lines changed: 0 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,21 @@ All URIs are relative to *http://localhost:8080*
66
|------------- | ------------- | -------------|
77
| [**createSolution**](SolutionApi.md#createSolution) | **POST** /organizations/{organization_id}/solutions | Create a new solution |
88
| [**createSolutionAccessControl**](SolutionApi.md#createSolutionAccessControl) | **POST** /organizations/{organization_id}/solutions/{solution_id}/security/access | Create solution access control |
9-
| [**createSolutionFile**](SolutionApi.md#createSolutionFile) | **POST** /organizations/{organization_id}/solutions/{solution_id}/files | Upload a file for the Solution |
109
| [**createSolutionParameter**](SolutionApi.md#createSolutionParameter) | **POST** /organizations/{organization_id}/solutions/{solution_id}/parameters | Create solution parameter for a solution |
1110
| [**createSolutionParameterGroup**](SolutionApi.md#createSolutionParameterGroup) | **POST** /organizations/{organization_id}/solutions/{solution_id}/parameterGroups | Create a solution parameter group |
1211
| [**createSolutionRunTemplate**](SolutionApi.md#createSolutionRunTemplate) | **POST** /organizations/{organization_id}/solutions/{solution_id}/runTemplates | Create a solution run template |
1312
| [**deleteSolution**](SolutionApi.md#deleteSolution) | **DELETE** /organizations/{organization_id}/solutions/{solution_id} | Delete a solution |
1413
| [**deleteSolutionAccessControl**](SolutionApi.md#deleteSolutionAccessControl) | **DELETE** /organizations/{organization_id}/solutions/{solution_id}/security/access/{identity_id} | Delete solution access control |
15-
| [**deleteSolutionFile**](SolutionApi.md#deleteSolutionFile) | **DELETE** /organizations/{organization_id}/solutions/{solution_id}/files/delete | Delete a solution file |
16-
| [**deleteSolutionFiles**](SolutionApi.md#deleteSolutionFiles) | **DELETE** /organizations/{organization_id}/solutions/{solution_id}/files | Delete all Solution files |
1714
| [**deleteSolutionParameter**](SolutionApi.md#deleteSolutionParameter) | **DELETE** /organizations/{organization_id}/solutions/{solution_id}/parameters/{parameter_id} | Delete specific parameter from the solution |
1815
| [**deleteSolutionParameterGroup**](SolutionApi.md#deleteSolutionParameterGroup) | **DELETE** /organizations/{organization_id}/solutions/{solution_id}/parameterGroups/{parameter_group_id} | Delete a parameter group from the solution |
1916
| [**deleteSolutionRunTemplate**](SolutionApi.md#deleteSolutionRunTemplate) | **DELETE** /organizations/{organization_id}/solutions/{solution_id}/runTemplates/{run_template_id} | Delete a specific run template |
2017
| [**getRunTemplate**](SolutionApi.md#getRunTemplate) | **GET** /organizations/{organization_id}/solutions/{solution_id}/runTemplates/{run_template_id} | Retrieve a solution run templates |
2118
| [**getSolution**](SolutionApi.md#getSolution) | **GET** /organizations/{organization_id}/solutions/{solution_id} | Get the details of a solution |
2219
| [**getSolutionAccessControl**](SolutionApi.md#getSolutionAccessControl) | **GET** /organizations/{organization_id}/solutions/{solution_id}/security/access/{identity_id} | Get solution access control |
23-
| [**getSolutionFile**](SolutionApi.md#getSolutionFile) | **GET** /organizations/{organization_id}/solutions/{solution_id}/files/download | Download the Solution File specified |
2420
| [**getSolutionParameter**](SolutionApi.md#getSolutionParameter) | **GET** /organizations/{organization_id}/solutions/{solution_id}/parameters/{parameter_id} | Get the details of a solution parameter |
2521
| [**getSolutionParameterGroup**](SolutionApi.md#getSolutionParameterGroup) | **GET** /organizations/{organization_id}/solutions/{solution_id}/parameterGroups/{parameter_group_id} | Get details of a solution parameter group |
2622
| [**getSolutionSecurity**](SolutionApi.md#getSolutionSecurity) | **GET** /organizations/{organization_id}/solutions/{solution_id}/security | Get solution security information |
2723
| [**listRunTemplates**](SolutionApi.md#listRunTemplates) | **GET** /organizations/{organization_id}/solutions/{solution_id}/runTemplates | List all solution run templates |
28-
| [**listSolutionFiles**](SolutionApi.md#listSolutionFiles) | **GET** /organizations/{organization_id}/solutions/{solution_id}/files | List all Solution files |
2924
| [**listSolutionParameterGroups**](SolutionApi.md#listSolutionParameterGroups) | **GET** /organizations/{organization_id}/solutions/{solution_id}/parameterGroups | List all solution parameter groups |
3025
| [**listSolutionParameters**](SolutionApi.md#listSolutionParameters) | **GET** /organizations/{organization_id}/solutions/{solution_id}/parameters | List all solution parameters |
3126
| [**listSolutionSecurityUsers**](SolutionApi.md#listSolutionSecurityUsers) | **GET** /organizations/{organization_id}/solutions/{solution_id}/security/users | List solution security users |
@@ -91,35 +86,6 @@ Create solution access control
9186
- **Content-Type**: application/json, application/yaml
9287
- **Accept**: application/json, application/yaml
9388

94-
<a name="createSolutionFile"></a>
95-
# **createSolutionFile**
96-
> SolutionFile createSolutionFile(organization\_id, solution\_id, file, overwrite, destination)
97-
98-
Upload a file for the Solution
99-
100-
### Parameters
101-
102-
|Name | Type | Description | Notes |
103-
|------------- | ------------- | ------------- | -------------|
104-
| **organization\_id** | **String**| the Organization identifier | [default to null] |
105-
| **solution\_id** | **String**| the Solution identifier | [default to null] |
106-
| **file** | **File**| The file to upload | [default to null] |
107-
| **overwrite** | **Boolean**| Whether to overwrite an existing file | [optional] [default to false] |
108-
| **destination** | **String**| Destination path. Must end with a &#39;/&#39; if specifying a folder. Note that paths may or may not start with a &#39;/&#39;, but they are always treated as relative to the Solution root location. | [optional] [default to null] |
109-
110-
### Return type
111-
112-
[**SolutionFile**](../Models/SolutionFile.md)
113-
114-
### Authorization
115-
116-
[oAuth2AuthCode](../README.md#oAuth2AuthCode)
117-
118-
### HTTP request headers
119-
120-
- **Content-Type**: multipart/form-data
121-
- **Accept**: application/json, application/yaml
122-
12389
<a name="createSolutionParameter"></a>
12490
# **createSolutionParameter**
12591
> RunTemplateParameter createSolutionParameter(organization\_id, solution\_id, RunTemplateParameterCreateRequest)
@@ -254,59 +220,6 @@ null (empty response body)
254220
- **Content-Type**: Not defined
255221
- **Accept**: Not defined
256222

257-
<a name="deleteSolutionFile"></a>
258-
# **deleteSolutionFile**
259-
> deleteSolutionFile(organization\_id, solution\_id, file\_name)
260-
261-
Delete a solution file
262-
263-
### Parameters
264-
265-
|Name | Type | Description | Notes |
266-
|------------- | ------------- | ------------- | -------------|
267-
| **organization\_id** | **String**| the Organization identifier | [default to null] |
268-
| **solution\_id** | **String**| the Solution identifier | [default to null] |
269-
| **file\_name** | **String**| The file name | [default to null] |
270-
271-
### Return type
272-
273-
null (empty response body)
274-
275-
### Authorization
276-
277-
[oAuth2AuthCode](../README.md#oAuth2AuthCode)
278-
279-
### HTTP request headers
280-
281-
- **Content-Type**: Not defined
282-
- **Accept**: Not defined
283-
284-
<a name="deleteSolutionFiles"></a>
285-
# **deleteSolutionFiles**
286-
> deleteSolutionFiles(organization\_id, solution\_id)
287-
288-
Delete all Solution files
289-
290-
### Parameters
291-
292-
|Name | Type | Description | Notes |
293-
|------------- | ------------- | ------------- | -------------|
294-
| **organization\_id** | **String**| the Organization identifier | [default to null] |
295-
| **solution\_id** | **String**| the Solution identifier | [default to null] |
296-
297-
### Return type
298-
299-
null (empty response body)
300-
301-
### Authorization
302-
303-
[oAuth2AuthCode](../README.md#oAuth2AuthCode)
304-
305-
### HTTP request headers
306-
307-
- **Content-Type**: Not defined
308-
- **Accept**: Not defined
309-
310223
<a name="deleteSolutionParameter"></a>
311224
# **deleteSolutionParameter**
312225
> deleteSolutionParameter(organization\_id, solution\_id, parameter\_id)
@@ -468,33 +381,6 @@ Get solution access control
468381
- **Content-Type**: Not defined
469382
- **Accept**: application/json, application/yaml
470383

471-
<a name="getSolutionFile"></a>
472-
# **getSolutionFile**
473-
> File getSolutionFile(organization\_id, solution\_id, file\_name)
474-
475-
Download the Solution File specified
476-
477-
### Parameters
478-
479-
|Name | Type | Description | Notes |
480-
|------------- | ------------- | ------------- | -------------|
481-
| **organization\_id** | **String**| the Organization identifier | [default to null] |
482-
| **solution\_id** | **String**| the Solution identifier | [default to null] |
483-
| **file\_name** | **String**| The file name | [default to null] |
484-
485-
### Return type
486-
487-
**File**
488-
489-
### Authorization
490-
491-
[oAuth2AuthCode](../README.md#oAuth2AuthCode)
492-
493-
### HTTP request headers
494-
495-
- **Content-Type**: Not defined
496-
- **Accept**: application/octet-stream
497-
498384
<a name="getSolutionParameter"></a>
499385
# **getSolutionParameter**
500386
> RunTemplateParameter getSolutionParameter(organization\_id, solution\_id, parameter\_id)
@@ -601,32 +487,6 @@ List all solution run templates
601487
- **Content-Type**: Not defined
602488
- **Accept**: application/json, application/yaml
603489

604-
<a name="listSolutionFiles"></a>
605-
# **listSolutionFiles**
606-
> List listSolutionFiles(organization\_id, solution\_id)
607-
608-
List all Solution files
609-
610-
### Parameters
611-
612-
|Name | Type | Description | Notes |
613-
|------------- | ------------- | ------------- | -------------|
614-
| **organization\_id** | **String**| the Organization identifier | [default to null] |
615-
| **solution\_id** | **String**| the Solution identifier | [default to null] |
616-
617-
### Return type
618-
619-
[**List**](../Models/SolutionFile.md)
620-
621-
### Authorization
622-
623-
[oAuth2AuthCode](../README.md#oAuth2AuthCode)
624-
625-
### HTTP request headers
626-
627-
- **Content-Type**: Not defined
628-
- **Accept**: application/json, application/yaml
629-
630490
<a name="listSolutionParameterGroups"></a>
631491
# **listSolutionParameterGroups**
632492
> List listSolutionParameterGroups(organization\_id, solution\_id)

0 commit comments

Comments
 (0)