Mighten commented on code in PR #16565: URL: https://github.com/apache/dolphinscheduler/pull/16565#discussion_r1770825420
########## dolphinscheduler-storage-plugin/dolphinscheduler-storage-cos/pom.xml: ########## @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one or more + ~ contributor license agreements. See the NOTICE file distributed with + ~ this work for additional information regarding copyright ownership. + ~ The ASF licenses this file to You under the Apache License, Version 2.0 + ~ (the "License"); you may not use this file except in compliance with + ~ the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.apache.dolphinscheduler</groupId> + <artifactId>dolphinscheduler-storage-plugin</artifactId> + <version>dev-SNAPSHOT</version> + </parent> + + <artifactId>dolphinscheduler-storage-cos</artifactId> + + <dependencies> + <dependency> + <groupId>com.qcloud</groupId> + <artifactId>cos_api</artifactId> + </dependency> + + <dependency> + <groupId>org.apache.dolphinscheduler</groupId> + <artifactId>dolphinscheduler-storage-api</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.dolphinscheduler</groupId> + <artifactId>dolphinscheduler-task-api</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> Review Comment: Please see another *unresolved conversation* regarding this PR (#16565), at the file: `CosStorageOperator.java`: > ```java > log.warn("{} -> {} should not start with / in cos", Constants.RESOURCE_UPLOAD_PATH, > resourceBaseAbsolutePath); > return resourceBaseAbsolutePath.substring(1); > ``` > [@SbloodyS](https://github.com/SbloodyS): It's better to throw exception here since there may be abnormal data in this. The updated code will throw an exception and get stuck on the login page: ```java @Override public String getStorageBaseDirectory() { // All directory should end with File.separator if (resourceBaseAbsolutePath.startsWith("/")) { // use ----> File.separator String errorMessage = String.format("%s -> %s should not start with %s in tencent cos", StorageConstants.RESOURCE_UPLOAD_PATH, resourceBaseAbsolutePath, "/"); // use ----> File.separator throw new IllegalArgumentException(errorMessage); } return resourceBaseAbsolutePath; } ```  Since there are existing test cases stating that `resource.storage.upload.base.path=/dolphinscheduler`:  Throwing an exception will cause the E2E tests to fail. -- 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]
