Copilot commented on code in PR #3724:
URL: https://github.com/apache/texera/pull/3724#discussion_r2335627470


##########
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 = {
     val repoNamePattern = "^[a-z0-9][a-z0-9-]{2,62}$".r
 
     // Validate repoName
     if (!repoNamePattern.matches(repoName)) {
       throw new IllegalArgumentException(
-        s"Invalid dataset name: '$repoName'. " +
-          "Dataset names must be 3-63 characters long, " +
+        s"Invalid repository name: '$repoName'. " +
+          "Repository names must be 3-63 characters long, " +
           "contain only lowercase letters, numbers, and hyphens, " +
-          "and cannot start or end with a hyphen."
+          "and cannot start with a hyphen."

Review Comment:
   The error message states repository names 'cannot start with a hyphen' but 
the regex pattern `^[a-z0-9][a-z0-9-]{2,62}$` actually prevents starting with a 
hyphen and also prevents ending with a hyphen. The message should be updated to 
include 'and cannot start or end with a hyphen' to accurately reflect the 
validation logic.
   ```suggestion
             "and cannot start or end with a hyphen."
   ```



-- 
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]

Reply via email to