You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "FalconSL (via GitHub)" <gi...@apache.org> on 2024/04/28 13:25:25 UTC
[PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
FalconSL opened a new pull request, #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933
<!--Thanks very much for contributing to Apache DolphinScheduler, we are happy that you want to help us improve DolphinScheduler! -->
## Purpose of the pull request
<!--(For example: This pull request adds checkstyle plugin).-->
## Brief change log
The version identifier of dolphinscheduler cannot be found on the UI. Please add the current version identifier on the UI.
在WEB 的UI界面上 无法找到当前运行的 dolphinscheduler 版本信息,无法确定当前运行的版本。
## Verify this pull request
<!--*(Please pick either of the following options)*-->
This pull request is code cleanup without any test coverage.
*(or)*
This pull request is already covered by existing tests, such as *(please describe tests)*.
(or)
This change added tests and can be verified as follows:
**at testQueryProductInfo() method of UiPluginControllerTest class**
(or)
If your pull request contain incompatible change, you should also add it to `docs/docs/en/guide/upgrede/incompatible.md`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "pusl6 (via GitHub)" <gi...@apache.org>.
pusl6 commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1617027966
##########
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/UiPluginControllerTest.java:
##########
@@ -53,6 +63,8 @@ public class UiPluginControllerTest extends AbstractControllerTest {
private static final ImmutableMap<String, Object> uiPluginServiceResult =
ImmutableMap.of(Constants.STATUS, Status.SUCCESS, Constants.DATA_LIST, "Test Data");
+ private static final Logger logger = LoggerFactory.getLogger(TenantControllerTest.class);
+
Review Comment:
>
Okay, I have removed the code from the places you mentioned
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2082126514
> > The front-end code has also been completed and will be submitted after the back-end is error free
>
> Features like this need to be committed at both the backend and frontend.
+1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1593439147
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java:
##########
@@ -85,4 +89,22 @@ public Result queryUiPluginDetailById(@Parameter(hidden = true) @RequestAttribut
Map<String, Object> result = uiPluginService.queryUiPluginDetailById(pluginId);
return returnDataList(result);
}
+
+ /**
+ * obtain project version and address
+ *
+// * @param loginUser login user
+// * @param userId token for user
+ * @return product info
+ */
+ @Operation(summary = "queryProductInfo", description = "QUERY_PRODUCT_INFO")
+ @PostMapping(value = "/queryProductInfo")
+ @ResponseStatus(HttpStatus.OK)
+ @ApiException(VERSION_INFO_STATE_ERROR)
+ public Result<ProductInfoDto> queryProductInfo(
+ @Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
+ @RequestParam(value = "userId") Integer userId) {
+ ProductInfoDto result = uiPluginService.queryProductInfo(loginUser, userId);
+ return Result.success(result);
Review Comment:
```suggestion
public Result<ProductInfoDto> queryProductInfo(
@Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) {
ProductInfoDto result = uiPluginService.queryProductInfo(loginUser);
return Result.success(result);
```
##########
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/UiPluginControllerTest.java:
##########
@@ -91,4 +103,31 @@ public void testQueryUiPluginDetailById() throws Exception {
JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
assertThat(actualResponseContent.toString()).isEqualTo(expectResponseContent.toString());
}
+
+ @Test
+ public void testQueryProductInfo() throws Exception {
+ ProductInfoDto mockResult = new ProductInfoDto();
+ Mockito.when(uiPluginService.queryProductInfo(Mockito.any(), Mockito.anyInt())).thenReturn(mockResult);
+
+ MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+ paramsMap.add("userId", "1");
+
+ MvcResult mvcResult = mockMvc.perform(post("/ui-plugins/queryProductInfo")
+ .header(SESSION_ID, sessionId)
+ .params(paramsMap))
+ .andExpect(status().isOk())
+ .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+ .andReturn();
+
+ Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
+ Assertions.assertEquals(Status.SUCCESS.getCode(), result.getCode().intValue());
+ logger.info(mvcResult.getResponse().getContentAsString());
Review Comment:
Don't use log in UT
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UiPluginServiceImpl.java:
##########
@@ -82,4 +92,24 @@ public Map<String, Object> queryUiPluginDetailById(int id) {
return result;
}
+ @Override
+ public ProductInfoDto queryProductInfo(User loginUser, int userId) {
+
+ // check if user is existed
+ if (userId <= 0 || !(loginUser.getId() == userId)) {
+ throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR,
+ "User id: " + userId + " should not less than or equals to 0.");
+ }
+ // persist to the database
+ DsVersion dsVersion = dsVersionMapper.selectById(1);
+
+ if(StringUtils.isBlank(dsVersion.getVersion())){
+ throw new ServiceException(Status.VERSION_INFO_STATE_ERROR);
+ }
+ ProductInfoDto result = new ProductInfoDto();
+ result.setId(dsVersion.getId());
+ result.setVersion(dsVersion.getVersion());
+ return result;
Review Comment:
Don't query the version by id, id might changed.
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UiPluginService.java:
##########
@@ -30,4 +32,6 @@ public interface UiPluginService {
Map<String, Object> queryUiPluginDetailById(int id);
+ ProductInfoDto queryProductInfo(User loginUser, int userId);
+
Review Comment:
It's weird that there exists a method `queryProductInfo` in uiPluginServer.
##########
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/UiPluginControllerTest.java:
##########
@@ -91,4 +103,31 @@ public void testQueryUiPluginDetailById() throws Exception {
JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
assertThat(actualResponseContent.toString()).isEqualTo(expectResponseContent.toString());
}
+
+ @Test
+ public void testQueryProductInfo() throws Exception {
+ ProductInfoDto mockResult = new ProductInfoDto();
+ Mockito.when(uiPluginService.queryProductInfo(Mockito.any(), Mockito.anyInt())).thenReturn(mockResult);
+
+ MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+ paramsMap.add("userId", "1");
+
+ MvcResult mvcResult = mockMvc.perform(post("/ui-plugins/queryProductInfo")
+ .header(SESSION_ID, sessionId)
+ .params(paramsMap))
+ .andExpect(status().isOk())
+ .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+ .andReturn();
+
+ Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
+ Assertions.assertEquals(Status.SUCCESS.getCode(), result.getCode().intValue());
+ logger.info(mvcResult.getResponse().getContentAsString());
+ }
+
+ private User getLoginUser() {
+ User user = new User();
+ user.setId(1);
+ user.setUserName("admin");
+ return user;
+ }
Review Comment:
Don't add useless code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "caishunfeng (via GitHub)" <gi...@apache.org>.
caishunfeng commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1597414527
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java:
##########
@@ -85,4 +89,21 @@ public Result queryUiPluginDetailById(@Parameter(hidden = true) @RequestAttribut
Map<String, Object> result = uiPluginService.queryUiPluginDetailById(pluginId);
return returnDataList(result);
}
+
+ /**
+ * obtain project version and address
+ *
+// * @param loginUser login user
+// * @param userId token for user
Review Comment:
```suggestion
```
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UiPluginServiceImpl.java:
##########
@@ -45,6 +53,14 @@ public class UiPluginServiceImpl extends BaseServiceImpl implements UiPluginServ
@Autowired
PluginDefineMapper pluginDefineMapper;
+ @Autowired
+ DsVersionMapper dsVersionMapper;
+
+ @Autowired
+ private DsVersionDao dsVersionDao;
Review Comment:
It's better to use dao in service but not mapper.
```suggestion
@Autowired
private DsVersionDao dsVersionDao;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "pusl6 (via GitHub)" <gi...@apache.org>.
pusl6 commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1625732094
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/ProductInfoDto.java:
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * ProductInfoDto
+ */
Review Comment:
>
My original idea for the throw code was to report errors when there is data but the version field is empty or null
Based on your proposal, I have made the following changes:
1. Remove error prompts and directly display unknown when missing data
2. Modify API URL path
3. Remove method comments

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2169117888
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15933&resolved=false&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15933&resolutions=WONTFIX)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15933&resolved=false&sinceLeakPeriod=true)
 [62.5% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15933&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15933&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "FalconSL (via GitHub)" <gi...@apache.org>.
FalconSL commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2111696916
> Personally, I feel that there is no need to use a separate page to display the current version. You can put the version information at the top of this drop-down menu.
Okay, I have removed the unused front-end references. According to my original plan, after completing the version function, document help, problem report submission, policy instructions, and service terms will also be placed on this page. If the version information is placed separately in the homepage column and other functions are added, it will appear crowded
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1609639575
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java:
##########
@@ -85,4 +89,18 @@ public Result queryUiPluginDetailById(@Parameter(hidden = true) @RequestAttribut
Map<String, Object> result = uiPluginService.queryUiPluginDetailById(pluginId);
return returnDataList(result);
}
+
+ /**
+ * obtain project version and address
+ * @return product info
+ */
+ @Operation(summary = "queryProductInfo", description = "QUERY_PRODUCT_INFO")
+ @PostMapping(value = "/queryProductInfo")
Review Comment:
Please use GetMapping
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UiPluginServiceImpl.java:
##########
@@ -82,4 +94,18 @@ public Map<String, Object> queryUiPluginDetailById(int id) {
return result;
}
+ @Override
+ public ProductInfoDto queryProductInfo(User loginUser) {
+
+ // persist to the database
+ dsVersion = dsVersionDao.selectVersion().map(DsVersion::getVersion).orElse("unknown");
+
Review Comment:
These seems never changed, so it would be better to query only once when the api startup, this can reduce a lot of db query.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1618090679
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java:
##########
@@ -85,4 +89,18 @@
Map<String, Object> result = uiPluginService.queryUiPluginDetailById(pluginId);
return returnDataList(result);
}
+
+ /**
+ * obtain project version and address
+ * @return product info
+ */
+ @Operation(summary = "queryProductInfo", description = "QUERY_PRODUCT_INFO")
+ @GetMapping(value = "/queryProductInfo")
+ @ResponseStatus(HttpStatus.OK)
+ @ApiException(VERSION_INFO_STATE_ERROR)
+ public Result<ProductInfoDto> queryProductInfo(
+ @Parameter(hidden = true) @RequestAttribute(value = Constants.SESSION_USER) User loginUser) {
Review Comment:
## Useless parameter
The parameter 'loginUser' is never used.
[Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/4160)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1631635938
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java:
##########
@@ -27,22 +29,24 @@
import org.apache.dolphinscheduler.dao.entity.User;
import java.util.Map;
-
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-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.ResponseStatus;
-import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestAttribute;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import static org.apache.dolphinscheduler.api.enums.Status.*;
Review Comment:
Please use mvn spotless:apply to fix these.
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/ProductInfoDto.java:
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * ProductInfoDto
+ */
Review Comment:
This comment is meaningless, you need to remove.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2165581265
## [Codecov](https://app.codecov.io/gh/apache/dolphinscheduler/pull/15933?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
Attention: Patch coverage is `62.50000%` with `3 lines` in your changes missing coverage. Please review.
> Project coverage is 40.71%. Comparing base [(`8e53f2f`)](https://app.codecov.io/gh/apache/dolphinscheduler/commit/8e53f2fdcbd8dbb7ed745f814ea1bbf5627c9251?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`3988a06`)](https://app.codecov.io/gh/apache/dolphinscheduler/commit/3988a062fe399fa0d7794477c7a555b64b5d2f90?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
> :exclamation: **Current head 3988a06 differs from pull request most recent head c05fad8**
>
> Please [upload](https://docs.codecov.com/docs/codecov-uploader) reports for the commit c05fad8 to get more accurate results.
| [Files](https://app.codecov.io/gh/apache/dolphinscheduler/pull/15933?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [...cheduler/api/service/impl/UiPluginServiceImpl.java](https://app.codecov.io/gh/apache/dolphinscheduler/pull/15933?src=pr&el=tree&filepath=dolphinscheduler-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fdolphinscheduler%2Fapi%2Fservice%2Fimpl%2FUiPluginServiceImpl.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9VaVBsdWdpblNlcnZpY2VJbXBsLmphdmE=) | 40.00% | [3 Missing :warning: ](https://app.codecov.io/gh/apache/dolphinscheduler/pull/15933?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## dev #15933 +/- ##
=========================================
Coverage 40.71% 40.71%
- Complexity 5247 5248 +1
=========================================
Files 1385 1385
Lines 46109 46117 +8
Branches 4923 4923
=========================================
+ Hits 18772 18776 +4
- Misses 25412 25415 +3
- Partials 1925 1926 +1
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dolphinscheduler/pull/15933?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2165602208
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15933&resolved=false&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15933&resolutions=WONTFIX)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15933&resolved=false&sinceLeakPeriod=true)
 [62.5% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15933&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15933&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "pusl6 (via GitHub)" <gi...@apache.org>.
pusl6 commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2175076787
> Some NIP, it's not a good idea to add a unknown version here, version is a must.
Thanks. In the scenario, unless the database version is empty, there will be no unknown
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "FalconSL (via GitHub)" <gi...@apache.org>.
FalconSL commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1597415772
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UiPluginServiceImpl.java:
##########
@@ -45,6 +53,14 @@ public class UiPluginServiceImpl extends BaseServiceImpl implements UiPluginServ
@Autowired
PluginDefineMapper pluginDefineMapper;
+ @Autowired
+ DsVersionMapper dsVersionMapper;
+
+ @Autowired
+ private DsVersionDao dsVersionDao;
Review Comment:
> It's better to use dao in service but not mapper.
You are right. The actual method used is dsVersionDao, which was not deleted during the last modification. I will delete it immediately

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1625479118
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java:
##########
@@ -85,4 +89,17 @@ public Result queryUiPluginDetailById(@Parameter(hidden = true) @RequestAttribut
Map<String, Object> result = uiPluginService.queryUiPluginDetailById(pluginId);
return returnDataList(result);
}
+
+ /**
+ * obtain project version and address
+ * @return product info
+ */
+ @Operation(summary = "queryProductInfo", description = "QUERY_PRODUCT_INFO")
+ @GetMapping(value = "/queryProductInfo")
Review Comment:
```suggestion
@GetMapping(value = "/query-product-info")
```
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UiPluginServiceImpl.java:
##########
@@ -45,6 +54,19 @@ public class UiPluginServiceImpl extends BaseServiceImpl implements UiPluginServ
@Autowired
PluginDefineMapper pluginDefineMapper;
+ @Autowired
+ private DsVersionDao dsVersionDao;
+
+ private String dsVersion;
+
+ @PostConstruct
+ private void init() {
+ dsVersion = dsVersionDao.selectVersion().map(DsVersion::getVersion).orElse("unknown");
+ if(StringUtils.isBlank(dsVersion)){
+ throw new ServiceException(Status.VERSION_INFO_STATE_ERROR);
+ }
Review Comment:
This is strange, if the t_ds_version is empty will use unknown, but if the version empty will throw exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "pusl6 (via GitHub)" <gi...@apache.org>.
pusl6 commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1637985552
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java:
##########
@@ -27,22 +29,24 @@
import org.apache.dolphinscheduler.dao.entity.User;
import java.util.Map;
-
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-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.ResponseStatus;
-import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestAttribute;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import static org.apache.dolphinscheduler.api.enums.Status.*;
Review Comment:
Okay, I have executed it as required
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2081817530
> The front-end code has also been completed and will be submitted after the back-end is error free
Features like this need to be committed at both the backend and frontend.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "FalconSL (via GitHub)" <gi...@apache.org>.
FalconSL commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2084773889
> > The front-end code has also been completed and will be submitted after the back-end is error free
>
> Features like this need to be committed at both the backend and frontend.
I have modified the backend code as required and submitted the frontend code at the same time. Here is a screenshot of the completed version

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement-15815][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2208187415
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933) **Quality Gate failed**
Failed conditions
 [50.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15933&metric=new_coverage&view=list) (required ≥ 60%)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1616982898
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UiPluginService.java:
##########
@@ -30,4 +32,6 @@ public interface UiPluginService {
Map<String, Object> queryUiPluginDetailById(int id);
+ ProductInfoDto queryProductInfo(User loginUser);
Review Comment:
```suggestion
ProductInfoDto queryProductInfo();
```
##########
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/UiPluginControllerTest.java:
##########
@@ -53,6 +63,8 @@ public class UiPluginControllerTest extends AbstractControllerTest {
private static final ImmutableMap<String, Object> uiPluginServiceResult =
ImmutableMap.of(Constants.STATUS, Status.SUCCESS, Constants.DATA_LIST, "Test Data");
+ private static final Logger logger = LoggerFactory.getLogger(TenantControllerTest.class);
+
Review Comment:
```suggestion
private static final Logger logger = LoggerFactory.getLogger(TenantControllerTest.class);
```
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UiPluginServiceImpl.java:
##########
@@ -82,4 +104,12 @@ public Map<String, Object> queryUiPluginDetailById(int id) {
return result;
}
+ @Override
+ public ProductInfoDto queryProductInfo(User loginUser) {
+ // persist to the database
Review Comment:
```suggestion
// persist to the database
```
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/ProductInfoDto.java:
##########
@@ -0,0 +1,35 @@
+/*
+ * 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.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * ProductInfoDto
+ */
+@Data
+public class ProductInfoDto {
+
+ private Integer id;
Review Comment:
```suggestion
private Integer id;
```
Remove the useless code.
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UiPluginServiceImpl.java:
##########
@@ -82,4 +104,12 @@ public Map<String, Object> queryUiPluginDetailById(int id) {
return result;
}
+ @Override
+ public ProductInfoDto queryProductInfo(User loginUser) {
Review Comment:
```suggestion
public ProductInfoDto queryProductInfo() {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1584411557
##########
dolphinscheduler-ui/src/locales/en_US/user-dropdown.ts:
##########
@@ -18,5 +18,6 @@
export default {
profile: 'Profile',
password: 'Password',
+ product: 'Product',
Review Comment:
I would prefer to use `about` instead of `Product`.
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java:
##########
@@ -30,20 +29,16 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-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.ResponseStatus;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
Review Comment:
Wildcard import is not allowed.
##########
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/UiPluginControllerTest.java:
##########
@@ -91,4 +103,33 @@ public void testQueryUiPluginDetailById() throws Exception {
JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
assertThat(actualResponseContent.toString()).isEqualTo(expectResponseContent.toString());
}
+
+ @Test
+ public void testQueryProductInfo() throws Exception {
+// Map<String, Object> mockResult = new HashMap<>();
+// mockResult.put(Constants.STATUS, Status.SUCCESS);
Review Comment:
Please remove useless comments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2169091634
@SbloodyS PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "FalconSL (via GitHub)" <gi...@apache.org>.
FalconSL commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1593727078
##########
dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/UiPluginControllerTest.java:
##########
@@ -91,4 +103,31 @@ public void testQueryUiPluginDetailById() throws Exception {
JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
assertThat(actualResponseContent.toString()).isEqualTo(expectResponseContent.toString());
}
+
+ @Test
+ public void testQueryProductInfo() throws Exception {
+ ProductInfoDto mockResult = new ProductInfoDto();
+ Mockito.when(uiPluginService.queryProductInfo(Mockito.any(), Mockito.anyInt())).thenReturn(mockResult);
+
+ MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
+ paramsMap.add("userId", "1");
+
+ MvcResult mvcResult = mockMvc.perform(post("/ui-plugins/queryProductInfo")
+ .header(SESSION_ID, sessionId)
+ .params(paramsMap))
+ .andExpect(status().isOk())
+ .andExpect(content().contentType(MediaType.APPLICATION_JSON))
+ .andReturn();
+
+ Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
+ Assertions.assertEquals(Status.SUCCESS.getCode(), result.getCode().intValue());
+ logger.info(mvcResult.getResponse().getContentAsString());
+ }
+
+ private User getLoginUser() {
+ User user = new User();
+ user.setId(1);
+ user.setUserName("admin");
+ return user;
+ }
Review Comment:
> Don't add useless code
Based on your proposal, I have made the following modifications:
1. Remove the userid from the input parameter
2. Change the query for version to selectVersion ()
3. Remove log() and redundant methods in UT
In addition, the queryProductInfo method in uiPluginService was submitted this time and there are no duplicate named methods in the project, so the method name has not been changed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "songjianet (via GitHub)" <gi...@apache.org>.
songjianet commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2111614686
Personally, I feel that there is no need to use a separate page to display the current version. You can put the version information at the top of this drop-down menu.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "FalconSL (via GitHub)" <gi...@apache.org>.
FalconSL commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2081816631
> I can't find the code for the UI part. Where is it?
The front-end code has also been completed and will be submitted after the back-end is error free
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "FalconSL (via GitHub)" <gi...@apache.org>.
FalconSL commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1584490718
##########
dolphinscheduler-ui/src/locales/en_US/user-dropdown.ts:
##########
@@ -18,5 +18,6 @@
export default {
profile: 'Profile',
password: 'Password',
+ product: 'Product',
Review Comment:
> I would prefer to use `about` instead of `Product`.
These issues mentioned has been resolved
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement-15815][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS merged PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2165600696
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15933&resolved=false&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15933&resolutions=WONTFIX)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15933&resolved=false&sinceLeakPeriod=true)
 [62.5% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15933&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15933&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1630850091
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/ProductInfoDto.java:
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * ProductInfoDto
+ */
Review Comment:
This comment is meanless, you need to remove.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1630852014
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java:
##########
@@ -27,22 +29,24 @@
import org.apache.dolphinscheduler.dao.entity.User;
import java.util.Map;
-
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-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.ResponseStatus;
-import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestAttribute;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import static org.apache.dolphinscheduler.api.enums.Status.*;
Review Comment:
Avoid wildcard import.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "FalconSL (via GitHub)" <gi...@apache.org>.
FalconSL commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2084771963
> > > The front-end code has also been completed and will be submitted after the back-end is error free
> >
> >
> > Features like this need to be committed at both the backend and frontend.
>
> +1
I have modified the backend code as required and submitted the frontend code at the same time. Here is a screenshot of the completed version

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "FalconSL (via GitHub)" <gi...@apache.org>.
FalconSL commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2081815958
> Is this PR want to solve #15875 ?
> Is this PR want to solve #15875 ?
Yes, I am currently addressing the issue you mentioned
> Is this PR want to solve #15875 ?
I am currently addressing the issue you mentioned, yes, and also addressing 15875
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1593780413
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UiPluginService.java:
##########
@@ -30,4 +32,6 @@
Map<String, Object> queryUiPluginDetailById(int id);
+ ProductInfoDto queryProductInfo(User loginUser);
Review Comment:
## Useless parameter
The parameter 'loginUser' is never used.
[Show more details](https://github.com/apache/dolphinscheduler/security/code-scanning/4133)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1625480109
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/UiPluginController.java:
##########
@@ -85,4 +89,17 @@ public Result queryUiPluginDetailById(@Parameter(hidden = true) @RequestAttribut
Map<String, Object> result = uiPluginService.queryUiPluginDetailById(pluginId);
return returnDataList(result);
}
+
+ /**
+ * obtain project version and address
+ * @return product info
+ */
Review Comment:
```suggestion
/**
* obtain project version and address
* @return product info
*/
```
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/ProductInfoDto.java:
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * ProductInfoDto
+ */
Review Comment:
```suggestion
/**
* ProductInfoDto
*/
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement-15815][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "pusl6 (via GitHub)" <gi...@apache.org>.
pusl6 closed pull request #15933: [Improvement-15815][ui] improving to find current version identifier(#15815)
URL: https://github.com/apache/dolphinscheduler/pull/15933
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement-15815][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2208188257
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933) **Quality Gate failed**
Failed conditions
 [50.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15933&metric=new_coverage&view=list) (required ≥ 60%)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2169117756
## [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933) **Quality Gate passed**
Issues
 [2 New issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15933&resolved=false&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=15933&resolutions=WONTFIX)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=15933&resolved=false&sinceLeakPeriod=true)
 [62.5% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15933&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=15933&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=15933)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement-15815][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2208196381
Awesome work, congrats on your first merged pull request!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement-15815][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "pusl6 (via GitHub)" <gi...@apache.org>.
pusl6 commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2205020549
> Please resolve conflicts.
oh, the reason for the conflict is that the enumeration class was not updated for a long time and has now been processed and resubmitted


--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "FalconSL (via GitHub)" <gi...@apache.org>.
FalconSL commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1609779800
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UiPluginServiceImpl.java:
##########
@@ -82,4 +94,18 @@ public Map<String, Object> queryUiPluginDetailById(int id) {
return result;
}
+ @Override
+ public ProductInfoDto queryProductInfo(User loginUser) {
+
+ // persist to the database
+ dsVersion = dsVersionDao.selectVersion().map(DsVersion::getVersion).orElse("unknown");
+
Review Comment:
Okay, I have changed the scheduling interface to querying the database once during initialization, for avoiding wasting database resources caused by multiple scheduling, and changed the interface type from post to get

--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on code in PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#discussion_r1582492608
##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/VersionMapper.java:
##########
@@ -0,0 +1,41 @@
+/*
+ * 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.dao.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.dolphinscheduler.dao.entity.User;
+import org.apache.dolphinscheduler.dao.entity.UserWithProcessDefinitionCode;
+import org.apache.dolphinscheduler.dao.entity.Version;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * user mapper interface
+ */
+public interface VersionMapper extends BaseMapper<Version> {
Review Comment:
Duplicate with `DsVersionMapper`.
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/UiPluginService.java:
##########
@@ -30,4 +32,6 @@ public interface UiPluginService {
Map<String, Object> queryUiPluginDetailById(int id);
+ Map<String, Object> queryProductInfo(User loginUser, int userId);
Review Comment:
Please use a specific object rather than `Map<String, Object> as the service method result.
##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Version.java:
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.dao.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import org.apache.dolphinscheduler.common.enums.UserType;
+
+import java.util.Date;
+
+@Data
+@TableName("t_ds_version")
+public class Version {
Review Comment:
There already exist `DsVersion`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2081796106
Is this PR want to solve https://github.com/apache/dolphinscheduler/issues/15875 ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Improvement][ui] improving to find current version identifier(#15815) [dolphinscheduler]
Posted by "FalconSL (via GitHub)" <gi...@apache.org>.
FalconSL commented on PR #15933:
URL: https://github.com/apache/dolphinscheduler/pull/15933#issuecomment-2081821554
> > The front-end code has also been completed and will be submitted after the back-end is error free
>
> Features like this need to be committed at both the backend and frontend.
Okay, then I will modify the interface return class and resubmit the front-end and back-end code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org