Skip to content

Commit 962f468

Browse files
committed
Remove DatasetCreateInfo model and runnerId field
- Replaced `DatasetCreateInfo` with `DatasetEditInfo` across models, schemas, and tests. - Removed `runnerId` field from `DatasetCreateRequest`. - Updated documentation, OpenAPI spec, integration tests, and services accordingly.
1 parent b1bc493 commit 962f468

File tree

11 files changed

+8
-63
lines changed

11 files changed

+8
-63
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,6 @@ class ControllerTestUtils {
438438
description = DATASET_DESCRIPTION,
439439
tags = mutableListOf("tag1", "tag2"),
440440
additionalData = mutableMapOf("customClient" to "customDatasetData"),
441-
runnerId = "r-12345678910",
442441
parts =
443442
mutableListOf(
444443
DatasetPartCreateRequest(

api/src/integrationTest/kotlin/com/cosmotech/api/home/dataset/DatasetControllerTests.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ class DatasetControllerTests : ControllerTestBase() {
141141
.andExpect(jsonPath("$.organizationId").value(organizationId))
142142
.andExpect(jsonPath("$.workspaceId").value(workspaceId))
143143
.andExpect(jsonPath("$.createInfo.userId").value(PLATFORM_ADMIN_EMAIL))
144-
.andExpect(jsonPath("$.createInfo.runnerId").value("r-12345678910"))
145144
.andExpect(jsonPath("$.createInfo.timestamp").isNumber)
146145
.andExpect(jsonPath("$.createInfo.timestamp").value(greaterThan(0.toLong())))
147146
.andExpect(jsonPath("$.updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
@@ -180,8 +179,7 @@ class DatasetControllerTests : ControllerTestBase() {
180179
DatasetCreateRequest(
181180
name = DATASET_NAME,
182181
description = DATASET_DESCRIPTION,
183-
tags = mutableListOf("tag1", "tag2"),
184-
runnerId = "r-12345678910"))
182+
tags = mutableListOf("tag1", "tag2")))
185183
.toString()
186184
.byteInputStream())
187185

@@ -197,7 +195,6 @@ class DatasetControllerTests : ControllerTestBase() {
197195
.andExpect(jsonPath("$.workspaceId").value(workspaceId))
198196
.andExpect(jsonPath("$.parts", empty<DatasetPart>()))
199197
.andExpect(jsonPath("$.createInfo.userId").value(PLATFORM_ADMIN_EMAIL))
200-
.andExpect(jsonPath("$.createInfo.runnerId").value("r-12345678910"))
201198
.andExpect(jsonPath("$.createInfo.timestamp").isNumber)
202199
.andExpect(jsonPath("$.createInfo.timestamp").value(greaterThan(0.toLong())))
203200
.andExpect(jsonPath("$.updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
@@ -223,8 +220,7 @@ class DatasetControllerTests : ControllerTestBase() {
223220
name = DATASET_NAME,
224221
description = DATASET_DESCRIPTION,
225222
tags = mutableListOf("tag1", "tag2"),
226-
parts = mutableListOf(),
227-
runnerId = "r-12345678910"))
223+
parts = mutableListOf()))
228224
.toString()
229225
.byteInputStream())
230226

@@ -240,7 +236,6 @@ class DatasetControllerTests : ControllerTestBase() {
240236
.andExpect(jsonPath("$.workspaceId").value(workspaceId))
241237
.andExpect(jsonPath("$.parts", empty<DatasetPart>()))
242238
.andExpect(jsonPath("$.createInfo.userId").value(PLATFORM_ADMIN_EMAIL))
243-
.andExpect(jsonPath("$.createInfo.runnerId").value("r-12345678910"))
244239
.andExpect(jsonPath("$.createInfo.timestamp").isNumber)
245240
.andExpect(jsonPath("$.createInfo.timestamp").value(greaterThan(0.toLong())))
246241
.andExpect(jsonPath("$.updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))

dataset/src/integrationTest/kotlin/com/cosmotech/dataset/service/DatasetServiceIntegrationTest.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,7 @@ class DatasetServiceIntegrationTest() : CsmTestBase() {
152152
val datasetTags = mutableListOf("dataset", "public", "customers")
153153
val datasetCreateRequest =
154154
DatasetCreateRequest(
155-
name = datasetName,
156-
description = datasetDescription,
157-
tags = datasetTags,
158-
runnerId = "r-12354678910")
155+
name = datasetName, description = datasetDescription, tags = datasetTags)
159156

160157
val createdDataset =
161158
datasetApiService.createDataset(
@@ -165,7 +162,6 @@ class DatasetServiceIntegrationTest() : CsmTestBase() {
165162
assertEquals(datasetName, createdDataset.name)
166163
assertEquals(datasetDescription, createdDataset.description)
167164
assertEquals(datasetTags, createdDataset.tags)
168-
assertEquals("r-12354678910", createdDataset.createInfo.runnerId)
169165
assertEquals(0, createdDataset.parts.size)
170166
}
171167

dataset/src/main/kotlin/com/cosmotech/dataset/service/DatasetServiceImpl.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import com.cosmotech.common.utils.sanitizeDatasetPartId
2727
import com.cosmotech.dataset.DatasetApiServiceInterface
2828
import com.cosmotech.dataset.domain.Dataset
2929
import com.cosmotech.dataset.domain.DatasetAccessControl
30-
import com.cosmotech.dataset.domain.DatasetCreateInfo
3130
import com.cosmotech.dataset.domain.DatasetCreateRequest
3231
import com.cosmotech.dataset.domain.DatasetEditInfo
3332
import com.cosmotech.dataset.domain.DatasetPart
@@ -152,9 +151,7 @@ class DatasetServiceImpl(
152151
val now = Instant.now().toEpochMilli()
153152
val userId = getCurrentAccountIdentifier(csmPlatformProperties)
154153
val editInfo = DatasetEditInfo(timestamp = now, userId = userId)
155-
val createInfo =
156-
DatasetCreateInfo(
157-
timestamp = now, userId = userId, runnerId = datasetCreateRequest.runnerId)
154+
val createInfo = DatasetEditInfo(timestamp = now, userId = userId)
158155
val security =
159156
csmRbac
160157
.initSecurity(datasetCreateRequest.security.toGenericSecurity(datasetId))

dataset/src/main/openapi/dataset.yaml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ components:
807807
createInfo:
808808
description: The details of the Dataset creation
809809
allOf:
810-
- $ref: '#/components/schemas/DatasetCreateInfo'
810+
- $ref: '#/components/schemas/DatasetEditInfo'
811811
updateInfo:
812812
description: The details of the Dataset last update
813813
allOf:
@@ -853,9 +853,6 @@ components:
853853
default: []
854854
security:
855855
$ref: '#/components/schemas/DatasetSecurity'
856-
runnerId:
857-
type: string
858-
pattern: '^r-\w{10,20}'
859856
required:
860857
- name
861858

@@ -1075,24 +1072,6 @@ components:
10751072
userId:
10761073
description: The id of the user who did the modification
10771074
type: string
1078-
required:
1079-
- timestamp
1080-
- userId
1081-
1082-
DatasetCreateInfo:
1083-
type: object
1084-
properties:
1085-
timestamp:
1086-
description: The timestamp of the creation in millisecond
1087-
type: integer
1088-
format: int64
1089-
userId:
1090-
description: The id of the user who did the creation
1091-
type: string
1092-
runnerId:
1093-
description: The runner id which has created the dataset (nullable)
1094-
type: string
1095-
pattern: '^r-\w{10,20}'
10961075
required:
10971076
- timestamp
10981077
- userId

doc/.openapi-generator/FILES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Models/ContainerResourceSizing.md
1313
Models/CreatedRun.md
1414
Models/Dataset.md
1515
Models/DatasetAccessControl.md
16-
Models/DatasetCreateInfo.md
1716
Models/DatasetCreateRequest.md
1817
Models/DatasetEditInfo.md
1918
Models/DatasetPart.md

doc/Models/Dataset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
| **tags** | **List** | the list of tags | [default to null] |
1212
| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] |
1313
| **parts** | [**List**](DatasetPart.md) | | [default to null] |
14-
| **createInfo** | [**DatasetCreateInfo**](DatasetCreateInfo.md) | The details of the Dataset creation | [default to null] |
14+
| **createInfo** | [**DatasetEditInfo**](DatasetEditInfo.md) | The details of the Dataset creation | [default to null] |
1515
| **updateInfo** | [**DatasetEditInfo**](DatasetEditInfo.md) | The details of the Dataset last update | [default to null] |
1616
| **security** | [**DatasetSecurity**](DatasetSecurity.md) | | [default to null] |
1717

doc/Models/DatasetCreateInfo.md

Lines changed: 0 additions & 11 deletions
This file was deleted.

doc/Models/DatasetCreateRequest.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] |
1010
| **parts** | [**List**](DatasetPartCreateRequest.md) | | [optional] [default to []] |
1111
| **security** | [**DatasetSecurity**](DatasetSecurity.md) | | [optional] [default to null] |
12-
| **runnerId** | **String** | | [optional] [default to null] |
1312

1413
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1514

doc/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ All URIs are relative to *http://localhost:8080*
121121
- [CreatedRun](./Models/CreatedRun.md)
122122
- [Dataset](./Models/Dataset.md)
123123
- [DatasetAccessControl](./Models/DatasetAccessControl.md)
124-
- [DatasetCreateInfo](./Models/DatasetCreateInfo.md)
125124
- [DatasetCreateRequest](./Models/DatasetCreateRequest.md)
126125
- [DatasetEditInfo](./Models/DatasetEditInfo.md)
127126
- [DatasetPart](./Models/DatasetPart.md)

0 commit comments

Comments
 (0)