status
stringclasses 1
value | repo_name
stringclasses 31
values | repo_url
stringclasses 31
values | issue_id
int64 1
104k
| title
stringlengths 4
233
| body
stringlengths 0
186k
⌀ | issue_url
stringlengths 38
56
| pull_url
stringlengths 37
54
| before_fix_sha
stringlengths 40
40
| after_fix_sha
stringlengths 40
40
| report_datetime
timestamp[us, tz=UTC] | language
stringclasses 5
values | commit_datetime
timestamp[us, tz=UTC] | updated_file
stringlengths 7
188
| chunk_content
stringlengths 1
1.03M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | String phone,
String queue,
int state,
String timeZone) throws IOException {
Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false);
if (check(result, !hasPerm(loginUser, userId), Status.USER_NO_OPERATION_PERM)) {
return result;
}
User user = userMapper.selectById(userId);
if (user == null) {
putMsg(result, Status.USER_NOT_EXIST, userId);
return result;
}
if (StringUtils.isNotEmpty(userName)) {
if (!CheckUtils.checkUserName(userName)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, userName);
return result;
}
User tempUser = userMapper.queryByUserNameAccurately(userName);
if (tempUser != null && tempUser.getId() != userId) {
putMsg(result, Status.USER_NAME_EXIST);
return result;
}
user.setUserName(userName);
}
if (StringUtils.isNotEmpty(userPassword)) {
if (!CheckUtils.checkPassword(userPassword)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, userPassword);
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
user.setUserPassword(EncryptionUtils.getMd5(userPassword));
}
if (StringUtils.isNotEmpty(email)) {
if (!CheckUtils.checkEmail(email)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, email);
return result;
}
user.setEmail(email);
}
if (StringUtils.isNotEmpty(phone) && !CheckUtils.checkPhone(phone)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, phone);
return result;
}
if (state == 0 && user.getState() != state && loginUser.getId() == user.getId()) {
putMsg(result, Status.NOT_ALLOW_TO_DISABLE_OWN_ACCOUNT);
return result;
}
if (StringUtils.isNotEmpty(timeZone)) {
if (!CheckUtils.checkTimeZone(timeZone)) {
putMsg(result, Status.TIME_ZONE_ILLEGAL, timeZone);
return result;
}
user.setTimeZone(timeZone);
}
user.setPhone(phone);
user.setQueue(queue);
user.setState(state);
Date now = new Date();
user.setUpdateTime(now); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | if (user.getTenantId() != tenantId) {
Tenant oldTenant = tenantMapper.queryById(user.getTenantId());
Tenant newTenant = tenantMapper.queryById(tenantId);
if (newTenant != null) {
if (PropertyUtils.getResUploadStartupState() && oldTenant != null) {
String newTenantCode = newTenant.getTenantCode();
String oldResourcePath = HadoopUtils.getHdfsResDir(oldTenant.getTenantCode());
String oldUdfsPath = HadoopUtils.getHdfsUdfDir(oldTenant.getTenantCode());
if (HadoopUtils.getInstance().exists(oldResourcePath)) {
String newResourcePath = HadoopUtils.getHdfsResDir(newTenantCode);
String newUdfsPath = HadoopUtils.getHdfsUdfDir(newTenantCode);
List<Resource> fileResourcesList = resourceMapper.queryResourceList(
null, userId, ResourceType.FILE.ordinal());
if (CollectionUtils.isNotEmpty(fileResourcesList)) {
ResourceTreeVisitor resourceTreeVisitor = new ResourceTreeVisitor(fileResourcesList);
ResourceComponent resourceComponent = resourceTreeVisitor.visit();
copyResourceFiles(resourceComponent, oldResourcePath, newResourcePath);
}
List<Resource> udfResourceList = resourceMapper.queryResourceList(
null, userId, ResourceType.UDF.ordinal());
if (CollectionUtils.isNotEmpty(udfResourceList)) {
ResourceTreeVisitor resourceTreeVisitor = new ResourceTreeVisitor(udfResourceList);
ResourceComponent resourceComponent = resourceTreeVisitor.visit();
copyResourceFiles(resourceComponent, oldUdfsPath, newUdfsPath); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
String oldUserPath = HadoopUtils.getHdfsUserDir(oldTenant.getTenantCode(), userId);
HadoopUtils.getInstance().delete(oldUserPath, true);
} else {
createTenantDirIfNotExists(oldTenant.getTenantCode());
}
if (HadoopUtils.getInstance().exists(HadoopUtils.getHdfsTenantDir(newTenant.getTenantCode()))) {
String newUserPath = HadoopUtils.getHdfsUserDir(newTenant.getTenantCode(), user.getId());
HadoopUtils.getInstance().mkdir(newUserPath);
} else {
createTenantDirIfNotExists(newTenant.getTenantCode());
}
}
}
user.setTenantId(tenantId);
}
userMapper.updateById(user);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* delete user
*
* @param loginUser login user
* @param id user id |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | * @return delete result code
* @throws Exception exception when operate hdfs
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> deleteUserById(User loginUser, int id) throws IOException {
Map<String, Object> result = new HashMap<>();
if (!isAdmin(loginUser)) {
putMsg(result, Status.USER_NO_OPERATION_PERM, id);
return result;
}
User tempUser = userMapper.selectById(id);
if (tempUser == null) {
putMsg(result, Status.USER_NOT_EXIST, id);
return result;
}
List<Project> projects = projectMapper.queryProjectCreatedByUser(id);
if (CollectionUtils.isNotEmpty(projects)) {
String projectNames = projects.stream().map(Project::getName).collect(Collectors.joining(","));
putMsg(result, Status.TRANSFORM_PROJECT_OWNERSHIP, projectNames);
return result;
}
User user = userMapper.queryTenantCodeByUserId(id);
if (user != null) {
if (PropertyUtils.getResUploadStartupState()) {
String userPath = HadoopUtils.getHdfsUserDir(user.getTenantCode(), id); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | if (HadoopUtils.getInstance().exists(userPath)) {
HadoopUtils.getInstance().delete(userPath, true);
}
}
}
accessTokenMapper.deleteAccessTokenByUserId(id);
userMapper.deleteById(id);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* grant project
*
* @param loginUser login user
* @param userId user id
* @param projectIds project id array
* @return grant result code
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> grantProject(User loginUser, int userId, String projectIds) {
Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false);
User tempUser = userMapper.selectById(userId);
if (tempUser == null) {
putMsg(result, Status.USER_NOT_EXIST, userId);
return result;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | if (check(result, StringUtils.isEmpty(projectIds), Status.SUCCESS)) {
projectUserMapper.deleteProjectRelation(0, userId);
return result;
}
String[] projectIdArr = projectIds.split(",");
for (String projectId : projectIdArr) {
Date now = new Date();
ProjectUser projectUser = new ProjectUser();
projectUser.setUserId(userId);
projectUser.setProjectId(Integer.parseInt(projectId));
projectUser.setPerm(Constants.AUTHORIZE_WRITABLE_PERM);
projectUser.setCreateTime(now);
projectUser.setUpdateTime(now);
projectUserMapper.insert(projectUser);
}
putMsg(result, Status.SUCCESS);
return result;
}
/**
* grant project by code
*
* @param loginUser login user
* @param userId user id
* @param projectCode project code
* @return grant result code
*/
@Override
public Map<String, Object> grantProjectByCode(final User loginUser, final int userId, final long projectCode) {
Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | User tempUser = this.userMapper.selectById(userId);
if (tempUser == null) {
this.putMsg(result, Status.USER_NOT_EXIST, userId);
return result;
}
Project project = this.projectMapper.queryByCode(projectCode);
if (project == null) {
this.putMsg(result, Status.PROJECT_NOT_FOUND, projectCode);
return result;
}
if (!this.hasPerm(loginUser, project.getUserId())) {
this.putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
final Date today = new Date();
ProjectUser projectUser = new ProjectUser();
projectUser.setUserId(userId);
projectUser.setProjectId(project.getId());
projectUser.setPerm(7);
projectUser.setCreateTime(today);
projectUser.setUpdateTime(today);
this.projectUserMapper.insert(projectUser);
this.putMsg(result, Status.SUCCESS);
return result;
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | * revoke the project permission for specified user.
* @param loginUser Login user
* @param userId User id
* @param projectCode Project Code
* @return
*/
@Override
public Map<String, Object> revokeProject(User loginUser, int userId, long projectCode) {
Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false);
if (this.check(result, !this.isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
User user = this.userMapper.selectById(userId);
if (user == null) {
this.putMsg(result, Status.USER_NOT_EXIST, userId);
return result;
}
Project project = this.projectMapper.queryByCode(projectCode);
if (project == null) {
this.putMsg(result, Status.PROJECT_NOT_FOUND, projectCode);
return result;
}
this.projectUserMapper.deleteProjectRelation(project.getId(), user.getId());
this.putMsg(result, Status.SUCCESS);
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
/**
* grant resource
*
* @param loginUser login user
* @param userId user id
* @param resourceIds resource id array
* @return grant result code
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> grantResources(User loginUser, int userId, String resourceIds) {
Map<String, Object> result = new HashMap<>();
User user = userMapper.selectById(userId);
if (user == null) {
putMsg(result, Status.USER_NOT_EXIST, userId);
return result;
}
Set<Integer> needAuthorizeResIds = new HashSet<>();
if (StringUtils.isNotBlank(resourceIds)) {
String[] resourceFullIdArr = resourceIds.split(",");
for (String resourceFullId : resourceFullIdArr) {
String[] resourceIdArr = resourceFullId.split("-");
for (int i = 0; i <= resourceIdArr.length - 1; i++) {
int resourceIdValue = Integer.parseInt(resourceIdArr[i]);
needAuthorizeResIds.add(resourceIdValue);
}
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | List<Integer> resIds = resourceUserMapper.queryResourcesIdListByUserIdAndPerm(userId, Constants.AUTHORIZE_WRITABLE_PERM);
List<Resource> oldAuthorizedRes = CollectionUtils.isEmpty(resIds) ? new ArrayList<>() : resourceMapper.queryResourceListById(resIds);
Set<Integer> oldAuthorizedResIds = oldAuthorizedRes.stream().map(Resource::getId).collect(Collectors.toSet());
oldAuthorizedResIds.removeAll(needAuthorizeResIds);
if (CollectionUtils.isNotEmpty(oldAuthorizedResIds)) {
List<Map<String, Object>> list = processDefinitionMapper.listResourcesByUser(userId);
Map<Integer, Set<Long>> resourceProcessMap = ResourceProcessDefinitionUtils.getResourceProcessDefinitionMap(list);
Set<Integer> resourceIdSet = resourceProcessMap.keySet();
resourceIdSet.retainAll(oldAuthorizedResIds);
if (CollectionUtils.isNotEmpty(resourceIdSet)) {
logger.error("can't be deleted,because it is used of process definition");
for (Integer resId : resourceIdSet) {
logger.error("resource id:{} is used of process definition {}", resId, resourceProcessMap.get(resId));
}
putMsg(result, Status.RESOURCE_IS_USED);
return result;
}
}
resourceUserMapper.deleteResourceUser(userId, 0);
if (check(result, StringUtils.isEmpty(resourceIds), Status.SUCCESS)) {
return result;
}
for (int resourceIdValue : needAuthorizeResIds) {
Resource resource = resourceMapper.selectById(resourceIdValue);
if (resource == null) {
putMsg(result, Status.RESOURCE_NOT_EXIST); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | return result;
}
Date now = new Date();
ResourcesUser resourcesUser = new ResourcesUser();
resourcesUser.setUserId(userId);
resourcesUser.setResourcesId(resourceIdValue);
if (resource.isDirectory()) {
resourcesUser.setPerm(Constants.AUTHORIZE_READABLE_PERM);
} else {
resourcesUser.setPerm(Constants.AUTHORIZE_WRITABLE_PERM);
}
resourcesUser.setCreateTime(now);
resourcesUser.setUpdateTime(now);
resourceUserMapper.insert(resourcesUser);
}
putMsg(result, Status.SUCCESS);
return result;
}
/**
* grant udf function
*
* @param loginUser login user
* @param userId user id
* @param udfIds udf id array
* @return grant result code
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> grantUDFFunction(User loginUser, int userId, String udfIds) {
Map<String, Object> result = new HashMap<>(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | User user = userMapper.selectById(userId);
if (user == null) {
putMsg(result, Status.USER_NOT_EXIST, userId);
return result;
}
udfUserMapper.deleteByUserId(userId);
if (check(result, StringUtils.isEmpty(udfIds), Status.SUCCESS)) {
return result;
}
String[] resourcesIdArr = udfIds.split(",");
for (String udfId : resourcesIdArr) {
Date now = new Date();
UDFUser udfUser = new UDFUser();
udfUser.setUserId(userId);
udfUser.setUdfId(Integer.parseInt(udfId));
udfUser.setPerm(Constants.AUTHORIZE_WRITABLE_PERM);
udfUser.setCreateTime(now);
udfUser.setUpdateTime(now);
udfUserMapper.insert(udfUser);
}
putMsg(result, Status.SUCCESS);
return result;
}
/**
* grant datasource
*
* @param loginUser login user
* @param userId user id
* @param datasourceIds data source id array
* @return grant result code |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | */
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> grantDataSource(User loginUser, int userId, String datasourceIds) {
Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false);
User user = userMapper.selectById(userId);
if (user == null) {
putMsg(result, Status.USER_NOT_EXIST, userId);
return result;
}
datasourceUserMapper.deleteByUserId(userId);
if (check(result, StringUtils.isEmpty(datasourceIds), Status.SUCCESS)) {
return result;
}
String[] datasourceIdArr = datasourceIds.split(",");
for (String datasourceId : datasourceIdArr) {
Date now = new Date();
DatasourceUser datasourceUser = new DatasourceUser();
datasourceUser.setUserId(userId);
datasourceUser.setDatasourceId(Integer.parseInt(datasourceId));
datasourceUser.setPerm(Constants.AUTHORIZE_WRITABLE_PERM);
datasourceUser.setCreateTime(now);
datasourceUser.setUpdateTime(now);
datasourceUserMapper.insert(datasourceUser);
}
putMsg(result, Status.SUCCESS);
return result;
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | * query user info
*
* @param loginUser login user
* @return user info
*/
@Override
public Map<String, Object> getUserInfo(User loginUser) {
Map<String, Object> result = new HashMap<>();
User user = null;
if (loginUser.getUserType() == UserType.ADMIN_USER) {
user = loginUser;
} else {
user = userMapper.queryDetailsById(loginUser.getId());
List<AlertGroup> alertGroups = alertGroupMapper.queryByUserId(loginUser.getId());
StringBuilder sb = new StringBuilder();
if (alertGroups != null && !alertGroups.isEmpty()) {
for (int i = 0; i < alertGroups.size() - 1; i++) {
sb.append(alertGroups.get(i).getGroupName() + ",");
}
sb.append(alertGroups.get(alertGroups.size() - 1));
user.setAlertGroup(sb.toString());
}
}
result.put(Constants.DATA_LIST, user);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query user list
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | * @param loginUser login user
* @return user list
*/
@Override
public Map<String, Object> queryAllGeneralUsers(User loginUser) {
Map<String, Object> result = new HashMap<>();
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
List<User> userList = userMapper.queryAllGeneralUser();
result.put(Constants.DATA_LIST, userList);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query user list
*
* @param loginUser login user
* @return user list
*/
@Override
public Map<String, Object> queryUserList(User loginUser) {
Map<String, Object> result = new HashMap<>();
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
List<User> userList = userMapper.selectList(null);
result.put(Constants.DATA_LIST, userList); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | putMsg(result, Status.SUCCESS);
return result;
}
/**
* verify user name exists
*
* @param userName user name
* @return true if user name not exists, otherwise return false
*/
@Override
public Result<Object> verifyUserName(String userName) {
Result<Object> result = new Result<>();
User user = userMapper.queryByUserNameAccurately(userName);
if (user != null) {
putMsg(result, Status.USER_NAME_EXIST);
} else {
putMsg(result, Status.SUCCESS);
}
return result;
}
/**
* unauthorized user
*
* @param loginUser login user
* @param alertgroupId alert group id
* @return unauthorize result code
*/
@Override
public Map<String, Object> unauthorizedUser(User loginUser, Integer alertgroupId) {
Map<String, Object> result = new HashMap<>(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
List<User> userList = userMapper.selectList(null);
List<User> resultUsers = new ArrayList<>();
Set<User> userSet = null;
if (userList != null && !userList.isEmpty()) {
userSet = new HashSet<>(userList);
List<User> authedUserList = userMapper.queryUserListByAlertGroupId(alertgroupId);
Set<User> authedUserSet = null;
if (authedUserList != null && !authedUserList.isEmpty()) {
authedUserSet = new HashSet<>(authedUserList);
userSet.removeAll(authedUserSet);
}
resultUsers = new ArrayList<>(userSet);
}
result.put(Constants.DATA_LIST, resultUsers);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* authorized user
*
* @param loginUser login user
* @param alertgroupId alert group id
* @return authorized result code
*/
@Override
public Map<String, Object> authorizedUser(User loginUser, Integer alertgroupId) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | Map<String, Object> result = new HashMap<>();
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
List<User> userList = userMapper.queryUserListByAlertGroupId(alertgroupId);
result.put(Constants.DATA_LIST, userList);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* @param tenantId tenant id
* @return true if tenant exists, otherwise return false
*/
private boolean checkTenantExists(int tenantId) {
return tenantMapper.queryById(tenantId) != null;
}
/**
* @return if check failed return the field, otherwise return null
*/
private String checkUserParams(String userName, String password, String email, String phone) {
String msg = null;
if (!CheckUtils.checkUserName(userName)) {
msg = userName;
} else if (!CheckUtils.checkPassword(password)) {
msg = password;
} else if (!CheckUtils.checkEmail(email)) {
msg = email;
} else if (!CheckUtils.checkPhone(phone)) {
msg = phone; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
return msg;
}
/**
* copy resource files
*
* @param resourceComponent resource component
* @param srcBasePath src base path
* @param dstBasePath dst base path
* @throws IOException io exception
*/
private void copyResourceFiles(ResourceComponent resourceComponent, String srcBasePath, String dstBasePath) throws IOException {
List<ResourceComponent> components = resourceComponent.getChildren();
if (CollectionUtils.isNotEmpty(components)) {
for (ResourceComponent component : components) {
if (!HadoopUtils.getInstance().exists(String.format("%s/%s", srcBasePath, component.getFullName()))) {
logger.error("resource file: {} not exist,copy error", component.getFullName());
throw new ServiceException(Status.RESOURCE_NOT_EXIST);
}
if (!component.isDirctory()) {
HadoopUtils.getInstance().copy(String.format("%s/%s", srcBasePath, component.getFullName()), String.format("%s/%s", dstBasePath, component.getFullName()), false, true);
continue;
}
if (CollectionUtils.isEmpty(component.getChildren())) {
if (!HadoopUtils.getInstance().exists(String.format("%s/%s", dstBasePath, component.getFullName()))) {
HadoopUtils.getInstance().mkdir(String.format("%s/%s", dstBasePath, component.getFullName()));
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | } else {
copyResourceFiles(component, srcBasePath, dstBasePath);
}
}
}
}
/**
* registry user, default state is 0, default tenant_id is 1, no phone, no queue
*
* @param userName user name
* @param userPassword user password
* @param repeatPassword repeat password
* @param email email
* @return registry result code
* @throws Exception exception
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> registerUser(String userName, String userPassword, String repeatPassword, String email) {
Map<String, Object> result = new HashMap<>();
String msg = this.checkUserParams(userName, userPassword, email, "");
if (!StringUtils.isEmpty(msg)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, msg);
return result;
}
if (!userPassword.equals(repeatPassword)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "two passwords are not same");
return result;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | User user = createUser(userName, userPassword, email, 1, "", "", Flag.NO.ordinal());
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, user);
return result;
}
/**
* activate user, only system admin have permission, change user state code 0 to 1
*
* @param loginUser login user
* @param userName user name
* @return create result code
*/
@Override
public Map<String, Object> activateUser(User loginUser, String userName) {
Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false);
if (!isAdmin(loginUser)) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
if (!CheckUtils.checkUserName(userName)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, userName);
return result;
}
User user = userMapper.queryByUserNameAccurately(userName);
if (user == null) {
putMsg(result, Status.USER_NOT_EXIST, userName);
return result;
}
if (user.getState() != Flag.NO.ordinal()) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, userName);
return result;
}
user.setState(Flag.YES.ordinal());
Date now = new Date();
user.setUpdateTime(now);
userMapper.updateById(user);
User responseUser = userMapper.queryByUserNameAccurately(userName);
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, responseUser);
return result;
}
/**
* activate user, only system admin have permission, change users state code 0 to 1
*
* @param loginUser login user
* @param userNames user name
* @return create result code
*/
@Override
public Map<String, Object> batchActivateUser(User loginUser, List<String> userNames) {
Map<String, Object> result = new HashMap<>();
if (!isAdmin(loginUser)) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
int totalSuccess = 0;
List<String> successUserNames = new ArrayList<>();
Map<String, Object> successRes = new HashMap<>();
int totalFailed = 0; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 7,896 | [Bug] [api] When the project is authorized, it will generate a duplicate authorized project | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened
step1, Authorize more than two projects to user a
step2, Cancel some of the projects that have been authorized to user a, please do not cancel all of them
step3, When project authorization is performed again, the list of authorized projects produces duplicate project names
The problem is shown in the following gif demonstration:

### What you expected to happen
Do not generate duplicate authorized items
### How to reproduce
see 'what happened'
### Anything else
_No response_
### Version
2.0.1
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/7896 | https://github.com/apache/dolphinscheduler/pull/8453 | bb1ba967cdd0715bb83f69406e3c184fcecd4294 | 2aed250ed4cdb33d7a116e59bceb5d30eda6073a | 2022-01-08T09:42:29Z | java | 2022-03-10T08:58:02Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | List<Map<String, String>> failedInfo = new ArrayList<>();
Map<String, Object> failedRes = new HashMap<>();
for (String userName : userNames) {
Map<String, Object> tmpResult = activateUser(loginUser, userName);
if (tmpResult.get(Constants.STATUS) != Status.SUCCESS) {
totalFailed++;
Map<String, String> failedBody = new HashMap<>();
failedBody.put("userName", userName);
Status status = (Status) tmpResult.get(Constants.STATUS);
String errorMessage = MessageFormat.format(status.getMsg(), userName);
failedBody.put("msg", errorMessage);
failedInfo.add(failedBody);
} else {
totalSuccess++;
successUserNames.add(userName);
}
}
successRes.put("sum", totalSuccess);
successRes.put("userName", successUserNames);
failedRes.put("sum", totalFailed);
failedRes.put("info", failedInfo);
Map<String, Object> res = new HashMap<>();
res.put("success", successRes);
res.put("failed", failedRes);
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, res);
return result;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClickhouseDataSourceE2ETest.java | /*
* 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.
*
*/
package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClickhouseDataSourceE2ETest.java | import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
@DolphinScheduler(composeFiles = "docker/datasource-clickhouse/docker-compose.yaml")
public class ClickhouseDataSourceE2ETest {
private static RemoteWebDriver browser;
private static final String tenant = System.getProperty("user.name");
private static final String user = "admin";
private static final String password = "dolphinscheduler123";
private static final String dataSourceType = "CLICKHOUSE";
private static final String dataSourceName = "clickhouse_test";
private static final String dataSourceDescription = "clickhouse_test";
private static final String ip = "clickhouse";
private static final String port = "8123";
private static final String userName = "ch_test";
private static final String pgPassword = "ch_test";
private static final String database = "ch_test";
private static final String jdbcParams = "";
@BeforeAll
public static void setup() {
new LoginPage(browser) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClickhouseDataSourceE2ETest.java | .login(user, password)
.goToNav(DataSourcePage.class);
}
@Test
@Order(10)
void testCreateClickhouseDataSource() {
final DataSourcePage page = new DataSourcePage(browser);
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams);
new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName)));
}
@Test
@Order(20)
void testDeleteClickhouseDataSource() {
final DataSourcePage page = new DataSourcePage(browser);
page.delete(dataSourceName);
await().untilAsserted(() -> {
browser.navigate().refresh();
assertThat(
page.dataSourceItemsList()
).noneMatch(
it -> it.getText().contains(dataSourceName)
);
});
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/HiveDataSourceE2ETest.java | /*
* 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.
*
*/
package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/HiveDataSourceE2ETest.java | import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
@DolphinScheduler(composeFiles = "docker/datasource-hive/docker-compose.yaml")
public class HiveDataSourceE2ETest {
private static RemoteWebDriver browser;
private static final String tenant = System.getProperty("user.name");
private static final String user = "admin";
private static final String password = "dolphinscheduler123";
private static final String dataSourceType = "HIVE";
private static final String dataSourceName = "hive_test";
private static final String dataSourceDescription = "hive_test";
private static final String ip = "hive-server";
private static final String port = "10000";
private static final String userName = "hadoop";
private static final String hivePassword = "";
private static final String database = "default";
private static final String jdbcParams = "";
@BeforeAll
public static void setup() {
new LoginPage(browser) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/HiveDataSourceE2ETest.java | .login(user, password)
.goToNav(DataSourcePage.class);
}
@Test
@Order(10)
void testCreateHiveDataSource() {
final DataSourcePage page = new DataSourcePage(browser);
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, hivePassword, database, jdbcParams);
new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName)));
}
@Test
@Order(20)
void testDeleteHiveDataSource() {
final DataSourcePage page = new DataSourcePage(browser);
page.delete(dataSourceName);
await().untilAsserted(() -> {
browser.navigate().refresh();
assertThat(
page.dataSourceItemsList()
).noneMatch(
it -> it.getText().contains(dataSourceName)
);
});
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/MysqlDataSourceE2ETest.java | /*
* 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.
*
*/
package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/MysqlDataSourceE2ETest.java | import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
@DolphinScheduler(composeFiles = "docker/datasource-mysql/docker-compose.yaml")
public class MysqlDataSourceE2ETest {
private static RemoteWebDriver browser;
private static final String tenant = System.getProperty("user.name");
private static final String user = "admin";
private static final String password = "dolphinscheduler123";
private static final String dataSourceType = "MYSQL";
private static final String dataSourceName = "mysql_test";
private static final String dataSourceDescription = "mysql_test";
private static final String ip = "mysql";
private static final String port = "3306";
private static final String userName = "root";
private static final String mysqlPassword = "123456";
private static final String database = "mysql";
private static final String jdbcParams = "{\"useSSL\": false}";
@BeforeAll
public static void setup() {
new LoginPage(browser) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/MysqlDataSourceE2ETest.java | .login(user, password)
.goToNav(DataSourcePage.class);
}
@Test
@Order(10)
void testCreateMysqlDataSource() {
final DataSourcePage page = new DataSourcePage(browser);
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, mysqlPassword, database, jdbcParams);
new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName)));
}
@Test
@Order(20)
void testDeleteMysqlDataSource() {
final DataSourcePage page = new DataSourcePage(browser);
page.delete(dataSourceName);
await().untilAsserted(() -> {
browser.navigate().refresh();
assertThat(
page.dataSourceItemsList()
).noneMatch(
it -> it.getText().contains(dataSourceName)
);
});
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/PostgresDataSourceE2ETest.java | /*
* 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.
*
*/
package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/PostgresDataSourceE2ETest.java | import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
@DolphinScheduler(composeFiles = "docker/datasource-postgresql/docker-compose.yaml")
public class PostgresDataSourceE2ETest {
private static RemoteWebDriver browser;
private static final String tenant = System.getProperty("user.name");
private static final String user = "admin";
private static final String password = "dolphinscheduler123";
private static final String dataSourceType = "POSTGRESQL";
private static final String dataSourceName = "postgres_test";
private static final String dataSourceDescription = "postgres_test";
private static final String ip = "postgres";
private static final String port = "5432";
private static final String userName = "postgres";
private static final String pgPassword = "postgres";
private static final String database = "postgres";
private static final String jdbcParams = "";
@BeforeAll
public static void setup() {
new LoginPage(browser) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/PostgresDataSourceE2ETest.java | .login(user, password)
.goToNav(DataSourcePage.class);
}
@Test
@Order(10)
void testCreatePostgresDataSource() {
final DataSourcePage page = new DataSourcePage(browser);
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams);
new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName)));
}
@Test
@Order(20)
void testDeletePostgresDataSource() {
final DataSourcePage page = new DataSourcePage(browser);
page.delete(dataSourceName);
await().untilAsserted(() -> {
browser.navigate().refresh();
assertThat(
page.dataSourceItemsList()
).noneMatch(
it -> it.getText().contains(dataSourceName)
);
});
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/SqlServerDataSourceE2ETest.java | /*
* 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.
*
*/
package org.apache.dolphinscheduler.e2e.cases;
import static org.assertj.core.api.Assertions.assertThat; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/SqlServerDataSourceE2ETest.java | import static org.awaitility.Awaitility.await;
import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
import org.apache.dolphinscheduler.e2e.pages.LoginPage;
import org.apache.dolphinscheduler.e2e.pages.datasource.DataSourcePage;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
@DolphinScheduler(composeFiles = "docker/datasource-sqlserver/docker-compose.yaml")
public class SqlServerDataSourceE2ETest {
private static RemoteWebDriver browser;
private static final String tenant = System.getProperty("user.name");
private static final String user = "admin";
private static final String password = "dolphinscheduler123";
private static final String dataSourceType = "SQLSERVER";
private static final String dataSourceName = "sqlserver_test";
private static final String dataSourceDescription = "sqlserver_test";
private static final String ip = "sqlserver";
private static final String port = "1433";
private static final String userName = "sa";
private static final String pgPassword = "OcP2020123";
private static final String database = "master";
private static final String jdbcParams = "";
@BeforeAll
public static void setup() {
new LoginPage(browser) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/SqlServerDataSourceE2ETest.java | .login(user, password)
.goToNav(DataSourcePage.class);
}
@Test
@Order(10)
void testCreateSqlServerDataSource() {
final DataSourcePage page = new DataSourcePage(browser);
page.createDataSource(dataSourceType, dataSourceName, dataSourceDescription, ip, port, userName, pgPassword, database, jdbcParams);
new WebDriverWait(page.driver(), 10).until(ExpectedConditions.invisibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
await().untilAsserted(() -> assertThat(page.dataSourceItemsList())
.as("DataSource list should contain newly-created database")
.extracting(WebElement::getText)
.anyMatch(it -> it.contains(dataSourceName)));
}
@Test
@Order(20)
void testDeleteSqlServerDataSource() {
final DataSourcePage page = new DataSourcePage(browser);
page.delete(dataSourceName);
await().untilAsserted(() -> {
browser.navigate().refresh();
assertThat(
page.dataSourceItemsList()
).noneMatch(
it -> it.getText().contains(dataSourceName)
);
});
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java | * 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.
*
*/
package org.apache.dolphinscheduler.e2e.pages.datasource;
import lombok.Getter;
import org.apache.dolphinscheduler.e2e.pages.common.NavBarPage;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.FindBys;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.support.ui.WebDriverWait;
@Getter |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java | public class DataSourcePage extends NavBarPage implements NavBarPage.NavBarItem {
@FindBy(id = "btnCreateDataSource")
private WebElement buttonCreateDataSource;
@FindBy(className = "data-source-items")
private List<WebElement> dataSourceItemsList;
@FindBys({
@FindBy(className = "el-popconfirm"),
@FindBy(className = "el-button--primary"),
})
private List<WebElement> buttonConfirm;
private final CreateDataSourceForm createDataSourceForm;
public DataSourcePage(RemoteWebDriver driver) {
super(driver);
createDataSourceForm = new CreateDataSourceForm();
}
public DataSourcePage createDataSource(String dataSourceType, String dataSourceName, String dataSourceDescription, String ip, String port, String userName, String password, String database,
String jdbcParams) {
buttonCreateDataSource().click();
createDataSourceForm().btnDataSourceTypeDropdown().click();
new WebDriverWait(driver, 10).until(ExpectedConditions.visibilityOfElementLocated(new By.ById("dialogCreateDataSource")));
createDataSourceForm().selectDataSourceType()
.stream()
.filter(it -> it.getText().contains(dataSourceType.toUpperCase()))
.findFirst()
.orElseThrow(() -> new RuntimeException(String.format("No %s in data source type list", dataSourceType.toUpperCase())))
.click();
createDataSourceForm().inputDataSourceName().sendKeys(dataSourceName);
createDataSourceForm().inputDataSourceDescription().sendKeys(dataSourceDescription); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java | createDataSourceForm().inputIP().sendKeys(ip);
createDataSourceForm().inputPort().clear();
createDataSourceForm().inputPort().sendKeys(port);
createDataSourceForm().inputUserName().sendKeys(userName);
createDataSourceForm().inputPassword().sendKeys(password);
createDataSourceForm().inputDataBase().sendKeys(database);
if (!"".equals(jdbcParams)) {
createDataSourceForm().inputJdbcParams().sendKeys(jdbcParams);
}
createDataSourceForm().buttonSubmit().click();
return this;
}
public DataSourcePage delete(String name) {
dataSourceItemsList()
.stream()
.filter(it -> it.getText().contains(name))
.flatMap(it -> it.findElements(By.id("btnDelete")).stream())
.filter(WebElement::isDisplayed)
.findFirst()
.orElseThrow(() -> new RuntimeException("No delete button in data source list"))
.click();
buttonConfirm()
.stream()
.filter(WebElement::isDisplayed)
.findFirst()
.orElseThrow(() -> new RuntimeException("No confirm button when deleting"))
.click();
return this;
}
@Getter |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java | public class CreateDataSourceForm {
CreateDataSourceForm() {
PageFactory.initElements(driver, this); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,844 | [Feature][E2E] Restore datasource center e2e test cases in ui-next | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
Restore datasource center e2e test cases in ui-next
### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8844 | https://github.com/apache/dolphinscheduler/pull/8845 | b0ffec5a4ca619f84aa44d1491c44d3fa0d8c7fe | 2335453482df236841bf2147596a89ef359f7036 | 2022-03-13T01:39:02Z | java | 2022-03-13T04:33:19Z | dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/pages/datasource/DataSourcePage.java | }
@FindBy(className = "options-datasource-type")
private List<WebElement> selectDataSourceType;
@FindBy(id = "btnDataSourceTypeDropDown")
private WebElement btnDataSourceTypeDropdown;
@FindBy(id = "inputDataSourceName")
private WebElement inputDataSourceName;
@FindBy(id = "inputDataSourceDescription")
private WebElement inputDataSourceDescription;
@FindBy(id = "inputIP")
private WebElement inputIP;
@FindBy(id = "inputPort")
private WebElement inputPort;
@FindBy(id = "inputUserName")
private WebElement inputUserName;
@FindBy(id = "inputPassword")
private WebElement inputPassword;
@FindBy(id = "inputDataBase")
private WebElement inputDataBase;
@FindBy(id = "inputJdbcParams")
private WebElement inputJdbcParams;
@FindBy(id = "btnSubmit")
private WebElement buttonSubmit;
@FindBy(id = "btnCancel")
private WebElement buttonCancel;
@FindBy(id = "btnTestConnection")
private WebElement btnTestConnection;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,758 | [Improvement] [dolphinscheduler-worker] the object 'preTaskCache' is never used, Suggested deletion | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
worker received task execute request command and cache 'TaskExecutionContext',and new Object of 'preTaskCache', but unused. maybe it have other useful?

### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8758 | https://github.com/apache/dolphinscheduler/pull/8795 | 6514ed2da27ec13775183ec9d7fac12e9132fe16 | 6a5b3bb8f92e41f2cab1ad688430b334bb0873f9 | 2022-03-08T13:10:25Z | java | 2022-03-14T06:14:21Z | dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskExecuteProcessor.java | /*
* 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.
*/
package org.apache.dolphinscheduler.server.worker.processor;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.Event;
import org.apache.dolphinscheduler.common.enums.ExecutionStatus;
import org.apache.dolphinscheduler.common.enums.TaskType;
import org.apache.dolphinscheduler.common.utils.CommonUtils;
import org.apache.dolphinscheduler.common.utils.DateUtils;
import org.apache.dolphinscheduler.common.utils.FileUtils; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,758 | [Improvement] [dolphinscheduler-worker] the object 'preTaskCache' is never used, Suggested deletion | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
worker received task execute request command and cache 'TaskExecutionContext',and new Object of 'preTaskCache', but unused. maybe it have other useful?

### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8758 | https://github.com/apache/dolphinscheduler/pull/8795 | 6514ed2da27ec13775183ec9d7fac12e9132fe16 | 6a5b3bb8f92e41f2cab1ad688430b334bb0873f9 | 2022-03-08T13:10:25Z | java | 2022-03-14T06:14:21Z | dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskExecuteProcessor.java | import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.common.utils.NetUtils;
import org.apache.dolphinscheduler.common.utils.OSUtils;
import org.apache.dolphinscheduler.remote.command.Command;
import org.apache.dolphinscheduler.remote.command.CommandType;
import org.apache.dolphinscheduler.remote.command.TaskExecuteAckCommand;
import org.apache.dolphinscheduler.remote.command.TaskExecuteRequestCommand;
import org.apache.dolphinscheduler.remote.processor.NettyRemoteChannel;
import org.apache.dolphinscheduler.remote.processor.NettyRequestProcessor;
import org.apache.dolphinscheduler.server.utils.LogUtils;
import org.apache.dolphinscheduler.server.worker.cache.ResponseCache;
import org.apache.dolphinscheduler.server.worker.config.WorkerConfig;
import org.apache.dolphinscheduler.server.worker.plugin.TaskPluginManager;
import org.apache.dolphinscheduler.server.worker.runner.TaskExecuteThread;
import org.apache.dolphinscheduler.server.worker.runner.WorkerManagerThread;
import org.apache.dolphinscheduler.service.alert.AlertClientService;
import org.apache.dolphinscheduler.service.queue.entity.TaskExecutionContext;
import org.apache.dolphinscheduler.spi.task.TaskExecutionContextCacheManager;
import org.apache.dolphinscheduler.spi.task.request.TaskRequest;
import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.google.common.base.Preconditions;
import io.netty.channel.Channel;
/**
* worker request processor
*/
@Component |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,758 | [Improvement] [dolphinscheduler-worker] the object 'preTaskCache' is never used, Suggested deletion | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
worker received task execute request command and cache 'TaskExecutionContext',and new Object of 'preTaskCache', but unused. maybe it have other useful?

### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8758 | https://github.com/apache/dolphinscheduler/pull/8795 | 6514ed2da27ec13775183ec9d7fac12e9132fe16 | 6a5b3bb8f92e41f2cab1ad688430b334bb0873f9 | 2022-03-08T13:10:25Z | java | 2022-03-14T06:14:21Z | dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskExecuteProcessor.java | public class TaskExecuteProcessor implements NettyRequestProcessor {
private static final Logger logger = LoggerFactory.getLogger(TaskExecuteProcessor.class);
/**
* worker config
*/
@Autowired
private WorkerConfig workerConfig;
/**
* task callback service
*/
@Autowired
private TaskCallbackService taskCallbackService; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,758 | [Improvement] [dolphinscheduler-worker] the object 'preTaskCache' is never used, Suggested deletion | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
worker received task execute request command and cache 'TaskExecutionContext',and new Object of 'preTaskCache', but unused. maybe it have other useful?

### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8758 | https://github.com/apache/dolphinscheduler/pull/8795 | 6514ed2da27ec13775183ec9d7fac12e9132fe16 | 6a5b3bb8f92e41f2cab1ad688430b334bb0873f9 | 2022-03-08T13:10:25Z | java | 2022-03-14T06:14:21Z | dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskExecuteProcessor.java | /**
* alert client service
*/
@Autowired
private AlertClientService alertClientService;
@Autowired
private TaskPluginManager taskPluginManager;
/**
* task execute manager
*/
@Autowired
private WorkerManagerThread workerManager;
/**
* Pre-cache task to avoid extreme situations when kill task. There is no such task in the cache
*
* @param taskExecutionContext task
*/
private void setTaskCache(TaskExecutionContext taskExecutionContext) {
TaskExecutionContext preTaskCache = new TaskExecutionContext();
preTaskCache.setTaskInstanceId(taskExecutionContext.getTaskInstanceId());
TaskRequest taskRequest = JSONUtils.parseObject(JSONUtils.toJsonString(taskExecutionContext), TaskRequest.class);
TaskExecutionContextCacheManager.cacheTaskExecutionContext(taskRequest);
}
@Override
public void process(Channel channel, Command command) {
Preconditions.checkArgument(CommandType.TASK_EXECUTE_REQUEST == command.getType(),
String.format("invalid command type : %s", command.getType()));
TaskExecuteRequestCommand taskRequestCommand = JSONUtils.parseObject(
command.getBody(), TaskExecuteRequestCommand.class);
if (taskRequestCommand == null) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,758 | [Improvement] [dolphinscheduler-worker] the object 'preTaskCache' is never used, Suggested deletion | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
worker received task execute request command and cache 'TaskExecutionContext',and new Object of 'preTaskCache', but unused. maybe it have other useful?

### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8758 | https://github.com/apache/dolphinscheduler/pull/8795 | 6514ed2da27ec13775183ec9d7fac12e9132fe16 | 6a5b3bb8f92e41f2cab1ad688430b334bb0873f9 | 2022-03-08T13:10:25Z | java | 2022-03-14T06:14:21Z | dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskExecuteProcessor.java | logger.error("task execute request command is null");
return;
}
logger.info("task execute request command : {}", taskRequestCommand);
String contextJson = taskRequestCommand.getTaskExecutionContext();
TaskExecutionContext taskExecutionContext = JSONUtils.parseObject(contextJson, TaskExecutionContext.class);
if (taskExecutionContext == null) {
logger.error("task execution context is null");
return;
}
setTaskCache(taskExecutionContext);
taskExecutionContext.setHost(NetUtils.getAddr(workerConfig.getListenPort()));
taskExecutionContext.setLogPath(LogUtils.getTaskLogPath(taskExecutionContext));
if (Constants.DRY_RUN_FLAG_NO == taskExecutionContext.getDryRun()) {
String execLocalPath = getExecLocalPath(taskExecutionContext);
logger.info("task instance local execute path : {}", execLocalPath);
taskExecutionContext.setExecutePath(execLocalPath);
try {
FileUtils.createWorkDirIfAbsent(execLocalPath);
if (CommonUtils.isSudoEnable() && workerConfig.isTenantAutoCreate()) {
OSUtils.createUserIfAbsent(taskExecutionContext.getTenantCode());
}
} catch (Throwable ex) {
logger.error("create execLocalPath: {}", execLocalPath, ex);
TaskExecutionContextCacheManager.removeByTaskInstanceId(taskExecutionContext.getTaskInstanceId());
}
}
taskCallbackService.addRemoteChannel(taskExecutionContext.getTaskInstanceId(), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,758 | [Improvement] [dolphinscheduler-worker] the object 'preTaskCache' is never used, Suggested deletion | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
worker received task execute request command and cache 'TaskExecutionContext',and new Object of 'preTaskCache', but unused. maybe it have other useful?

### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8758 | https://github.com/apache/dolphinscheduler/pull/8795 | 6514ed2da27ec13775183ec9d7fac12e9132fe16 | 6a5b3bb8f92e41f2cab1ad688430b334bb0873f9 | 2022-03-08T13:10:25Z | java | 2022-03-14T06:14:21Z | dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskExecuteProcessor.java | new NettyRemoteChannel(channel, command.getOpaque()));
long remainTime = DateUtils.getRemainTime(taskExecutionContext.getFirstSubmitTime(), taskExecutionContext.getDelayTime() * 60L);
if (remainTime > 0) {
logger.info("delay the execution of task instance {}, delay time: {} s", taskExecutionContext.getTaskInstanceId(), remainTime);
taskExecutionContext.setCurrentExecutionStatus(ExecutionStatus.DELAY_EXECUTION);
taskExecutionContext.setStartTime(null);
} else {
taskExecutionContext.setCurrentExecutionStatus(ExecutionStatus.RUNNING_EXECUTION);
taskExecutionContext.setStartTime(new Date());
}
this.doAck(taskExecutionContext);
if (!workerManager.offer(new TaskExecuteThread(taskExecutionContext, taskCallbackService, alertClientService, taskPluginManager))) {
logger.info("submit task to manager error, queue is full, queue size is {}", workerManager.getDelayQueueSize());
}
}
private void doAck(TaskExecutionContext taskExecutionContext) {
TaskExecuteAckCommand ackCommand = buildAckCommand(taskExecutionContext);
ResponseCache.get().cache(taskExecutionContext.getTaskInstanceId(), ackCommand.convert2Command(), Event.ACK);
taskCallbackService.sendAck(taskExecutionContext.getTaskInstanceId(), ackCommand.convert2Command());
}
/**
* build ack command
*
* @param taskExecutionContext taskExecutionContext
* @return TaskExecuteAckCommand
*/
private TaskExecuteAckCommand buildAckCommand(TaskExecutionContext taskExecutionContext) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,758 | [Improvement] [dolphinscheduler-worker] the object 'preTaskCache' is never used, Suggested deletion | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement.
### Description
worker received task execute request command and cache 'TaskExecutionContext',and new Object of 'preTaskCache', but unused. maybe it have other useful?

### Use case
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8758 | https://github.com/apache/dolphinscheduler/pull/8795 | 6514ed2da27ec13775183ec9d7fac12e9132fe16 | 6a5b3bb8f92e41f2cab1ad688430b334bb0873f9 | 2022-03-08T13:10:25Z | java | 2022-03-14T06:14:21Z | dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/processor/TaskExecuteProcessor.java | TaskExecuteAckCommand ackCommand = new TaskExecuteAckCommand();
ackCommand.setTaskInstanceId(taskExecutionContext.getTaskInstanceId());
ackCommand.setStatus(taskExecutionContext.getCurrentExecutionStatus().getCode());
ackCommand.setLogPath(LogUtils.getTaskLogPath(taskExecutionContext));
ackCommand.setHost(taskExecutionContext.getHost());
ackCommand.setStartTime(taskExecutionContext.getStartTime());
if (TaskType.SQL.getDesc().equalsIgnoreCase(taskExecutionContext.getTaskType()) || TaskType.PROCEDURE.getDesc().equalsIgnoreCase(taskExecutionContext.getTaskType())) {
ackCommand.setExecutePath(null);
} else {
ackCommand.setExecutePath(taskExecutionContext.getExecutePath());
}
taskExecutionContext.setLogPath(ackCommand.getLogPath());
ackCommand.setProcessInstanceId(taskExecutionContext.getProcessInstanceId());
return ackCommand;
}
/**
* get execute local path
*
* @param taskExecutionContext taskExecutionContext
* @return execute local path
*/
private String getExecLocalPath(TaskExecutionContext taskExecutionContext) {
return FileUtils.getProcessExecDir(taskExecutionContext.getProjectCode(),
taskExecutionContext.getProcessDefineCode(),
taskExecutionContext.getProcessDefineVersion(),
taskExecutionContext.getProcessInstanceId(),
taskExecutionContext.getTaskInstanceId());
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | /*
* 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.
*/
package org.apache.dolphinscheduler.api.controller;
import static org.apache.dolphinscheduler.api.enums.Status.AUTHORIZED_FILE_RESOURCE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.AUTHORIZED_UDF_FUNCTION_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.AUTHORIZE_RESOURCE_TREE;
import static org.apache.dolphinscheduler.api.enums.Status.CREATE_RESOURCE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.CREATE_RESOURCE_FILE_ON_LINE_ERROR; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | import static org.apache.dolphinscheduler.api.enums.Status.CREATE_UDF_FUNCTION_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.DELETE_RESOURCE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.DELETE_UDF_FUNCTION_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.DOWNLOAD_RESOURCE_FILE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.EDIT_RESOURCE_FILE_ON_LINE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_DATASOURCE_BY_TYPE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_RESOURCES_LIST_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_RESOURCES_LIST_PAGING;
import static org.apache.dolphinscheduler.api.enums.Status.QUERY_UDF_FUNCTION_LIST_PAGING_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.RESOURCE_FILE_IS_EMPTY;
import static org.apache.dolphinscheduler.api.enums.Status.RESOURCE_NOT_EXIST;
import static org.apache.dolphinscheduler.api.enums.Status.UNAUTHORIZED_UDF_FUNCTION_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_RESOURCE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_UDF_FUNCTION_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_RESOURCE_BY_NAME_AND_TYPE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_UDF_FUNCTION_NAME_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.VIEW_RESOURCE_FILE_ON_LINE_ERROR;
import static org.apache.dolphinscheduler.api.enums.Status.VIEW_UDF_FUNCTION_ERROR;
import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.exceptions.ApiException;
import org.apache.dolphinscheduler.api.service.ResourcesService;
import org.apache.dolphinscheduler.api.service.UdfFuncService;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.ProgramType;
import org.apache.dolphinscheduler.spi.enums.ResourceType;
import org.apache.dolphinscheduler.common.enums.UdfType;
import org.apache.dolphinscheduler.common.utils.ParameterUtils;
import org.apache.dolphinscheduler.dao.entity.User; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | import org.apache.commons.lang.StringUtils;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;
/**
* resources controller
*/
@Api(tags = "RESOURCES_TAG") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @RestController
@RequestMapping("resources")
public class ResourcesController extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(ResourcesController.class);
@Autowired
private ResourcesService resourceService;
@Autowired
private UdfFuncService udfFuncService;
/**
* @param loginUser login user
* @param type type
* @param alias alias
* @param description description
* @param pid parent id
* @param currentDir current directory
* @return create result code
*/
@ApiOperation(value = "createDirctory", notes = "CREATE_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataType = "String"), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType = "String"),
@ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataType = "Int", example = "10"),
@ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENTDIR", required = true, dataType = "String")
})
@PostMapping(value = "/directory")
@ApiException(CREATE_RESOURCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result createDirectory(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "name") String alias,
@RequestParam(value = "description", required = false) String description,
@RequestParam(value = "pid") int pid,
@RequestParam(value = "currentDir") String currentDir) {
return resourceService.createDirectory(loginUser, alias, description, type, pid, currentDir);
}
/**
* create resource
*
* @return create result code
*/
@ApiOperation(value = "createResource", notes = "CREATE_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType = "String"),
@ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true, dataType = "MultipartFile"),
@ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataType = "Int", example = "10"),
@ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENTDIR", required = true, dataType = "String")
})
@PostMapping() |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @ApiException(CREATE_RESOURCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result createResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "name") String alias,
@RequestParam(value = "description", required = false) String description,
@RequestParam("file") MultipartFile file,
@RequestParam(value = "pid") int pid,
@RequestParam(value = "currentDir") String currentDir) {
return resourceService.createResource(loginUser, alias, description, type, file, pid, currentDir);
}
/**
* update resource
*
* @param loginUser login user
* @param alias alias
* @param resourceId resource id
* @param type resource type
* @param description description
* @param file resource file
* @return update result code
*/
@ApiOperation(value = "updateResource", notes = "UPDATE_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "name", value = "RESOURCE_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType = "String"),
@ApiImplicitParam(name = "file", value = "RESOURCE_FILE", required = true, dataType = "MultipartFile")
}) |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @PutMapping(value = "/{id}")
@ApiException(UPDATE_RESOURCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result updateResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int resourceId,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "name") String alias,
@RequestParam(value = "description", required = false) String description,
@RequestParam(value = "file", required = false) MultipartFile file) {
return resourceService.updateResource(loginUser, resourceId, alias, description, type, file);
}
/**
* query resources list
*
* @param loginUser login user
* @param type resource type
* @return resource list
*/
@ApiOperation(value = "queryResourceList", notes = "QUERY_RESOURCE_LIST_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType")
})
@GetMapping(value = "/list")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_RESOURCES_LIST_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryResourceList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type
) {
Map<String, Object> result = resourceService.queryResourceList(loginUser, type); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | return returnDataList(result);
}
/**
* query resources list paging
*
* @param loginUser login user
* @param type resource type
* @param searchVal search value
* @param pageNo page number
* @param pageSize page size
* @return resource list page
*/
@ApiOperation(value = "queryResourceListPaging", notes = "QUERY_RESOURCE_LIST_PAGING_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "int", example = "10"),
@ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"),
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20")
})
@GetMapping()
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_RESOURCES_LIST_PAGING)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryResourceListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "id") int id,
@RequestParam("pageNo") Integer pageNo,
@RequestParam(value = "searchVal", required = false) String searchVal,
@RequestParam("pageSize") Integer pageSize |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | ) {
Result result = checkPageParams(pageNo, pageSize);
if (!result.checkResult()) {
return result;
}
searchVal = ParameterUtils.handleEscapes(searchVal);
result = resourceService.queryResourceListPaging(loginUser, id, type, searchVal, pageNo, pageSize);
return result;
}
/**
* delete resource
*
* @param loginUser login user
* @param resourceId resource id
* @return delete result code
*/
@ApiOperation(value = "deleteResource", notes = "DELETE_RESOURCE_BY_ID_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
})
@DeleteMapping(value = "/{id}")
@ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_RESOURCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result deleteResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int resourceId
) throws Exception {
return resourceService.delete(loginUser, resourceId);
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | * verify resource by alias and type
*
* @param loginUser login user
* @param fullName resource full name
* @param type resource type
* @return true if the resource name not exists, otherwise return false
*/
@ApiOperation(value = "verifyResourceName", notes = "VERIFY_RESOURCE_NAME_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "fullName", value = "RESOURCE_FULL_NAME", required = true, dataType = "String")
})
@GetMapping(value = "/verify-name")
@ResponseStatus(HttpStatus.OK)
@ApiException(VERIFY_RESOURCE_BY_NAME_AND_TYPE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result verifyResourceName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "fullName") String fullName,
@RequestParam(value = "type") ResourceType type
) {
return resourceService.verifyResourceName(fullName, type, loginUser);
}
/**
* query resources by type
*
* @param loginUser login user
* @param type resource type
* @return resource list
*/
@ApiOperation(value = "queryResourceByProgramType", notes = "QUERY_RESOURCE_LIST_NOTES") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType")
})
@GetMapping(value = "/query-by-type")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_RESOURCES_LIST_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryResourceJarList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "programType", required = false) ProgramType programType
) {
Map<String, Object> result = resourceService.queryResourceByProgramType(loginUser, type, programType);
return returnDataList(result);
}
/**
* query resource by full name and type
*
* @param loginUser login user
* @param fullName resource full name
* @param type resource type
* @param id resource id
* @return true if the resource name not exists, otherwise return false
*/
@ApiOperation(value = "queryResource", notes = "QUERY_BY_RESOURCE_NAME")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "fullName", value = "RESOURCE_FULL_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = false, dataType = "Int", example = "10")
})
@GetMapping(value = "/{id}") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @ResponseStatus(HttpStatus.OK)
@ApiException(RESOURCE_NOT_EXIST)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "fullName", required = false) String fullName,
@PathVariable(value = "id", required = false) Integer id,
@RequestParam(value = "type") ResourceType type
) {
return resourceService.queryResource(fullName, id, type);
}
/**
* view resource file online
*
* @param loginUser login user
* @param resourceId resource id
* @param skipLineNum skip line number
* @param limit limit
* @return resource content
*/
@ApiOperation(value = "viewResource", notes = "VIEW_RESOURCE_BY_ID_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "skipLineNum", value = "SKIP_LINE_NUM", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "limit", value = "LIMIT", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/{id}/view")
@ApiException(VIEW_RESOURCE_FILE_ON_LINE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result viewResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int resourceId, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @RequestParam(value = "skipLineNum") int skipLineNum,
@RequestParam(value = "limit") int limit
) {
return resourceService.readResource(resourceId, skipLineNum, limit);
}
/**
* create resource file online
*
* @return create result code
*/
@ApiOperation(value = "onlineCreateResource", notes = "ONLINE_CREATE_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "RESOURCE_TYPE", required = true, dataType = "ResourceType"),
@ApiImplicitParam(name = "fileName", value = "RESOURCE_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "suffix", value = "SUFFIX", required = true, dataType = "String"),
@ApiImplicitParam(name = "description", value = "RESOURCE_DESC", dataType = "String"),
@ApiImplicitParam(name = "content", value = "CONTENT", required = true, dataType = "String"),
@ApiImplicitParam(name = "pid", value = "RESOURCE_PID", required = true, dataType = "Int", example = "10"),
@ApiImplicitParam(name = "currentDir", value = "RESOURCE_CURRENTDIR", required = true, dataType = "String")
})
@PostMapping(value = "/online-create")
@ApiException(CREATE_RESOURCE_FILE_ON_LINE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result onlineCreateResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") ResourceType type,
@RequestParam(value = "fileName") String fileName,
@RequestParam(value = "suffix") String fileSuffix,
@RequestParam(value = "description", required = false) String description,
@RequestParam(value = "content") String content,
@RequestParam(value = "pid") int pid, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @RequestParam(value = "currentDir") String currentDir
) {
if (StringUtils.isEmpty(content)) {
logger.error("resource file contents are not allowed to be empty");
return error(Status.RESOURCE_FILE_IS_EMPTY.getCode(), RESOURCE_FILE_IS_EMPTY.getMsg());
}
return resourceService.onlineCreateResource(loginUser, type, fileName, fileSuffix, description, content, pid, currentDir);
}
/**
* edit resource file online
*
* @param loginUser login user
* @param resourceId resource id
* @param content content
* @return update result code
*/
@ApiOperation(value = "updateResourceContent", notes = "UPDATE_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100"),
@ApiImplicitParam(name = "content", value = "CONTENT", required = true, dataType = "String")
})
@PutMapping(value = "/{id}/update-content")
@ApiException(EDIT_RESOURCE_FILE_ON_LINE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result updateResourceContent(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int resourceId,
@RequestParam(value = "content") String content
) {
if (StringUtils.isEmpty(content)) {
logger.error("The resource file contents are not allowed to be empty"); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | return error(Status.RESOURCE_FILE_IS_EMPTY.getCode(), RESOURCE_FILE_IS_EMPTY.getMsg());
}
return resourceService.updateResourceContent(resourceId, content);
}
/**
* download resource file
*
* @param loginUser login user
* @param resourceId resource id
* @return resource content
*/
@ApiOperation(value = "downloadResource", notes = "DOWNLOAD_RESOURCE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/{id}/download")
@ResponseBody
@ApiException(DOWNLOAD_RESOURCE_FILE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public ResponseEntity downloadResource(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int resourceId) throws Exception {
Resource file = resourceService.downloadResource(resourceId);
if (file == null) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(Status.RESOURCE_NOT_EXIST.getMsg());
}
return ResponseEntity
.ok()
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + file.getFilename() + "\"")
.body(file);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | /**
* create udf function
*
* @param loginUser login user
* @param type udf type
* @param funcName function name
* @param argTypes argument types
* @param database database
* @param description description
* @param className class name
* @param resourceId resource id
* @return create result code
*/
@ApiOperation(value = "createUdfFunc", notes = "CREATE_UDF_FUNCTION_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "UDF_TYPE", required = true, dataType = "UdfType"),
@ApiImplicitParam(name = "funcName", value = "FUNC_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "className", value = "CLASS_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "argTypes", value = "ARG_TYPES", dataType = "String"),
@ApiImplicitParam(name = "database", value = "DATABASE_NAME", dataType = "String"),
@ApiImplicitParam(name = "description", value = "UDF_DESC", dataType = "String"),
@ApiImplicitParam(name = "resourceId", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
})
@PostMapping(value = "/{resourceId}/udf-func")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(CREATE_UDF_FUNCTION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result createUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "type") UdfType type,
@RequestParam(value = "funcName") String funcName, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @RequestParam(value = "className") String className,
@RequestParam(value = "argTypes", required = false) String argTypes,
@RequestParam(value = "database", required = false) String database,
@RequestParam(value = "description", required = false) String description,
@PathVariable(value = "resourceId") int resourceId) {
return udfFuncService.createUdfFunction(loginUser, funcName, className, argTypes, database, description, type, resourceId);
}
/**
* view udf function
*
* @param loginUser login user
* @param id resource id
* @return udf function detail
*/
@ApiOperation(value = "viewUIUdfFunction", notes = "VIEW_UDF_FUNCTION_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/{id}/udf-func")
@ResponseStatus(HttpStatus.OK)
@ApiException(VIEW_UDF_FUNCTION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result viewUIUdfFunction(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable("id") int id) {
Map<String, Object> map = udfFuncService.queryUdfFuncDetail(id);
return returnDataList(map);
}
/**
* update udf function
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | * @param loginUser login user
* @param type resource type
* @param funcName function name
* @param argTypes argument types
* @param database data base
* @param description description
* @param resourceId resource id
* @param className class name
* @param udfFuncId udf function id
* @return update result code
*/
@ApiOperation(value = "updateUdfFunc", notes = "UPDATE_UDF_FUNCTION_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "UDF_ID", required = true, dataType = "Int"),
@ApiImplicitParam(name = "type", value = "UDF_TYPE", required = true, dataType = "UdfType"),
@ApiImplicitParam(name = "funcName", value = "FUNC_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "className", value = "CLASS_NAME", required = true, dataType = "String"),
@ApiImplicitParam(name = "argTypes", value = "ARG_TYPES", dataType = "String"),
@ApiImplicitParam(name = "database", value = "DATABASE_NAME", dataType = "String"),
@ApiImplicitParam(name = "description", value = "UDF_DESC", dataType = "String"),
@ApiImplicitParam(name = "resourceId", value = "RESOURCE_ID", required = true, dataType = "Int", example = "100")
})
@PutMapping(value = "/{resourceId}/udf-func/{id}")
@ApiException(UPDATE_UDF_FUNCTION_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result updateUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int udfFuncId,
@RequestParam(value = "type") UdfType type,
@RequestParam(value = "funcName") String funcName,
@RequestParam(value = "className") String className, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @RequestParam(value = "argTypes", required = false) String argTypes,
@RequestParam(value = "database", required = false) String database,
@RequestParam(value = "description", required = false) String description,
@PathVariable(value = "resourceId") int resourceId) {
Map<String, Object> result = udfFuncService.updateUdfFunc(udfFuncId, funcName, className, argTypes, database, description, type, resourceId);
return returnDataList(result);
}
/**
* query udf function list paging
*
* @param loginUser login user
* @param searchVal search value
* @param pageNo page number
* @param pageSize page size
* @return udf function list page
*/
@ApiOperation(value = "queryUdfFuncListPaging", notes = "QUERY_UDF_FUNCTION_LIST_PAGING_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "searchVal", value = "SEARCH_VAL", dataType = "String"),
@ApiImplicitParam(name = "pageNo", value = "PAGE_NO", required = true, dataType = "Int", example = "1"),
@ApiImplicitParam(name = "pageSize", value = "PAGE_SIZE", required = true, dataType = "Int", example = "20")
})
@GetMapping(value = "/udf-func")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_UDF_FUNCTION_LIST_PAGING_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result<Object> queryUdfFuncListPaging(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("pageNo") Integer pageNo,
@RequestParam(value = "searchVal", required = false) String searchVal,
@RequestParam("pageSize") Integer pageSize |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | ) {
Result result = checkPageParams(pageNo, pageSize);
if (!result.checkResult()) {
return result;
}
result = udfFuncService.queryUdfFuncListPaging(loginUser, searchVal, pageNo, pageSize);
return result;
}
/**
* query udf func list by type
*
* @param loginUser login user
* @param type resource type
* @return resource list
*/
@ApiOperation(value = "queryUdfFuncList", notes = "QUERY_UDF_FUNC_LIST_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "type", value = "UDF_TYPE", required = true, dataType = "UdfType")
})
@GetMapping(value = "/udf-func/list")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_DATASOURCE_BY_TYPE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result<Object> queryUdfFuncList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("type") UdfType type) {
Map<String, Object> result = udfFuncService.queryUdfFuncList(loginUser, type.ordinal());
return returnDataList(result);
}
/**
* verify udf function name can use or not |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | *
* @param loginUser login user
* @param name name
* @return true if the name can user, otherwise return false
*/
@ApiOperation(value = "verifyUdfFuncName", notes = "VERIFY_UDF_FUNCTION_NAME_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "name", value = "FUNC_NAME", required = true, dataType = "String")
})
@GetMapping(value = "/udf-func/verify-name")
@ResponseStatus(HttpStatus.OK)
@ApiException(VERIFY_UDF_FUNCTION_NAME_ERROR)
@AccessLogAnnotation
public Result verifyUdfFuncName(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam(value = "name") String name
) {
return udfFuncService.verifyUdfFuncByName(name);
}
/**
* delete udf function
*
* @param loginUser login user
* @param udfFuncId udf function id
* @return delete result code
*/
@ApiOperation(value = "deleteUdfFunc", notes = "DELETE_UDF_FUNCTION_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "UDF_FUNC_ID", required = true, dataType = "Int", example = "100")
})
@DeleteMapping(value = "/udf-func/{id}") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @ResponseStatus(HttpStatus.OK)
@ApiException(DELETE_UDF_FUNCTION_ERROR)
@AccessLogAnnotation
public Result deleteUdfFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@PathVariable(value = "id") int udfFuncId
) {
return udfFuncService.delete(udfFuncId);
}
/**
* authorized file resource list
*
* @param loginUser login user
* @param userId user id
* @return authorized result
*/
@ApiOperation(value = "authorizedFile", notes = "AUTHORIZED_FILE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/authed-file")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(AUTHORIZED_FILE_RESOURCE_ERROR)
@AccessLogAnnotation
public Result authorizedFile(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("userId") Integer userId) {
Map<String, Object> result = resourceService.authorizedFile(loginUser, userId);
return returnDataList(result);
}
/**
* unauthorized file resource list |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | *
* @param loginUser login user
* @param userId user id
* @return unauthorized result code
*/
@ApiOperation(value = "authorizeResourceTree", notes = "AUTHORIZE_RESOURCE_TREE_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/authed-resource-tree")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(AUTHORIZE_RESOURCE_TREE)
@AccessLogAnnotation
public Result authorizeResourceTree(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("userId") Integer userId) {
Map<String, Object> result = resourceService.authorizeResourceTree(loginUser, userId);
return returnDataList(result);
}
/**
* unauthorized udf function
*
* @param loginUser login user
* @param userId user id
* @return unauthorized result code
*/
@ApiOperation(value = "unauthUDFFunc", notes = "UNAUTHORIZED_UDF_FUNC_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/unauth-udf-func") |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ResourcesController.java | @ResponseStatus(HttpStatus.CREATED)
@ApiException(UNAUTHORIZED_UDF_FUNCTION_ERROR)
@AccessLogAnnotation
public Result unauthUDFFunc(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("userId") Integer userId) {
Map<String, Object> result = resourceService.unauthorizedUDFFunction(loginUser, userId);
return returnDataList(result);
}
/**
* authorized udf function
*
* @param loginUser login user
* @param userId user id
* @return authorized result code
*/
@ApiOperation(value = "authUDFFunc", notes = "AUTHORIZED_UDF_FUNC_NOTES")
@ApiImplicitParams({
@ApiImplicitParam(name = "userId", value = "USER_ID", required = true, dataType = "Int", example = "100")
})
@GetMapping(value = "/authed-udf-func")
@ResponseStatus(HttpStatus.CREATED)
@ApiException(AUTHORIZED_UDF_FUNCTION_ERROR)
@AccessLogAnnotation
public Result authorizedUDFFunction(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("userId") Integer userId) {
Map<String, Object> result = resourceService.authorizedUDFFunction(loginUser, userId);
return returnDataList(result);
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java | /*
* 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.
*/
package org.apache.dolphinscheduler.api.service;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.enums.ProgramType;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.spi.enums.ResourceType;
import java.io.IOException;
import java.util.Map;
import org.springframework.web.multipart.MultipartFile;
/**
* resources service
*/
public interface ResourcesService { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java | /**
* create directory
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java | * @param loginUser login user
* @param name alias
* @param description description
* @param type type
* @param pid parent id
* @param currentDir current directory
* @return create directory result
*/
Result<Object> createDirectory(User loginUser,
String name,
String description,
ResourceType type,
int pid,
String currentDir);
/**
* create resource
*
* @param loginUser login user
* @param name alias
* @param desc description
* @param file file
* @param type type
* @param pid parent id
* @param currentDir current directory
* @return create result code
*/
Result<Object> createResource(User loginUser,
String name,
String desc,
ResourceType type, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java | MultipartFile file,
int pid,
String currentDir);
/**
* update resource
* @param loginUser login user
* @param resourceId resource id
* @param name name
* @param desc description
* @param type resource type
* @param file resource file
* @return update result code
*/
Result<Object> updateResource(User loginUser,
int resourceId,
String name,
String desc,
ResourceType type,
MultipartFile file);
/**
* query resources list paging
*
* @param loginUser login user
* @param type resource type
* @param searchVal search value
* @param pageNo page number
* @param pageSize page size
* @return resource list page
*/
Result queryResourceListPaging(User loginUser, int directoryId, ResourceType type, String searchVal, Integer pageNo, Integer pageSize); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java | /**
* query resource list
*
* @param loginUser login user
* @param type resource type
* @return resource list
*/
Map<String, Object> queryResourceList(User loginUser, ResourceType type);
/**
* query resource list by program type
*
* @param loginUser login user
* @param type resource type
* @return resource list
*/
Map<String, Object> queryResourceByProgramType(User loginUser, ResourceType type, ProgramType programType);
/**
* delete resource
*
* @param loginUser login user
* @param resourceId resource id
* @return delete result code
* @throws IOException exception
*/
Result<Object> delete(User loginUser, int resourceId) throws IOException;
/**
* verify resource by name and type
* @param loginUser login user
* @param fullName resource full name
* @param type resource type |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java | * @return true if the resource name not exists, otherwise return false
*/
Result<Object> verifyResourceName(String fullName, ResourceType type,User loginUser);
/**
* verify resource by full name or pid and type
* @param fullName resource full name
* @param id resource id
* @param type resource type
* @return true if the resource full name or pid not exists, otherwise return false
*/
Result<Object> queryResource(String fullName,Integer id,ResourceType type);
/**
* view resource file online
*
* @param resourceId resource id
* @param skipLineNum skip line number
* @param limit limit
* @return resource content
*/
Result<Object> readResource(int resourceId, int skipLineNum, int limit);
/**
* create resource file online
*
* @param loginUser login user
* @param type resource type
* @param fileName file name
* @param fileSuffix file suffix
* @param desc description
* @param content content
* @return create result code |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java | */
Result<Object> onlineCreateResource(User loginUser, ResourceType type, String fileName, String fileSuffix, String desc, String content,int pid,String currentDirectory);
/**
* updateProcessInstance resource
*
* @param resourceId resource id
* @param content content
* @return update result cod
*/
Result<Object> updateResourceContent(int resourceId, String content);
/**
* download file
*
* @param resourceId resource id
* @return resource content
* @throws IOException exception
*/
org.springframework.core.io.Resource downloadResource(int resourceId) throws IOException;
/**
* list all file
*
* @param loginUser login user
* @param userId user id
* @return unauthorized result code
*/
Map<String, Object> authorizeResourceTree(User loginUser, Integer userId);
/**
* unauthorized file
*
* @param loginUser login user |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ResourcesService.java | * @param userId user id
* @return unauthorized result code
*/
Map<String, Object> unauthorizedFile(User loginUser, Integer userId);
/**
* unauthorized udf function
*
* @param loginUser login user
* @param userId user id
* @return unauthorized result code
*/
Map<String, Object> unauthorizedUDFFunction(User loginUser, Integer userId);
/**
* authorized udf function
*
* @param loginUser login user
* @param userId user id
* @return authorized result code
*/
Map<String, Object> authorizedUDFFunction(User loginUser, Integer userId);
/**
* authorized file
*
* @param loginUser login user
* @param userId user id
* @return authorized result
*/
Map<String, Object> authorizedFile(User loginUser, Integer userId);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | /*
* 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.
*/
package org.apache.dolphinscheduler.api.service.impl;
import static org.apache.dolphinscheduler.common.Constants.ALIAS;
import static org.apache.dolphinscheduler.common.Constants.CONTENT;
import static org.apache.dolphinscheduler.common.Constants.JAR;
import org.apache.dolphinscheduler.api.dto.resources.ResourceComponent;
import org.apache.dolphinscheduler.api.dto.resources.filter.ResourceFilter;
import org.apache.dolphinscheduler.api.dto.resources.visitor.ResourceTreeVisitor;
import org.apache.dolphinscheduler.api.dto.resources.visitor.Visitor;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.exceptions.ServiceException;
import org.apache.dolphinscheduler.api.service.ResourcesService;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.RegexUtils; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.ProgramType;
import org.apache.dolphinscheduler.spi.enums.ResourceType;
import org.apache.dolphinscheduler.common.utils.FileUtils;
import org.apache.dolphinscheduler.common.utils.HadoopUtils;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
import org.apache.dolphinscheduler.dao.entity.Resource;
import org.apache.dolphinscheduler.dao.entity.ResourcesUser;
import org.apache.dolphinscheduler.dao.entity.Tenant;
import org.apache.dolphinscheduler.dao.entity.UdfFunc;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ResourceMapper;
import org.apache.dolphinscheduler.dao.mapper.ResourceUserMapper;
import org.apache.dolphinscheduler.dao.mapper.TenantMapper;
import org.apache.dolphinscheduler.dao.mapper.UdfFuncMapper;
import org.apache.dolphinscheduler.dao.mapper.UserMapper;
import org.apache.dolphinscheduler.dao.utils.ResourceProcessDefinitionUtils;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.google.common.io.Files;
/**
* resources service impl
*/
@Service
public class ResourcesServiceImpl extends BaseServiceImpl implements ResourcesService {
private static final Logger logger = LoggerFactory.getLogger(ResourcesServiceImpl.class);
@Autowired
private ResourceMapper resourcesMapper;
@Autowired
private UdfFuncMapper udfFunctionMapper;
@Autowired
private TenantMapper tenantMapper; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | @Autowired
private UserMapper userMapper;
@Autowired
private ResourceUserMapper resourceUserMapper;
@Autowired
private ProcessDefinitionMapper processDefinitionMapper;
/**
* create directory
*
* @param loginUser login user
* @param name alias
* @param description description
* @param type type
* @param pid parent id
* @param currentDir current directory
* @return create directory result
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Result<Object> createDirectory(User loginUser,
String name,
String description,
ResourceType type,
int pid,
String currentDir) {
Result<Object> result = checkResourceUploadStartupState();
if (!result.getCode().equals(Status.SUCCESS.getCode())) {
return result;
}
String fullName = currentDir.equals("/") ? String.format("%s%s",currentDir,name) : String.format("%s/%s",currentDir,name); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | result = verifyResource(loginUser, type, fullName, pid);
if (!result.getCode().equals(Status.SUCCESS.getCode())) {
return result;
}
if (checkResourceExists(fullName, type.ordinal())) {
logger.error("resource directory {} has exist, can't recreate", fullName);
putMsg(result, Status.RESOURCE_EXIST);
return result;
}
Date now = new Date();
Resource resource = new Resource(pid,name,fullName,true,description,name,loginUser.getId(),type,0,now,now);
try {
resourcesMapper.insert(resource);
putMsg(result, Status.SUCCESS);
Map<Object, Object> dataMap = new BeanMap(resource);
Map<String, Object> resultMap = new HashMap<>();
for (Map.Entry<Object, Object> entry: dataMap.entrySet()) {
if (!"class".equalsIgnoreCase(entry.getKey().toString())) {
resultMap.put(entry.getKey().toString(), entry.getValue());
}
}
result.setData(resultMap);
} catch (DuplicateKeyException e) {
logger.error("resource directory {} has exist, can't recreate", fullName);
putMsg(result, Status.RESOURCE_EXIST);
return result;
} catch (Exception e) {
logger.error("resource already exists, can't recreate ", e);
throw new ServiceException("resource already exists, can't recreate");
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | createDirectory(loginUser,fullName,type,result);
return result;
}
/**
* create resource
*
* @param loginUser login user
* @param name alias
* @param desc description
* @param file file
* @param type type
* @param pid parent id
* @param currentDir current directory
* @return create result code
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Result<Object> createResource(User loginUser,
String name,
String desc,
ResourceType type,
MultipartFile file,
int pid,
String currentDir) {
Result<Object> result = checkResourceUploadStartupState();
if (!result.getCode().equals(Status.SUCCESS.getCode())) {
return result;
}
result = verifyPid(loginUser, pid); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | if (!result.getCode().equals(Status.SUCCESS.getCode())) {
return result;
}
result = verifyFile(name, type, file);
if (!result.getCode().equals(Status.SUCCESS.getCode())) {
return result;
}
String fullName = currentDir.equals("/") ? String.format("%s%s",currentDir,name) : String.format("%s/%s",currentDir,name);
if (checkResourceExists(fullName, type.ordinal())) {
logger.error("resource {} has exist, can't recreate", RegexUtils.escapeNRT(name));
putMsg(result, Status.RESOURCE_EXIST);
return result;
}
Date now = new Date();
Resource resource = new Resource(pid,name,fullName,false,desc,file.getOriginalFilename(),loginUser.getId(),type,file.getSize(),now,now);
try {
resourcesMapper.insert(resource);
putMsg(result, Status.SUCCESS);
Map<Object, Object> dataMap = new BeanMap(resource);
Map<String, Object> resultMap = new HashMap<>();
for (Map.Entry<Object, Object> entry: dataMap.entrySet()) {
if (!"class".equalsIgnoreCase(entry.getKey().toString())) {
resultMap.put(entry.getKey().toString(), entry.getValue());
}
}
result.setData(resultMap);
} catch (Exception e) {
logger.error("resource already exists, can't recreate ", e);
throw new ServiceException("resource already exists, can't recreate"); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | }
if (!upload(loginUser, fullName, file, type)) {
logger.error("upload resource: {} file: {} failed.", RegexUtils.escapeNRT(name), RegexUtils.escapeNRT(file.getOriginalFilename()));
putMsg(result, Status.HDFS_OPERATION_ERROR);
throw new ServiceException(String.format("upload resource: %s file: %s failed.", name, file.getOriginalFilename()));
}
return result;
}
/**
* check resource is exists
*
* @param fullName fullName
* @param type type
* @return true if resource exists
*/
private boolean checkResourceExists(String fullName, int type) {
Boolean existResource = resourcesMapper.existResource(fullName, type);
return existResource == Boolean.TRUE;
}
/**
* update resource
* @param loginUser login user
* @param resourceId resource id
* @param name name
* @param desc description
* @param type resource type
* @param file resource file
* @return update result code
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | @Override
@Transactional(rollbackFor = Exception.class)
public Result<Object> updateResource(User loginUser,
int resourceId,
String name,
String desc,
ResourceType type,
MultipartFile file) {
Result<Object> result = checkResourceUploadStartupState();
if (!result.getCode().equals(Status.SUCCESS.getCode())) {
return result;
}
Resource resource = resourcesMapper.selectById(resourceId);
if (resource == null) {
putMsg(result, Status.RESOURCE_NOT_EXIST);
return result;
}
if (!hasPerm(loginUser, resource.getUserId())) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
if (file == null && name.equals(resource.getAlias()) && desc.equals(resource.getDescription())) {
putMsg(result, Status.SUCCESS);
return result;
}
String originFullName = resource.getFullName();
String originResourceName = resource.getAlias();
String fullName = String.format("%s%s",originFullName.substring(0,originFullName.lastIndexOf("/") + 1),name);
if (!originResourceName.equals(name) && checkResourceExists(fullName, type.ordinal())) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | logger.error("resource {} already exists, can't recreate", name);
putMsg(result, Status.RESOURCE_EXIST);
return result;
}
result = verifyFile(name, type, file);
if (!result.getCode().equals(Status.SUCCESS.getCode())) {
return result;
}
String tenantCode = getTenantCode(resource.getUserId(),result);
if (StringUtils.isEmpty(tenantCode)) {
return result;
}
String originHdfsFileName = HadoopUtils.getHdfsFileName(resource.getType(),tenantCode,originFullName);
try {
if (!HadoopUtils.getInstance().exists(originHdfsFileName)) {
logger.error("{} not exist", originHdfsFileName);
putMsg(result,Status.RESOURCE_NOT_EXIST);
return result;
}
} catch (IOException e) {
logger.error(e.getMessage(),e);
throw new ServiceException(Status.HDFS_OPERATION_ERROR);
}
if (!resource.isDirectory()) {
String originSuffix = Files.getFileExtension(originFullName);
String suffix = Files.getFileExtension(fullName); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | boolean suffixIsChanged = false;
if (StringUtils.isBlank(suffix) && StringUtils.isNotBlank(originSuffix)) {
suffixIsChanged = true;
}
if (StringUtils.isNotBlank(suffix) && !suffix.equals(originSuffix)) {
suffixIsChanged = true;
}
if (suffixIsChanged) {
Map<String, Object> columnMap = new HashMap<>();
columnMap.put("resources_id", resourceId);
List<ResourcesUser> resourcesUsers = resourceUserMapper.selectByMap(columnMap);
if (CollectionUtils.isNotEmpty(resourcesUsers)) {
List<Integer> userIds = resourcesUsers.stream().map(ResourcesUser::getUserId).collect(Collectors.toList());
List<User> users = userMapper.selectBatchIds(userIds);
String userNames = users.stream().map(User::getUserName).collect(Collectors.toList()).toString();
logger.error("resource is authorized to user {},suffix not allowed to be modified", userNames);
putMsg(result,Status.RESOURCE_IS_AUTHORIZED,userNames);
return result;
}
}
}
Date now = new Date();
resource.setAlias(name);
resource.setFileName(name);
resource.setFullName(fullName);
resource.setDescription(desc);
resource.setUpdateTime(now); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | if (file != null) {
resource.setSize(file.getSize());
}
try {
resourcesMapper.updateById(resource);
if (resource.isDirectory()) {
List<Integer> childrenResource = listAllChildren(resource,false);
if (CollectionUtils.isNotEmpty(childrenResource)) {
String matcherFullName = Matcher.quoteReplacement(fullName);
List<Resource> childResourceList;
Integer[] childResIdArray = childrenResource.toArray(new Integer[childrenResource.size()]);
List<Resource> resourceList = resourcesMapper.listResourceByIds(childResIdArray);
childResourceList = resourceList.stream().map(t -> {
t.setFullName(t.getFullName().replaceFirst(originFullName, matcherFullName));
t.setUpdateTime(now);
return t;
}).collect(Collectors.toList());
resourcesMapper.batchUpdateResource(childResourceList);
if (ResourceType.UDF.equals(resource.getType())) {
List<UdfFunc> udfFuncs = udfFunctionMapper.listUdfByResourceId(childResIdArray);
if (CollectionUtils.isNotEmpty(udfFuncs)) {
udfFuncs = udfFuncs.stream().map(t -> {
t.setResourceName(t.getResourceName().replaceFirst(originFullName, matcherFullName));
t.setUpdateTime(now);
return t;
}).collect(Collectors.toList());
udfFunctionMapper.batchUpdateUdfFunc(udfFuncs);
}
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | } else if (ResourceType.UDF.equals(resource.getType())) {
List<UdfFunc> udfFuncs = udfFunctionMapper.listUdfByResourceId(new Integer[]{resourceId});
if (CollectionUtils.isNotEmpty(udfFuncs)) {
udfFuncs = udfFuncs.stream().map(t -> {
t.setResourceName(fullName);
t.setUpdateTime(now);
return t;
}).collect(Collectors.toList());
udfFunctionMapper.batchUpdateUdfFunc(udfFuncs);
}
}
putMsg(result, Status.SUCCESS);
Map<Object, Object> dataMap = new BeanMap(resource);
Map<String, Object> resultMap = new HashMap<>();
for (Map.Entry<Object, Object> entry: dataMap.entrySet()) {
if (!Constants.CLASS.equalsIgnoreCase(entry.getKey().toString())) {
resultMap.put(entry.getKey().toString(), entry.getValue());
}
}
result.setData(resultMap);
} catch (Exception e) {
logger.error(Status.UPDATE_RESOURCE_ERROR.getMsg(), e);
throw new ServiceException(Status.UPDATE_RESOURCE_ERROR);
}
if (originResourceName.equals(name) && file == null) {
return result;
}
if (file != null) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | if (!upload(loginUser, fullName, file, type)) {
logger.error("upload resource: {} file: {} failed.", name, RegexUtils.escapeNRT(file.getOriginalFilename()));
putMsg(result, Status.HDFS_OPERATION_ERROR);
throw new ServiceException(String.format("upload resource: %s file: %s failed.", name, file.getOriginalFilename()));
}
if (!fullName.equals(originFullName)) {
try {
HadoopUtils.getInstance().delete(originHdfsFileName,false);
} catch (IOException e) {
logger.error(e.getMessage(),e);
throw new ServiceException(String.format("delete resource: %s failed.", originFullName));
}
}
return result;
}
String destHdfsFileName = HadoopUtils.getHdfsFileName(resource.getType(),tenantCode,fullName);
try {
logger.info("start hdfs copy {} -> {}", originHdfsFileName, destHdfsFileName);
HadoopUtils.getInstance().copy(originHdfsFileName, destHdfsFileName, true, true);
} catch (Exception e) {
logger.error(MessageFormat.format("hdfs copy {0} -> {1} fail", originHdfsFileName, destHdfsFileName), e);
putMsg(result,Status.HDFS_COPY_FAIL);
throw new ServiceException(Status.HDFS_COPY_FAIL);
}
return result;
}
private Result<Object> verifyFile(String name, ResourceType type, MultipartFile file) {
Result<Object> result = new Result<>();
putMsg(result, Status.SUCCESS); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | if (file != null) {
if (file.isEmpty()) {
logger.error("file is empty: {}", RegexUtils.escapeNRT(file.getOriginalFilename()));
putMsg(result, Status.RESOURCE_FILE_IS_EMPTY);
return result;
}
String fileSuffix = Files.getFileExtension(file.getOriginalFilename());
String nameSuffix = Files.getFileExtension(name);
if (!(StringUtils.isNotEmpty(fileSuffix) && fileSuffix.equalsIgnoreCase(nameSuffix))) {
logger.error("rename file suffix and original suffix must be consistent: {}", RegexUtils.escapeNRT(file.getOriginalFilename()));
putMsg(result, Status.RESOURCE_SUFFIX_FORBID_CHANGE);
return result;
}
if (Constants.UDF.equals(type.name()) && !JAR.equalsIgnoreCase(fileSuffix)) {
logger.error(Status.UDF_RESOURCE_SUFFIX_NOT_JAR.getMsg());
putMsg(result, Status.UDF_RESOURCE_SUFFIX_NOT_JAR);
return result;
}
if (file.getSize() > Constants.MAX_FILE_SIZE) {
logger.error("file size is too large: {}", RegexUtils.escapeNRT(file.getOriginalFilename()));
putMsg(result, Status.RESOURCE_SIZE_EXCEED_LIMIT);
return result;
}
}
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 8,836 | [Bug][UI Next][V1.0.0-Alpha] create directory/file path wrong | ### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
### What happened

### What you expected to happen
above.
### How to reproduce
create index folder ```test2``` in root path. And then entering the ```test2``` folder. And then create folder ```test1```. And then returning to the root path. And then create folder ```test2``` success.
In the same path can not contain two identical file/folder.
There are two issues:
1. Send request path error while creating folder
2. Folder hierarchy display error
### Anything else
_No response_
### Version
dev
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
| https://github.com/apache/dolphinscheduler/issues/8836 | https://github.com/apache/dolphinscheduler/pull/8892 | db64dcade8446267bce7423940f133492c07eaac | c7e80e42d79f56e237d296d430386860724588ff | 2022-03-11T08:33:58Z | java | 2022-03-15T06:19:19Z | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ResourcesServiceImpl.java | }
/**
* query resources list paging
*
* @param loginUser login user
* @param type resource type
* @param searchVal search value
* @param pageNo page number
* @param pageSize page size
* @return resource list page
*/
@Override
public Result queryResourceListPaging(User loginUser, int directoryId, ResourceType type, String searchVal, Integer pageNo, Integer pageSize) {
Result result = new Result();
Page<Resource> page = new Page<>(pageNo, pageSize);
int userId = loginUser.getId();
if (isAdmin(loginUser)) {
userId = 0;
}
if (directoryId != -1) {
Resource directory = resourcesMapper.selectById(directoryId);
if (directory == null) {
putMsg(result, Status.RESOURCE_NOT_EXIST);
return result;
}
}
List<Integer> resourcesIds = resourceUserMapper.queryResourcesIdListByUserIdAndPerm(userId, 0);
IPage<Resource> resourceIPage = resourcesMapper.queryResourcePaging(page, userId, directoryId, type.ordinal(), searchVal,resourcesIds);
PageInfo<Resource> pageInfo = new PageInfo<>(pageNo, pageSize);
pageInfo.setTotal((int)resourceIPage.getTotal()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.