Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ class ControllerTestUtils {
description = DATASET_DESCRIPTION,
tags = mutableListOf("tag1", "tag2"),
additionalData = mutableMapOf("customClient" to "customDatasetData"),
runnerId = "r-12345678910",
parts =
mutableListOf(
DatasetPartCreateRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ class DatasetControllerTests : ControllerTestBase() {
.andExpect(jsonPath("$.organizationId").value(organizationId))
.andExpect(jsonPath("$.workspaceId").value(workspaceId))
.andExpect(jsonPath("$.createInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$.createInfo.runnerId").value("r-12345678910"))
.andExpect(jsonPath("$.createInfo.timestamp").isNumber)
.andExpect(jsonPath("$.createInfo.timestamp").value(greaterThan(0.toLong())))
.andExpect(jsonPath("$.updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
Expand Down Expand Up @@ -180,8 +179,7 @@ class DatasetControllerTests : ControllerTestBase() {
DatasetCreateRequest(
name = DATASET_NAME,
description = DATASET_DESCRIPTION,
tags = mutableListOf("tag1", "tag2"),
runnerId = "r-12345678910"))
tags = mutableListOf("tag1", "tag2")))
.toString()
.byteInputStream())

Expand All @@ -197,7 +195,6 @@ class DatasetControllerTests : ControllerTestBase() {
.andExpect(jsonPath("$.workspaceId").value(workspaceId))
.andExpect(jsonPath("$.parts", empty<DatasetPart>()))
.andExpect(jsonPath("$.createInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$.createInfo.runnerId").value("r-12345678910"))
.andExpect(jsonPath("$.createInfo.timestamp").isNumber)
.andExpect(jsonPath("$.createInfo.timestamp").value(greaterThan(0.toLong())))
.andExpect(jsonPath("$.updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
Expand All @@ -223,8 +220,7 @@ class DatasetControllerTests : ControllerTestBase() {
name = DATASET_NAME,
description = DATASET_DESCRIPTION,
tags = mutableListOf("tag1", "tag2"),
parts = mutableListOf(),
runnerId = "r-12345678910"))
parts = mutableListOf()))
.toString()
.byteInputStream())

Expand All @@ -240,7 +236,6 @@ class DatasetControllerTests : ControllerTestBase() {
.andExpect(jsonPath("$.workspaceId").value(workspaceId))
.andExpect(jsonPath("$.parts", empty<DatasetPart>()))
.andExpect(jsonPath("$.createInfo.userId").value(PLATFORM_ADMIN_EMAIL))
.andExpect(jsonPath("$.createInfo.runnerId").value("r-12345678910"))
.andExpect(jsonPath("$.createInfo.timestamp").isNumber)
.andExpect(jsonPath("$.createInfo.timestamp").value(greaterThan(0.toLong())))
.andExpect(jsonPath("$.updateInfo.userId").value(PLATFORM_ADMIN_EMAIL))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,7 @@ class DatasetServiceIntegrationTest() : CsmTestBase() {
val datasetTags = mutableListOf("dataset", "public", "customers")
val datasetCreateRequest =
DatasetCreateRequest(
name = datasetName,
description = datasetDescription,
tags = datasetTags,
runnerId = "r-12354678910")
name = datasetName, description = datasetDescription, tags = datasetTags)

val createdDataset =
datasetApiService.createDataset(
Expand All @@ -165,7 +162,6 @@ class DatasetServiceIntegrationTest() : CsmTestBase() {
assertEquals(datasetName, createdDataset.name)
assertEquals(datasetDescription, createdDataset.description)
assertEquals(datasetTags, createdDataset.tags)
assertEquals("r-12354678910", createdDataset.createInfo.runnerId)
assertEquals(0, createdDataset.parts.size)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import com.cosmotech.common.utils.sanitizeDatasetPartId
import com.cosmotech.dataset.DatasetApiServiceInterface
import com.cosmotech.dataset.domain.Dataset
import com.cosmotech.dataset.domain.DatasetAccessControl
import com.cosmotech.dataset.domain.DatasetCreateInfo
import com.cosmotech.dataset.domain.DatasetCreateRequest
import com.cosmotech.dataset.domain.DatasetEditInfo
import com.cosmotech.dataset.domain.DatasetPart
Expand Down Expand Up @@ -152,9 +151,7 @@ class DatasetServiceImpl(
val now = Instant.now().toEpochMilli()
val userId = getCurrentAccountIdentifier(csmPlatformProperties)
val editInfo = DatasetEditInfo(timestamp = now, userId = userId)
val createInfo =
DatasetCreateInfo(
timestamp = now, userId = userId, runnerId = datasetCreateRequest.runnerId)
val createInfo = DatasetEditInfo(timestamp = now, userId = userId)
val security =
csmRbac
.initSecurity(datasetCreateRequest.security.toGenericSecurity(datasetId))
Expand Down
23 changes: 1 addition & 22 deletions dataset/src/main/openapi/dataset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ components:
createInfo:
description: The details of the Dataset creation
allOf:
- $ref: '#/components/schemas/DatasetCreateInfo'
- $ref: '#/components/schemas/DatasetEditInfo'
updateInfo:
description: The details of the Dataset last update
allOf:
Expand Down Expand Up @@ -853,9 +853,6 @@ components:
default: []
security:
$ref: '#/components/schemas/DatasetSecurity'
runnerId:
type: string
pattern: '^r-\w{10,20}'
required:
- name

Expand Down Expand Up @@ -1075,24 +1072,6 @@ components:
userId:
description: The id of the user who did the modification
type: string
required:
- timestamp
- userId

DatasetCreateInfo:
type: object
properties:
timestamp:
description: The timestamp of the creation in millisecond
type: integer
format: int64
userId:
description: The id of the user who did the creation
type: string
runnerId:
description: The runner id which has created the dataset (nullable)
type: string
pattern: '^r-\w{10,20}'
required:
- timestamp
- userId
1 change: 0 additions & 1 deletion doc/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Models/ContainerResourceSizing.md
Models/CreatedRun.md
Models/Dataset.md
Models/DatasetAccessControl.md
Models/DatasetCreateInfo.md
Models/DatasetCreateRequest.md
Models/DatasetEditInfo.md
Models/DatasetPart.md
Expand Down
2 changes: 1 addition & 1 deletion doc/Models/Dataset.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| **tags** | **List** | the list of tags | [default to null] |
| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] |
| **parts** | [**List**](DatasetPart.md) | | [default to null] |
| **createInfo** | [**DatasetCreateInfo**](DatasetCreateInfo.md) | The details of the Dataset creation | [default to null] |
| **createInfo** | [**DatasetEditInfo**](DatasetEditInfo.md) | The details of the Dataset creation | [default to null] |
| **updateInfo** | [**DatasetEditInfo**](DatasetEditInfo.md) | The details of the Dataset last update | [default to null] |
| **security** | [**DatasetSecurity**](DatasetSecurity.md) | | [default to null] |

Expand Down
11 changes: 0 additions & 11 deletions doc/Models/DatasetCreateInfo.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/Models/DatasetCreateRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
| **additionalData** | [**Map**](AnyType.md) | Free form additional data | [optional] [default to null] |
| **parts** | [**List**](DatasetPartCreateRequest.md) | | [optional] [default to []] |
| **security** | [**DatasetSecurity**](DatasetSecurity.md) | | [optional] [default to null] |
| **runnerId** | **String** | | [optional] [default to null] |

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

1 change: 0 additions & 1 deletion doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ All URIs are relative to *http://localhost:8080*
- [CreatedRun](./Models/CreatedRun.md)
- [Dataset](./Models/Dataset.md)
- [DatasetAccessControl](./Models/DatasetAccessControl.md)
- [DatasetCreateInfo](./Models/DatasetCreateInfo.md)
- [DatasetCreateRequest](./Models/DatasetCreateRequest.md)
- [DatasetEditInfo](./Models/DatasetEditInfo.md)
- [DatasetPart](./Models/DatasetPart.md)
Expand Down
11 changes: 2 additions & 9 deletions openapi/plantuml/schemas.plantuml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ entity Dataset {
* tags: List<String>
additionalData: Map
* parts: List<DatasetPart>
* createInfo: DatasetCreateInfo
* createInfo: DatasetEditInfo
* updateInfo: DatasetEditInfo
* security: DatasetSecurity
}
Expand All @@ -54,20 +54,13 @@ entity DatasetAccessControl {
* role: String
}

entity DatasetCreateInfo {
* timestamp: Long
* userId: String
runnerId: String
}

entity DatasetCreateRequest {
* name: String
description: String
tags: List<String>
additionalData: Map
parts: List<DatasetPartCreateRequest>
security: DatasetSecurity
runnerId: String
}

entity DatasetEditInfo {
Expand Down Expand Up @@ -639,7 +632,7 @@ Solution -- "0..*" RunTemplateParameterGroup : parameterGroups
Solution -- "0..*" RunTemplate : runTemplates
Solution -- SolutionSecurity : security
Dataset -- "0..*" DatasetPart : parts
Dataset -- DatasetCreateInfo : createInfo
Dataset -- DatasetEditInfo : createInfo
Dataset -- DatasetEditInfo : updateInfo
Dataset -- DatasetSecurity : security
Run -- RunEditInfo : createInfo
Expand Down