bobbai00 commented on code in PR #3715: URL: https://github.com/apache/texera/pull/3715#discussion_r2343137696
########## core/file-service/src/main/scala/edu/uci/ics/texera/service/resource/DatasetResource.scala: ########## @@ -239,43 +239,70 @@ class DatasetResource { withTransaction(context) { ctx => val uid = user.getUid - val datasetDao: DatasetDao = new DatasetDao(ctx.configuration()) val datasetUserAccessDao: DatasetUserAccessDao = new DatasetUserAccessDao(ctx.configuration()) val datasetName = request.datasetName val datasetDescription = request.datasetDescription val isDatasetPublic = request.isDatasetPublic val isDatasetDownloadable = request.isDatasetDownloadable - // Check if a dataset with the same name already exists - if (!datasetDao.fetchByName(datasetName).isEmpty) { - throw new BadRequestException("Dataset with the same name already exists") - } - - // Initialize the repository in LakeFS + // validate dataset name try { - LakeFSStorageClient.initRepo(datasetName) + LakeFSStorageClient.validateRepositoryName(datasetName) Review Comment: You can remove this. The datasetName is now user-given name, not the actual repository name. So you don't need to validate the datasetName using lakeFS rule. ########## core/workflow-core/src/main/scala/edu/uci/ics/amber/core/storage/util/LakeFSStorageClient.scala: ########## @@ -74,25 +74,36 @@ object LakeFSStorageClient { } /** - * Initializes a new repository in LakeFS. + * Validates the repository name against LakeFS naming conventions. * - * @param repoName Name of the repository. - * @param defaultBranch Default branch name, usually "main". + * @param repoName name of the repository to validate. + * @throws IllegalArgumentException if the repository name is invalid. */ - def initRepo( - repoName: String - ): Repository = { + def validateRepositoryName(repoName: String): Unit = { Review Comment: As stated above, this method seems not needed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@texera.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org