AnzhiZhang commented on code in PR #3715:
URL: https://github.com/apache/texera/pull/3715#discussion_r2361883285
##########
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:
resolved
##########
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:
resolved
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]